query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Metodo....: logComponente Descricao.: Grava uma linha no arquivo de LOG para log de componentes de negocio
public void logComponente(long idProcesso, int aTipo, String aComponente, String aMensagem, String aStatus) { StringBuffer mensagemFinal = new StringBuffer("<Servidor> ").append( getHostName()); mensagemFinal.append(" <ID> " ).append(idProcesso); mensagemFinal.append(" <Mensagem> " ).append(aMensagem); mensagemFinal.append(" <ST> " ).append(aStatus); registraLog(aTipo,mensagemFinal.toString()); mensagemFinal = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logComponente (int aTipo, String aComponente, String aMensagem )\n\t{\n\t\tlogComponente(0,aTipo,aComponente,aMensagem,\" \");\n\t}", "String getLogContinued();", "String getLogHandled();", "public void componentStartInfo(INode node) {\n\t\t\tif (isLog4jEnabled) {\n\t\t\t\n stringBuffer.append(TEXT_16);\n stringBuffer.append(cid);\n stringBuffer.append(TEXT_17);\n \n\t\t\t}\n\t\t}", "static public final void ccLogln(String pxLine){\n ccLogln(pxLine, null);\n }", "private void writeLog(){\n\t\tStringBuilder str = new StringBuilder();\r\n\t\tstr.append(System.currentTimeMillis() + \", \");\r\n\t\tstr.append(fileInfo.getCreator() + \", \");\r\n\t\tstr.append(fileInfo.getFileName() + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(networkSize + \", \");\r\n\t\tstr.append(fileInfo.getN1() + \", \");\r\n\t\tstr.append(fileInfo.getK1() + \", \");\r\n\t\tstr.append(fileInfo.getN2() + \", \");\r\n\t\tstr.append(fileInfo.getK2() + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT)+ \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.encryStart, logger.encryStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \"\\n\");\r\n\t\t\r\n\t\tString tmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getKeyStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\r\n\t\t\r\n\t\ttmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getFileStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.FILE_CREATION, str.toString());\t\t\r\n\t\t\r\n\t\t// Topology Discovery\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"TopologyDisc, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.topStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT ) + \", \");\r\n\t\tstr.append(\"\\n\");\t\t\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\r\n\t\t\r\n\t\t// Optimization\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"Optimization, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.optStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(\"\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t\t\r\n\t\t\r\n\t\t// File Distribution\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"FileDistribution, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(logger.distStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \", \");\r\n\t\tstr.append(\"\\n\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t}", "private void logToFile() {\n }", "void log(String line);", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "IFileLogger log();", "java.lang.String getLogMessage();", "private void logika_rozpocznij(){\n\t}", "private void doTestDontLog(File log) throws IOException {\n FileHandler fileHandler = new FileHandler(log.getPath());\n fileHandler.setFormatter(new SimpleFormatter());\n Logger logger = Logger.getLogger(JdkLogChute.DEFAULT_LOG_NAME);\n logger.addHandler(fileHandler);\n logger.setLevel(Level.ALL);\n LogManager logManager = LogManager.getLogManager();\n logManager.addLogger(logger);\n\n // Now do a random compilation that implies using RetroWeiboProcessor.\n JavaFileObject javaFileObject = JavaFileObjects.forSourceLines(\n \"foo.bar.Baz\",\n \"package foo.bar;\",\n \"\",\n \"import retroweibo.RetroWeibo;\",\n \"\",\n \"@RetroWeibo\",\n \"public abstract class Baz {\",\n \" public abstract int buh();\",\n \"\",\n \" public static Baz create(int buh) {\",\n \" return new RetroWeibo_Baz(buh);\",\n \" }\",\n \"}\");\n assert_().about(javaSource())\n .that(javaFileObject)\n .processedWith(new RetroWeiboProcessor())\n .compilesWithoutError();\n\n // The log file should be empty.\n fileHandler.close();\n assertEquals(\"\", Files.toString(log, StandardCharsets.UTF_8));\n }", "abstract protected String getLogFileName();", "public String getLog();", "public void imprimir(String log){\n System.out.println(log);\n\n }", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tString mensagemFinal = \"<Servidor> \" + this.hostName; \n\t\tmensagemFinal = mensagemFinal + \" <ID> \" + idProcesso;\n\t\tmensagemFinal = mensagemFinal + \" <CL> \" + aClasse;\n\t\tmensagemFinal = mensagemFinal + \" <ME> \" + aMetodo;\n\t\tmensagemFinal = mensagemFinal + \" <Mensagem> \" + aMensagem;\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal);\n\t}", "public SecurityLog()\n {\n String fileName = \"Log.txt\";\n File output = new File(fileName);\n if(output.exists())\n readFile(fileName);\n }", "public static String logMessageDetaint(Object o) {\n return o.toString().replaceAll(\"[\\n|\\r|\\t]\", \"_\");\n }", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tStringBuffer mensagemFinal = new StringBuffer(\"<Servidor> \").append(getHostName()); \n\t\tmensagemFinal.append(\" <ID> \").append(idProcesso);\n\t\tmensagemFinal.append(\" <Metodo> \").append(aMetodo);\n\t\tmensagemFinal.append(\" <Mensagem> \").append(aMensagem);\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal.toString());\n\t\tmensagemFinal = null;\n\t}", "public Log() {\n cadenas = new Vector<String>();\n }", "void log(String source, String line);", "public void cleanLogFile() throws IOException{\r\n\t\t//begin with creation of new file\r\n\t\tJFileChooser fc = new JFileChooser();\r\n\t\t//set directory and \".log\" filter\r\n\t\tfc.setMultiSelectionEnabled(true);\r\n\t\tfc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\r\n\t\tfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\r\n\t\tfc.setFileFilter(logFileFilter_);\r\n\t\t\r\n\t\tint status = fc.showDialog(this, Messages.getString(\"EditLogControlPanel.approveButton\"));\r\n\t\t\r\n\t\t//the coordinates with a port\r\n\t\tclass MixZoneCoordinate{\r\n\t\t\tpublic int xCoordinate = -1;\r\n\t\t\tpublic int yCoordinate = -1;\r\n\t\t\tpublic int port = -1;\r\n\t\t\t\r\n\t\t\tpublic MixZoneCoordinate(int x,int y, int p){\r\n\t\t\t\txCoordinate = x;\r\n\t\t\t\tyCoordinate = y;\r\n\t\t\t\tport = p;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//choose one or mor logs\r\n\t\tif(status == JFileChooser.APPROVE_OPTION){\r\n\t\t\t File[] files = fc.getSelectedFiles();\r\n\t\t\t for(File file:files){\r\n\t\t\t\t\tArrayList<MixZoneCoordinate> mixZoneCoordinateList = new ArrayList<MixZoneCoordinate>();\r\n\t\t\t\t\t\r\n\t\t\t BufferedReader reader;\r\n\t\t\t FileWriter fstream = new FileWriter(file.getPath().substring(0, file.getPath().length() - 4) +\"_cleaned.log\");\r\n\t\t\t BufferedWriter out = new BufferedWriter(fstream);\r\n\t\t\t \r\n\t\t\t try{\r\n\t\t\t reader = new BufferedReader(new FileReader(file));\r\n\t\t\t String line = reader.readLine();\r\n\t\t\t \r\n\t\t\t boolean headerSeperator = true;\r\n\t\t\t \r\n\t\t\t ArrayList<String> savedLines = new ArrayList<String>();\r\n\t\t\t \r\n\t\t\t while(line != null){\r\n\t\t\t \t//read header completely\r\n\t\t\t \tif(line.length() >= 8 && line.substring(0, 8).equals(\"Mix-Zone\")){\r\n\t\t\t \t\tArrayList<String> savedLines2 = new ArrayList<String>();\r\n\t\t\t \t\tboolean saved = false;\r\n\t\t\t \t\tString[] lineSplitted = line.split(\":\");\r\n\t\t\t \t\t\r\n\t\t\t \t\tif(savedLines.size() < 1){\r\n\t\t\t \t\t\tsavedLines2.add(line);\r\n\t\t\t \t\t\tsaved = true;\r\n\t\t\t \t\t}\r\n\t\t\t \t\tfor(String savedLine:savedLines){\r\n\t\t\t \t\t\tif(!saved && Integer.parseInt(lineSplitted[2]) < Integer.parseInt(savedLine.split(\":\")[2])){\r\n\t\t\t \t\t\t\tsaved = true;\r\n\t\t\t \t\t\t\tsavedLines2.add(line);\r\n\t\t\t \t\t\t}\r\n\t\t\t \t\t\tsavedLines2.add(savedLine);\r\n\t\t\t \t\t}\r\n\t\t\t \t\tif(!saved)savedLines2.add(line);\r\n\t\t\t \t\tsavedLines = savedLines2;\r\n\t\t\t \t}\r\n\t\t\t \telse{\r\n\t\t\t \t\tif(headerSeperator){\r\n\t\t\t\t \t\tString xArray[];\r\n\t\t\t\t \t\tString yArray[];\r\n\t\t\t\t \t\tString writeLine =\"\"; \r\n\t\t\t\t \t\t\r\n\t\t\t\t \t\t//save all coordinates\r\n\t\t\t \t\t\tfor(int j = 0; j < savedLines.size(); j=j+2){\r\n\r\n\t\t\t \t\t\t\t\r\n\t\t\t\t\t \t\txArray = savedLines.get(j).split(\":\");\r\n\t\t\t\t\t \t\tyArray = savedLines.get(j+1).split(\":\");\r\n\r\n\t\t\t\t\t \t\twriteLine = \"Mix-Zone:\" + xArray[1] + \":\" + xArray[2] + \":\" + xArray[3] + \":\" + xArray[4];\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t \t\tfor(int i = 5; i < xArray.length; i++) {\r\n\t\t\t\t\t \t\t\twriteLine += \":\" + (i-4) + \"=\" + xArray[i] + \"/\" + yArray[i];\r\n\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\t\tmixZoneCoordinateList.add(new MixZoneCoordinate(Integer.parseInt(xArray[i]), Integer.parseInt(yArray[i]), i-4));\r\n\t\t\t\t\t \t\t}\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tout.write(writeLine + \"\\n\");\r\n\t\t\t \t\t\t}\r\n\t\t\t \t\t\t \t\t\r\n\t\t\t \t\t\tout.write(\"*******************\" + \"\\n\");\r\n\t\t\t \t\t\theaderSeperator=false;\r\n\t\t\t \t\t}\r\n\t\t\t \t\tint xCoord = -1;\r\n\t\t\t \t\tint yCoord = -1;\r\n\t\t\t \t\t\r\n\t\t\t \t\tString[] lineSplit = line.split(\":\");\r\n\t\t\t \t\tif(lineSplit.length == 23){\r\n\t\t\t \t\t\txCoord = Integer.parseInt(lineSplit[20]);\r\n\t\t\t \t\t\tyCoord = Integer.parseInt(lineSplit[22]);\t \t\t\t\r\n\t\t\t \t\t}\r\n\t\t\t \t\telse break;\r\n\t\t\t \t\t\r\n\t\t\t \t\t//check which coordinate is which port and write the result to file\r\n\t\t\t \t\tfor(MixZoneCoordinate c : mixZoneCoordinateList){\r\n\t\t\t\t\t\t\t\t\tlong dx = c.xCoordinate - xCoord;\r\n\t\t\t\t\t\t\t\t\tlong dy = c.yCoordinate - yCoord;\r\n\t\t\t\t\t\t\t\t\tlong distanceSquared = dx * dx + dy * dy;\r\n\t\t\t\t\t\t\t\t\tif(distanceSquared < 500000){\r\n\t\t\t\t\t\t\t\t\t\tout.write(lineSplit[0] + \":\" + lineSplit[1] + \":\" + lineSplit[2] + \":\" + lineSplit[3] + \":\" + lineSplit[4] + \":\" + lineSplit[5] + \":\" + lineSplit[6] + \":\" + lineSplit[7] + \":\" + lineSplit[8] + \":\" + lineSplit[9] + \":\" + lineSplit[10] + \":\" + lineSplit[11] + \":\" + lineSplit[12] + \":\" + lineSplit[13] + \":\" + lineSplit[14] + \":\" + lineSplit[15] + \":\" + lineSplit[16] + \":\" + lineSplit[17] + \":\" + lineSplit[18] + \":port:\" + c.port + \"\\n\");\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t \t\t}\t\r\n\t\t\t \t}\r\n\t\t\t \tline = reader.readLine();\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t out.close();\r\n\t\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t\t System.err.println(\"FileNotFoundException: \" + e.getMessage());\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t System.err.println(\"Caught IOException: \" + e.getMessage());\r\n\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "Appendable getLog();", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "private static void writeLog(Exception e) {\n if (logFile == null) createLogFile();\n LogTools.trace(e);\n LogTools.flush();\n }", "public void analizarArchivoDeLog(String nombreArchivo)\n {\n archivoLog.clear();\n try{\n File log = new File(nombreArchivo);\n Scanner sc = new Scanner(log);\n while (sc.hasNextLine()) {\n String linea = sc.nextLine();\n String[] arrayDeString = linea.split(\" \");\n archivoLog.add(new Acceso (Integer.parseInt(arrayDeString[0]),Integer.parseInt(arrayDeString[1]),Integer.parseInt(arrayDeString[2]),Integer.parseInt(arrayDeString[3]),Integer.parseInt(arrayDeString[4])));\n }\n sc.close();\n }\n\n catch (FileNotFoundException e){\n e.printStackTrace();\n }\n }", "public AddebitoFissoLogica(Modulo modulo) {\n /* rimanda al costruttore della superclasse */\n super(modulo);\n\n try { // prova ad eseguire il codice\n /* regolazioni iniziali di riferimenti e variabili */\n this.inizia();\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }", "private Log() {\r\n\t}", "public RMPLogica(Modulo modulo) {\n /* rimanda al costruttore della superclasse */\n super(modulo);\n\n try { // prova ad eseguire il codice\n /* regolazioni iniziali di riferimenti e variabili */\n this.inizia();\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }", "public String get_log(){\n }", "public String getClLog() {\r\n return clLog;\r\n }", "protected GerentePoolLog(Class ownerClass)\n {\n\t\tArquivoConfiguracaoGPP arqConf = ArquivoConfiguracaoGPP.getInstance();\n\t\t//Define o nome e a porta do servidor q serao utilizados no LOG\n\t\thostName = arqConf.getEnderecoOrbGPP() + \":\" + arqConf.getPortaOrbGPP();\n\n\t\t/* Configura o LOG4J com as propriedades definidas no arquivo\n\t\t * de configuracao do GPP\n\t\t */\n\t\t\n\t\tPropertyConfigurator.configure(arqConf.getConfiguracaoesLog4j());\n\t\t//Inicia a instancia do Logger do LOG4J\n\t\tlogger = Logger.getLogger(ownerClass);\n\t\tlog(0,Definicoes.DEBUG,\"GerentePoolLog\",\"Construtor\",\"Iniciando escrita de Log do sistema GPP...\");\n }", "public abstract void CancelLog();", "public static void logLayout(StructuredFile log)\n\t{\n\t}", "String getLogStackTrace();", "private void log(String l) {\n if (LOG) {\n System.out.println(\"RotationMatrixTest.\" + l);\n }\n }", "private void startLogFile() {\n try {\n createLogFile();\n // First line of file contains field names\n String [] header = new String [] {\"Job\", \"Step\", \"Total Residents\", \"Domestic\", \"Employed\", \"Student\", \"Rebel\", \"Heard original rumor\", \"Heard new rumor\", \"Run\"};\n dataCSVFile_identity.writeLine(header);\n\n // activity\n String [] header_actions = new String [] {\"Job\",\"Step\",\"total residents\", \"At Home\", \"Work\", \"Searching for Work\",\n \"School\", \"Socialiazing\", \"Church\", \"Getting Water\", \"Rebel\", \"Run\"};\n\n dataCSVFile_action.writeLine(header_actions);\n\n String [] header_network = new String [] {\"Job\", \"Step\", \"node1\", \"node2\", \"weight\"};\n dataCSVFile_network.writeLine(header_network);\n\n String [] header_working = new String [] {\"Job\", \"Step\", \"Business\", \"School\", \"Health Facility\", \"Religious Facility\", \n \"Formal\", \"Informal\", \"Searching\", \"Inactive\", \"Formal at home\", \"Informal at home\", \"Run\"};\n dataCSVFile_working.writeLine(header_working);\n \n String [] header_rebels = new String [] {\"Job\", \"Step\", \"AgeGroup\", \"HHDiscrepancy\", \"Identity\", \"Count\" };\n dataCSVFile_rebels.writeLine(header_rebels);\n\n String[] header_residents = new String [] {\"Job\", \"Step\", \"Resident\", \"Age\", \"Employment status\", \"Laid off\", \"Action\", \n \"Daily water use\", \"Remaining water\", \"Required water\",\n \"Identity\",\"Is initial rebel\", \n \"Heard original rumor\", \"Heard new rumor\", \"Energy\", \"Current Aggression\", \"Aggression Rate\", \"Formal Business Capacity\", \n \"Informal Business Capacity\", \"School Capacity\", \"Has School\", \"Has formal employer\", \"Has informal Employer\", \n \"Formal income\", \"Informal income\", \"Searching income\", \"Inactive income\", \"Household Income\", \"Has electricity\", \"Has sanitation\",\n \"Has water\", \"Household expenditures\", \"Rent cost\", \"Water cost\", \"Electric cost\", \"Sanitation cost\", \n \"Transportation cost\", \"Other cost\", \"Food cost\", \"Discrepancy\", \"Run\", \"Preference\"};\n \n \n dataCSVFile_residents.writeLine(header_residents);\n\n String [] header_degreestats = new String [] {\"Job\", \"Step\", \"max degree\", \"min degree\", \"mean degree\", \"sum degree\", \"mean connections\", \"Run\"};\n dataCSVFile_degreestats.writeLine(header_degreestats);\n\n }\n\n catch (IOException ex) {\n Logger.getLogger(Kibera.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void log(String txt);", "LogFile(File file)\n {\n this.file = file;\n }", "public Log agregar(String linea) {\n cadenas.add(linea);\n return this;\n }", "public void testLogAccuracy() {\r\n // log the message\r\n Exception cause = new Exception(\"some error\");\r\n String message = \"some message\";\r\n log.log(Level.ALL, cause, message);\r\n\r\n // check the result\r\n String result = AccuracyTestsHelper.getFileContent(FILE);\r\n assertTrue(result.indexOf(\"some message\") >= 0);\r\n assertTrue(result.indexOf(\"some error\") >= 0);\r\n }", "@Override\n public void log()\n {\n }", "private void log(IndexObjectException e) {\n\t\t\r\n\t}", "public Logs() {\n initComponents();\n }", "public ChangeLog() {\n initComponents();\n }", "@Override \n public String toString(){\n return this.logRepresentation;\n }", "public void changerLogique(String nouvFormule,String nouvCommentaire,EOGenericRecord ecEnModif) {\r\n\t\t// retrouver l'entité IpUeSeuil qui va bien...\r\n\r\n\t\tif (ecEnModif != null) {\r\n\t\t\tERXGenericRecord toEcSeuil = (ERXGenericRecord)ecEnModif.valueForKey(\"toEcSeuil\");\r\n\t\t\tif (toEcSeuil != null) {\r\n\r\n\t\t\t\ttoEcSeuil.takeStoredValueForKey(nouvFormule, \"rceFormuleContrainte\");\r\n\t\t\t\ttoEcSeuil.takeStoredValueForKey(nouvFormule, \"rceFormuleContrainte\");\r\n\t\t\t\tEOEditingContext ecEnt = ecEnModif.editingContext();\r\n\t\t\t\tecEnt.saveChanges();\r\n\r\n\t\t\t\t// Il faut provoquer un refresh des objets dans le shared editing context de l'application...\r\n\t\t\t\tmaSession.monApp.InvaliderSharedEC();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\r\n public void test_logEntrance1_NoLogging() throws Exception {\r\n log = null;\r\n LoggingWrapperUtility.logEntrance(log, signature, paramNames, paramValues);\r\n\r\n assertEquals(\"'logEntrance' should be correct.\", 0, TestsHelper.readFile(TestsHelper.LOG_FILE).length());\r\n }", "public void logCritical(final String msg, final Throwable e) {\n\t\tlogger.warn(msg, e);\n\t\tlogger.warn(e);\n\t\t\n\t}", "void log();", "public void logDose() {\n List<Double> standardPattern = new ArrayList<>();\n for (double point : CORTISOL_PATTERN) {\n standardPattern.add(point);\n }\n logDoseList = logarithmTable2(standardPattern);\n }", "Path getLogFilePath();", "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "public SystemLog () {\r\n\t\tsuper();\r\n\t}", "String getLogExhausted();", "@Test\r\n public void test_logEntrance2_NoLogging() throws Exception {\r\n log = null;\r\n LoggingWrapperUtility.logEntrance(log, signature, paramNames, paramValues, true, Level.INFO);\r\n\r\n assertEquals(\"'logEntrance' should be correct.\", 0, TestsHelper.readFile(TestsHelper.LOG_FILE).length());\r\n }", "public void test_getLogMessage_1() {\n String logMessage = instance.getLogMessage();\n\n assertTrue(\"'getLogMessage' should be correct.\",\n logMessage.indexOf(\"type: type id: 1 operator:operator - message\") != -1);\n assertTrue(\"'getLogMessage' should be correct.\", logMessage.indexOf(\"java.lang.Exception\") != -1);\n }", "public ClipLog() { }", "private final static boolean doTrace(String component, String level,\n\t String type) {\n\t\tif (!enableTraces) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif (component == null || component.trim().length() == 0) {\n\t\t\t\tcomponent = COMPONENT_UNASSIGNED;\n\t\t\t}\n\t\t\tLogger log = Logger.getLogger(component);\n\t\t\tPriority pri = getPriority(type);\n\t\t\treturn (log.isEnabledFor(pri));\n\t\t}\n\t}", "public void disableLogging();", "public void writeLog(Exception e, String... data){\r\n // Print to console for us to read\r\n System.out.println(\"Error: \" + e);\r\n System.out.print(\"Log: \");\r\n for(int i = 0; i < data.length; i ++){\r\n System.out.println(data[i]);\r\n }\r\n System.out.println(\"\");\r\n \r\n // Write to file\r\n try{\r\n bw.append(\"Error: \" + e);\r\n bw.append(System.lineSeparator());\r\n bw.append(\"Log: \");\r\n for(int i = 0; i < data.length; i ++){\r\n bw.append(data[i]);\r\n bw.append(System.lineSeparator());\r\n }\r\n bw.append(System.lineSeparator());\r\n bw.close();\r\n }\r\n catch(IOException ioe){\r\n System.out.println(\"Error creating file in DLException.java\\nError: \" + ioe);\r\n }\r\n }", "public final void toLogFile() {\n\t\tRetroTectorEngine.toLogFile(\"Error message from \" + THESTRINGS[0] + \":\");\n\t\tfor (int i=1; i<THESTRINGS.length; i++) {\n\t\t\tRetroTectorEngine.toLogFile(THESTRINGS[i]);\n\t\t}\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\n Logger file = new Logger(\"/home/vladimir/text.txt\");\n\n file.log(\"dikie sobaki\");\n file.end();\n\n\n }", "@Override\n\tpublic String getLogFileName() {\n\t\treturn model.getLogFileName();\n\t}", "public Catelog() {\n super();\n }", "private void logMessage(String msg) {\n\n\t\tlog.logMsg(\"(L\" + lexAnalyser.getLineCount() + \")\" + msg + \"\\n\");\n\n\t\t// System.out.println(\"(L\" + lexAnalyser.getLineCount() + \")\" + msg);\n\n\t}", "public static void LogIt(String action, File entity) {\n\t\t\r\n\t}", "protected String logFile(AggregatedJob job) {\n StringBuffer sb = new StringBuffer(32);\n if (mGlobalLog) {\n // the basename of the log file is derived from the dag name\n sb.append(this.mClusteredADag.getLabel());\n } else {\n // per seqexec job name\n sb.append(job.getName());\n }\n sb.append(this.SEQEXEC_PROGRESS_REPORT_SUFFIX);\n return sb.toString();\n }", "public void test_getLogMessage_2() {\n instance = new LogMessage(null, null, null, null);\n\n String logMessage = instance.getLogMessage();\n\n assertTrue(\"'getLogMessage' should be correct.\",\n logMessage.indexOf(\"type: Unknown id: Unknown operator:Unknown - null\") != -1);\n assertFalse(\"'getLogMessage' should be correct.\", logMessage.indexOf(\"java.lang.Exception\") != -1);\n }", "public String toString (){\r\n \r\n String mensaje=\"El rey color \"+color_rey+\" esta en la fila \"+posicion_rey.fila+\" y columna \"+posicion_rey.columna+\".\";\r\n \r\n return mensaje;\r\n \r\n }", "private void btnExecutarLabirinto(){\n log.setText(\"Log de erros\");\n botao[2].setEnabled(false);\n try{\n lab.encontrarAdj();\n lab.andadinha();\n info.setText(\" \");\n visor.setText(lab.toString());\n\n Pilha<Coordenada> caminho = lab.getCaminho();\n Pilha<Coordenada> inverso = new Pilha<Coordenada>();\n while(!caminho.isVazia())\n {\n inverso.guardeUmItem(caminho.recupereUmItem());\n caminho.removaUmItem();\n }\n\n log.setText(\"Caminho percorrido: \");\n while(!inverso.isVazia())\n {\n log.setText(log.getText() + inverso.recupereUmItem().toString() + \" \");\n inverso.removaUmItem();\n }\n }\n catch(Exception erro1){\n log.setText(erro1.getMessage());\n }\n\t\t}", "public void stdOutputLine(String line) { \n debug(\"output:\"+line);\n if (line.equals(FINAL_SPLIT)) {\n if (addingDescription) {\n addingDescription = false;\n logInfo.setDescription(tempBuffer.toString());\n }\n if (addingLogMessage) {\n addingLogMessage = false;\n revision.setMessage(findUniqueString(tempBuffer.toString(), messageList));\n }\n if (revision != null) {\n logInfo.addRevision(revision);\n revision = null;\n }\n \n if (logInfo != null) { \n resultList.add(logInfo);\n // logInfo = null;\n tempBuffer = null;\n }\n return;\n }\n if (addingLogMessage) {\n // first check for the branches tag\n if (line.startsWith(BRANCHES)) {\n processBranches(line.substring(BRANCHES.length()));\n }\n else {\n processLogMessage(line);\n return;\n }\n }\n if (addingSymNames) { \n processSymbolicNames(line);\n }\n if (addingDescription) {\n processDescription(line);\n }\n // revision stuff first -> will be the most common to parse\n if (line.startsWith(REVISION)) {\n processRevisionStart(line);\n }\n if (line.startsWith(DATE)) {\n processRevisionDate(line);\n }\n\n if (line.startsWith(KEYWORD_SUBST)) {\n logInfo.setKeywordSubstitution(line.substring(KEYWORD_SUBST.length()).trim().intern());\n addingSymNames = false;\n return;\n }\n\n if (line.startsWith(DESCRIPTION)) {\n tempBuffer = new StringBuffer(line.substring(DESCRIPTION.length()));\n addingDescription = true;\n }\n\n if (line.indexOf(LOGGING_DIR) >= 0) {\n fileDirectory = line.substring(line.indexOf(LOGGING_DIR) + LOGGING_DIR.length()).trim();\n debug(\"fileDirectory: \"+fileDirectory);\n return;\n }\n if (line.startsWith(RCS_FILE)) {\n processRcsFile(line.substring(RCS_FILE.length()));\n return;\n }\n if (line.startsWith(WORK_FILE)) {\n processWorkingFile(line.substring(WORK_FILE.length()));\n return;\n }\n if (line.startsWith(REV_HEAD)) {\n logInfo.setHeadRevision(line.substring(REV_HEAD.length()).trim().intern());\n return;\n }\n if (line.startsWith(BRANCH)) {\n logInfo.setBranch(line.substring(BRANCH.length()).trim().intern());\n }\n if (line.startsWith(LOCKS)) {\n logInfo.setLocks(line.substring(LOCKS.length()).trim().intern());\n }\n if (line.startsWith(ACCESS_LIST)) {\n logInfo.setAccessList(line.substring(ACCESS_LIST.length()).trim().intern());\n }\n if (line.startsWith(SYM_NAME)) {\n addingSymNames = true;\n }\n if (line.startsWith(TOTAL_REV)) {\n int ind = line.indexOf(';');\n if (ind < 0) {\n // no selected revisions here..\n logInfo.setTotalRevisions(line.substring(TOTAL_REV.length()).trim().intern());\n logInfo.setSelectedRevisions(\"0\"); //NOI18N\n }\n else {\n String total = line.substring(0, ind);\n String select = line.substring(ind, line.length());\n logInfo.setTotalRevisions(total.substring(TOTAL_REV.length()).trim().intern());\n logInfo.setSelectedRevisions(select.substring(SEL_REV.length()).trim().intern());\n }\n }\n }", "public Log() { //Null constructor is adequate as all values start at zero\n\t}", "public SystemLogMessage() {\n\t\tthis.setVersion(Constants.VERSION);\t\t\t\t\t\t\t\t//version is universal for all log messages\n\t\tthis.setCertifiedDatatype(Constants.SYSTEM_LOG_OID);\t\t\t//certifiedDataType is the OID, for all transaction logs it is the same\n\t\t\n\t\t//algorithm parameter has to be set using the LogMessage setAlgorithm method.\n\t\t//the ERSSpecificModule has to set the algorithm\n\t\t//serial number has to be set by someone who has access to it \n\t}", "private void logException(Exception e)\n throws Exception {\n\n FileWriter write = null;\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n\n try {\n write = new FileWriter(\"c:\\\\temp\\\\CaseOperationException.log\", true);\n PrintWriter print_line = new PrintWriter(write);\n print_line.printf(dateFormat.format(date) + \"\\n\");\n e.printStackTrace(print_line);\n print_line.close();\n } catch (IOException exc) {\n }\n\n throw e;\n }", "static public final void ccLogln(String pxTag, Object pxValue){\n if(cmLogOn){\n ccPrintln(pxTag, pxValue);\n }//..?\n }", "public String getRunLog();", "public void generateLogFile() {\n\t\tFileOperations operator = new FileOperations(path);\n\t\toperator.writeFile(buildLogContent());\n\t}", "@Override\n public void incluir(Colaborador objeto)throws Exception {\n try {\n System.out.println(\"Estou Gravando no Arquivo\" + nomeDoArquivoNoDisco);\n FileWriter fw = new FileWriter(nomeDoArquivoNoDisco, true);\n //Criar o buffer do arquivo\n BufferedWriter bw = new BufferedWriter(fw);\n //Escreve no arquivo\n bw.write(objeto.toString() + \"\\n\");\n //Fechar o arquivo\n bw.close();\n } catch (Exception erro) {\n throw erro;\n }\n }", "private TypicalLogEntries() {}", "public void zalogujSkonci() {\n PrintWriter pw;\n try {\n pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(\"logClient.txt\"), true)));\n pw.println(\"Odeslano bytu: \" + main.odeslanoZprav);\n pw.println(\"Prijato bytu: \" + main.prijatoBytu);\n pw.println(\"Odeslano zprav: \" + main.odeslanoZprav);\n pw.println(\"Prijato zprav: \" + main.prijatoZprav);\n pw.println(\"Odehrano her: \" + main.odehranoHer);\n pw.println(\"Doba behu: \" + (System.currentTimeMillis() - main.start) / 1000 + \" sekund.\");\n pw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n System.exit(0);\n }", "@Override\r\n\tpublic void exibir() {\n\t\t\r\n\t\tSystem.out.println(\"Condicoes atuais: \" + temp + \"°C e \" + umid + \"% de umidade \" \r\n\t\t\t\t+ pressao + \" pressao\");\r\n\t\t\r\n\t}", "private void logInvalidMessage(String msg){\n \tif (null != utilLog){\n \t\tutilLog.error(msg);\n \t}\n \telse{\n \t\tSystem.out.println(msg);\n \t}\n }", "@Test\n public void shouldLogMessage() {\n ILogger logger = new SysoutLogger();\n logger.log(\"hello\");\n assertThat(outContent.toString(), is(\"hello\" + System.getProperty(\"line.separator\")));\n }", "public LogScrap() {\n\t\tconsumer = bin->Conveyor.LOG.debug(\"{}\",bin);\n\t}", "private void logToFile(ByteArrayOutputStream logbaos) {\n String filename = \"/tmp/QlikLoad.dat\"; // + totalOps;\n try(OutputStream outputStream = new FileOutputStream(filename, true)) {\n System.out.println(\"logging BAOS content to file: \" + filename);\n logbaos.writeTo(outputStream);\n } catch (FileNotFoundException e) {\n LOG.error(\"error writing buffer to file\", e);\n } catch (IOException e) {\n LOG.error(\"IOException when writing buffer to file\", e);\n }\n }", "public void logData(){\n }", "public void debugWriteData(INode node) {\n\t\t\tif(isLog4jEnabled){\n\t\t\t\n stringBuffer.append(TEXT_21);\n stringBuffer.append(label);\n stringBuffer.append(TEXT_22);\n stringBuffer.append(cid );\n stringBuffer.append(TEXT_23);\n \n\t\t\t}\n\t\t}", "void setLogFile(File log);", "private Log() {\r\n readFile(\"Save.bin\",allLogs);\r\n readFile(\"Tag.bin\", allTags);\r\n readFile(\"Password.bin\", userInfo);\r\n }", "public LoggingPanel() {\n initComponents();\n\n }", "private void verLogroBotonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verLogroBotonActionPerformed\n if(logrosTabla.getModel().getRowCount() > 0){\n String logroTitulo = logrosTabla.getModel().getValueAt(logrosTabla.getSelectedRow(), 1).toString();\n Logro logro = ninno.getLogro(logroTitulo);\n \n if(logro != null){\n JOptionPane.showMessageDialog(this, logro.getDescripcion(), logroTitulo, JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }", "public void testCombinedCmsConcurrentApplicationStoppedTimeLogging() {\n // TODO: Create File in platform independent way.\n File testFile = new File(\"src/test/data/dataset27.txt\");\n GcManager gcManager = new GcManager();\n File preprocessedFile = gcManager.preprocess(testFile, null);\n gcManager.store(preprocessedFile, false);\n JvmRun jvmRun = gcManager.getJvmRun(new Jvm(null, null), Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n Assert.assertEquals(\"Event type count not correct.\", 2, jvmRun.getEventTypes().size());\n Assert.assertTrue(\"Log line not recognized as \" + JdkUtil.LogEventType.CMS_CONCURRENT.toString() + \".\",\n jvmRun.getEventTypes().contains(JdkUtil.LogEventType.CMS_CONCURRENT));\n Assert.assertTrue(\n \"Log line not recognized as \" + JdkUtil.LogEventType.APPLICATION_STOPPED_TIME.toString() + \".\",\n jvmRun.getEventTypes().contains(JdkUtil.LogEventType.APPLICATION_STOPPED_TIME));\n }", "private void dumpComponent(ServiceComponentExt comp)\n {\n log(\"*\");\n log(\"* ServiceComponent Information\");\n assertNotNull(\"SC Name cannot be null\", comp.getName());\n log(\"* SC Name: \" + comp.getName());\n int pid = comp.getPID();\n // TODO (Josh) Verify this range of pids\n assertTrue(\"SC Pid does not fall within valid range\", pid > 0 && pid < 65535);\n log(\"* SC Pid: \" + pid);\n log(\"* SC Assoc. Language: \" + comp.getAssociatedLanguage());\n assertNotNull(\"SC ServiceInformationType cannot be null\", comp.getServiceInformationType());\n log(\"* SC ServiceInformationType: \" + comp.getServiceInformationType());\n assertNotNull(\"SC StreamType cannot be null\", comp.getStreamType());\n log(\"* SC StreamType: \" + comp.getStreamType());\n short est = comp.getElementaryStreamType();\n // TODO (Josh) Enable once Elementary StreamType is broadcast properly\n // assertTrue(\"Elementary StreamType does not fall within valid range: 1-14 or 128-132 (inclusive)\",\n // (est > 0 && est < 15) && (est > 127 && est < 133));\n log(\"* SC Elementary StreamType: \" + est);\n assertNotNull(\"SC UpdateTime cannot be null\", comp.getUpdateTime());\n long now = new Date().getTime();\n long oneYearAgo = now - (1000 * 60 * 60 * 24 * 365);\n long oneYearAhead = now + (1000 * 60 * 60 * 24 * 365);\n assertTrue(\"ServiceDetails' Update time should not be more than a year off\", (oneYearAgo < comp.getUpdateTime()\n .getTime())\n && (oneYearAhead > comp.getUpdateTime().getTime()));\n log(\"* SC UpdateTime: \" + comp.getUpdateTime());\n try\n {\n log(\"* SC Component Tag: \" + comp.getComponentTag());\n }\n catch (SIException ex)\n {\n log(\"* SC Component Tag: UNDEFINED\");\n }\n try\n {\n log(\"* SC Carousel ID: \" + comp.getCarouselID());\n }\n catch (SIException ex)\n {\n log(\"* SC Carousel ID: UNDEFINED\");\n }\n assertNotNull(\"SC Locator cannot be null\", comp.getLocator());\n log(\"* SC Locator: \" + comp.getLocator());\n assertNotNull(\"SC Handle cannot be null\", comp.getServiceComponentHandle());\n log(\"* SC Handle: \" + comp.getServiceComponentHandle());\n assertNotNull(\"Returned ServiceDetails cannot be null\", comp.getServiceDetails());\n }", "public String getLogFileContent() {\r\n\t\treturn _logFileContent;\r\n\t}", "public void setClLog(String clLog) {\r\n this.clLog = clLog;\r\n }", "@Override\n protected void log(String tag, String msg) {\n Log.i(tag, \"[you can use your custom logger here \\\"]\" + msg);\n }" ]
[ "0.66562235", "0.56832486", "0.5658161", "0.54110116", "0.52694917", "0.52594835", "0.5186603", "0.51820415", "0.5169697", "0.5169697", "0.5169697", "0.51575214", "0.5142037", "0.51323396", "0.5063728", "0.5045303", "0.5041811", "0.50417346", "0.5039992", "0.50293744", "0.5004841", "0.4998465", "0.49786794", "0.4970617", "0.49637306", "0.49608374", "0.49534065", "0.49060947", "0.48969293", "0.48719835", "0.48717645", "0.48510337", "0.4832955", "0.4821799", "0.4820154", "0.48117056", "0.48041108", "0.47935334", "0.47934067", "0.47835281", "0.47797862", "0.4763457", "0.4762499", "0.47611132", "0.4755944", "0.47503173", "0.4738703", "0.4728307", "0.4725949", "0.47136575", "0.47080326", "0.4707859", "0.4705956", "0.47058797", "0.46965426", "0.4684332", "0.46684915", "0.46651757", "0.46540248", "0.46455583", "0.46444097", "0.46427575", "0.46407765", "0.46359196", "0.46315882", "0.46269673", "0.46235985", "0.4622861", "0.46103364", "0.4607178", "0.45976257", "0.45836577", "0.4580352", "0.45755577", "0.4574623", "0.45729998", "0.45726317", "0.45696735", "0.45690167", "0.45683518", "0.45639056", "0.4560526", "0.45599955", "0.45596993", "0.4555978", "0.45504287", "0.45494524", "0.45436963", "0.45261332", "0.45243382", "0.45241827", "0.4523621", "0.45205387", "0.45105127", "0.45097062", "0.45093694", "0.45036772", "0.45033538", "0.45016325", "0.45011362" ]
0.6174222
1
Metodo....: logComponente Descricao.: Grava uma linha de informacoes de componentes de negocio. OBS: Este metodo foi mantido para compatibilidade com versoes anteriores. deprecated Favor utilizar o metodo logComponente(idProcesso,tipo,nomeComponente,mensagem,status)
public void logComponente (int aTipo, String aComponente, String aMensagem ) { logComponente(0,aTipo,aComponente,aMensagem," "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logComponente(long idProcesso, int aTipo, String aComponente, String aMensagem, String aStatus)\n\t{\n\t\tStringBuffer mensagemFinal = new StringBuffer(\"<Servidor> \").append( getHostName()); \n mensagemFinal.append(\" <ID> \" ).append(idProcesso);\n\t\tmensagemFinal.append(\" <Mensagem> \" ).append(aMensagem);\n\t\tmensagemFinal.append(\" <ST> \" ).append(aStatus);\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal.toString());\n\t\tmensagemFinal = null;\n\t}", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tString mensagemFinal = \"<Servidor> \" + this.hostName; \n\t\tmensagemFinal = mensagemFinal + \" <ID> \" + idProcesso;\n\t\tmensagemFinal = mensagemFinal + \" <CL> \" + aClasse;\n\t\tmensagemFinal = mensagemFinal + \" <ME> \" + aMetodo;\n\t\tmensagemFinal = mensagemFinal + \" <Mensagem> \" + aMensagem;\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal);\n\t}", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tStringBuffer mensagemFinal = new StringBuffer(\"<Servidor> \").append(getHostName()); \n\t\tmensagemFinal.append(\" <ID> \").append(idProcesso);\n\t\tmensagemFinal.append(\" <Metodo> \").append(aMetodo);\n\t\tmensagemFinal.append(\" <Mensagem> \").append(aMensagem);\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal.toString());\n\t\tmensagemFinal = null;\n\t}", "public void liberaIdProcesso(long idProcesso, String compNegocio, String status)\n\t{\n\t\tlogComponente(idProcesso,Definicoes.DEBUG,compNegocio,\"FIM\",status);\n\t}", "public void componentStartInfo(INode node) {\n\t\t\tif (isLog4jEnabled) {\n\t\t\t\n stringBuffer.append(TEXT_16);\n stringBuffer.append(cid);\n stringBuffer.append(TEXT_17);\n \n\t\t\t}\n\t\t}", "public void changerLogique(String nouvFormule,String nouvCommentaire,EOGenericRecord ecEnModif) {\r\n\t\t// retrouver l'entité IpUeSeuil qui va bien...\r\n\r\n\t\tif (ecEnModif != null) {\r\n\t\t\tERXGenericRecord toEcSeuil = (ERXGenericRecord)ecEnModif.valueForKey(\"toEcSeuil\");\r\n\t\t\tif (toEcSeuil != null) {\r\n\r\n\t\t\t\ttoEcSeuil.takeStoredValueForKey(nouvFormule, \"rceFormuleContrainte\");\r\n\t\t\t\ttoEcSeuil.takeStoredValueForKey(nouvFormule, \"rceFormuleContrainte\");\r\n\t\t\t\tEOEditingContext ecEnt = ecEnModif.editingContext();\r\n\t\t\t\tecEnt.saveChanges();\r\n\r\n\t\t\t\t// Il faut provoquer un refresh des objets dans le shared editing context de l'application...\r\n\t\t\t\tmaSession.monApp.InvaliderSharedEC();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic String log(String info) {\n\t\tlong id=Thread.currentThread().getId();\r\n\t\tCalcThread b=ProCalcManage.getInstance().threadIDMap.get(id);\r\n\t\tsynchronized (b.proinfo.info.log) {\r\n\t\t\tb.proinfo.info.log.add(new LogInfo(new Date(), info));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn info;\r\n\t}", "public List<ActDetalleActivo> listarDetalleActivoLaboratorio(long codigoSalaLaboratorio,long codigoTipo,String amie, int estado,int anio);", "@Override\r\n\tpublic String getAsString(FacesContext facesContext, UIComponent component, Object objeto) {\n\ttry {\r\n\t\t\t\r\n\t\tEnsino ensino = (Ensino)objeto;\r\n\t\tLong codigo = ensino.getIdEnsino();\r\n\r\n\t\tFacesUtil.adicionarMsgInfo(\"getAsString: \"+codigo.toString());\r\n\r\n\t\treturn codigo.toString();\r\n\t\t\r\n\t\t}catch(RuntimeException er) {\r\n\t\t\t\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public Logradouro(int id, String tipo, String descricao) {\n\t\tsuper(id, descricao);\n\t\tthis.tipo = tipo;\n\t}", "@Override\n public String getInformacionInstruccion() {\n\treturn \"comando desconocido\";\n }", "public void visualizarMensaje(Object pila);", "private void btnExecutarLabirinto(){\n log.setText(\"Log de erros\");\n botao[2].setEnabled(false);\n try{\n lab.encontrarAdj();\n lab.andadinha();\n info.setText(\" \");\n visor.setText(lab.toString());\n\n Pilha<Coordenada> caminho = lab.getCaminho();\n Pilha<Coordenada> inverso = new Pilha<Coordenada>();\n while(!caminho.isVazia())\n {\n inverso.guardeUmItem(caminho.recupereUmItem());\n caminho.removaUmItem();\n }\n\n log.setText(\"Caminho percorrido: \");\n while(!inverso.isVazia())\n {\n log.setText(log.getText() + inverso.recupereUmItem().toString() + \" \");\n inverso.removaUmItem();\n }\n }\n catch(Exception erro1){\n log.setText(erro1.getMessage());\n }\n\t\t}", "private void dumpComponent(ServiceComponentExt comp)\n {\n log(\"*\");\n log(\"* ServiceComponent Information\");\n assertNotNull(\"SC Name cannot be null\", comp.getName());\n log(\"* SC Name: \" + comp.getName());\n int pid = comp.getPID();\n // TODO (Josh) Verify this range of pids\n assertTrue(\"SC Pid does not fall within valid range\", pid > 0 && pid < 65535);\n log(\"* SC Pid: \" + pid);\n log(\"* SC Assoc. Language: \" + comp.getAssociatedLanguage());\n assertNotNull(\"SC ServiceInformationType cannot be null\", comp.getServiceInformationType());\n log(\"* SC ServiceInformationType: \" + comp.getServiceInformationType());\n assertNotNull(\"SC StreamType cannot be null\", comp.getStreamType());\n log(\"* SC StreamType: \" + comp.getStreamType());\n short est = comp.getElementaryStreamType();\n // TODO (Josh) Enable once Elementary StreamType is broadcast properly\n // assertTrue(\"Elementary StreamType does not fall within valid range: 1-14 or 128-132 (inclusive)\",\n // (est > 0 && est < 15) && (est > 127 && est < 133));\n log(\"* SC Elementary StreamType: \" + est);\n assertNotNull(\"SC UpdateTime cannot be null\", comp.getUpdateTime());\n long now = new Date().getTime();\n long oneYearAgo = now - (1000 * 60 * 60 * 24 * 365);\n long oneYearAhead = now + (1000 * 60 * 60 * 24 * 365);\n assertTrue(\"ServiceDetails' Update time should not be more than a year off\", (oneYearAgo < comp.getUpdateTime()\n .getTime())\n && (oneYearAhead > comp.getUpdateTime().getTime()));\n log(\"* SC UpdateTime: \" + comp.getUpdateTime());\n try\n {\n log(\"* SC Component Tag: \" + comp.getComponentTag());\n }\n catch (SIException ex)\n {\n log(\"* SC Component Tag: UNDEFINED\");\n }\n try\n {\n log(\"* SC Carousel ID: \" + comp.getCarouselID());\n }\n catch (SIException ex)\n {\n log(\"* SC Carousel ID: UNDEFINED\");\n }\n assertNotNull(\"SC Locator cannot be null\", comp.getLocator());\n log(\"* SC Locator: \" + comp.getLocator());\n assertNotNull(\"SC Handle cannot be null\", comp.getServiceComponentHandle());\n log(\"* SC Handle: \" + comp.getServiceComponentHandle());\n assertNotNull(\"Returned ServiceDetails cannot be null\", comp.getServiceDetails());\n }", "public void aggiungiInCatalogo(Componente componente) {\n\t\ttry {\n\t\t\t\n\t\t\tArrayList <Componente> arrayComponenti = new ArrayList<Componente>();\n\t\t\t\n\t\t\tif(this.mappaComponenti.containsKey(componente.getCategoria())) arrayComponenti = new ArrayList<Componente>(this.mappaComponenti.get(componente.getCategoria()));\n\t\t\telse arrayComponenti = new ArrayList<Componente>();\n\t\t\tarrayComponenti.add(componente);\n\t\t\t\n\t\t\tthis.mappaComponenti.put(componente.getCategoria(), arrayComponenti);\n\t\t\t\n\t\t}catch(Exception e){\n\t e.printStackTrace();\n\t }\n\t}", "@Override\r\n\tpublic List<Componente> crear(Jpo jpo, ProyectoBean proyectoBean) throws Exception {\n\t\treturn null;\r\n\t}", "public String addComponent() throws Exception {\n\t\ttry {\n\t\t\tLOGGER.info(\n\t\t\t\t\t\"Start of DataListTableBean.addComponent()\");\n\t\t\tcomponentService.addComponent(component);\n\t\t\tdataList = componentService.findAllComponent();\n\t\t\t\n\t\t\tFacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Data saved\", \"Data saved\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, facesMessage);\n\t\t\tdata = new Data();\n\t\t\t\n\t\t\tLOGGER.info(\n\t\t\t\t\t\"End of DataListTableBean.addComponent()\");\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\treturn manageError(e, \"Error while saving Data. \");\n\t\t}\n\t\treturn \"componentTable\";\n\t}", "private static void statACricri() {\n \tSession session = new Session();\n \tNSTimestamp dateRef = session.debutAnnee();\n \tNSArray listAffAnn = EOAffectationAnnuelle.findAffectationsAnnuelleInContext(session.ec(), null, null, dateRef);\n \tLRLog.log(\">> listAffAnn=\"+listAffAnn.count() + \" au \" + DateCtrlConges.dateToString(dateRef));\n \tlistAffAnn = LRSort.sortedArray(listAffAnn, \n \t\t\tEOAffectationAnnuelle.INDIVIDU_KEY + \".\" + EOIndividu.NOM_KEY);\n \t\n \tEOEditingContext ec = new EOEditingContext();\n \tCngUserInfo ui = new CngUserInfo(new CngDroitBus(ec), new CngPreferenceBus(ec), ec, new Integer(3065));\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"service\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"agent\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"contractuel\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"travaillees\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"conges\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"dues\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"restant\");\n \tsb.append(ConstsPrint.CSV_NEW_LINE);\n \t\n \n \tfor (int i = 0; i < listAffAnn.count(); i++) {\n \t\tEOAffectationAnnuelle itemAffAnn = (EOAffectationAnnuelle) listAffAnn.objectAtIndex(i);\n \t\t//\n \t\tEOEditingContext edc = new EOEditingContext();\n \t\t//\n \t\tNSArray array = EOAffectationAnnuelle.findSortedAffectationsAnnuellesForOidsInContext(\n \t\t\t\tedc, new NSArray(itemAffAnn.oid()));\n \t\t// charger le planning pour forcer le calcul\n \t\tPlanning p = Planning.newPlanning((EOAffectationAnnuelle) array.objectAtIndex(0), ui, dateRef);\n \t\t// quel les contractuels\n \t\t//if (p.affectationAnnuelle().individu().isContractuel(p.affectationAnnuelle())) {\n \t\ttry {p.setType(\"R\");\n \t\tEOCalculAffectationAnnuelle calcul = p.affectationAnnuelle().calculAffAnn(\"R\");\n \t\tint minutesTravaillees3112 = calcul.minutesTravaillees3112().intValue();\n \t\tint minutesConges3112 = calcul.minutesConges3112().intValue();\n \t\t\n \t\t// calcul des minutes dues\n \t\tint minutesDues3112 = /*0*/ 514*60;\n \t\t/*\tNSArray periodes = p.affectationAnnuelle().periodes();\n \t\tfor (int j=0; j<periodes.count(); j++) {\n \t\t\tEOPeriodeAffectationAnnuelle periode = (EOPeriodeAffectationAnnuelle) periodes.objectAtIndex(j);\n \t\tminutesDues3112 += periode.valeurPonderee(p.affectationAnnuelle().minutesDues(), septembre01, decembre31);\n \t\t}*/\n \t\tsb.append(p.affectationAnnuelle().structure().libelleCourt()).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(p.affectationAnnuelle().individu().nomComplet()).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(p.affectationAnnuelle().individu().isContractuel(p.affectationAnnuelle())?\"O\":\"N\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesTravaillees3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesConges3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesDues3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesTravaillees3112 - minutesConges3112 - minutesDues3112)).append(ConstsPrint.CSV_NEW_LINE);\n \t\tLRLog.log((i+1)+\"/\"+listAffAnn.count() + \" (\" + p.affectationAnnuelle().individu().nomComplet() + \")\");\n \t\t} catch (Throwable e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\tedc.dispose();\n \t\t//}\n \t}\n \t\n\t\tString fileName = \"/tmp/stat_000_\"+listAffAnn.count()+\".csv\";\n \ttry {\n\t\t\tBufferedWriter fichier = new BufferedWriter(new FileWriter(fileName));\n\t\t\tfichier.write(sb.toString());\n\t\t\tfichier.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tLRLog.log(\"writing \" + fileName);\n\t\t}\n }", "public RMPLogica(Modulo modulo) {\n /* rimanda al costruttore della superclasse */\n super(modulo);\n\n try { // prova ad eseguire il codice\n /* regolazioni iniziali di riferimenti e variabili */\n this.inizia();\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }", "public TelaCliente() {\n\n try {\n Handler console = new ConsoleHandler();\n Handler file = new FileHandler(\"/tmp/roquerou.log\");\n console.setLevel(Level.ALL);\n file.setLevel(Level.ALL);\n file.setFormatter(new SimpleFormatter());\n LOG.addHandler(file);\n LOG.addHandler(console);\n LOG.setUseParentHandlers(false);\n } catch (IOException io) {\n LOG.warning(\"O ficheiro hellologgin.xml não pode ser criado\");\n }\n\n initComponents();\n NivelDAO nd = new NivelDAO();\n if (nd.buscar() == 3) {\n botaoNovoCliente.setEnabled(false);\n buscarcli.setEnabled(false);\n tabelaCliente.setEnabled(false);\n popularCombo();\n setarLabels();\n\n LOG.info(\"Abertura da Tela de Clientes\");\n } else {\n popularCombo();\n setarLabels();\n\n LOG.info(\"Abertura da Tela de Clientes\");\n }\n }", "private void setComponentStatus() {}", "private void reestablecerComponentes()\n {\n tokenslist = new LinkedList<LineaToken>();\n tokenslistErrores = new LinkedList<LineaToken>();\n info_tabla_tokens.clear();\n info_tabla_errores.clear();\n ta_errores_sintacticos_id.clear();\n ta_errores_semanticos_id.clear();\n ta_tabla_simbolos_id.clear();\n ta_codigo_ensamblador_id.clear();\n Generador.contadorEtiq = 1;\n Generador.etiqAnterior = \"L0\";\n EliminarArchivoASM();\n }", "public AddebitoFissoLogica(Modulo modulo) {\n /* rimanda al costruttore della superclasse */\n super(modulo);\n\n try { // prova ad eseguire il codice\n /* regolazioni iniziali di riferimenti e variabili */\n this.inizia();\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }", "public PanelMethodSEDN(Color fondo){\n super(fondo,\"Solucion Sistemas ED\");\n titulo_n = new JLabel(\"Num. de Div:\");\n setPanelDatos();\n setInformacion();\n setAllElements();\n calcular.addActionListener(this);\n limpiar.addActionListener(this);\n agregar.addActionListener(this);\n }", "private void colocaComponentes() {\r\n\t\tJLabel lblId = new JLabel(\"Id\");\r\n\t\tlblId.setBounds(10, 11, 46, 14);\r\n\t\tadd(lblId);\r\n\t\t\r\n\t\tJLabel lblApellido = new JLabel(\"1er Apellido\");\r\n\t\tlblApellido.setBounds(168, 11, 131, 14);\r\n\t\tadd(lblApellido);\r\n\t\t\r\n\t\ttextId = new JTextField();\r\n\t\ttextId.setBounds(10, 36, 86, 20);\r\n\t\tadd(textId);\r\n\t\ttextId.setColumns(10);\r\n\t\t\r\n\t\ttextApellido = new JTextField();\r\n\t\ttextApellido.setBounds(168, 36, 118, 20);\r\n\t\tadd(textApellido);\r\n\t\ttextApellido.setColumns(10);\r\n\t\t\r\n\t\tbtnComprobar = new JButton(\"Comprobar\");\r\n\t\tbtnComprobar.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tconsultaDatos();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnComprobar.setBounds(10, 83, 362, 23);\r\n\t\tadd(btnComprobar);\r\n\t\t\r\n\t\ttextMensaje = new JTextField();\r\n\t\ttextMensaje.setEditable(false);\r\n\t\ttextMensaje.setBounds(10, 117, 362, 20);\r\n\t\tadd(textMensaje);\r\n\t\ttextMensaje.setColumns(10);\r\n\t\t\r\n\t\tbtnAtras = new JButton(\"Atras\");\r\n\t\tbtnAtras.setBounds(10, 254, 89, 23);\r\n\t\tadd(btnAtras);\r\n\t\tbtnAtras.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tcambiaPanelAnterior();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void verLogroBotonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verLogroBotonActionPerformed\n if(logrosTabla.getModel().getRowCount() > 0){\n String logroTitulo = logrosTabla.getModel().getValueAt(logrosTabla.getSelectedRow(), 1).toString();\n Logro logro = ninno.getLogro(logroTitulo);\n \n if(logro != null){\n JOptionPane.showMessageDialog(this, logro.getDescripcion(), logroTitulo, JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }", "public ActDetalleActivo buscarPorSerial(String serial,String amie, int estado,int anio);", "public CadastrarFuncionario(Kernel obj,int acao,Object texto) {\n kernel = obj; \n bd_Funcionario = new BD_Funcionario(kernel);\n bd_Nivel = new BD_Nivel(kernel);\n \n initComponents(); \n \n /********* PREENCHENDO O VETOR Nivel *************/ \n Nivel[] Nivel_vetor = null;\n try {\n Nivel_vetor = bd_Nivel.getNivels();\n } catch (SQLException exx) {\n Logger.getLogger(CadastrarFuncionario.class.getName()).log(Level.SEVERE, null, exx);\n }\n String dados4[] = new String[Nivel_vetor.length];\n\n obj_Nivel = new Nivel();\n int pos4 = 0;\n for(int i=0; i < Nivel_vetor.length; i++){\n obj_Nivel = (Nivel)Nivel_vetor[i];\n dados4[i] = String.valueOf(obj_Nivel.getNome()).toUpperCase(); \n if(i==0){\n Nivel_id.setText(String.valueOf(obj_Nivel.getNivel_id()));\n }\n }\n combo_nivel.setModel(new javax.swing.DefaultComboBoxModel(dados4)); \n \n if(acao!=0){\n combo_nivel.setSelectedIndex(pos4);\n } \n /*****************************************************************/\n \n if(acao!=0){\n try {\n PreencherFormulario(acao);\n } catch (SQLException ex) {\n Logger.getLogger(CadastrarFuncionario.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n \n }", "public String limpiar()\r\n/* 143: */ {\r\n/* 144:171 */ crearDimensionContable();\r\n/* 145:172 */ String[] filtro = { \"indicadorValidarDimension\" + this.dimension, \"true\" };\r\n/* 146:173 */ this.listaCuentaContableBean.agregarFiltro(filtro);\r\n/* 147:174 */ return \"\";\r\n/* 148: */ }", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaTipoDetalleMovimientoInventarioActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.tipodetallemovimientoinventario);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.tipodetallemovimientoinventario);\r\n\t\t\t\t\r\n\t\t\t\tTipoDetalleMovimientoInventarioBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.tipodetallemovimientoinventario,new Object(),this.tipodetallemovimientoinventarioParameterGeneral,this.tipodetallemovimientoinventarioReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tTipoDetalleMovimientoInventarioBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.tipodetallemovimientoinventario,new Object(),this.tipodetallemovimientoinventarioParameterGeneral,this.tipodetallemovimientoinventarioReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(TipoDetalleMovimientoInventario.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",TipoDetalleMovimientoInventario.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,TipoDetalleMovimientoInventarioConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaLibroContableActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.librocontable);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.librocontable);\r\n\t\t\t\t\r\n\t\t\t\tLibroContableBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.librocontable,new Object(),this.librocontableParameterGeneral,this.librocontableReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tLibroContableBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.librocontable,new Object(),this.librocontableParameterGeneral,this.librocontableReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(LibroContable.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",LibroContable.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,LibroContableConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "private static void addComponent() throws Exception {\n\t\tList<Component> list_components = componentManager.showComponents();\n\t\tfor (Component components : list_components) {\n\t\t\tSystem.out.println(components);\n\t\t}\n\t\tInteger id = new Integer(0);\n\t\tboolean wrongtext = false;\n\t\tdo {\n\t\t\tSystem.out.println(\"Introduce the selected component's id\");\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\tid = Integer.parseInt(reader.readLine());\n\t\t\t\t\twrongtext = false;\n\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\twrongtext = true;\n\t\t\t\t\tSystem.out.println(\"It's not a int, please enter a int.\");\n\t\t\t\t}\n\t\t\t} while (wrongtext);\n\t\t} while (componentManager.getComponent(id) == null);\n\t\tComponent toBeModified = componentManager.getComponent(id);\n\t\tSystem.out.println(toBeModified);\n\t\tint preexistingNumber = toBeModified.getNumberComponents();\n\t\tSystem.out.println(\"The number of components that are now avaiable are: \" + preexistingNumber);\n\t\t// System.out.println(\"Introduce the number of components you want to add: \");\n\t\tInteger numbercomponents = new Integer(0);\n\t\tboolean wrongtext1 = false;\n\t\tdo {\n\t\t\tSystem.out.println(\"Introduce the number of components you want to add: \");\n\t\t\ttry {\n\t\t\t\tnumbercomponents = Integer.parseInt(reader.readLine());\n\t\t\t\twrongtext1 = false;\n\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\twrongtext1 = true;\n\t\t\t\tSystem.out.println(\"It's not a int, please enter a int.\");\n\t\t\t}\n\t\t} while (wrongtext1);\n\t\tint updatedNumber = preexistingNumber + numbercomponents;\n\t\t// Component updateComponent=new Component(updatedNumber);\n\t\ttoBeModified.setNumberComponents(updatedNumber);\n\t\tcomponentManager.update(toBeModified);\n\t}", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaLiquidacionImpuestoImporActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.liquidacionimpuestoimpor);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.liquidacionimpuestoimpor);\r\n\t\t\t\t\r\n\t\t\t\tLiquidacionImpuestoImporBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.liquidacionimpuestoimpor,new Object(),this.liquidacionimpuestoimporParameterGeneral,this.liquidacionimpuestoimporReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tLiquidacionImpuestoImporBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.liquidacionimpuestoimpor,new Object(),this.liquidacionimpuestoimporParameterGeneral,this.liquidacionimpuestoimporReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(LiquidacionImpuestoImpor.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",LiquidacionImpuestoImpor.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,LiquidacionImpuestoImporConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "@Override\n public String toString() {\n return \"Id del Libro: \"+id+\" Nombre del Libro: \"+nombre+\" Disponibilidad: \"+disponibilidad;\n }", "public String etatParcelle(Parcelle p) {\n\t\tString etat=\"\"; \n//\t\tSystem.out.println(\"-------- Etat parcelle \"+p.getLibelleParcelle());\n\n\t\tif(p.getDateRetraitParcelle()!=null){\n//\t\t\tSystem.out.println(\"-------- Etat Parcelle (RED) dateRetrait : \"+p.getDateRetraitParcelle());\n\t\t\tetat = \"red\";\n\t\t}else if (notHaveTachePlanified(p).equals(\"true\")) {\n//\t\t\tSystem.out.println(\"-------- Etat parcelle GREEN \");\n\n\t\t\tetat = \"green\";\n\t\t}else {\n//\t\t\tSystem.out.println(\"-------- Etat parcelle ORANGE \");\n\n\t\t\tetat = \"orange\";\n\t\t}\n\t\treturn etat;\n\t}", "public ConsultaHistorialClinico(java.awt.Frame parent, boolean modal,TipoInforme tipo,DTOAbuelo dto) {\n super(parent, modal);\n initComponents();\n Image icon = new ImageIcon(getClass().getResource(\"/Vistas/imagenes/pinaricono.jpg\")).getImage();\n this.setLocationRelativeTo(null);\n idPaciente = dto.getId();\n tipoInforme=tipo;\n controlador= new ControladorABMAbuelos();\n controladorHistorial = new ControladorHistorialClinico();\n textDNI.setText(dto.getDni());\n textNombre.setText(dto.getNombre() + \" \" + dto.getApellido());\n textObraSocial.setText(dto.getDTOobraSocial().getNombreObraSocial());\n textPeso.setText(Double.toString(dto.getPeso()));\n textTalla.setText(Double.toString(dto.getTalla()));\n textTipoHistorial.setText(tipo.name());\n ///////FOTO////\n if(dto.getFoto()!=null){\n byte[] imagenbyte = dto.getFoto();\n BufferedImage img = null;\n try{ \n img = ImageIO.read(new ByteArrayInputStream(imagenbyte));\n Image imagen = img;\n imagen = imagen.getScaledInstance(130, 130, imagen.SCALE_DEFAULT);\n jLabel5.setIcon(new ImageIcon(imagen));\n }catch(IOException e){\n System.out.println(\"error\");\n }\n }\n ///////////////\n mostrarInformes();\n }", "private void registraLog(int aTipo, String aMensagem)\n\t{\n\t\tArquivoConfiguracaoGPP arqConf = ArquivoConfiguracaoGPP.getInstance();\n\t\tif (aTipo == Definicoes.FATAL)\n\t\t\tlogger.fatal(aMensagem);\n\t\telse if (aTipo == Definicoes.ERRO)\n\t\t\t\tlogger.error(aMensagem);\n\t\telse if (aTipo == Definicoes.WARN)\n\t\t\t\tlogger.warn(aMensagem);\n\t\telse if (aTipo == Definicoes.INFO)\n\t\t\t\tlogger.info(aMensagem);\n\t\telse if (aTipo == Definicoes.DEBUG)\n\t\t{\n\t\t\t\tif (arqConf.getSaidaDebug())\n\t\t\t\t\tlogger.debug(aMensagem);\n\t\t}\n\t\telse logger.warn(\"SEVERIDADE NAO DEFINIDA - \" + aMensagem);\n\t}", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaFacturaPuntoVentaActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.facturapuntoventa);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.facturapuntoventa);\r\n\t\t\t\t\r\n\t\t\t\tFacturaPuntoVentaBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.facturapuntoventa,new Object(),this.facturapuntoventaParameterGeneral,this.facturapuntoventaReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tFacturaPuntoVentaBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.facturapuntoventa,new Object(),this.facturapuntoventaParameterGeneral,this.facturapuntoventaReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(FacturaPuntoVenta.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",FacturaPuntoVenta.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,FacturaPuntoVentaConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaAnalisisTransaClienteActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.analisistransacliente);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.analisistransacliente);\r\n\t\t\t\t\r\n\t\t\t\tAnalisisTransaClienteBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.analisistransacliente,new Object(),this.analisistransaclienteParameterGeneral,this.analisistransaclienteReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tAnalisisTransaClienteBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.analisistransacliente,new Object(),this.analisistransaclienteParameterGeneral,this.analisistransaclienteReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(AnalisisTransaCliente.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",AnalisisTransaCliente.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,AnalisisTransaClienteConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "public SystemLogMessage(String operationType, byte[] serialNumber) {\n\t\tthis.setVersion(Constants.VERSION);\t\t\t\t\t\t\t\t//version is universal for all log messages\n\t\tthis.setCertifiedDatatype(Constants.SYSTEM_LOG_OID);\t\t\t//certifiedDataType is the OID, for all transaction logs it is the same\n\t\tthis.setSerialNumber(serialNumber); \t\t\t//serial number has to be set by someone who has access to it (ERSSpecificModule or SecurityModule)\n\t\t\n\t\t//algorithm parameter has to be set using the LogMessage setAlgorithm method.\n\t\t//the ERSSpecificModule has to set the algorithm\n\t\t\n\t\tthis.operationType=operationType;\n\t}", "public String toString (){\r\n \r\n String mensaje=\"El rey color \"+color_rey+\" esta en la fila \"+posicion_rey.fila+\" y columna \"+posicion_rey.columna+\".\";\r\n \r\n return mensaje;\r\n \r\n }", "private void registraLog(int aTipo, String aMensagem)\n\t{\n\t\tif (aTipo == Definicoes.FATAL)\n\t\t\tlogger.fatal(aMensagem);\n\t\telse if (aTipo == Definicoes.ERRO)\n\t\t\t\tlogger.error(aMensagem);\n\t\telse if (aTipo == Definicoes.WARN)\n\t\t\t\tlogger.warn(aMensagem);\n\t\telse if (aTipo == Definicoes.INFO)\n\t\t\t\tlogger.info(aMensagem);\n\t\telse if (aTipo == Definicoes.DEBUG)\n\t\t{\n\t\t\t\tif (arqConfig.getSaidaDebug())\n\t\t\t\t\tlogger.debug(aMensagem);\n\t\t}\n\t\telse logger.warn(\"SEVERIDADE NAO DEFINIDA - \" + aMensagem);\n\t}", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaTablaAmortiDetalleActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.tablaamortidetalle);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.tablaamortidetalle);\r\n\t\t\t\t\r\n\t\t\t\tTablaAmortiDetalleBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.tablaamortidetalle,new Object(),this.tablaamortidetalleParameterGeneral,this.tablaamortidetalleReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tTablaAmortiDetalleBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.tablaamortidetalle,new Object(),this.tablaamortidetalleParameterGeneral,this.tablaamortidetalleReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(TablaAmortiDetalle.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",TablaAmortiDetalle.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,TablaAmortiDetalleConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "public void informarTeclaPressionada( Tecla t );", "public void liberarConexoesEmUso (long idProcesso) {\r\n this._delegate.liberarConexoesEmUso(idProcesso);\r\n }", "public String geraStatus() {\r\n\t\tString statusComplemento = \"\";\r\n\t\tif (this.temProcesso() == false) {\r\n\t\t\treturn \"Nenhum processo\\n\";\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < this.escalonadores.size(); i++) {\r\n\t\t\t\tif (i > 0) {\r\n\t\t\t\t\tstatusComplemento += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tstatusComplemento += i + 1 + \" - \";\r\n\t\t\t\tif (this.escalonadores.get(i).temProcesso()) {\r\n\t\t\t\t\tstatusComplemento += this.escalonadores.get(i).geraStatusComplemento();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstatusComplemento += \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn statusComplemento;\r\n\t}", "public String toString(){\n\n\t\tString msg =\"\";\n\t\tmsg += super.toString()+\"\\n\";\n\t\tmsg +=\"El tipo de servicio es: \"+typeOfService+\"\\n\";\n\t\tmsg +=\"La cantidad de kiloWatts registrada es: \"+kiloWatts+\"\\n\";\n\t\tmsg +=\"Cantidad de arboles que deben plantar: \"+calculatedConsuption()+\"\\n\";\n\n\t return msg;\n\t}", "String getId(IApiComponent component) throws CoreException {\n StringBuffer buffer = new StringBuffer();\n //$NON-NLS-1$\n buffer.append(component.getSymbolicName()).append(\" \").append('(').append(component.getVersion()).append(')');\n return buffer.toString();\n }", "@Override public Object getComponente(String componente){\n return getBlindaje(componente);\n }", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaCierreCajaActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.cierrecaja);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.cierrecaja);\r\n\t\t\t\t\r\n\t\t\t\tCierreCajaBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.cierrecaja,new Object(),this.cierrecajaParameterGeneral,this.cierrecajaReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tCierreCajaBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.cierrecaja,new Object(),this.cierrecajaParameterGeneral,this.cierrecajaReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(CierreCaja.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",CierreCaja.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,CierreCajaConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "public void saveComm() throws Exception {\n JFileChooser chooser = new JFileChooser();\n chooser.setFileFilter(new FileNameExtensionFilter(\"Log-Datei (*.log)\", \"log\"));\n\n File comfile = null;\n File home;\n File folder;\n Date date = Calendar.getInstance().getTime();\n DateFormat df = new SimpleDateFormat(\"yy.MM.dd-HH.mm.ss.SSS\");\n\n try {\n home = new File(System.getProperty(\"user.home\"));\n } catch (Exception e) {\n home = null;\n }\n\n if (home != null && home.exists()) {\n folder = new File(home + File.separator + \"Bike-Files\" + File.separator + \"Service_Files\");\n if (!folder.exists()) {\n if (!folder.mkdir()) {\n throw new Exception(\"Internal Error\");\n }\n }\n comfile = new File(folder + File.separator + \"CommLog_\" + df.format(date) + \".log\");\n }\n\n chooser.setSelectedFile(comfile);\n\n int rv = chooser.showSaveDialog(this);\n if (rv == JFileChooser.APPROVE_OPTION) {\n comfile = chooser.getSelectedFile();\n\n try (BufferedWriter w = new BufferedWriter(new FileWriter(comfile))) {\n CommunicationLogger.getInstance().writeFile(w);\n } catch (Exception ex) {\n LOG.severe(ex);\n }\n }\n }", "public void anexaDescricao(Object descricao) {\n Log.info((String) descricao);\n ReportListener.setSteps((String) descricao);\n }", "public void setComponenteCosto(ComponenteCosto componenteCosto)\r\n/* 73: */ {\r\n/* 74: 95 */ this.componenteCosto = componenteCosto;\r\n/* 75: */ }", "private void writeLog(){\n\t\tStringBuilder str = new StringBuilder();\r\n\t\tstr.append(System.currentTimeMillis() + \", \");\r\n\t\tstr.append(fileInfo.getCreator() + \", \");\r\n\t\tstr.append(fileInfo.getFileName() + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(networkSize + \", \");\r\n\t\tstr.append(fileInfo.getN1() + \", \");\r\n\t\tstr.append(fileInfo.getK1() + \", \");\r\n\t\tstr.append(fileInfo.getN2() + \", \");\r\n\t\tstr.append(fileInfo.getK2() + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT)+ \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.encryStart, logger.encryStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \"\\n\");\r\n\t\t\r\n\t\tString tmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getKeyStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\r\n\t\t\r\n\t\ttmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getFileStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.FILE_CREATION, str.toString());\t\t\r\n\t\t\r\n\t\t// Topology Discovery\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"TopologyDisc, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.topStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT ) + \", \");\r\n\t\tstr.append(\"\\n\");\t\t\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\r\n\t\t\r\n\t\t// Optimization\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"Optimization, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.optStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(\"\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t\t\r\n\t\t\r\n\t\t// File Distribution\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"FileDistribution, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(logger.distStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \", \");\r\n\t\tstr.append(\"\\n\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t}", "public PersonalNoteLogConverter(EntityDetail entity,\n OMRSRepositoryHelper repositoryHelper,\n String serviceName)\n {\n super(entity, repositoryHelper, serviceName);\n }", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaTipoDireccionActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.tipodireccion);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.tipodireccion);\r\n\t\t\t\t\r\n\t\t\t\tTipoDireccionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.tipodireccion,new Object(),this.tipodireccionParameterGeneral,this.tipodireccionReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tTipoDireccionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.tipodireccion,new Object(),this.tipodireccionParameterGeneral,this.tipodireccionReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(TipoDireccion.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",TipoDireccion.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,TipoDireccionConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "@Override\r\n\tpublic void exibir() {\n\t\t\r\n\t\tSystem.out.println(\"Condicoes atuais: \" + temp + \"°C e \" + umid + \"% de umidade \" \r\n\t\t\t\t+ pressao + \" pressao\");\r\n\t\t\r\n\t}", "protected GerentePoolLog(Class ownerClass)\n {\n\t\tArquivoConfiguracaoGPP arqConf = ArquivoConfiguracaoGPP.getInstance();\n\t\t//Define o nome e a porta do servidor q serao utilizados no LOG\n\t\thostName = arqConf.getEnderecoOrbGPP() + \":\" + arqConf.getPortaOrbGPP();\n\n\t\t/* Configura o LOG4J com as propriedades definidas no arquivo\n\t\t * de configuracao do GPP\n\t\t */\n\t\t\n\t\tPropertyConfigurator.configure(arqConf.getConfiguracaoesLog4j());\n\t\t//Inicia a instancia do Logger do LOG4J\n\t\tlogger = Logger.getLogger(ownerClass);\n\t\tlog(0,Definicoes.DEBUG,\"GerentePoolLog\",\"Construtor\",\"Iniciando escrita de Log do sistema GPP...\");\n }", "public EmitirNFBonusTLDC (long logId)\n\t {\n\t\tsuper(logId, Definicoes.CL_EMITIR_NF_BONUS_TLDC);\n\t\t\n\t\t// Obtem referencia do gerente de conexoes do Banco de Dados\n\t\tthis.gerenteBancoDados = GerentePoolBancoDados.getInstancia(logId);\n\t }", "public void componentShown(ComponentEvent e)\r\n {\n new Thread(new Runnable()\r\n {\r\n public void run()\r\n {\r\n\t\t\t\t\t\t try\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t setName(aplicacion.getI18nString(\"importar.asistente.subparcelas.titulo.2\"));\r\n\t\t\t\t\t\t geopistaEditor = (GeopistaEditor) blackboard.get(\"geopistaEditorInfoReferencia\");\r\n\t\t\t\t\t\t jbInit();\r\n\t\t\t\t\t\t } catch (Exception e)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t e.printStackTrace();\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t finally\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t progressDialog.setVisible(false);\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}).start();\r\n\t\t\t\t\t\t\t\t}", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaCostoGastoImporActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.costogastoimpor);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.costogastoimpor);\r\n\t\t\t\t\r\n\t\t\t\tCostoGastoImporBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.costogastoimpor,new Object(),this.costogastoimporParameterGeneral,this.costogastoimporReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tCostoGastoImporBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.costogastoimpor,new Object(),this.costogastoimporParameterGeneral,this.costogastoimporReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(CostoGastoImpor.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",CostoGastoImpor.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,CostoGastoImporConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "@Override\n\tpublic String parler() {\n\t\treturn \"Je suis un Orc\";\n\t}", "private static void longer_logmsg_Log4j(Logger log, Object msg, Throwable ex, int id, \n String original_methname, Object msg_modified) {\n\n Level level = Level.toLevel(original_methname);\n boolean legacyEnabled = log.isEnabledFor(level);\n int printResult = shouldPrint(id, legacyEnabled);\n if( (printResult & LOG_OUT) != 0) {\n /*LEVS methname = getWarnLevel(id);\n if(methname == null)\n methname = setMeth(id, original_methname);\n Level level = Level.toLevel(methname.toString());*/\n if(msg_modified == null)\n msg_modified = taggedID(id) + msg;\n \n String logname = log.getName();\n\n log.callAppenders(\n new org.apache.log4j.spi.LoggingEvent(logname, log, level, msg_modified, ex));\n }\n if( (printResult & RECORD_OUT) != 0)\n RecordStatements.record(id, original_methname, msg, ex);\n }", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaPlantillaFacturaActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.plantillafactura);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.plantillafactura);\r\n\t\t\t\t\r\n\t\t\t\tPlantillaFacturaBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.plantillafactura,new Object(),this.plantillafacturaParameterGeneral,this.plantillafacturaReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tPlantillaFacturaBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.plantillafactura,new Object(),this.plantillafacturaParameterGeneral,this.plantillafacturaReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(PlantillaFactura.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",PlantillaFactura.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,PlantillaFacturaConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "public MailboxLog() {\n super(\"MAILBOX - LOG\");\n setResizable(false);\n\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setBounds(1, 1, 442, 342);\n\n textArea = new JTextAreaWithScroll(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,\n JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);\n textArea.setToolTipText(\"Registro de eventos de la cola de mensajes\");\n textArea.setFont(new Font(\"Segoe UI\", Font.PLAIN, 13));\n textArea.setBackground(new Color(0, 0, 0));\n textArea.setForeground(new Color(255, 255, 255));\n\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n textArea.setText(\"Log inicializado: \" + date + \"\\n\");\n getContentPane().add(textArea.getScrollPane());\n\n JSplitPane splitPane = new JSplitPane();\n getContentPane().add(splitPane, BorderLayout.SOUTH);\n\n //setListaProc(lstProc);\n JButton btnImprimirCola = new JButton(\"Continuar\");\n btnImprimirCola.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n setVisible(true);\n \t\t\t//lstProcesos.ocultarProcesos();\n //lstProcesos.Imprimir();\n \t\t\t/*NodosListaProceso aux = lstProcesos.PrimerNodo;\n int i = 0;\n while (aux.siguiente!=null && i<6) {\n aux.proceso.setVisible(false);\n i++;\n aux=aux.siguiente;\n }\n aux.proceso.setVisible(false); \t\t\n */\n }\n });\n btnImprimirCola.setToolTipText(\"Oculta las ventanas y continúa con la terminal de comandos\");\n splitPane.setLeftComponent(btnImprimirCola);\n\n JButton btnCerrar = new JButton(\"Cerrar y salir del sistema\");\n btnCerrar.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n /*INSTRUCCIONES PARA CIERRE DE TODOS LOS PROCESOS Y EL MAILBOX*/\n int reply = JOptionPane.showConfirmDialog(null, \"Esta operación cerrará todos los procesos del sistema de mensajería\\n\"\n + \" ¿Está seguro que desea salir?\\n\", \"Salir\", JOptionPane.YES_NO_OPTION);\n if (reply == JOptionPane.YES_OPTION) {\n System.exit(0);\n }\n\n }\n });\n btnCerrar.setToolTipText(\"Cierra todos los procesos de éste sistema\");\n splitPane.setRightComponent(btnCerrar);\n }", "public PrincipalComprar(ConectorDB conector,JPanel contenedor,JPanel panelMensaje) {\n this.conector = conector;\n this.contenedor = contenedor;\n this.panelMensaje = panelMensaje;\n initComponents();\n this.setBackground(AdaptadorSQLUI.fondoScrolls);\n this.setSize(870, 610);\n jScrollPane1.getViewport().setBackground(AdaptadorSQLUI.fondoTablas);\n jScrollPane2.getViewport().setBackground(AdaptadorSQLUI.fondoTablas);\n lock=1;\n Proveedor.llenarComboBox(conector, jcbProveedor);\n lock=0;\n panelComprar.setVisible(false);\n this.compras = new ArrayList<Lote_material>();\n jtfTotal.setText(String.valueOf(montoTotal));\n jtfTotal.setEnabled(false);\n jlErrorcantidad.setVisible(false);\n\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"ContaCorrente Numero : \" + numero + \", Tipo : \" + tipo + \"\"\n\t\t\t\t+ \", Solde : R$ \" + solde + \"\\n\";\n\t}", "public TelaInformacoes(Pessoa codPessoa) {\n initComponents();\n \n //System.out.println(codPessoa.getCodPessoa());\n //aluno = pessoa.localizarPessoa(codPessoa);\n \n jpTela.setBackground(Color.white);\n lbNome.setText(codPessoa.getNome());\n lbSexo.setText(codPessoa.getSexo());\n lbCor.setText(codPessoa.getCorRaca());\n lbNaturalidade.setText(codPessoa.getNaturalidade());\n lbNomePai.setText(codPessoa.getNomePai());\n lbNomeMae.setText(codPessoa.getNomeMae());\n lbEstado.setText(codPessoa.getUf());\n lbOrgaoEmissor.setText(codPessoa.getOrgaoEmissor());\n lbDataNascimento.setText(codPessoa.getDataNacimento());\n lbDataExpedicao.setText(codPessoa.getDataExpedicao());\n lbRG.setText(codPessoa.getRG());\n lbCPF.setText(codPessoa.getCpf());\n \n for(Endereco temp:alunob.listarEnderecoPessoa(codPessoa.getCodPessoa()))\n {\n lbRua.setText(temp.getRua());\n lbBairro.setText(temp.getBairro());\n lbNumCasa.setText(temp.getComplemento());\n lbCidade.setText(temp.getCidade());\n lbCep.setText(temp.getCep());\n \n }\n \n for(Contato temp:alunob.listarContatoPessoa(codPessoa))\n {\n lbCelular.setText(temp.getCelular());\n lbEmail.setText(temp.getEmail());\n lbTelefone.setText(temp.getTelefone());\n \n }\n \n \n }", "public String comunica() {\r\n// ritorna una stringa\r\n// posso usare il metodo astratto \r\n return msg + AggiungiQualcosa();\r\n }", "@Override\n public ComprobanteContable createComprobante(Aerolinea a, Boleto boleto, Cliente cliente, String tipo, NotaDebito nota) throws CRUDException {\n\n ComprobanteContable comprobante = new ComprobanteContable();\n //ComprobanteContablePK pk = new ComprobanteContablePK();\n //pk.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n\n //creamos el concepto\n StringBuilder buff = new StringBuilder();\n\n // DESCRIPCION \n // AEROLINEA/ # Boleto / Pasajero / Rutas\n buff.append(a.getNumero());\n\n buff.append(\"/\");\n\n //numero boleto\n buff.append(\"#\");\n buff.append(boleto.getNumero());\n buff.append(\"/\");\n\n //Pasajero\n buff.append(boleto.getNombrePasajero().toUpperCase());\n\n // Rutas\n buff.append(\"/\");\n buff.append(boleto.getIdRuta1() != null ? boleto.getIdRuta1() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta2() != null ? boleto.getIdRuta2() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta3() != null ? boleto.getIdRuta3() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta4() != null ? boleto.getIdRuta4() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta5() != null ? boleto.getIdRuta5() : \"\");\n\n //jala el nombre cliente\n comprobante.setIdCliente(cliente);\n comprobante.setConcepto(buff.toString());\n comprobante.setFactorCambiario(boleto.getFactorCambiario());\n comprobante.setFecha(boleto.getFechaEmision());\n comprobante.setFechaInsert(boleto.getFechaInsert());\n comprobante.setIdEmpresa(boleto.getIdEmpresa());\n comprobante.setIdUsuarioCreador(boleto.getIdUsuarioCreador());\n comprobante.setTipo(tipo);\n comprobante.setEstado(ComprobanteContable.EMITIDO);\n //comprobante.setComprobanteContablePK(pk);\n\n //ComprobanteContablePK numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n Integer numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n comprobante.setIdNumeroGestion(numero);\n comprobante.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n return comprobante;\n }", "protected Object[] get_ComponentInfo()\n {\n return new Object[]\n {\n \"ReporterMBean contains settings and statistics for the Coherence JMX Reporter.\",\n \"com.bea.owner=Context,com.bea.VisibleToPartitions=ALWAYS\",\n };\n }", "public void majInformation (String typeMessage, String moduleMessage, String corpsMessage) {\n Date date = new Date();\n listMessageInfo.addFirst(dateFormat.format(date)+\" - \"+typeMessage+\" - \"+moduleMessage+\" - \"+corpsMessage);\n }", "public void seleccionarTipoComprobante() {\r\n if (com_tipo_comprobante.getValue() != null) {\r\n tab_tabla1.setCondicion(\"fecha_trans_cnccc between '\" + cal_fecha_inicio.getFecha() + \"' and '\" + cal_fecha_fin.getFecha() + \"' and ide_cntcm=\" + com_tipo_comprobante.getValue());\r\n tab_tabla1.ejecutarSql();\r\n tab_tabla2.ejecutarValorForanea(tab_tabla1.getValorSeleccionado());\r\n } else {\r\n tab_tabla1.limpiar();\r\n tab_tabla2.limpiar();\r\n }\r\n tex_num_transaccion.setValue(null);\r\n calcularTotal();\r\n utilitario.addUpdate(\"gri_totales,tex_num_transaccion\");\r\n }", "public void verComprobante() {\r\n if (tab_tabla1.getValorSeleccionado() != null) {\r\n if (!tab_tabla1.isFilaInsertada()) {\r\n Map parametros = new HashMap();\r\n parametros.put(\"ide_cnccc\", Long.parseLong(tab_tabla1.getValorSeleccionado()));\r\n parametros.put(\"ide_cnlap_debe\", p_con_lugar_debe);\r\n parametros.put(\"ide_cnlap_haber\", p_con_lugar_haber);\r\n vpdf_ver.setVisualizarPDF(\"rep_contabilidad/rep_comprobante_contabilidad.jasper\", parametros);\r\n vpdf_ver.dibujar();\r\n } else {\r\n utilitario.agregarMensajeInfo(\"Debe guardar el comprobante\", \"\");\r\n }\r\n\r\n } else {\r\n utilitario.agregarMensajeInfo(\"No hay ningun comprobante seleccionado\", \"\");\r\n }\r\n }", "@Override\n\tpublic void muestraInfo() {\n\t\tSystem.out.println(\"Adivina un número par: Es un juego en el que el jugador\" +\n\t\t\t\t\" deberá acertar un número PAR comprendido entre el 0 y el 10 mediante un número limitado de intentos(vidas)\");\n\t}", "public pnl_Gestionar_info_laboratorio() {\n initComponents();\n listar_info_lab.setSelected(true);\n new CambiaPanel(panel_contenedor, new paneles_de_paneles.de_gestionar_info_laboratorio_listar());\n pnl_Gestionar_contrato.color_performed(listar_info_lab,add_info_lab);\n }", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaEvaluacionProveedorActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.evaluacionproveedor);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.evaluacionproveedor);\r\n\t\t\t\t\r\n\t\t\t\tEvaluacionProveedorBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.evaluacionproveedor,new Object(),this.evaluacionproveedorParameterGeneral,this.evaluacionproveedorReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tEvaluacionProveedorBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.evaluacionproveedor,new Object(),this.evaluacionproveedorParameterGeneral,this.evaluacionproveedorReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(EvaluacionProveedor.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",EvaluacionProveedor.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,EvaluacionProveedorConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "public void startProcessTipoDetalleMovimientoInventario(Boolean conSplash) throws Exception {\n\t\t\r\n\t\tfinal JTabbedPane jTabbedPaneBusquedasTipoDetalleMovimientoInventario=null; \r\n\t\t\r\n\t\tfinal JPanel jPanelParametrosReportesTipoDetalleMovimientoInventario=this.jPanelParametrosReportesTipoDetalleMovimientoInventario;\r\n\t\t//final JScrollPane jScrollPanelDatosTipoDetalleMovimientoInventario=this.jScrollPanelDatosTipoDetalleMovimientoInventario;\r\n\t\tfinal JTable jTableDatosTipoDetalleMovimientoInventario=this.jTableDatosTipoDetalleMovimientoInventario;\t\t\r\n\t\tfinal JPanel jPanelPaginacionTipoDetalleMovimientoInventario=this.jPanelPaginacionTipoDetalleMovimientoInventario;\r\n\t\t//final JScrollPane jScrollPanelDatosEdicionTipoDetalleMovimientoInventario=this.jScrollPanelDatosEdicionTipoDetalleMovimientoInventario;\r\n\t\tfinal JPanel jPanelAccionesTipoDetalleMovimientoInventario=this.jPanelAccionesTipoDetalleMovimientoInventario;\r\n\t\t\r\n\t\tJPanel jPanelCamposAuxiliarTipoDetalleMovimientoInventario=new JPanelMe();\r\n\t\tJPanel jPanelAccionesFormularioAuxiliarTipoDetalleMovimientoInventario=new JPanelMe();\r\n\t\t\r\n\t\tif(this.jInternalFrameDetalleFormTipoDetalleMovimientoInventario!=null) {\r\n\t\t\tjPanelCamposAuxiliarTipoDetalleMovimientoInventario=this.jInternalFrameDetalleFormTipoDetalleMovimientoInventario.jPanelCamposTipoDetalleMovimientoInventario;\r\n\t\t\tjPanelAccionesFormularioAuxiliarTipoDetalleMovimientoInventario=this.jInternalFrameDetalleFormTipoDetalleMovimientoInventario.jPanelAccionesFormularioTipoDetalleMovimientoInventario;\r\n\t\t}\r\n\t\t\r\n\t\tfinal JPanel jPanelCamposTipoDetalleMovimientoInventario=jPanelCamposAuxiliarTipoDetalleMovimientoInventario;\r\n\t\tfinal JPanel jPanelAccionesFormularioTipoDetalleMovimientoInventario=jPanelAccionesFormularioAuxiliarTipoDetalleMovimientoInventario;\r\n\t\t\r\n\t\t\r\n\t\tfinal JMenuBar jmenuBarTipoDetalleMovimientoInventario=this.jmenuBarTipoDetalleMovimientoInventario;\r\n\t\tfinal JToolBar jTtoolBarTipoDetalleMovimientoInventario=this.jTtoolBarTipoDetalleMovimientoInventario;\t\t\r\n\t\t\r\n\t\t\r\n\t\tJMenuBar jmenuBarDetalleAuxiliarTipoDetalleMovimientoInventario=new JMenuBar();\r\n\t\tJToolBar jTtoolBarDetalleAuxiliarTipoDetalleMovimientoInventario=new JToolBar();\t\t\r\n\t\t\r\n\t\tif(this.jInternalFrameDetalleFormTipoDetalleMovimientoInventario!=null) {\r\n\t\t\tjmenuBarDetalleAuxiliarTipoDetalleMovimientoInventario=this.jInternalFrameDetalleFormTipoDetalleMovimientoInventario.jmenuBarDetalleTipoDetalleMovimientoInventario;\r\n\t\t\tjTtoolBarDetalleAuxiliarTipoDetalleMovimientoInventario=this.jInternalFrameDetalleFormTipoDetalleMovimientoInventario.jTtoolBarDetalleTipoDetalleMovimientoInventario;\r\n\t\t}\r\n\t\t\r\n\t\tfinal JMenuBar jmenuBarDetalleTipoDetalleMovimientoInventario=jmenuBarDetalleAuxiliarTipoDetalleMovimientoInventario;\r\n\t\tfinal JToolBar jTtoolBarDetalleTipoDetalleMovimientoInventario=jTtoolBarDetalleAuxiliarTipoDetalleMovimientoInventario;\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif(Constantes2.CON_PROCESO_HILO) {\r\n\t\t\tThread threadRunnableProcess;\r\n\t\t\tProcessRunnable processRunnable;\r\n\t\t\t\r\n\t\t\tprocessRunnable=new ProcessRunnable();\r\n\t\t\t\r\n\t\t\tprocessRunnable.setsTipo(\"START\");\r\n\t\t\tprocessRunnable.setDesktop(jDesktopPane);\r\n\t\t\tprocessRunnable.setModuloActual(moduloActual);\r\n\t\t\tprocessRunnable.setModuloUsuarioSeleccionado(moduloActual);\r\n\t\t\tprocessRunnable.setOpcionActual(opcionActual);\r\n\t\t\tprocessRunnable.setParametroGeneralSg(parametroGeneralSg);\r\n\t\t\tprocessRunnable.setParametroGeneralUsuario(parametroGeneralUsuario);\r\n\t\t\tprocessRunnable.setResumenUsuarioActual(resumenUsuarioActual);\r\n\t\t\tprocessRunnable.setUsuarioActual(usuarioActual);\r\n\t\t\t\r\n\t\t\tprocessRunnable.jTabbedPaneBusquedas=jTabbedPaneBusquedasTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jPanelParametrosReportes=jPanelParametrosReportesTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jTableDatos=jTableDatosTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jPanelCampos=jPanelCamposTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jPanelPaginacion=jPanelPaginacionTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jPanelAcciones=jPanelAccionesTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jPanelAccionesFormulario=jPanelAccionesFormularioTipoDetalleMovimientoInventario;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tprocessRunnable.jmenuBar=jmenuBarTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jmenuBarDetalle=jmenuBarDetalleTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jTtoolBar=jTtoolBarTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jTtoolBarDetalle=jTtoolBarDetalleTipoDetalleMovimientoInventario;\r\n\t\t\tprocessRunnable.jInternalFrameBase=this;\r\n\t\t\t\r\n\t\t\t//processRunnable.CargarObjetosRendimientoCriticoModuloInventario();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tthreadRunnableProcess=new Thread(processRunnable);//.start();\r\n\t\t\t\t\t\r\n\t\t\tthreadRunnableProcess.start();\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tFuncionesSwing.enableDisablePanels(false,jTabbedPaneBusquedasTipoDetalleMovimientoInventario ,jPanelParametrosReportesTipoDetalleMovimientoInventario,jTableDatosTipoDetalleMovimientoInventario, /*jScrollPanelDatosTipoDetalleMovimientoInventario,*/jPanelCamposTipoDetalleMovimientoInventario,jPanelPaginacionTipoDetalleMovimientoInventario, /*jScrollPanelDatosEdicionTipoDetalleMovimientoInventario,*/ jPanelAccionesTipoDetalleMovimientoInventario,jPanelAccionesFormularioTipoDetalleMovimientoInventario,jmenuBarTipoDetalleMovimientoInventario,jmenuBarDetalleTipoDetalleMovimientoInventario,jTtoolBarTipoDetalleMovimientoInventario,jTtoolBarDetalleTipoDetalleMovimientoInventario);\r\n\t\t\r\n\t\t\tstartProcess();//this.\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\t/*\r\n\t\tif(conSplash) {\r\n\t\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\t public void run() {\r\n\t\t\t \t try {\r\n\t\t\t\t\t\t\tFuncionesSwing.enableDisablePanels(false,null ,jPanelParametrosReportesTipoDetalleMovimientoInventario, jScrollPanelDatosTipoDetalleMovimientoInventario,jPanelPaginacionTipoDetalleMovimientoInventario, jScrollPanelDatosEdicionTipoDetalleMovimientoInventario, jPanelAccionesTipoDetalleMovimientoInventario,jPanelAccionesFormularioTipoDetalleMovimientoInventario,jmenuBarTipoDetalleMovimientoInventario,jmenuBarDetalleTipoDetalleMovimientoInventario,jTtoolBarTipoDetalleMovimientoInventario,jTtoolBarDetalleTipoDetalleMovimientoInventario);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tstartProcess();//this.\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t});\r\n\t\t}\r\n\t\t*/\r\n\t}", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaUtilidadTipoPrecioActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.utilidadtipoprecio);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.utilidadtipoprecio);\r\n\t\t\t\t\r\n\t\t\t\tUtilidadTipoPrecioBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.utilidadtipoprecio,new Object(),this.utilidadtipoprecioParameterGeneral,this.utilidadtipoprecioReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tUtilidadTipoPrecioBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.utilidadtipoprecio,new Object(),this.utilidadtipoprecioParameterGeneral,this.utilidadtipoprecioReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(UtilidadTipoPrecio.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",UtilidadTipoPrecio.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,UtilidadTipoPrecioConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "@Override\n\tpublic void tipoComunicacao() {\n\t\tSystem.out.println(super.getNome() + \" se comunica miando.\");\n\t}", "public Veiculo(int numPassageiros, String modeloVeiculo, String tipo){\n this.numPassageiros = numPassageiros;\n this.tipo = tipo;\n this.modeloVeiculo = modeloVeiculo;\n }", "public static String logMessageDetaint(Object o) {\n return o.toString().replaceAll(\"[\\n|\\r|\\t]\", \"_\");\n }", "public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { \t \r\n\t\ttry {\r\n\t\t\tif(this.permiteManejarEventosControl()) {\r\n\t\t\t\t\r\n\t\t\t\t//SELECCIONA FILA A OBJETO ACTUAL\t\t\t\r\n\t\t\t\tthis.seleccionarFilaTablaPagosAutorizadosActual();\r\n\t\t\t\t\r\n\t\t\t\tEventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE;\r\n\t\t\t\t\r\n\t\t\t\tBoolean esControlTabla=false;\r\n\t\t\t\tContainer containerParent=null;\r\n\t\t\t\tContainer containerParentAux=null;\r\n\t\t\t\tJFormattedTextField JFormattedTextField=null;\r\n\t\t\t\tComponent componentOpposite=null;\r\n\t\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT\r\n\t\t\t\tGeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral();\t\t\t\r\n\t\t\t\tBoolean esUsoDesdeHijoLocal=false;\r\n\t\t\t\tBoolean conIrServidorAplicacionParent=false;\t\r\n\t\t\t\tArrayList<String> arrClasses=new ArrayList<String>();\t\t\t\r\n\t\t\t\t//PARAMETROS LLAMAR FUNCION PARENT_FIN\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\tif(this.esUsoDesdeHijo) {\r\n\t\t\t\t\teventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\tArrayList<Classe> classes=new ArrayList<Classe>();\r\n\t\t\t\t\r\n\t\t\t\tJFormattedTextField=(JFormattedTextField)evt.getSource();\r\n\t\t\t\t\r\n\t\t\t\tcontainerParentAux=JFormattedTextField.getParent();\r\n\t\t\t\t\r\n\t\t\t\tif(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) {\r\n\t\t\t\t\tcontainerParent=containerParentAux.getParent();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcomponentOpposite=null;//evt.getOppositeComponent();\r\n\t\t\t\t\r\n\t\t\t\tif((containerParent!=null && containerParent.getClass().equals(JTableMe.class))\r\n\t\t\t\t\t|| (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class))\r\n\t\t\t\t) {\t\t\t\t\t\r\n\t\t\t\t\tesControlTabla=true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.esControlTabla=esControlTabla;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"EVENTO_CONTROL\",false,this.pagosautorizados);\r\n\t\t\t\t\r\n\t\t\t\tthis.actualizarInformacion(\"INFO_PADRE\",false,this.pagosautorizados);\r\n\t\t\t\t\r\n\t\t\t\tPagosAutorizadosBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.pagosautorizados,new Object(),this.pagosautorizadosParameterGeneral,this.pagosautorizadosReturnGeneral);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\tPagosAutorizadosBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.pagosautorizados,new Object(),this.pagosautorizadosParameterGeneral,this.pagosautorizadosReturnGeneral);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(esUsoDesdeHijoLocal) {\r\n\t\t\t\t\tLong id=0L;\r\n\t\t\t\t\t\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR);\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominio(\"Formulario\");\r\n\t\t\t\t\tgeneralEntityParameterGeneral.setsDominioTipo(PagosAutorizados.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.jInternalFrameParent!=null) {\r\n\t\t\t\t\t\tthis.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,\"Formulario\",PagosAutorizados.class.getName(),sTipo,\"DATE\",esControlTabla,conIrServidorAplicacionParent,\r\n\t\t\t\t\t\t\tid,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses,\r\n\t\t\t\t\t\t\tevt,generalEntityParameterGeneral,null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n \t\t\tFuncionesSwing.manageException2(this, e,logger,PagosAutorizadosConstantesFunciones.CLASSNAME);\r\n \t\t}\r\n }", "com.spirit.cartera.entity.LogCarteraDetalleIf addLogCarteraDetalle(com.spirit.cartera.entity.LogCarteraDetalleIf model) throws GenericBusinessException;", "public VentanaEventos(String categoria) {\n //usuarioMostrar = ControladorUsuario.buscarUsuario(nickUsuario);\n categoriaActual=categoria;\n initComponents();\n mostrarTabla();\n\n\n }", "@Override\n\tpublic String detalheEleicao(Eleicao eleicao) throws RemoteException {\n\t\tString resultado = \"\";\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy:MM:dd hh:mm\");\n\t\tdataEleicao data_atual = textEditor.dataStringToData(dateFormat.format(new Date()));\n\t\tif (!data_atual.maior_data(textEditor.dataStringToData(eleicao.getDataInicio()))) {\n\t\t\tresultado += \"\\nTítulo eleição: \"+eleicao.getTitulo()+\" - Data início: \"+eleicao.getDataInicio()+\" - Data fim: \"+ eleicao.getDataFim();\n\t\t\tresultado += \"\\nEleição ainda não iniciada.\";\n\t\t\tfor(Candidatos candTemp: eleicao.getCandidatos()) {\n\t\t\t\tif(candTemp.getTipo().equalsIgnoreCase(\"lista\")) {\n\t\t\t\t\tLista lista = (Lista) candTemp;\n\t\t\t\t\tresultado += \"\\nNúmero candidato: \"+lista.getId()+\" - Nome lista: \"+lista.getNome()+\" Membros: \"+lista.getLista_pessoas();\n\t\t\t\t\tfor(PessoaLista pessoalista : lista.getLista_pessoas()) {\n\t\t\t\t\t\tresultado += \"\\n\\tCC: \"+pessoalista.getPessoa().getNcc()+\" - Cargo: \"+pessoalista.getCargo()+ \" - Nome: \"+pessoalista.getPessoa().getNome();\n\t\t\t\t\t}\n\t\t\t\t\tresultado += \"\\n\";\n\t\t\t\t}else {\n\t\t\t\t\tCandidatoIndividual cand = (CandidatoIndividual) candTemp;\n\t\t\t\t\tresultado += \"\\nNúmero candidato: \"+cand.getId()+\" - Nome: \"+cand.getPessoa().getNome()+\" - CC: \"+cand.getPessoa().getNcc();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (data_atual.maior_data(textEditor.dataStringToData(eleicao.getDataFim()))) {\n\t\t\t\tresultado += \"\\nTítulo eleição: \"+eleicao.getTitulo()+\" - Data início: \"+eleicao.getDataInicio()+\" - Data fim: \"+ eleicao.getDataFim();\n\t\t\t\tresultado += \"\\nEleição terminada.\";\n\t\t\t\tresultado += \"\\nVotos em branco/nulos: \"+eleicao.getnVotoBNA();\n\t\t\t\tfor(Candidatos candTemp: eleicao.getCandidatos()) {\n\t\t\t\t\tif(candTemp.getTipo().equalsIgnoreCase(\"lista\")) {\n\t\t\t\t\t\tLista lista = (Lista) candTemp;\n\t\t\t\t\t\tresultado += \"\\nNúmero candidato: \"+lista.getId()+\" - Nome lista: \"+lista.getNome()+\" Membros: \"+lista.getLista_pessoas()+\"Votos: \"+lista.getnVotos();\n\t\t\t\t\t\tresultado += \"\\n\";\n\t\t\t\t\t}else {\n\t\t\t\t\t\tCandidatoIndividual cand = (CandidatoIndividual) candTemp;\n\t\t\t\t\t\tresultado += \"\\nNúmero candidato: \"+cand.getId()+\" - Nome: \"+cand.getPessoa().getNome()+\" - CC: \"+cand.getPessoa().getNcc()+\" - Votos: \"+cand.getnVotos();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(eleicao.getDataInicio()+\"-\"+eleicao.getDataFim()+\": A decorrer\");\n\t\t\t}\n\t\t}\n\t\treturn resultado;\n\t\n\t}", "public SystemLogMessage() {\n\t\tthis.setVersion(Constants.VERSION);\t\t\t\t\t\t\t\t//version is universal for all log messages\n\t\tthis.setCertifiedDatatype(Constants.SYSTEM_LOG_OID);\t\t\t//certifiedDataType is the OID, for all transaction logs it is the same\n\t\t\n\t\t//algorithm parameter has to be set using the LogMessage setAlgorithm method.\n\t\t//the ERSSpecificModule has to set the algorithm\n\t\t//serial number has to be set by someone who has access to it \n\t}", "public String toString(){\n\n\tString msg =\"\";\n\n\tmsg += super.toString()+\"\\n\";\n\tmsg +=\"El tipo de servicio es: \"+typeOfService+\"\\n\";\n\tmsg +=\"La cantidad de kiloWatts registrada es: \"+kiloWatts+\"\\n\";\n\tmsg +=\"Cantidad de arboles que deben plantar: \"+calculatedConsuption()+\"\\n\";\n\tmsg += \"---------------------------------------------------------\";\n\n\n return msg;\n}", "public static String textoMensajeMail(String apellido,String nombreActividad, String expediente, \r\n\t\t\tString fechaVencimiento, int modo)\r\n\t{\n\t\tString texto =\"\";\r\n\t\tif (modo==1)\r\n\t\t{\r\n\t\t\ttexto = \"Estimado Doc. \"+apellido+\":\\n\" + \" La actividad procesal: \" + nombreActividad +\r\n\t\t\t\t\t\" del expediente: \" + expediente + \", esta proxima a vencer el dia \" + fechaVencimiento +\r\n\t\t\t\t\t\"\\n\\nPor favor tomar las medidas del caso.\" + \r\n\t\t\t\t\t\"\\n\\nAtte.\" + \r\n\t\t\t\t\t\"\\n\" +\r\n\t\t\t\t\t\"\\nSISTEMA DE GESTION LEGAL\";\r\n\t\t}\r\n\t\tif (modo==2)\r\n\t\t{\r\n\t\t\ttexto = \"Estimado Doc. \"+apellido+\":\\n\" + \" La actividad procesal: \" + nombreActividad +\r\n\t\t\t\t\t\" del expediente: \" + expediente + \" ha cambiado. La nueva Fecha de Vencimiento es: \" +\r\n\t\t\t\t\tfechaVencimiento +\r\n\t\t\t\t\t\"\\n\\nPor favor tomar las medidas del caso.\" + \r\n\t\t\t\t\t\"\\n\\nAtte.\" + \r\n\t\t\t\t\t\"\\n\" +\r\n\t\t\t\t\t\"\\nSISTEMA DE GESTION LEGAL\";\r\n\t\t}\r\n\t\tif (modo==3)\r\n\t\t{\r\n\t\t\ttexto = \"Estimado Doc. \"+apellido+\":\\n\" + \" La actividad procesal: \" + nombreActividad +\r\n\t\t\t\t\t\" del expediente: \" + expediente + \" ha vencido.\" +\r\n\t\t\t\t\t\"\\n\\nPor favor tomar las medidas del caso.\" + \r\n\t\t\t\t\t\"\\n\\nAtte.\" + \r\n\t\t\t\t\t\"\\n\" +\r\n\t\t\t\t\t\"\\nSISTEMA DE GESTION LEGAL\";\r\n\t\t}\r\n\t\treturn texto;\r\n\t}", "public String getCodaComponent() {\n return codaComponent;\n }", "public void mostrarInformacion(String nombre, String correo) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "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 ProcessRequestJPanel(JPanel userProcessContainer, LabTestWorkRequest request,Patient patient,Enterprise enterprise,UserAccount userAccount) {\n initComponents();\n this.userProcessContainer = userProcessContainer;\n this.request = request;\n this.patient=patient;\n this.enterprise= enterprise;\n this.userAccount=userAccount;\n this.vitalSignHistory=this.patient.getTestDir();\n Timestamp timeStamp = new Timestamp(new Date().getTime());\n time = String.valueOf(timeStamp);\n TimeStampText.setText(String.valueOf(time));\n \n \n }", "@Override\n\tprotected BaseProcesoForm devuelveFormProceso() throws Exception {\n\t\tProcesoBASLoggerForm objForm = new ProcesoBASLoggerForm();\n\t\treturn objForm;\n\t}", "public String toString()\n {\n StringBuffer loMessage = null;\n\n loMessage = new StringBuffer().append(\"\\n\");\n\n // Message Code\n if (getMSG_CD() != null)\n {\n loMessage.append(\"Message Code: \" + getMSG_CD() + \"\\n\");\n }\n\n // Severity Level\n if (getMSG_SEV() >= 0)\n {\n switch (getMSG_SEV())\n {\n case AMSMsgUtil.SEVERITY_LEVEL_INFO:\n loMessage.append(\"Severity Level: INFO\\n\");\n case AMSMsgUtil.SEVERITY_LEVEL_WARNING:\n loMessage.append(\"Severity Level: WARNING\\n\");\n case AMSMsgUtil.SEVERITY_LEVEL_ERROR:\n loMessage.append(\"Severity Level: ERROR\\n\");\n case AMSMsgUtil.SEVERITY_LEVEL_SEVERE:\n loMessage.append(\"Severity Level: SEVERE\\n\");\n } // end switch (liIndex)\n }\n\n // Override\n if (getOV_LVL() >= 0)\n {\n loMessage.append(\"Override: \" + getOV_LVL() + \"\\n\");\n }\n\n // Message\n if (getMSG_TXT() != null)\n {\n loMessage.append(\"Message: \" + getMSG_TXT() + \"\\n\");\n }\n\n // Component Name\n if (getCOMP_NM() != null)\n {\n loMessage.append(\"Component Name: \" + getCOMP_NM() + \"\\n\");\n }\n\n // Attribute ID\n if (getATTR_NM() != null)\n {\n loMessage.append(\"AttributeID: \" + getATTR_NM() + \"\\n\");\n }\n\n // Error Context\n if (getDOC_ID() != null)\n {\n loMessage.append(\"Error Context: \");\n loMessage.append(\"DOC_CD = \" + getDOC_CD() + \" AND \");\n loMessage.append(\"DOC_DEPT_CD = \" + getDOC_DEPT_CD() + \" AND \");\n loMessage.append(\"DOC_ID = \" + getDOC_ID() + \" AND \");\n loMessage.append(\"DOC_VERS_NO = \" + getDOC_VERS_NO() + \"\\n\");\n }\n\n return loMessage.toString();\n }", "Component duplicateComponentFound(Component component, String name, String type, String description, String technology);", "public String toString(){\n return \"MAVLINK_MSG_ID_BATTERY_batterySTATUS - sysid:\"+sysid+\" compid:\"+compid+\" time_total:\"+time_total+\" time_remaining:\"+time_remaining+\" battery_remaining:\"+battery_remaining+\" charge_state:\"+charge_state+\"\";\n }", "private void gestionPriseEnCompte() {\r\n\t\tString raison = new String(\"\");\r\n\t\tDate now = new Date();\r\n\t\tString strSql = \"\";\r\n\t\r\n if (tbAlarme.getRowCount() > 0) {\r\n \tif (tbAlarme.getSelectedRowCount() > 0) {\r\n\t\t int[] selection = tbAlarme.getSelectedRows();\r\n\t\t int indexSelection = selection[0];\r\n\t\t int idCapteur = mdlTpsReelAlarme.getIdCapteur(indexSelection); \r\n\t\t String strTypeAlarme = \"\";\r\n\t\t \r\n\t\t\t\t// Motif Prise En Compte seulement si appel Alert\r\n\t\t strTypeAlarme = (String) mdlTpsReelAlarme.getValueAt(indexSelection, JTABLE_ALARME_TYPE_ALARME);\r\n\t\t if (strTypeAlarme.equals(\"Alarme\")) {\r\n\t\t\t\t\tint idPriseEnCompte = 0;\r\n\t\t \tdo {\r\n\t\t\t\t\t\tObject [] possibilites = new Object[tbPriseEnCompte.size()];\r\n\t\t\t\t\t\tfor(int i = 0; i < tbPriseEnCompte.size(); i++) {\r\n\t\t\t\t\t\t\tpossibilites[i] = tbPriseEnCompte.get(i).getNom();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tString strReponse = (String)JOptionPane.showInputDialog(this, \"Choisir un motif de prise en compte : \", \"Prise en compte\", JOptionPane.QUESTION_MESSAGE, null, possibilites, null);\r\n\t\t\t\t\t\tidPriseEnCompte = 1;\r\n\t\t\t\t\t\tif (strReponse != null) {\r\n\t\t\t\t\t\t\tfor(int i = 0; i < tbPriseEnCompte.size(); i++) {\r\n\t\t\t\t\t\t\t\tif(strReponse.equals(tbPriseEnCompte.get(i).getNom())) {\r\n\t\t\t\t\t\t\t\t\tidPriseEnCompte = (int) tbPriseEnCompte.get(i).getId();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} // fin for\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\traison = \"En attente\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// idPriseEncompte == 1 (Autres)\r\n\t\t\t\t\t\tif(idPriseEnCompte == 1) {\r\n\t\t\t\t\t\t\t// Demande de commentaire\r\n\t\t\t\t\t\t\traison = AE_Fonctions.saisieTexte(\"Veuillez entrer une raison : \", \"Raison commentaire ...\");\r\n\t\t\t\t\t\t\tif (raison == null) raison = \"\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\traison = \"---\";\r\n\t\t\t\t\t\t}\r\n\t\t \t} while(raison == \"\");\r\n\t\t \t\r\n\t\t\t\t\tstrSql = \"UPDATE V2_AlarmeEnCours SET idPriseEnCompte = \" + idPriseEnCompte\r\n\t\t\t\t\t\t\t + \" , idUtilisateur = \" + EFS_Client_Variable.idUtilisateur\r\n\t\t\t\t\t\t\t + \" , CommentairePriseEnCompte = '\" + raison + \"'\"\r\n\t\t\t\t\t\t\t + \" WHERE idCapteur = \" + idCapteur;\r\n\t\t\t\t\tctn.fonctionSql(strSql);\r\n\t\t\t\t\tmdlTpsReelAlarme.setMotifIdPriseEncompte(indexSelection, idPriseEnCompte);\r\n\t\t } // fin if appelAlert\r\n\r\n\t\t if(mdlTpsReelAlarme.getValueAt(indexSelection, JTABLE_ALARME_PRISE_EN_COMPTE) == null) {\r\n\t\t\t\t\t// Date prise en compte\r\n\t\t\t\t\tstrSql = \"UPDATE V2_AlarmeEnCours SET DatePriseEnCompte = sysdate, blPriseEnCompte = 1 WHERE idCapteur = \" + idCapteur;\r\n\t\t\t\t\tctn.fonctionSql(strSql);\r\n\t\t\t\t\tmdlTpsReelAlarme.setValueAt(now, indexSelection, JTABLE_ALARME_PRISE_EN_COMPTE);\r\n\t\t } // fin if datePrsieEnCompte\r\n\t\r\n\t\t // Prevenir le programme maitre\r\n\t\t AE_Fonctions.modifierMaitreViaClient(idCapteur, VIA_API_PRISE_EN_COMPTE);\r\n\t\t \r\n\t\t\t\t// Arret klaxon et Alert\r\n//\t\t\t\tgestionKlaxon(false);\r\n//\t\t\t\tgestionAlert(false);\r\n\t\t\t\t\r\n \t} else {\r\n \t JOptionPane.showMessageDialog(this, \"Vous devez sélectionner une ligne pour prendre en compte ...\",\r\n \t \t\t \"GTC Visualize - Programme Maitre\", JOptionPane.WARNING_MESSAGE);\r\n \t}\r\n } else {\r\n//\t\t\tgestionKlaxon(false);\r\n//\t\t\tgestionAlert(false);\r\n }\r\n\t}", "public void setCodaComponent(String codaComponent) {\n this.codaComponent = codaComponent;\n }", "public String infoCompletaEmpleado(Empleado empleadoEncontrado){\n String info = \"\";\n info += \"Nombre: \" + empleadoEncontrado.getNombre() + \"\\n\" +\n \"Identificacion: \" + empleadoEncontrado.getIdentificacion() + \"\\n\" +\n \"Facultad: \" + empleadoEncontrado.getFacultad() + \"\\n\" +\n \"Edad: \" + empleadoEncontrado.getEdad() + \"\\n\" +\n \"Sexo: \" + empleadoEncontrado.getSexo() + \"\\n\" +\n \"Fecha de nacimiento (DD/MM/AAAA): \" + empleadoEncontrado.getFechaDeNacimiento() + \"\\n\" + \n \"Estatura (cm): \" + empleadoEncontrado.getEstatura() + \"\\n\" +\n \"Peso: \" + empleadoEncontrado.getPeso() + \"\\n\"+\n \"Enfermedades: \" + \"\\n\"+empleadoEncontrado.getCadenaFactoresRiesgo() + \"\\n\" +\n \"Sintomas Covid: \" +\"\\n\"+ empleadoEncontrado.getCovid() + \"\\n\";\n return info;\n }" ]
[ "0.7959309", "0.63956106", "0.6310262", "0.60513324", "0.5637144", "0.5265936", "0.5137876", "0.5120149", "0.5062507", "0.5009757", "0.49726766", "0.49693862", "0.4893555", "0.48868263", "0.48713925", "0.48400736", "0.48212472", "0.48128885", "0.48017827", "0.47894976", "0.47676086", "0.47629595", "0.4751745", "0.47460598", "0.4729659", "0.4727935", "0.47279313", "0.47171256", "0.4707696", "0.4700001", "0.46965185", "0.46929243", "0.4666201", "0.4664158", "0.4646947", "0.46445248", "0.4641668", "0.46351773", "0.46349424", "0.4634369", "0.4626916", "0.46206114", "0.4619215", "0.4617694", "0.46174297", "0.46123198", "0.4610938", "0.46095684", "0.46089602", "0.45996952", "0.45951265", "0.45904133", "0.459003", "0.4582634", "0.45776823", "0.45687288", "0.45625982", "0.45621282", "0.45620042", "0.4560219", "0.45584902", "0.45567393", "0.45542336", "0.4552881", "0.4552226", "0.45476243", "0.45432737", "0.45432287", "0.45368174", "0.4531301", "0.45294467", "0.45288727", "0.4524674", "0.45225307", "0.45217308", "0.4520644", "0.45190927", "0.45174515", "0.45155182", "0.45085734", "0.4508259", "0.45063508", "0.45018017", "0.44987604", "0.44920993", "0.4491121", "0.44828987", "0.44777045", "0.44709176", "0.44682243", "0.44677266", "0.44663703", "0.446605", "0.44648403", "0.44643366", "0.44618383", "0.44607338", "0.4457679", "0.44574094", "0.44516674" ]
0.7382337
1
Metodo....: registraLog Descricao.: Este metodo efetiva o registro do Log nos Appenders do Log4j
private void registraLog(int aTipo, String aMensagem) { ArquivoConfiguracaoGPP arqConf = ArquivoConfiguracaoGPP.getInstance(); if (aTipo == Definicoes.FATAL) logger.fatal(aMensagem); else if (aTipo == Definicoes.ERRO) logger.error(aMensagem); else if (aTipo == Definicoes.WARN) logger.warn(aMensagem); else if (aTipo == Definicoes.INFO) logger.info(aMensagem); else if (aTipo == Definicoes.DEBUG) { if (arqConf.getSaidaDebug()) logger.debug(aMensagem); } else logger.warn("SEVERIDADE NAO DEFINIDA - " + aMensagem); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void registraLog(int aTipo, String aMensagem)\n\t{\n\t\tif (aTipo == Definicoes.FATAL)\n\t\t\tlogger.fatal(aMensagem);\n\t\telse if (aTipo == Definicoes.ERRO)\n\t\t\t\tlogger.error(aMensagem);\n\t\telse if (aTipo == Definicoes.WARN)\n\t\t\t\tlogger.warn(aMensagem);\n\t\telse if (aTipo == Definicoes.INFO)\n\t\t\t\tlogger.info(aMensagem);\n\t\telse if (aTipo == Definicoes.DEBUG)\n\t\t{\n\t\t\t\tif (arqConfig.getSaidaDebug())\n\t\t\t\t\tlogger.debug(aMensagem);\n\t\t}\n\t\telse logger.warn(\"SEVERIDADE NAO DEFINIDA - \" + aMensagem);\n\t}", "private void addLog(String log) {\n LogHelper.addIdentificationLog(log);\n }", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "Appendable getLog();", "private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }", "public void configLog()\n\t{\n\t\tlogConfigurator.setFileName(Environment.getExternalStorageDirectory() + File.separator + dataFileName);\n\t\t// Set the root log level\n\t\t//writerConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\t///writerConfigurator.setMaxFileSize(1024 * 1024 * 500);\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 1024);\n\t\t// Set log level of a specific logger\n\t\t//writerConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setImmediateFlush(true);\n\t\t//writerConfigurator.configure();\n\t\tlogConfigurator.configure();\n\n\t\t//gLogger = Logger.getLogger(this.getClass());\n\t\t//gWriter = \n\t\tgLogger = Logger.getLogger(\"vdian\");\n\t}", "public void serializeLogs();", "public void addLog(Log p) {\n logs.add(p);\n }", "private void loggerEinrichten() {\n\t\tlogger.setLevel(Level.INFO);\n//\t\tHandler handler = new FileHandler(\"/home/programmieren/TestFiles/iCalender/temp.log\");\n\t\tHandler handler = new ConsoleHandler();\n\t\thandler.setLevel(Level.FINEST);\n\t\thandler.setFormatter(new Formatter() {\n\t\t\t@Override\n\t\t\tpublic String format(LogRecord record) {\n\t\t\t\treturn record.getSourceClassName() + \".\" + record.getSourceMethodName() + \": \" + record.getMessage()\n\t\t\t\t\t\t+ \"\\n\";\n\t\t\t}\n\t\t});\n\t\tlogger.addHandler(handler);\n\t\tlogger.setUseParentHandlers(false);\n\t\tlogger.finest(\"begonnen\");\n\t}", "public void saveLogger(Logger log) {\n this.getHibernateTemplate().save(log);\n \n\t}", "@Override\n public synchronized void record(LogEvent le) {\n \n le.setDateEvent(new Date());\n System.out.println(\"Записывается в \"+name+\" лог с датой: \"+SDF.format(le.getDateEvent()));\n String message = layout.getMessage(le);\n \n if (isRotation){\n try {\n if (Files.size(file.toPath())>=maxSize){\n System.out.println(\"Размер файла\" +file.getName()+\" был превышен!\");\n file = getRotationFile(file);\n \n if (changeXML){\n changeXML(file.toPath(), config, name);\n }\n }\n } catch (FileNotFoundException f){\n System.out.println(\"Ошибка ввода-вывода в RollingFileAppender\");\n System.out.println(\"Файд не найден! \"+f.getMessage());\n } catch (IOException ex){\n System.out.println(\"Ошибка ввода-вывода в RollingFileAppender\");\n System.out.println(\"Ошибка в проверке размера файла: \"+ex.getMessage());\n }\n }\n \n try(OutputStreamWriter writer \n = new OutputStreamWriter(Files.newOutputStream(file.toPath(),\n StandardOpenOption.APPEND, StandardOpenOption.WRITE,\n StandardOpenOption.CREATE, StandardOpenOption.DSYNC) )){\n String m2 = new String(message.getBytes(\"UTF-8\"));\n writer.append(m2);\n } catch (IOException ex){\n System.out.println(\"Ошибка ввода-вывода в FileAppender \"+ex.getMessage());\n }\n }", "@Override\r\n\tpublic void addLog(Log log) throws RuntimeException {\n\t\tlogMapper.addLog(log);\r\n\t}", "public void saveToLog(String log){\n \n File logfile = new File(System.getProperty(\"user.home\"), \"db_logfile\" + DwenguinoBlocklyArduinoPlugin.startTimestamp + \".txt\");\n try {\n BufferedWriter bWriter = new BufferedWriter(new PrintWriter(logfile));\n bWriter.write(log);\n bWriter.flush();\n bWriter.close();\n \n } catch (IOException ex) {\n Logger.getLogger(DwenguinoBlocklyServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private static void createLogger() {\n logger = myLogger.createHtmlLogger(\"JRECEIPTS\", Options.LOG_PATH + \"Receipts\", 262144, true, 1);\n// boolean append = true;\n// int limit = 1000000; // 1 Mb\n// int numLogFiles = 5;\n// FileHandler fh = new FileHandler(Options.LOG_PATH + \"Receipts_%g.html\", limit, numLogFiles, true);\n// fh.setFormatter(new SimpleFormatter());\n// // Add to the desired logger\n// logger = Logger.getLogger(\"Receipts\");\n// logger.addHandler(fh);\n }", "public void writeLog(String log){\n //Create, if no files.\n if(!this.loggingFile.exists()){\n try {\n this.loggingFile.createNewFile();\n FileWriter fileWriter = new FileWriter(this.loggingFile, true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(log);\n bufferedWriter.newLine();\n bufferedWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n //Open the file.\n else{\n try {\n synchronized (this.loggingFile) {\n FileWriter fileWriter = new FileWriter(this.loggingFile, true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(log);\n bufferedWriter.newLine();\n bufferedWriter.close();\n }\n }catch (IOException e){\n e.printStackTrace();\n }\n }\n\n }", "private static void createLogFile() {\n try {\n String date = new Date().toString().replaceAll(\":\", \"-\");\n logFile = new FileWriter(\"bio-formats-test-\" + date + \".log\");\n TestLogger log = new TestLogger(logFile);\n LogTools.setLog(log);\n }\n catch (IOException e) { }\n }", "private void logToFile() {\n }", "@Override\r\n protected void append(LoggingEvent event)\r\n {\n String category = event.getLoggerName();\r\n String logMessage = event.getRenderedMessage();\r\n String nestedDiagnosticContext = event.getNDC();\r\n String threadDescription = event.getThreadName();\r\n String level = event.getLevel().toString();\r\n long time = event.timeStamp;\r\n LocationInfo locationInfo = event.getLocationInformation();\r\n\r\n // Add the logging event information to a LogRecord\r\n Log4JLogRecord record = new Log4JLogRecord();\r\n\r\n record.setCategory(category);\r\n record.setMessage(logMessage);\r\n record.setLocation(locationInfo.fullInfo);\r\n record.setMillis(time);\r\n record.setThreadDescription(threadDescription);\r\n\r\n if (nestedDiagnosticContext != null) {\r\n record.setNDC(nestedDiagnosticContext);\r\n } else {\r\n record.setNDC(\"\");\r\n }\r\n\r\n if (event.getThrowableInformation() != null) {\r\n record.setThrownStackTrace(event.getThrowableInformation());\r\n }\r\n\r\n try {\r\n record.setLevel(LogLevel.valueOf(level));\r\n } catch (LogLevelFormatException e) {\r\n // If the priority level doesn't match one of the predefined\r\n // log levels, then set the level to warning.\r\n record.setLevel(LogLevel.WARN);\r\n }\r\n MgcLogBrokerMonitor monitor = Lf5MainWindowController.getMonitor();\r\n if (monitor != null) {\r\n monitor.addMessage(record);\r\n }\r\n }", "protected GerentePoolLog(Class ownerClass)\n {\n\t\tArquivoConfiguracaoGPP arqConf = ArquivoConfiguracaoGPP.getInstance();\n\t\t//Define o nome e a porta do servidor q serao utilizados no LOG\n\t\thostName = arqConf.getEnderecoOrbGPP() + \":\" + arqConf.getPortaOrbGPP();\n\n\t\t/* Configura o LOG4J com as propriedades definidas no arquivo\n\t\t * de configuracao do GPP\n\t\t */\n\t\t\n\t\tPropertyConfigurator.configure(arqConf.getConfiguracaoesLog4j());\n\t\t//Inicia a instancia do Logger do LOG4J\n\t\tlogger = Logger.getLogger(ownerClass);\n\t\tlog(0,Definicoes.DEBUG,\"GerentePoolLog\",\"Construtor\",\"Iniciando escrita de Log do sistema GPP...\");\n }", "public static void dumpLog() {\n\t\t\n\t\tif (log == null) {\n\t\t\t// We have no log! We must be accessing this entirely statically. Create a new log. \n\t\t\tnew Auditor(); // This will create the log for us. \n\t\t}\n\n\t\t// Try to open the log for writing.\n\t\ttry {\n\t\t\tFileWriter logOut = new FileWriter(log);\n\n\t\t\t// Write to the log.\n\t\t\tlogOut.write( trail.toString() );\n\n\t\t\t// Close the log writer.\n\t\t\tlogOut.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Close the log file itself.\n\t\t// Apparently we can't? TODO: Look into this. \n\n\t}", "public static void appendLog(String log) {\n\t\tif (mTracker != null && mDebugLogFile) {\n\t\t\tmTracker.appendLog(log);\n\t\t}\n\t}", "public void setupLogging() {\n\t\ttry {\n\t\t\t_logger = Logger.getLogger(QoSModel.class);\n\t\t\tSimpleLayout layout = new SimpleLayout();\n\t\t\t_appender = new FileAppender(layout,_logFileName+\".txt\",false);\n\t\t\t_logger.addAppender(_appender);\n\t\t\t_logger.setLevel(Level.ALL);\n\t\t\tSystem.setOut(createLoggingProxy(System.out));\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void writeLog(){\n\t\tStringBuilder str = new StringBuilder();\r\n\t\tstr.append(System.currentTimeMillis() + \", \");\r\n\t\tstr.append(fileInfo.getCreator() + \", \");\r\n\t\tstr.append(fileInfo.getFileName() + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(networkSize + \", \");\r\n\t\tstr.append(fileInfo.getN1() + \", \");\r\n\t\tstr.append(fileInfo.getK1() + \", \");\r\n\t\tstr.append(fileInfo.getN2() + \", \");\r\n\t\tstr.append(fileInfo.getK2() + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT)+ \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.encryStart, logger.encryStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \"\\n\");\r\n\t\t\r\n\t\tString tmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getKeyStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\r\n\t\t\r\n\t\ttmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getFileStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.FILE_CREATION, str.toString());\t\t\r\n\t\t\r\n\t\t// Topology Discovery\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"TopologyDisc, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.topStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT ) + \", \");\r\n\t\tstr.append(\"\\n\");\t\t\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\r\n\t\t\r\n\t\t// Optimization\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"Optimization, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.optStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(\"\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t\t\r\n\t\t\r\n\t\t// File Distribution\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"FileDistribution, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(logger.distStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \", \");\r\n\t\tstr.append(\"\\n\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t}", "@Override\n\tpublic void update() {\n\t\tFile logFile = new File(AppStorage.getInstance().getLogFileLocation());\n\t\tlogFile.getParentFile().mkdirs();\n\n\t\ttry {\n\t\t\tFileHandler fileHandler = new FileHandler(AppStorage.getInstance().getLogFileLocation(), true);\n\t\t\tSimpleFormatter formatter = new SimpleFormatter();\n\t\t\tfileHandler.setFormatter(formatter);\n\n\t\t\twhile (logger.getHandlers().length > 0) {\n\t\t\t\tFileHandler prevFileHandler = (FileHandler)logger.getHandlers()[0];\n\t\t\t\tlogger.removeHandler(prevFileHandler);\n\t\t\t\tprevFileHandler.close();\n\t\t\t}\n\n\t\t\tlogger.addHandler(fileHandler);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initLogConfig() {\n\t\t logConfigurator = new LogConfigurator();\n\t\t// Setting append log coudn't cover by a new log.\n\t\tlogConfigurator.setUseFileAppender(true);\n\t\t// Define a file path for output log.\n\t\tString filename = StorageUtils.getLogFile();\n\t\tLog.i(\"info\", filename);\n\t\t// Setting log output\n\t\tlogConfigurator.setFileName(filename);\n\t\t// Setting log's level\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setFilePattern(\"%d %-5p [%c{2}]-[%L] %m%n\");\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 5);\n\t\t// Set up to use the cache first and then output to a file for a period\n\t\t// of time\n\t\tlogConfigurator.setImmediateFlush(false);\n\t\tlogConfigurator.setUseLogCatAppender(true);\n\t\t// logConfigurator.setResetConfiguration(true);\n\t\tlogConfigurator.configure();\n\t}", "@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = \"RV_RETURN_VALUE_IGNORED_BAD_PRACTICE\",\n justification = \"Return value for file delete is not important here.\")\n private void initLogWriter() throws org.apache.geode.admin.AdminException {\n loggingSession.createSession(this);\n\n final LogConfig logConfig = agentConfig.createLogConfig();\n\n // LOG: create logWriterAppender here\n loggingSession.startSession();\n\n // LOG: look in AgentConfigImpl for existing LogWriter to use\n InternalLogWriter existingLogWriter = agentConfig.getInternalLogWriter();\n if (existingLogWriter != null) {\n logWriter = existingLogWriter;\n } else {\n // LOG: create LogWriterLogger\n logWriter = LogWriterFactory.createLogWriterLogger(logConfig, false);\n // Set this log writer in AgentConfigImpl\n agentConfig.setInternalLogWriter(logWriter);\n }\n\n // LOG: create logWriter here\n logWriter = LogWriterFactory.createLogWriterLogger(logConfig, false);\n\n // Set this log writer in AgentConfig\n agentConfig.setInternalLogWriter(logWriter);\n\n // LOG:CONFIG: changed next three statements from config to info\n logger.info(LogMarker.CONFIG_MARKER,\n String.format(\"Agent config property file name: %s\",\n AgentConfigImpl.retrievePropertyFile()));\n logger.info(LogMarker.CONFIG_MARKER, agentConfig.getPropertyFileDescription());\n logger.info(LogMarker.CONFIG_MARKER, agentConfig.toPropertiesAsString());\n }", "protected void writeLog() {\r\n\r\n // get the current date/time\r\n DateFormat df1 = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);\r\n\r\n // write to the history area\r\n if (Preferences.is(Preferences.PREF_LOG) && completed) {\r\n\r\n if (destImage != null) {\r\n\r\n if (srcImage != null) {\r\n destImage.getHistoryArea().setText(srcImage.getHistoryArea().getText());\r\n }\r\n\r\n if (historyString != null) {\r\n destImage.getHistoryArea().append(\"[\" + df1.format(new Date()) + \"] \" + historyString);\r\n }\r\n } else if (srcImage != null) {\r\n\r\n if (historyString != null) {\r\n srcImage.getHistoryArea().append(\"[\" + df1.format(new Date()) + \"] \" + historyString);\r\n }\r\n }\r\n }\r\n }", "void initializeLogging();", "IFileLogger log();", "private static void writeLog(String log, boolean print) {\n\t\t// Store new log\n\t\talLogs.add(log);\n\n\t\tif(print) {\n\t\t\t// Print the log\n\t\t\tSystem.out.println(log);\n\t\t}\n\t}", "void saveLog(LogInfo logText);", "private static void writeLog(String log) {\n\t\twriteLog(log, true);\n\t}", "private Logger configureLogging() {\r\n\t Logger rootLogger = Logger.getLogger(\"\");\r\n\t rootLogger.setLevel(Level.FINEST);\r\n\r\n\t // By default there is one handler: the console\r\n\t Handler[] defaultHandlers = Logger.getLogger(\"\").getHandlers();\r\n\t defaultHandlers[0].setLevel(Level.CONFIG);\r\n\r\n\t // Add our logger\r\n\t Logger ourLogger = Logger.getLogger(serviceLocator.getAPP_NAME());\r\n\t ourLogger.setLevel(Level.FINEST);\r\n\t \r\n\t // Add a file handler, putting the rotating files in the tmp directory \r\n\t // \"%u\" a unique number to resolve conflicts, \"%g\" the generation number to distinguish rotated logs \r\n\t try {\r\n\t Handler logHandler = new FileHandler(\"/%h\"+serviceLocator.getAPP_NAME() + \"_%u\" + \"_%g\" + \".log\",\r\n\t 1000000, 3);\r\n\t logHandler.setLevel(Level.FINEST);\r\n\t ourLogger.addHandler(logHandler);\r\n\t logHandler.setFormatter(new Formatter() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic String format(LogRecord record) {\r\n\t\t\t\t\t\tString result=\"\";\r\n\t\t\t\t\t\tif(record.getLevel().intValue() >= Level.WARNING.intValue()){\r\n\t\t\t\t\t\t\tresult += \"ATTENTION!: \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd-MMM-yyyy HH:mm:ss\");\r\n\t\t\t\t\t\tDate d = new Date(record.getMillis());\r\n\t\t\t\t\t\tresult += df.format(d)+\" \";\r\n\t\t\t\t\t\tresult += \"[\"+record.getLevel()+\"] \";\r\n\t\t\t\t\t\tresult += this.formatMessage(record);\r\n\t\t\t\t\t\tresult += \"\\r\\n\";\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t } catch (Exception e) { // If we are unable to create log files\r\n\t throw new RuntimeException(\"Unable to initialize log files: \"\r\n\t + e.toString());\r\n\t }\r\n\r\n\t return ourLogger;\r\n\t }", "public abstract WriteResult writeUserLog(User user, Log log);", "abstract void initiateLog();", "public void appendLog(String text) {\r\n\t\tFile logFile = new File(\"sdcard/\" + application.LOGFILENAME);\r\n\t\tif (!logFile.exists()) {\r\n\t\t\ttry {\r\n\t\t\t\tlogFile.createNewFile();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tBufferedWriter buf = new BufferedWriter(new FileWriter(logFile, true));\r\n\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\ttry {\r\n\t\t\t\tSystem.err.println(\"Logged Date-Time : \" + calendar.getTime().toLocaleString());\r\n\t\t\t} catch (Throwable e) {\r\n\t\t\t}\r\n\t\t\tbuf.append(\"Logged Date-Time : \" + calendar.getTime().toLocaleString());\r\n\t\t\tbuf.append(\"\\n\\n\");\r\n\t\t\tbuf.append(text);\r\n\t\t\tbuf.newLine();\r\n\t\t\tbuf.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void configLogger() {\n Logger.addLogAdapter(new AndroidLogAdapter());\n }", "public void addLog(int type)\n {\n m_Log.addFirst(new SecurityLog(type));\n //truncate log list to 6 entries\n if(m_Log.size() > 6)\n m_Log.removeLast();\n }", "@Override\n public void log()\n {\n }", "private void addLog(final String key, final Log logger) {\r\n this.logs.put(key, logger);\r\n }", "private static void writeLog(Exception e) {\n if (logFile == null) createLogFile();\n LogTools.trace(e);\n LogTools.flush();\n }", "private void initJulLogger() {\n SLF4JBridgeHandler.removeHandlersForRootLogger();\n SLF4JBridgeHandler.install();\n }", "private void addEntranceLog(String logType) {\n if(ticketTrans == null || checkedItems.size() == 0) return;\n\n Entrance entrance = new Entrance(EntranceStep2Activity.this);\n\n Log.d(EntranceStep2Activity.class.toString(), logType);\n\n try {\n entrance.add(encryptRefNo, checkedItems, logType);\n } catch (Exception e) {\n String reason = e.getMessage();\n Toast.makeText(getApplicationContext(), reason, Toast.LENGTH_SHORT).show();\n } finally {\n loading.dismiss();\n }\n }", "public PlaceholderDailyRollingFileAppender() {\n }", "void addLogger(BotLogger logger);", "public void log(String str)\n\t{\n\t\tDate date = new Date();\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm\");\n\t\t\n\t\tString loggable = dateFormat.format(date) + \": \" + str;\n\t\t\n\t\t// Add it to the log\n\t\tthis.log.add(loggable);\n\t\t\n\t\t// Print it out, for now.\n\t\tSystem.out.println(loggable); \n\t}", "@Override\n public void logs() {\n \n }", "public void uploadLogCollection();", "LogRecord saveLog(LogRecord logRecord);", "public Log agregar(String linea) {\n cadenas.add(linea);\n return this;\n }", "@Override\r\n\tpublic Admin savelog(Admin log) {\n\t\treturn user.savelog(log);\r\n\t}", "@Override\n\tpublic void onEnable() {\n\t\tMBEPlugin Mbes = (MBEPlugin) this.getPluginManager().getPlugin(\"MbEssentials\");\n\t\t\n\t\t//Get the LogManager from the plugin\n\t\tLogManager log = Mbes.getLogManager();\n\t\t\n\t\t//Make a logger. The string tells the logmanager where to create the log\n\t\tLogger myLog = new Logger(\"plugins\\\\\"); \n\t\t// You can do this Logger myLog = new Logger(new File(\"plugins\\\\mylog.txt\")); it will overide the default name \n\t\t\n\t\t//Attach logger to the logManager\n\t\tlog.attachLogger(myLog);\n\t\t\t\n\t\t\t//write to the log\n\t\t\tlog.writeLog(\"Im logging this\",myLog,false); //Its false so it can log it using the default formatting\n\t\t\t// You can also do this log.writeLog(\"Im logging this\",myLog.getId(),false);\n\t\t}", "@Override\n public Logger getLog(Class clazz) {\n return new Slf4jLogger(LoggerFactory.getLogger(clazz));\n }", "static public void setup() throws IOException {\n Logger logger = Logger.getLogger(\"\");\n\n logger.setLevel(Level.INFO);\n Calendar cal = Calendar.getInstance();\n //SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH-mm-ss\");\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String dateStr = sdf.format(cal.getTime());\n fileTxt = new FileHandler(\"log_\" + dateStr + \".txt\");\n fileHTML = new FileHandler(\"log_\" + dateStr + \".html\");\n\n // Create txt Formatter\n formatterTxt = new SimpleFormatter();\n fileTxt.setFormatter(formatterTxt);\n logger.addHandler(fileTxt);\n\n // Create HTML Formatter\n formatterHTML = new LogHTMLFormatter();\n fileHTML.setFormatter(formatterHTML);\n logger.addHandler(fileHTML);\n }", "private static void saveLogs(boolean append) {\n\t\ttry {\n\t\t\tif (alLogs!=null && alLogs.size()>0) {\n\t\t\t\t// Convert the ArrayList to string array\n\t\t\t\tString[] arrLogs = new String[alLogs.size()];\n\t\t\t\tarrLogs = alLogs.toArray(arrLogs);\n\n\t\t\t\t// Open the log\n\t\t\t\tFileWriter fileWriterLog = new FileWriter(FILE_LOG, append);\n\n\t\t\t\t// User BufferedWriter to add new line\n\t\t\t\tBufferedWriter bufferedWriterLog = new BufferedWriter(fileWriterLog);\n\n\t\t\t\t// Go through all the content and write them to the file\n\t\t\t\tfor(int ix=0; ix < arrLogs.length; ix++) {\n\t\t\t\t\t// Write the current log\n\t\t\t\t\tbufferedWriterLog.write(arrLogs[ix]);\n\t\t\t\t\t// One log one line\n\t\t\t\t\tbufferedWriterLog.newLine();\n\t\t\t\t}\n\n\t\t\t\t// Always close files.\n\t\t\t\tbufferedWriterLog.close();\n\t\t\t}\n\t\t}\n\t\tcatch(FileNotFoundException ex) {\n\t\t\tSystem.out.println(\"Unable to open file '\" + FILE_LOG + \"'\");\n\t\t}\n\t\tcatch(IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "protected void createLogEvent(String data) {\n\t\t// if we have no listeners, do nothing...\n\t\tif (listeners != null && !listeners.isEmpty()) {\n\t\t\t// create the event object to send\n\t\t\tLogEvent event = \n\t\t\t\tnew LogEvent( this, data );\n\n\t\t\t// make a copy of the listener list in case\n\t\t\t// anyone adds/removes listeners\n\t\t\tVector targets;\n\t\t\tsynchronized (this) {\n\t\t\t\ttargets = (Vector) listeners.clone();\n\t\t\t}\n\n\t\t\t// walk through the listener list and\n\t\t\t// call the sunMoved method in each\n\t\t\tEnumeration e = targets.elements();\n\t\t\twhile (e.hasMoreElements()) {\n\t\t\t\tLogListener l = (LogListener) e.nextElement();\n\t\t\t\tl.onLogEvent(event);\n\t\t\t}\n\t\t}\n\t}", "void addLog(String beforeChange, String afterChange, String time) {\r\n ArrayList<String> logItem = new ArrayList<>();\r\n logItem.add(beforeChange);\r\n logItem.add(afterChange);\r\n logItem.add(time);\r\n allLogs.add(logItem);\r\n writeToFile(\"Save.bin\",allLogs);\r\n }", "private void repetitiveWork(){\n\t PropertyConfigurator.configure(\"log4j.properties\");\n\t log = Logger.getLogger(BackupRestore.class.getName());\n }", "public void writeEvent(LogEvent logEvent) throws Exception {\n appendObjectToLog(logEvent);\n }", "private static void addToLog(String message) {\n\t\ttry {\n\t\t\tDateFormat df = new SimpleDateFormat(\"dd/MM/yy HH:mm:ss:SS\");\n\t\t\tDate dateobj = new Date();\n\t\t\tlog.write(df.format(dateobj) + \": \" + message + \"\\n\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error With the Log File\");\n\t\t\tSystem.err.println(\"Exiting...\");\n\t\t\tSystem.exit(1);\n\t\t};\n\t}", "protected static Logger initLogger() {\n \n \n File logFile = new File(\"workshop2_slf4j.log\");\n logFile.delete();\n return LoggerFactory.getLogger(Slf4j.class.getName());\n }", "void setupFileLogging();", "LogRecorder getLogRecorder();", "LogRecorder getLogRecorder();", "@Override\n\tpublic void initLogger() {\n\t\t\n\t}", "public static void setupElementLogger(String elementId, long logSize) throws IOException {\n\t\tint maxFileSize = (int) (logSize * 1_000_000); \n\t\tint logFileCount = Math.round(logSize);\n\t\tfinal File logDirectory = new File(Configuration.getLogDiskDirectory());\n\n\t\tlogDirectory.mkdirs();\n\n\t\tUserPrincipalLookupService lookupservice = FileSystems.getDefault().getUserPrincipalLookupService();\n\t\tfinal GroupPrincipal group = lookupservice.lookupPrincipalByGroupName(\"iofog\");\n\t\tFiles.getFileAttributeView(logDirectory.toPath(), PosixFileAttributeView.class,\n\t\t\t\tLinkOption.NOFOLLOW_LINKS).setGroup(group);\n\t\tSet<PosixFilePermission> perms = PosixFilePermissions.fromString(\"rwxrwx---\");\n\t\tFiles.setPosixFilePermissions(logDirectory.toPath(), perms);\n\n\t\tfinal String logFilePattern = logDirectory.getPath() + \"/\" + elementId + \".%g.log\";\n\t\tLogger logger = elementLogger.get(elementId);\n\t\t\n\t\tif (logger != null) {\n\t\t\tfor (Handler f : logger.getHandlers())\n\t\t\t\tf.close();\n\t\t} \n\t\t\n\t\tHandler logFileHandler = new FileHandler(logFilePattern, maxFileSize / logFileCount, logFileCount);\n\t\n\t\tlogFileHandler.setFormatter(new LogFormatter());\n\t\n\t\tlogger = Logger.getLogger(elementId);\n\t\tlogger.addHandler(logFileHandler);\n\n\t\tlogger.setUseParentHandlers(false);\n\n\t\telementLogger.put(elementId, logger);\n\t}", "void setLogFile(File log);", "Map<String, Logger> loggers();", "@Test\r\n\tpublic void testLogArchiver() throws Exception {\r\n\t\tLoggingBean bean = new LoggingBean();\r\n\t\t\r\n\t\tServerModelImpl sm = new ServerModelImpl(\r\n\t\t\t\tnew ServerId(\"//test\"), \r\n\t\t\t\tnew MockThreadManager(), \r\n\t\t\t\tnew MockServerInterfaceManagerFactory());\r\n\t\t\r\n\t\tsm.setLogFormat(\"%m\");\r\n\t\t\t\t\t\t\t\r\n\t\tLogger testLogger = LoggerFactory.getLogger(bean.loggerName());\r\n\t\tLoggerAdapter.appenderAdapterFor(bean.loggerName()).setLevel(LogLevel.DEBUG);\r\n\t\t\r\n\t\tLL ll = new LL();\r\n\r\n\t\tServerContext serverContext = new ServerContextImpl(\r\n\t\t\t\tbean, sm, new OurRegistry());\r\n\t\t\r\n\t\ttestLogger.info(\"Test\");\r\n\t\t\r\n\t\tserverContext.getLogArchiver().addLogListener(ll, bean, LogLevel.DEBUG, -1, 10);\r\n\t\t\r\n\t\tassertNotNull(\"event\", ll.e);\r\n\t\tassertEquals(\"event message\", \"Test\", ll.e.getMessage());\r\n\t}", "public abstract WriteResult writeSystemLog(Log log);", "public interface Logger {\n public void writeLog();\n}", "@Override\n\tpublic boolean InsertEmployessLog(EmployeesLog employeesLog) {\n\t\treturn false;\n\t}", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tString mensagemFinal = \"<Servidor> \" + this.hostName; \n\t\tmensagemFinal = mensagemFinal + \" <ID> \" + idProcesso;\n\t\tmensagemFinal = mensagemFinal + \" <CL> \" + aClasse;\n\t\tmensagemFinal = mensagemFinal + \" <ME> \" + aMetodo;\n\t\tmensagemFinal = mensagemFinal + \" <Mensagem> \" + aMensagem;\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal);\n\t}", "abstract protected String getLogFileName();", "void exportarLog() {\n try {\n JasperPrint rU = null;\n HashMap map = new HashMap();\n\n String arquivoJasper = \"/Sistema/relatorios/relatorioAcessos.jasper\";\n try{\n rU = JasperFillManager.fillReport(arquivoJasper, map, parametrosNS.con);\n }catch(Exception e){ \n JOptionPane.showMessageDialog(null, \"visualizar relatorio \" + e);\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n JasperViewer.viewReport(rU, false); \n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"o erro foi ao gerar relatorio \" + e);\n }\n }", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tStringBuffer mensagemFinal = new StringBuffer(\"<Servidor> \").append(getHostName()); \n\t\tmensagemFinal.append(\" <ID> \").append(idProcesso);\n\t\tmensagemFinal.append(\" <Metodo> \").append(aMetodo);\n\t\tmensagemFinal.append(\" <Mensagem> \").append(aMensagem);\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal.toString());\n\t\tmensagemFinal = null;\n\t}", "@Override\n protected void append(LoggingEvent event) {\n if (event.getMessage() instanceof WrsAccessLogEvent) {\n WrsAccessLogEvent wrsLogEvent = (WrsAccessLogEvent) event.getMessage();\n\n try {\n HttpServletRequest request = wrsLogEvent.getRequest();\n if (request != null) {\n String pageHash = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_BCD_PAGEHASH));\n String requestHash = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_BCD_REQUESTHASH));\n String sessionId = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_SESSION_ID));\n String requestUrl = request.getRequestURL().toString();\n String reqQuery = request.getQueryString();\n requestUrl += (reqQuery != null ? \"?\" + reqQuery : \"\");\n if (requestUrl.length()> 2000)\n requestUrl = requestUrl.substring(0, 2000);\n String bindingSetName = wrsLogEvent.getBindingSetName();\n if (bindingSetName != null && bindingSetName.length()> 255)\n bindingSetName = bindingSetName.substring(0, 255);\n String requestXML = wrsLogEvent.getRequestDoc()!=null ? Utils.serializeElement(wrsLogEvent.getRequestDoc()) : null;\n\n // log access\n if(AccessSqlLogger.getInstance().isEnabled()) {\n final AccessSqlLogger.LogRecord recordAccess = new AccessSqlLogger.LogRecord(\n sessionId\n , requestUrl\n , pageHash\n , requestHash\n , bindingSetName\n , requestXML\n , wrsLogEvent.getRowCount()\n , wrsLogEvent.getValueCount()\n , wrsLogEvent.getRsStartTime()\n , wrsLogEvent.getRsEndTime()\n , wrsLogEvent.getWriteDuration()\n , wrsLogEvent.getExecuteDuration()\n );\n AccessSqlLogger.getInstance().process(recordAccess);\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "public FileAppender()\n {\n //LogManager.getLogManager().reset();\n logger = Logger.getLogger(\"MyLog\");\n\n final Properties loggerProps = new Properties();\n try {\n loggerProps.load(FileAppender.class.getResourceAsStream(\"/logger.properties\"));\n final String filePath = loggerProps.getProperty(Utility.LOGGER_APPENDER_FILE_PATH);\n final FileHandler fh = new FileHandler(filePath);\n logger.addHandler(fh);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n }", "public void Salvar(logModel logModel){\n\n ContentValues contentValues = new ContentValues();\n /*MONTANDO OS PARAMETROS PARA SEREM SALVOS*/\n contentValues.put(\"log_evento\", logModel.getEvento());\n contentValues.put(\"log_date\", logModel.getDate());\n\n /*EXECUTANDO INSERT DE UM NOVO REGISTRO*/\n databaseUtil.GetConexaoDataBase().insert(\"tb_log\",null,contentValues);\n\n }", "private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }", "public void add_to_log(String s){\n }", "public void appendLogFile(String str)\n{\n if(fileWriter != null)\n {\n try { \n \n fileWriter.append(str); \n \n } catch (Exception e) { \n \n System.out.println(\"Error in CsvFileWriter !!!\"); \n e.printStackTrace(); \n \n } finally { \n \n try {\n \n fileWriter.flush(); \n //fileWriter.close(); \n \n } catch (IOException e) { \n \n System.out.println(\"Error while flushing/closing fileWriter !!!\"); \n e.printStackTrace(); \n } \n \n } \n }\n}", "@Override\npublic int addSysLog(EhrUser user, LogOperateType operation, Module module ,String operationInfo)\n\t\tthrows Exception {\n\tEhrSysLog log = new EhrSysLog();\n\tlog.setUserId(user.getUserId());\n\tlog.setUserName(user.getUserName());\n\tlog.setOperateType(operation.getValue());\n\tlog.setModule(module.getModuleName());\n\t\n\tif (user.getCompany() != null) {\n\t\tlog.setCompanyId(user.getCompany().getCompanyId());\n\t\tlog.setCompanyCode(user.getCompany().getCompanyCode());\n\t\tlog.setCompanyName(user.getCompany().getCompanyName());\n\t} else {\n\t\tEhrCompany company = companyMapper.selectByPrimaryKey(user.getCompanyId());\n\t\tlog.setCompanyId(company.getCompanyId());\n\t\tlog.setCompanyCode(company.getCompanyCode());\n\t\tlog.setCompanyName(company.getCompanyName());\n\t}\n\tlog.setOperateInfo(operationInfo);\n\tlog.setOperateDate(new Date());\n\treturn logMapper.insertSelective(log);\n\n}", "public void analizarArchivoDeLog(String nombreArchivo)\n {\n archivoLog.clear();\n try{\n File log = new File(nombreArchivo);\n Scanner sc = new Scanner(log);\n while (sc.hasNextLine()) {\n String linea = sc.nextLine();\n String[] arrayDeString = linea.split(\" \");\n archivoLog.add(new Acceso (Integer.parseInt(arrayDeString[0]),Integer.parseInt(arrayDeString[1]),Integer.parseInt(arrayDeString[2]),Integer.parseInt(arrayDeString[3]),Integer.parseInt(arrayDeString[4])));\n }\n sc.close();\n }\n\n catch (FileNotFoundException e){\n e.printStackTrace();\n }\n }", "@Override\n\t\tpublic void add(int index, LogCate element) {\n\t\t\tsuper.add(index, element);\n\t\t\tLogCateManager.getInstance().onLogsChanged();\n\t\t}", "private void logika_rozpocznij(){\n\t}", "public interface IMesaLogger {\n\n\t/**\n\t * Writes a text string to the MESA log\n\t * \n\t * @param message The text string to display\n\t */\n\tpublic void writeString(String message);\n\n\t/**\n\t * Writes a SOAP message to the MESA log\n\t * \n\t * @param message The SOAP message to display\n\t */\n\tpublic void writeSoapMessage(SOAPMessage message);\n\n\t/**\n\t * Writes out an Axiom OMElement message to the logger.\n\t * \n\t * @param message the element to display\n\t */\n\tpublic void writeAxiomElementMessage(OMElement message);\n\n\t/**\n\t * Writes an HL7 message to the MESA log\n\t * \n\t * @param message the HL7 message to display\n\t */\n\tpublic void writeHL7Message(Message message);\n}", "public interface Loggable {\n void writeToLog(String message);\n void closeLog();\n}", "public static void writeToLog(String filename,String log)\r\n\t{\n\t\ttry \r\n\t\t{\r\n\t\t\tString str = log + \" at \" + new Date() + \"\\n\";\r\n\t\t\tFiles.write(Paths.get(\"log.log\"),str.getBytes(),StandardOpenOption.APPEND);\r\n\t\t\t/*PrintWriter out = new PrintWriter(f);\r\n\t\t\tout.append(log + \" at \" + new Date());\r\n\t\t\tout.flush();\r\n\t\t\tout.close();*/\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"FNE: \" + e.getMessage());\r\n\t\t} \r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"IOE: \" + e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t}", "public void setGestioneLog(GestioneLog gestioneLog) {\n this.gestioneLog = gestioneLog;\n }", "public void recordLog(){\r\n\t\tthis.finishLog(resourceFiles.getString(\"PathHepparIITestDirectory\") + \"/\" + TEST_FILE_NAME); \r\n\t}", "@Override\n public LogWriter getLogWriter() {\n return logWriter;\n }", "private void log4jConfig(String actionName) {\n\t\tString LOG4J_ROLLING_FILE_NAME_TOKEN = \"Launcher\";\n\t Logger rootLogger = LogManager.getRootLogger();\n\t RollingFileAppender fileAppender = (RollingFileAppender)rootLogger.getAppender(\"fileAppender\");\n\n\t // <param name=\"FileNamePattern\" value=\"/var/log/Launcher.log.%d{yyyy-MM-dd}.gz\"/>\n\t String currentLogFile = fileAppender.getFile();\n\t String newLogPattern = currentLogFile.replace(LOG4J_ROLLING_FILE_NAME_TOKEN, actionName);\n\t fileAppender.setFile(newLogPattern);\n\t \n\t fileAppender.activateOptions();\n\t}", "public void add(SignLog log) {\n ContentValues values = new ContentValues();\n values.put(DatabaseSQLiteHelper.LOGS_NAME, log.getName());\n values.put(DatabaseSQLiteHelper.LOGS_PASSWORD, log.getPassword());\n values.put(DatabaseSQLiteHelper.LOGS_USER_ID, log.getUserId());\n values.put(DatabaseSQLiteHelper.LOGS_DAY, log.getDay());\n values.put(DatabaseSQLiteHelper.LOGS_TIME, log.getTime());\n values.put(DatabaseSQLiteHelper.LOGS_TYPE, log.getType());\n\n database.insert(DatabaseSQLiteHelper.TABLE_SIGN_LOGS, null, values);\n }", "void crearAuditoria(String emailUsuario, String observacion, String dirIP, String hostName);", "public void enableLogging();", "public void append(LoggingEvent loggingevent) {\n //System.out.println(\"TracerAppender \" + loggingevent + \" into \" + tracer);\n StringBuffer buffer = new StringBuffer(loggingevent.getLoggerName());\n buffer.append(\": \");\n buffer.append(loggingevent.getMessage());\n ThrowableInformation ti = loggingevent.getThrowableInformation();\n if (ti == null) {\n tracer.log(loggingevent.getLevel().getSyslogEquivalent(), buffer.toString());\n } else {\n tracer.log(loggingevent.getLevel().getSyslogEquivalent(), buffer.toString(), ti.getThrowable());\n }\n }" ]
[ "0.6616909", "0.65041244", "0.6372452", "0.6372452", "0.6372452", "0.63671213", "0.6319371", "0.6160509", "0.6122056", "0.6091333", "0.60300654", "0.5976172", "0.59697586", "0.5853747", "0.58472866", "0.58133805", "0.58086246", "0.5798693", "0.57965016", "0.5793573", "0.5749922", "0.5719035", "0.5699698", "0.5691216", "0.568118", "0.56759715", "0.5675041", "0.56614226", "0.5653924", "0.56505543", "0.5637499", "0.5627891", "0.5624331", "0.5621548", "0.559709", "0.55970156", "0.559115", "0.55804694", "0.55747163", "0.55723965", "0.5566178", "0.55647385", "0.55586815", "0.5558223", "0.5556726", "0.55477273", "0.5534448", "0.5532577", "0.5532569", "0.55278313", "0.55263525", "0.55238974", "0.55164325", "0.5513267", "0.5483273", "0.54788774", "0.54706466", "0.5452118", "0.5448868", "0.5433448", "0.543179", "0.54205364", "0.5407332", "0.5398096", "0.53896743", "0.53896743", "0.53823847", "0.5382377", "0.5366589", "0.53621876", "0.5351048", "0.53446895", "0.53442615", "0.53365827", "0.53330547", "0.5332332", "0.53311926", "0.5322107", "0.53123283", "0.5308679", "0.5307096", "0.530582", "0.5302597", "0.52984107", "0.5293698", "0.5292152", "0.5288721", "0.5287788", "0.52844274", "0.52841306", "0.52829325", "0.52828693", "0.5274646", "0.52692866", "0.5261535", "0.5261281", "0.52581847", "0.5251778", "0.52495563", "0.5248936" ]
0.67627364
0
a serverside persistent linked list interface.
public interface PersistentLinkedListModel { boolean isEmpty() throws PhysicalResourceException; int size() throws PhysicalResourceException; void add(byte[] item) throws PhysicalResourceException; void remove() throws PhysicalResourceException; void removeAll() throws PhysicalResourceException; byte[] take() throws PhysicalResourceException; byte[] peek() throws PhysicalResourceException; Iterator<Locator> iterate() throws PhysicalResourceException; Locator getMetaData() throws PhysicalResourceException; void setMetaData(Locator locator) throws PhysicalResourceException; /** * get the segment data for the given locator. * * @param locator * @return * @throws PhysicalResourceException */ byte[] getSegmentData(Locator locator) throws PhysicalResourceException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void operateLinkedList() {\n\n List linkedList = new LinkedList();\n linkedList.add( \"syed\" );\n linkedList.add( \"Mohammed\" );\n linkedList.add( \"Younus\" );\n System.out.println( linkedList );\n linkedList.set( 0, \"SYED\" );\n System.out.println( linkedList );\n linkedList.add( 0, \"Mr.\" );\n System.out.println( linkedList );\n\n\n }", "public WCLinkedList(){\n size=0;\n head = null;\n tail = null;\n }", "public interface LinkedList<T> {\n \n T getFirst();\n \n void add(T element);\n \n /**\n * Get element with the according index from a linked list.\n * @param index - index of an element in a linked list.\n * @return element with the according index from a linked list.\n */\n T get(int index);\n \n /**\n * Remove element with the according index from a linked list.\n * @param index - index of an element in a linked list\n * @return element with the according index from a linked list.\n */\n T remove(int index);\n \n T removeFirst();\n \n int size();\n \n boolean isEmpty();\n}", "interface List { // List ADT\npublic void clear(); // Remove all Objects from list\npublic void insert(Object item); // Insert Object at curr position\npublic void append(Object item); // Insert Object at tail of list\npublic Object remove(); // Remove/return current Object\npublic void setFirst(); // Set current to first position\npublic void next(); // Move current to next position\npublic void prev(); // Move current to prev position\npublic int length(); // Return current length of list\npublic void setPos(int pos); // Set current to specified pos\npublic void setValue(Object val); // Set current Object's value\npublic Object currValue(); // Return value of current Object\npublic boolean isEmpty(); // Return true if list is empty\npublic boolean isInList(); // True if current is within list\npublic void print(); // Print all of list's elements\n}", "public MySinglyLinkedList() { }", "public LinkedList() {\n\t\tthis(\"list\");\n\t}", "public UserList(){\n\t\tthis.head = new User();\n\t\tthis.tail = this.head;\n\n\t}", "public interface IMList<T> {\r\n boolean pushFront(String listName,T item);\r\n\r\n boolean pushBack(String listName,T item);\r\n\r\n boolean deleteFront(String listName);\r\n\r\n boolean deleteBack(String listName);\r\n\r\n int size(String listName);\r\n\r\n boolean del(String listName,T item);\r\n\r\n T get(String listName,int pos);\r\n\r\n List<T> get(String listName,int pos, int num);\r\n\r\n List<T> rget(String listName,int pos, int num);\r\n\r\n boolean insert(String listName,int pos, T key);\r\n\r\n boolean set(String listName,int pos, T key);\r\n\r\n boolean clear(String listName);\r\n\r\n\r\n}", "public SinglyLinkedList() {\n this.len = 0;\n }", "public List() {\n\t\tthis.head = null; \n\t}", "public LinkList(String data){\n this.head = new Node(data, null);\n this.tail = this.head;\n }", "public SmartList() {\n size = 0;\n storage = null;\n }", "public SinglyLinkedList getPublicList() {\n return this.publicList;\n }", "public UtillLinkList() {\n\t\tlist = new LinkedList<String>();\n\t}", "abstract void makeList();", "public DLList() {\n head = null;\n tail = null;\n }", "public SinglyLinkedList(){\n this.first = null;\n }", "public CustomSinglyLinkedList()\n {\n head = null;\n tail = head;\n size = 0;\n }", "public LinkedListStructureofaSinglyLinkedListClass() {\n\t\theadNode=null;\n\t\tsize=0;\n\t\t\n\t}", "public LinkedList() {\n\t\titems = lastNode = new DblListnode<E>(null);\n\t\tnumItems=0;\n\t}", "public interface Link<T> extends ITable<T>, List<T>, RandomAccess {\r\n /**\r\n * Set number of the linked objects \r\n * @param newSize new number of linked objects (if it is greater than original number, \r\n * than extra elements will be set to null)\r\n */\r\n public void setSize(int newSize);\r\n \r\n /**\r\n * Returns <tt>true</tt> if there are no related object\r\n *\r\n * @return <tt>true</tt> if there are no related object\r\n */\r\n boolean isEmpty();\r\n\r\n /**\r\n * Get related object by index\r\n * @param i index of the object in the relation\r\n * @return referenced object\r\n */\r\n public T get(int i);\r\n\r\n /**\r\n * Get related object by index without loading it.\r\n * Returned object can be used only to get it OID or to compare with other objects using\r\n * <code>equals</code> method\r\n * @param i index of the object in the relation\r\n * @return stub representing referenced object\r\n */\r\n public Object getRaw(int i);\r\n\r\n /**\r\n * Replace i-th element of the relation\r\n * @param i index in the relartion\r\n * @param obj object to be included in the relation \r\n * @return the element previously at the specified position.\r\n */\r\n public T set(int i, T obj);\r\n\r\n /**\r\n * Assign value to i-th element of the relation.\r\n * Unlike Link.set methos this method doesn't return previous value of the element\r\n * and so is faster if previous element value is not needed (it has not to be fetched from the database)\r\n * @param i index in the relartion\r\n * @param obj object to be included in the relation \r\n */\r\n public void setObject(int i, T obj);\r\n\r\n /**\r\n * Remove object with specified index from the relation\r\n * Unlike Link.remove methos this method doesn't return removed element and so is faster \r\n * if it is not needed (it has not to be fetched from the database)\r\n * @param i index in the relartion\r\n */\r\n public void removeObject(int i);\r\n\r\n /**\r\n * Insert new object in the relation\r\n * @param i insert poistion, should be in [0,size()]\r\n * @param obj object inserted in the relation\r\n */\r\n public void insert(int i, T obj);\r\n\r\n /**\r\n * Add all elements of the array to the relation\r\n * @param arr array of obects which should be added to the relation\r\n */\r\n public void addAll(T[] arr);\r\n \r\n /**\r\n * Add specified elements of the array to the relation\r\n * @param arr array of obects which should be added to the relation\r\n * @param from index of the first element in the array to be added to the relation\r\n * @param length number of elements in the array to be added in the relation\r\n */\r\n public void addAll(T[] arr, int from, int length);\r\n\r\n /**\r\n * Add all object members of the other relation to this relation\r\n * @param link another relation\r\n */\r\n public boolean addAll(Link<T> link);\r\n\r\n /**\r\n * Return array with relation members. Members are not loaded and \r\n * size of the array can be greater than actual number of members. \r\n * @return array of object with relation members used in implementation of Link class\r\n */\r\n public Object[] toRawArray(); \r\n\r\n /**\r\n * Get all relation members as array.\r\n * The runtime type of the returned array is that of the specified array. \r\n * If the index fits in the specified array, it is returned therein. \r\n * Otherwise, a new array is allocated with the runtime type of the \r\n * specified array and the size of this index.<p>\r\n *\r\n * If this index fits in the specified array with room to spare\r\n * (i.e., the array has more elements than this index), the element\r\n * in the array immediately following the end of the index is set to\r\n * <tt>null</tt>. This is useful in determining the length of this\r\n * index <i>only</i> if the caller knows that this index does\r\n * not contain any <tt>null</tt> elements.)<p>\r\n * @return array of object with relation members\r\n */\r\n public <T> T[] toArray(T[] arr);\r\n\r\n /**\r\n * Checks if relation contains specified object instance\r\n * @param obj specified object\r\n * @return <code>true</code> if object is present in the collection, <code>false</code> otherwise\r\n */\r\n public boolean containsObject(T obj);\r\n\r\n /**\r\n * Check if i-th element of Link is the same as specified obj\r\n * @param i element index\r\n * @param obj object to compare with\r\n * @return <code>true</code> if i-th element of Link reference the same object as \"obj\"\r\n */\r\n public boolean containsElement(int i, T obj);\r\n\r\n /**\r\n * Get index of the specified object instance in the relation. \r\n * This method use comparison by object identity (instead of equals() method) and\r\n * is significantly faster than List.indexOf() method\r\n * @param obj specified object instance\r\n * @return zero based index of the object or -1 if object is not in the relation\r\n */\r\n public int indexOfObject(Object obj);\r\n\r\n /**\r\n * Get index of the specified object instance in the relation\r\n * This method use comparison by object identity (instead of equals() method) and\r\n * is significantly faster than List.indexOf() method\r\n * @param obj specified object instance\r\n * @return zero based index of the object or -1 if object is not in the relation\r\n */\r\n public int lastIndexOfObject(Object obj);\r\n\r\n /**\r\n * Remove all members from the relation\r\n */\r\n public void clear();\r\n\r\n /**\r\n * Get iterator through link members\r\n * This iterator supports remove() method.\r\n * @return iterator through linked objects\r\n */\r\n public Iterator<T> iterator();\r\n\r\n /**\r\n * Replace all direct references to linked objects with stubs. \r\n * This method is needed tyo avoid memory exhaustion in case when \r\n * there is a large numebr of objectys in databasse, mutually\r\n * refefencing each other (each object can directly or indirectly \r\n * be accessed from other objects).\r\n */\r\n public void unpin();\r\n \r\n /**\r\n * Replace references to elements with direct references.\r\n * It will impove spped of manipulations with links, but it can cause\r\n * recursive loading in memory large number of objects and as a result - memory\r\n * overflow, because garbage collector will not be able to collect them\r\n */\r\n public void pin(); \r\n}", "public ListReferenceBased() {\r\n\t numItems = 0; // declares numItems is 0\r\n\t head = null; // declares head is null\r\n }", "public interface DList {\n}", "public interface SimpleList<E> {\n\n // Query Operations\n\n\n /**\n * Returns the number of elements in this list. If this list contains\n * more than <tt>Integer.MAX_VALUE</tt> elements, returns\n * <tt>Integer.MAX_VALUE</tt>.\n *\n * @return the number of elements in this list\n */\n\n public int size();\n\n\n /**\n * Returns <tt>true</tt> if this list contains no elements.\n *\n * @return <tt>true</tt> if this list contains no elements\n */\n\n public boolean isEmpty();\n\n\n /**\n * Returns <tt>true</tt> if this list contains the specified element.\n * More formally, returns <tt>true</tt> if and only if this list contains\n * at least one element <tt>e</tt> such that\n * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.\n *\n * @param o element whose presence in this list is to be tested\n * @return <tt>true</tt> if this list contains the specified element\n * @throws ClassCastException if the type of the specified element\n * is incompatible with this list\n * (<a href=\"Collection.html#optional-restrictions\">optional</a>)\n * @throws NullPointerException if the specified element is null and this\n * list does not permit null elements\n * (<a href=\"Collection.html#optional-restrictions\">optional</a>)\n */\n\n public boolean contains(Object o);\n\n\n /**\n * Returns an iterator over the elements in this list in proper sequence.\n *\n * @return an iterator over the elements in this list in proper sequence\n */\n\n public Iterator<E> iterator();\n\n\n // Modification Operations\n\n\n /**\n * Appends the specified element to the end of this list (optional\n * operation).\n *\n * <p>Lists that support this operation may place limitations on what\n * elements may be added to this list. In particular, some\n * lists will refuse to add null elements, and others will impose\n * restrictions on the type of elements that may be added. List\n * classes should clearly specify in their documentation any restrictions\n * on what elements may be added.\n *\n * @param e element to be appended to this list\n * @return <tt>true</tt> (as specified by {@link Collection#add})\n * @throws UnsupportedOperationException if the <tt>add</tt> operation\n * is not supported by this list\n * @throws ClassCastException if the class of the specified element\n * prevents it from being added to this list\n * @throws NullPointerException if the specified element is null and this\n * list does not permit null elements\n * @throws IllegalArgumentException if some property of this element\n * prevents it from being added to this list\n */\n\n public boolean add(E e);\n\n\n /**\n * Removes the first occurrence of the specified element from this list,\n * if it is present (optional operation). If this list does not contain\n * the element, it is unchanged. More formally, removes the element with\n * the lowest index <tt>i</tt> such that\n * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>\n * (if such an element exists). Returns <tt>true</tt> if this list\n * contained the specified element (or equivalently, if this list changed\n * as a result of the call).\n *\n * @param o element to be removed from this list, if present\n * @return <tt>true</tt> if this list contained the specified element\n * @throws ClassCastException if the type of the specified element\n * is incompatible with this list\n * (<a href=\"Collection.html#optional-restrictions\">optional</a>)\n * @throws NullPointerException if the specified element is null and this\n * list does not permit null elements\n * (<a href=\"Collection.html#optional-restrictions\">optional</a>)\n * @throws UnsupportedOperationException if the <tt>remove</tt> operation\n * is not supported by this list\n */\n\n public boolean remove(Object o);\n\n\n\n /**\n * Removes all of the elements from this list.\n * The list will be empty after this call returns.\n */\n\n public void clear();\n\n\n\n // Comparison and hashing\n\n\n /**\n * Compares the specified object with this list for equality. Returns\n * <tt>true</tt> if and only if the specified object is also a list, both\n * lists have the same size, and all corresponding pairs of elements in\n * the two lists are <i>equal</i>. (Two elements <tt>e1</tt> and\n * <tt>e2</tt> are <i>equal</i> if <tt>(e1==null ? e2==null :\n * e1.equals(e2))</tt>.) In other words, two lists are defined to be\n * equal if they contain the same elements in the same order. This\n * definition ensures that the equals method works properly across\n * different implementations of the <tt>List</tt> interface.\n *\n * @param o the object to be compared for equality with this list\n * @return <tt>true</tt> if the specified object is equal to this list\n */\n\n boolean equals(Object o);\n\n\n\n // Positional Access Operations\n\n\n /**\n * Returns the element at the specified position in this list.\n *\n * @param index index of the element to return\n * @return the element at the specified position in this list\n * @throws IndexOutOfBoundsException if the index is out of range\n * (<tt>index &lt; 0 || index &gt;= size()</tt>)\n */\n\n public E get(int index);\n\n\n /**\n * Replaces the element at the specified position in this list with the\n * specified element (optional operation).\n *\n * @param index index of the element to replace\n * @param element element to be stored at the specified position\n * @return the element previously at the specified position\n * @throws ClassCastException if the class of the specified element\n * prevents it from being added to this list\n * @throws NullPointerException if the specified element is null and\n * this list does not permit null elements\n * @throws IllegalArgumentException if some property of the specified\n * element prevents it from being added to this list\n * @throws IndexOutOfBoundsException if the index is out of range\n * (<tt>index &lt; 0 || index &gt;= size()</tt>)\n */\n\n public E set(int index, E element);\n\n\n /**\n * Inserts the specified element at the specified position in this list\n * (optional operation). Shifts the element currently at that position\n * (if any) and any subsequent elements to the right (adds one to their\n * indices).\n *\n * @param index index at which the specified element is to be inserted\n * @param element element to be inserted\n * @throws UnsupportedOperationException if the <tt>add</tt> operation\n * is not supported by this list\n * @throws ClassCastException if the class of the specified element\n * prevents it from being added to this list\n * @throws NullPointerException if the specified element is null and\n * this list does not permit null elements\n * @throws IllegalArgumentException if some property of the specified\n * element prevents it from being added to this list\n * @throws IndexOutOfBoundsException if the index is out of range\n * (<tt>index &lt; 0 || index &gt; size()</tt>)\n */\n\n public void add(int index, E element);\n\n\n /**\n * Removes the element at the specified position in this list (optional\n * operation). Shifts any subsequent elements to the left (subtracts one\n * from their indices). Returns the element that was removed from the\n * list.\n *\n * @param index the index of the element to be removed\n * @return the element previously at the specified position\n * @throws IndexOutOfBoundsException if the index is out of range\n * (<tt>index &lt; 0 || index &gt;= size()</tt>)\n */\n\n public E remove(int index);\n\n\n\n // Search Operations\n\n\n /**\n * Returns the index of the first occurrence of the specified element\n * in this list, or -1 if this list does not contain the element.\n * More formally, returns the lowest index <tt>i</tt> such that\n * <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,\n * or -1 if there is no such index.\n *\n * @param o element to search for\n * @return the index of the first occurrence of the specified element in\n * this list, or -1 if this list does not contain the element\n * @throws ClassCastException if the type of the specified element\n * is incompatible with this list\n * (<a href=\"Collection.html#optional-restrictions\">optional</a>)\n * @throws NullPointerException if the specified element is null and this\n * list does not permit null elements\n * (<a href=\"Collection.html#optional-restrictions\">optional</a>)\n */\n\n public int indexOf(Object o);\n\n\n}", "public interface List<T> extends Collection<T> {\n\t\n\t/**\n\t * Returns the object that is stored in the list at position <code>index</code>.\n\t * @param index position from which the object will be returned\n\t * @return the object that is stored at position <code>index</code>\n\t * @throws IndexOutOfBoundsException index must be between 0 and size-1\n\t */\n\tT get(int index);\n\t\n\t/**\n\t * Inserts the object at the specified position. It does not overwrite the given value at the given position, \n\t * it shifts the elements at greater positions one place toward the end.\n\t * @param value object to be inserted\n\t * @param position index where the object should be inserted\n\t * @throws NullPointerException <code>null</code> object will not be inserted into the list\n\t * @throws IndexOutOfBoundsException index must be between 0 and size\n\t */\n\tvoid insert(T value, int position);\n\t\n\t/**\n\t * Searches the collection and returns the index of the first occurrence of the given value\n\t * or -1 if the value is not found.\n\t * @param value object that will be searched\n\t * @return index of the first occurrence of the given object or -1 if the value is not found\n\t */\n\tint indexOf(Object value);\n\t\n\t/**\n\t * Removes element at specified index from collection. \n\t * Element that was previously at location index+1 after this operation is on location index , etc.\n\t * @param index index at which the element should be removed\n\t * @throws IndexOutOfBoundsException index must be between 0 and size-1\n\t */\n\tvoid remove(int index);\n}", "public SLList()\n {\n head = tail = null;\n }", "public SinglyLinkedList() {\n this.head = null; \n }", "public LinkedList () {\n\t\tMemoryBlock dummy;\n\t\tdummy = new MemoryBlock(0,0);\n\t\ttail = new Node(dummy);\n\t\tdummy = new MemoryBlock(0,0);\n\t\thead = new Node(dummy);\n\t\ttail.next = head;\n\t\thead.previous = tail;\n\t\tsize = 2;\n\t}", "public listNode(String val) {\n\t\t\tdata= val;\n\t\t\tnext= null;\n\t\t\tprevious= null;\n\t\t}", "public interface List<T> extends Collection<T> {\n\n public void insert(T element, int index);\n public T replace(T element, int index);\n public T remove(int index);\n public T removeFirst();\n public T removeLast();\n public int indexOf(T element);\n public T get(int index);\n public T first();\n public T last();\n \n}", "public LinkedList(){\n this.size = 0;\n first = null;\n last = null;\n }", "public abstract List<T> delegate();", "interface List extends Follow {\n /**\n * The list of available bookmarks.\n *\n * @author Oved Ourfali <oourfali@redhat.com>\n * @date 12 Dec 2016\n * @status added\n */\n @Out Bookmark[] bookmarks();\n\n /**\n * Sets the maximum number of bookmarks to return. If not specified all the bookmarks are returned.\n */\n @In Integer max();\n }", "public interface List extends Collection{\r\n\t/**\r\n\t * Returns the object that is stored in backing \r\n\t * list at position index.\r\n\t * @param index position of the element\r\n\t * @return element\r\n\t */\r\n\tObject get(int index);\r\n\t/**\r\n\t * Inserts (does not overwrite) the given value \r\n\t * at the given position in list.\r\n\t * @param value\r\n\t * @param position\r\n\t */\r\n\tvoid insert(Object value, int position);\r\n\t/**\r\n\t * Searches the collection and returns the index \r\n\t * of the first occurrence of the given value or -1 \r\n\t * if the value is not found.\r\n\t * @param value list element\r\n\t * @return index\r\n\t */\r\n\tint indexOf(Object value);\r\n\t/**\r\n\t * Removes element at specified \r\n\t * index from collection.\r\n\t * @param index specified position\r\n\t */\r\n\tvoid remove(int index);\r\n\r\n}", "interface List extends Follow {\n @Out Network[] networks();\n\n /**\n * Sets the maximum number of networks to return. If not specified all the networks are returned.\n */\n @In Integer max();\n\n /**\n * A query string used to restrict the returned networks.\n */\n @In String search();\n\n /**\n * Indicates if the search performed using the `search` parameter should be performed taking case into\n * account. The default value is `true`, which means that case is taken into account. If you want to search\n * ignoring case set it to `false`.\n */\n @In Boolean caseSensitive();\n }", "public DoublyLinkedList() {\r\n\t\tinitializeDataFields();\r\n\t}", "public interface ListNode<T> {\n\n /**\n * Get the value contained in this node.\n * @return the value in this node.\n */\n public T getValue();\n\n /**\n * Get the next node.\n * @return the next node (the node this node (forward) links to).\n */\n public ListNode<T> getNext();\n}", "public interface List<E> {\n\n /**\n * Return number of elements in the list\n * @return Number of elements\n */\n int size();\n\n /**\n * Returns whether the list is empty\n * @return True if the list is empty, false otherwise\n */\n boolean isEmpty();\n\n /**\n * Returns the element at index i\n * @param i Index\n * @return Element at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E get(int i) throws IndexOutOfBoundsException;\n\n /**\n * Replaces the element at index i with e, and returns the replaced element\n * @param i Index\n * @param e New element\n * @return Element replaced by e\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E set(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Inserts element e to be at index i, shifting all subsequent elements later\n * @param i Index\n * @param e New element\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n void add(int i, E e) throws IndexOutOfBoundsException;\n\n /**\n * Removes and returns the element at index i, shifting subsequent elements\n * earlier\n * @param i Index\n * @return Element previously at i\n * @exception IndexOutOfBoundsException If i is not valid, exception\n */\n E remove(int i) throws IndexOutOfBoundsException;\n\n /**\n * Empty the list\n */\n public void clear();\n\n /**\n * Construct a clone (copy) of the object.\n * @return New list object with the same structure. This copy should be\n * shallow, i.e., the individual elements are not cloned.\n */\n public List<E> clone();\n}", "public LinkList() {\n this.head = null;\n this.tail = null;\n }", "public void updated(ServerList list);", "public interface ListModel {\n\n /** \n * Returns the length of the list.\n * @return the length of the list\n */\n int getSize();\n\n /**\n * Returns the value at the specified index. \n * @param index the requested index\n * @return the value at <code>index</code>\n */\n Object getElementAt(int index);\n\n /**\n * Adds a listener to the list that's notified each time a change\n * to the data model occurs.\n * @param listener the <code>ListDataListener</code> to be added\n */ \n void addListDataListener(ListDataListener listener);\n\n /**\n * Removes a listener from the list that's notified each time a \n * change to the data model occurs.\n * @param listener the <code>ListDataListener</code> to be removed\n */ \n void removeListDataListener(ListDataListener listener);\n}", "public ListNode(Object newItem){\n\t\tlistItem = newItem;\n\t\tnext = null;\n\t}", "public Lista()\n {\n empty=true;\n next = null;\n }", "public SinglyLinkedList() {\n this.head = null;\n this.tail = null;\n this.size = 0;\n }", "public linkedList() { // constructs an initially empty list\r\n\r\n }", "abstract protected Object newList( int capacity );", "PublicLinkedList() {\n\t\tfront = back = null;\n\t}", "public interface ChatList extends Remote {\r\n\r\n Chat newChat(String s) throws RemoteException;\r\n\r\n Vector allChats() throws RemoteException;\r\n\r\n int getVersion() throws RemoteException;\r\n\r\n boolean newName(String s) throws RemoteException;\r\n \r\n boolean deleteName(String s) throws RemoteException;\r\n\r\n void print() throws RemoteException;\r\n\r\n void registration(ChatList l) throws RemoteException;\r\n}", "public DoubleLinkedList(){\n this.head = null;\n this.tail = null;\n this.size = 0;\n this.selec = null;\n }", "public interface ILocalDataSource {\n\n Flowable<List<CategoryDBO>> loadCategoriesFromLocal();\n\n void saveCategoriesToLocal(CategoryDBO categoryDBO);\n}", "void storeLinks();", "public List<Server> getServerList() {\n return serverList;\n }", "List<Note> list();", "public SLL() {\n\t\tsuper();\n\t\tthis.head = null;\n\t\tthis.size = 0;\n\t}", "public static void main(String[] args) {\n\t\tSinglyLinkedList<Integer> linkedList = new SinglyLinkedList<Integer>();\r\n\t\tlinkedList.add(10);\r\n\t\tlinkedList.add(20);\r\n\t\tlinkedList.add(30);\r\n\t\t//linkedList.reverseDisplay();\r\n\t\tSystem.out.println(linkedList.get(1));\r\n\t\t//linkedList.display();\r\n\t\t//linkedList.display();\r\n\t\tlinkedList.delete(1);\r\n\t\t\r\n\t}", "public LinkedList() {\n size = 0;\n head = new DoublyLinkedNode<E>(null);\n tail = new DoublyLinkedNode<E>(null);\n\n head.setNext(tail);\n tail.setPrevious(head);\n }", "public PacketLinkedList<SimplePacket> getListBuffer() {\n\t\treturn list;\n\t}", "public interface IList<T> {\n \n public boolean isEmpty();\n \n public T getFirst();\n \n public T getLast();\n \n public T get(int i); // a[3] a.get(3)\n \n public void set(T p, int i);\n \n public int size(); // a.length a.size()\n \n public LinkedList<T> addLast(T p);\n \n public LinkedList<T> add(T p, int i);\n \n public void remove(T p);\n \n public void remove(int i);\n \n public boolean contains(T p);\n \n}", "public interface ListReadOnly<T> {\n /**\n * Returns the number of elements in this list.\n *\n * @return The number of elements in this list.\n */\n\n public int size();\n\n\n /**\n * Returns the element at the specified position in this list.\n *\n * @param index Index of the element to return\n * @return The element at the specified position in this list.\n * @throws IndexOutOfBoundsException If the index is out of range\n * (<code>index &lt; 0 || index &gt;= size()</code>)\n */\n public T get(int index);\n}", "public SinglyLinkedList()\n {\n first = null; \n last = null;\n }", "public static <T> LinkedList<T> createLinkedList() {\n \t\treturn new LinkedList<T>();\n \t}", "public interface ListTwoWays<T> {\n boolean isEmpty();\n\n void insertToHead(T element);\n\n void insertToTail(T element);\n\n T deleteFromHead();\n\n T deleteFromTail();\n\n T getFromHead();\n\n T getFromTail();\n}", "ListOfBooks(){\n \tlist = new LinkedList<Book>();\n }", "private WrapperList getWplObject() throws IOException{\n WrapperList wpl = new WrapperList();\n wpl.setFileList(getDownloadableFiles());\n wpl.setServerHost(new Host(this.serverPeerIp,InetAddress.getLocalHost().getHostAddress()));\n log.info(\"Registering server + files \" + wpl.toString());\n return wpl;\n\n }", "public DLList() {\r\n init();\r\n }", "public DOCKSList getList() {\r\n return localList;\r\n }", "public MyLinkedList() {\n this.size = 0;\n this.head = new ListNode(0);\n }", "public IterableRemoteIndexedList(RemoteIndexedList<KEY, T> delegate) {\r\n super(delegate);\r\n this.delegate = delegate;\r\n }", "public List<NetworkNode> listNetworkNode();", "public interface LinkedListIntereface<T> {\n\n //methods used in LinkedList\n\n int getCurrentSize();\n boolean isFull();\n boolean isEmpty();\n boolean add(T newEntry);\n T remove();\n boolean remove(T anEntry);\n void clear();\n int getFrequencyOf(T anEntry);\n boolean contains(T anEntry);\n T[] toArray(Class c);\n\n}", "public interface ListSettable<T> {\n\n void setData(List<T> data);\n}", "public ListADTImpl() {\r\n head = new GenericEmptyNode();\r\n }", "@Override\r\n\tpublic String list() {\n\t\tList<HeadLine> dataList=new ArrayList<HeadLine>();\r\n\t\tPagerItem pagerItem=new PagerItem();\r\n\t\tpagerItem.parsePageSize(pageSize);\r\n\t\tpagerItem.parsePageNum(pageNum);\r\n\t\t\r\n\t\tLong count=headLineService.count();\r\n\t\tpagerItem.changeRowCount(count);\r\n\t\t\r\n\t\tdataList=headLineService.pager(pagerItem.getPageNum(), pagerItem.getPageSize());\r\n\t\tpagerItem.changeUrl(SysFun.generalUrl(requestURI, queryString));\r\n\t\t\r\n\t\trequest.put(\"DataList\", dataList);\r\n\t\trequest.put(\"pagerItem\", pagerItem);\r\n\t\t\r\n\t\t\r\n\t\treturn \"list\";\r\n\t}", "private Lists() { }", "public List<New> list();", "public LinkedList(){\n\t\thead = null;\n\t\ttail = null;\n\t}", "public void setList(DOCKSList param) {\r\n localListTracker = param != null;\r\n\r\n this.localList = param;\r\n }", "public List() {\n this.list = new Object[MIN_CAPACITY];\n this.n = 0;\n }", "public UserList list();", "List<T> read();", "public interface List<E> {\n /** Returns the number of elements in this list */\n int size();\n /** Returns whether the list is empty */\n boolean isEmpty();\n\n E get(int i) throws IndexOutOfBoundsException;\n\n E set(int i, E e) throws IndexOutOfBoundsException;\n\n void add(int i, E e) throws IndexOutOfBoundsException;\n\n E remove(int i) throws IndexOutOfBoundsException;\n}", "List() {\n this.length = 0;\n }", "private void getItemList(){\n sendPacket(Item_stocksTableAccess.getConnection().getItemList());\n \n }", "public LinkedList() {\r\n front = new ListNode(null);\r\n back = new ListNode(null, front, null);\r\n front.next = back;\r\n size = 0;\r\n }", "@Override\r\n public ListADT<T> toMutable() {\r\n return new ListADTImpl<T>(this.head);\r\n }", "public LinkedList() {\n\t\tfirst = null;\n\t}", "public interface StorageService {\n\t\n\t/**\n\t * Storage.\n\t *\n\t * @param storage the storage\n\t * @return the storage state\n\t */\n\tpublic StorageState storage(ArrayList<StorageVO> storage);\n\t\n}", "public MyLinkedList()\n {\n head = new Node(null, null, tail);\n tail = new Node(null, head, null);\n }", "public abstract List<T> getList();", "public static void main(String[] args) {\n\n\t\tList<Integer> arrList = new ArrayList<Integer>();\n\t\tarrList.add(1);\n\t\tarrList.add(2);\n\t\tList<Integer> arrLinked = new LinkedList<Integer>(arrList);\n\t\tarrLinked.add(1, 3);\n\t\tarrLinked.set(0, 4);\n\t\tSystem.out.println(arrLinked.get(2));\n\n\t\tSystem.out.println(arrLinked.toString());\n\n\t}", "public AllOOneDataStructure() {\n\t\thead=new Node(\"\", 0);\n\t\ttail=new Node(\"\", 0);\n\t\thead.next=tail;\n\t\ttail.prev=head;\n\t\tmap=new HashMap<>();\n\t}", "@Override\n public String getName() {\n return \"list\";\n }", "public LinkedListGeneric() {\n head = null;\n }", "List<Server> servers() {\n return servers;\n }", "public interface Topology {\r\n\r\n /**\r\n * Returns list of links\r\n * @return list of links\r\n */\r\n List<Link> getLinks();\r\n \r\n /**\r\n * Returns list of nodes\r\n * @return list of nodes\r\n */\r\n List<Node> getNodes();\r\n \r\n /**\r\n * Returns list od domains\r\n * @return list of domains\r\n */\r\n List<AdminDomain> getDomains();\r\n \r\n /**\r\n * Inserts link in the topology\r\n * @param link link to insert\r\n * @return if insertion of link was successful returns true, otherwise false \r\n */\r\n boolean insertLink(Link link);\r\n \r\n /**\r\n * Removes link from topology\r\n * @param link link to delete\r\n * @return if deletion of link was successful returns true, otherwise false\r\n */\r\n boolean removeLink(Link link);\r\n \r\n}", "public interface FlyWeight {\n\n List<Item> getList();\n}", "public list() {\r\n }", "public UtentiDB(){\r\n this.utenti = new LinkedList<Utente>();\r\n }", "public interface List<E> extends Collection<E> {\n\n E get(int index);\n\n E set(int index, E element);\n\n E remove(int index);\n\n @Override\n int size();\n\n @Override\n boolean isEmpty();\n\n @Override\n boolean contains(Object o);\n\n @Override\n boolean add(E element);\n\n void add(int index, E element);\n\n @Override\n boolean addAll(Collection<? extends E> c);\n\n @Override\n boolean remove(Object o);\n\n @Override\n void clear();\n\n @Override\n Iterator<E> iterator();\n\n @Override\n int hashCode();\n\n @Override\n boolean equals(Object o);\n}", "@Override\n public Iterator<Item> iterator(){return new ListIterator();}" ]
[ "0.60220605", "0.6003366", "0.5877006", "0.58464", "0.58282256", "0.57889736", "0.5776674", "0.5768559", "0.57487273", "0.5729102", "0.5723742", "0.5700809", "0.56961733", "0.56944996", "0.5676375", "0.5663846", "0.56376654", "0.5635204", "0.561708", "0.5616416", "0.56085646", "0.5593445", "0.55625176", "0.5554316", "0.55426455", "0.5537392", "0.5534863", "0.5521719", "0.5508577", "0.5508498", "0.5504512", "0.55044913", "0.55001307", "0.5470283", "0.5468744", "0.5467522", "0.54525524", "0.54411995", "0.54315186", "0.54181314", "0.5393226", "0.53860515", "0.53761786", "0.5375061", "0.5367268", "0.53612095", "0.535596", "0.5345367", "0.53388405", "0.5337402", "0.5330424", "0.53258747", "0.532537", "0.53245425", "0.5323793", "0.5320636", "0.5318909", "0.5317862", "0.5311871", "0.5307511", "0.5304729", "0.5304078", "0.5295691", "0.52945215", "0.5278434", "0.5278307", "0.5274008", "0.5272263", "0.52715516", "0.5263966", "0.5262209", "0.5256192", "0.52521807", "0.524973", "0.5246587", "0.5243057", "0.52423346", "0.5237974", "0.52377987", "0.52272743", "0.52264154", "0.5225423", "0.5214295", "0.5211831", "0.5196222", "0.51951236", "0.5192563", "0.5191685", "0.5187914", "0.518774", "0.5185099", "0.518428", "0.51820296", "0.5168448", "0.51559424", "0.51493573", "0.5145476", "0.5140479", "0.5139491", "0.51387185" ]
0.68429536
0
get the segment data for the given locator.
byte[] getSegmentData(Locator locator) throws PhysicalResourceException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object getSegment(K node);", "private RecordedService getRecordedService(final RecordedServiceLocator locator)\n {\n // TODO(Todd): What kind of security check should be done here?\n\n if (log.isDebugEnabled())\n {\n log.debug(\"getRecordedService for \" + locator);\n }\n\n final RecordingManager rm = RecordingManager.getInstance();\n final int recordingID = locator.getRecordingID();\n final int segmentIndex = locator.getSegmentIndex();\n\n RecordingRequest rr = rm.getRecordingRequest(recordingID);\n\n if (!(rr instanceof LeafRecordingRequest))\n {\n return null;\n }\n \n RecordedService rs;\n try\n {\n rs = ((LeafRecordingRequest)rr).getService();\n }\n catch (Exception e)\n {\n if (log.isInfoEnabled())\n {\n log.info(\"Caught an exception trying to access recorded service from \" \n + rr + \" via locator \" + locator, e);\n }\n return null;\n }\n \n if ((rs == null) || (segmentIndex == -1) || !(rs instanceof SegmentedRecordedService))\n { // This Locator doesn't refer to a RecordingRequest that has a RecordedService\n // (it hasn't started or the RS has been deleted) or the Locator doesn't refer\n // to a segment in a SegmentedRecordedService. Either way, we're done here. \n return rs;\n }\n \n // Assert: we have a RS Locator with an index reference and a non-null \n // SegmentedRecordedService. Try to find the segment.\n final RecordedService segments[] = ((SegmentedRecordedService)rs).getSegments();\n for (int i=0; i<segments.length; i++)\n {\n OcapRecordedServiceExt orse = (RecordedServiceImpl)segments[i];\n \n if (orse.getSegmentIndex() == segmentIndex)\n {\n return orse;\n }\n }\n\n // The recorded service was not found\n return null;\n }", "int getSegment();", "public Data getDataAt(Address addr);", "com.google.ads.googleads.v6.common.Segments getSegments();", "public Segment getSegment(int index) {\n return null;\n }", "private TrackSegment readSegment(XmlPullParser parser) throws IOException, XmlPullParserException {\n List<TrackPoint> points = new ArrayList<>();\n parser.require(XmlPullParser.START_TAG, ns, TAG_SEGMENT);\n while (loopMustContinue(parser.next())) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n continue;\n }\n String name = parser.getName();\n switch (name) {\n case TAG_TRACK_POINT:\n points.add(readTrackPoint(parser));\n break;\n default:\n skip(parser);\n break;\n }\n }\n parser.require(XmlPullParser.END_TAG, ns, TAG_SEGMENT);\n return new TrackSegment.Builder()\n .setTrackPoints(points)\n .build();\n }", "public String getSegment()\n {\n return m_strSegment;\n }", "public com.eviware.soapui.coverage.SegmentType getSegmentArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.eviware.soapui.coverage.SegmentType target = null;\n target = (com.eviware.soapui.coverage.SegmentType)get_store().find_element_user(SEGMENT$2, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target;\n }\n }", "public SelectMapedBufferResult getData(final long offset) {\n return this.getData(offset, (0 == offset ? true : false));\n }", "private LineSegment[] findSegments() {\n List<LineSegment> segmentList = new ArrayList<>();\n int N = points.length;\n for (int i = 0; i < N; i++) {\n for (int j = i+1; j < N; j++) {\n Double slopePQ = points[i].slopeTo(points[j]);\n for (int k = j+1; k < N; k++) {\n Double slopePR = points[i].slopeTo(points[k]);\n if (slopePQ.equals(slopePR)) {\n for (int l = k + 1; l < N; l++) {\n Double slopePS = points[i].slopeTo(points[l]);\n if (slopePQ.equals(slopePS)) {\n LineSegment lineSegment = new LineSegment(points[i], points[l]);\n segmentList.add(lineSegment);\n }\n }\n }\n }\n }\n }\n return segmentList.toArray(new LineSegment[segmentList.size()]);\n }", "public com.eviware.soapui.coverage.SegmentType[] getSegmentArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List<com.eviware.soapui.coverage.SegmentType> targetList = new java.util.ArrayList<com.eviware.soapui.coverage.SegmentType>();\n get_store().find_all_element_users(SEGMENT$2, targetList);\n com.eviware.soapui.coverage.SegmentType[] result = new com.eviware.soapui.coverage.SegmentType[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "public LineSegment[] segments(){\n\t\tPoint[] ptArr = new Point[numpoints];\n\t\tfor(int i =0; i < numpoints; i++){\n\t\t\tfor(int j =0; j < numpoints;j++) ptArr[j] = mypoints[j];\n\t\t\tPoint origin = mypoints[i];\t\t\n\t\t\t//Sort the points using mergeSort for doubles\n\t\t\tArrays.sort(ptArr,origin.slopeOrder());\t\n\t\t\tfindAllCollinearPts(ptArr,origin);\n\t\t}\n\t\treturn getSegments();\n\t}", "public Service getService(Locator locator) throws InvalidLocatorException, SecurityException\n {\n // Handle recorded service locators here. Handle all other locators in\n // the super-class.\n if (log.isDebugEnabled())\n {\n log.debug(\"DVRSIManagerDelegate.getService(\" + locator + \") class \" + locator.getClass());\n }\n \n if (locator instanceof RecordedServiceLocator)\n {\n RecordedService service = getRecordedService((RecordedServiceLocator)locator);\n if (service == null)\n {\n throw new InvalidLocatorException(locator, \"Recorded service not found\");\n }\n return service;\n }\n \n return null;\n }", "String getMatchingSegments(Integer pointId);", "void getSegmentFiles(DataSegment segment, File dir) throws SegmentLoadingException;", "public NurbsPoint get_control_point(int segment, int point) {\n return points[segment][point];\n }", "public static Segment getSegment(double id) {\n\n String idAsString = String.valueOf(id);\n String sql = \"SELECT id, fileID, fileName, thai, english, committed, removed, rank FROM corpus1 WHERE id =\" + idAsString + \";\";\n\n try (Connection conn = DatabaseOperations.connect();\n Statement stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(sql)) {\n\n // loop through the result set\n while (rs.next()) {\n // Segment ret = new Segment(rs.getInt(\"id\"), rs.getInt(\"fileID\"), rs.getString(\"fileName\"));\n return rebuildSegment(rs);\n }\n return null;\n } catch (SQLException e) {\n System.out.println(\"getSegment: \" + e.getMessage());\n }\n return null;\n }", "public Object getData(Component componentAt, Point location);", "@Override\n public InstancesContainer readData(String path, String dataSpliter, String valueSpliter)\n {\n ArrayList<ArrayList<String>> data = readFile(path, dataSpliter);\n InstancesContainer instances = Factory.getInstanceContainer(1);\n instances.setPaths(data);\n return instances;\n }", "AssignmentPathSegment getSegment(int index);", "default SegmentStats[] segmentStats() {\n throw new UnsupportedOperationException(\"todo\");\n }", "public java.util.List<com.eviware.soapui.coverage.SegmentType> getSegmentList()\n {\n final class SegmentList extends java.util.AbstractList<com.eviware.soapui.coverage.SegmentType>\n {\n public com.eviware.soapui.coverage.SegmentType get(int i)\n { return LineTypeImpl.this.getSegmentArray(i); }\n \n public com.eviware.soapui.coverage.SegmentType set(int i, com.eviware.soapui.coverage.SegmentType o)\n {\n com.eviware.soapui.coverage.SegmentType old = LineTypeImpl.this.getSegmentArray(i);\n LineTypeImpl.this.setSegmentArray(i, o);\n return old;\n }\n \n public void add(int i, com.eviware.soapui.coverage.SegmentType o)\n { LineTypeImpl.this.insertNewSegment(i).set(o); }\n \n public com.eviware.soapui.coverage.SegmentType remove(int i)\n {\n com.eviware.soapui.coverage.SegmentType old = LineTypeImpl.this.getSegmentArray(i);\n LineTypeImpl.this.removeSegment(i);\n return old;\n }\n \n public int size()\n { return LineTypeImpl.this.sizeOfSegmentArray(); }\n \n }\n \n synchronized (monitor())\n {\n check_orphaned();\n return new SegmentList();\n }\n }", "phaseI.Hdfs.DataNodeLocation getLocations(int index);", "public final ObservableList<T> getSegments() {\n return segments.get();\n }", "@Override\n public Iterable<ParameterMap> fetchSegment(final Segment segment) {\n try {\n final List<Parameter> parameters = segment.getOutputParameters();\n return Files.readLines(\n new File(segment.getName()),\n Charset.defaultCharset(),\n new LineProcessor<List<ParameterMap>>() {\n private final List<ParameterMap> entries = Lists.newArrayList();\n @Override\n public boolean processLine(String line) throws IOException {\n // If the line is invalid, skip it and continue\n if (line == null || line.length() == 0) return true;\n String[] values = line.split(\"\\t\");\n // If there is an entry which is improperly sized, there is a problem so bail\n if (values.length != segment.getOutputParameters().size()) return false;\n ParameterMap.Builder builder = new ParameterMap.Builder();\n for (int i=0; i<parameters.size();i++)\n {\n builder.with(parameters.get(i), values[i]);\n }\n entries.add(builder.build());\n return true;\n }\n\n @Override\n public List<ParameterMap> getResult() {\n return entries;\n }\n });\n } catch (IOException e) {\n e.printStackTrace();\n }\n return Lists.newArrayList();\n }", "public static DiskPMT getDiskSegmentPMT(String jobId,int segment){\n\t\tDiskSMT smt = diskJobStorage.get(jobId);\n\t\treturn smt.segment[segment];\n\t}", "public Segment getSegment(int index) {\n\t\treturn mSegmentList.get(index);\n\t}", "List<Segment> getSegments() throws Exception {\n\t\tlogger.log(\"in getSegments\");\n\t\tSegmentsDAO dao = new SegmentsDAO();\n\t\t\n\t\treturn dao.getAllSegments();\n\t}", "public long [] getData(Long index);", "public Data getDataContaining(Address addr);", "public Segment GetFirstSegment() { return cs1; }", "public abstract long getStreamSegmentOffset();", "McastRouteData getRouteData(McastRoute route);", "protected DiskData getDiskData(String sessionIdentifier, boolean create)\n\t{\n\t\tif (!create)\n\t\t{\n\t\t\treturn diskDatas.get(sessionIdentifier);\n\t\t}\n\n\t\tDiskData data = new DiskData(this, sessionIdentifier);\n\t\tDiskData existing = diskDatas.putIfAbsent(sessionIdentifier, data);\n\t\treturn existing != null ? existing : data;\n\t}", "public Data getDefinedDataAt(Address addr);", "public LineSegment[] segments() {\n LineSegment[] segmentsArray = new LineSegment[segments.size()];\n segmentsArray = segments.toArray(segmentsArray);\n return segmentsArray;\n }", "public Segment getSegment(String track, int km, double m) {\r\n\t\treturn getTrack(track).getKilometer(km).getSegment(m);\r\n\t}", "private TreeSet<BisectDistInfo> findAllSegments( Coordinate[] poly ) {\n\t\t\n\t\tTreeSet<BisectDistInfo> distInfo = new TreeSet<BisectDistInfo>();\n\t\t\t\t\t\t\n\t Coordinate[] seg = new Coordinate[2];\n\t boolean qualify;\n\t \n\t\tfor ( int ii = 0; ii < (poly.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (poly.length); jj ++ ) {\n\t\t seg[0] = poly[ii];\n\t\t seg[1] = poly[jj]; \n\t\t \n\t\t\t qualify = polysegIntPoly( seg, poly );\n\t\t\t if ( qualify ) {\n\t\t\t\t double dist = GfaSnap.getInstance().distance( seg[0], seg[1] ) / PgenUtil.NM2M;\n\t\t\t\t if ( dist > GfaSnap.CLUSTER_DIST ) {\n\t\t\t\t\t distInfo.add( new BisectDistInfo( dist, ii, jj ) );\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\t\t\t\n }\n\n\t\treturn distInfo;\n\t\t\n\t}", "public Data getDataAfter(Address addr);", "private Segment getSegment(int addr, boolean get) throws ProgramException {\n Set<Segment> found = memory.get(addr);\n if (found.isEmpty()) {\n throw new ProgramException(get ? ErrorType.ADDRL : ErrorType.ADDRS);\n }\n return found.iterator().next();\n }", "Set<S> getSegments();", "public LinkedList<Point> segmentsToDraw() {\n LinkedList<Point> segmentCoordinates = new LinkedList<Point>();\n for (int segment = 1; segment <= snakeSize; segment++) {\n //search array for each segment number\n for (int x = 0; x < maxX; x++) {\n for (int y = 0; y < maxY; y++) {\n if (snakeSquares[x][y] == segment) {\n //make a Point for this segment's coordinates and add to list\n Point p = new Point(x * SnakeGame.getSquareSize(), y * SnakeGame.getSquareSize());\n segmentCoordinates.add(p);\n }\n }\n }\n }\n return segmentCoordinates;\n\n }", "public Data getDataBefore(Address addr);", "public static List<GenomeSegment> list() {\n return segmentList;\n }", "IRegion getLineInformationOfOffset(int offset) throws BadLocationException;", "public native String substringData(double offset, double count) /*-{\r\n\t\tvar jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\r\n\t\treturn jso.substringData(offset, count);\r\n }-*/;", "protected byte direct_read(int address) {\n return segment_data[address];\n }", "int getStartSegment();", "com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment();", "public Data getDefinedDataContaining(Address addr);", "private ProcessData getDataFor(Agent ag) {\n return (ProcessData)agents.get(ag);\n }", "String getSegmentName();", "public Point[] getCoordinates() {\n Point[] temp = new Point[segments.length];\n for (int i = 0; i < segments.length; i++) {\n temp[i] = segments[i].getCoordinates();\n }\n return temp;\n }", "private TreeSet<SpatialTemporal> gatherData() {\r\n TreeSet<SpatialTemporal> dataPoints = new TreeSet<>(new Comparator<SpatialTemporal>() {\r\n @Override\r\n public int compare(SpatialTemporal o1, SpatialTemporal o2) {\r\n return (new Double(o1.position)).compareTo(new Double(o2.position));\r\n }\r\n });\r\n\r\n double positionOnRoute = 0;\r\n for (final RoadSegment roadSegment : route) {\r\n for (Vehicle veh : roadSegment) {\r\n if (veh.type() == AgentType.OBSTACLE) {\r\n continue;\r\n }\r\n double position = positionOnRoute + veh.getFrontPosition();\r\n dataPoints.add(new SpatialTemporal(position, veh.getSpeed(), veh.getLength(), veh.getAcc()));\r\n }\r\n positionOnRoute += roadSegment.roadLength();\r\n }\r\n return dataPoints;\r\n }", "speech_formatting.SegmentedTextOuterClass.SentenceSegment getSentenceSegment(int index);", "public String getSegmentId() {\n return segmentId;\n }", "public SWDownloadSegment getDownloadSegment()\r\n {\r\n return downloadSegment;\r\n }", "public static String[] getRegion(String dataType, String region){\r\n String line = \"\"; \r\n try{ \r\n BufferedReader br = new BufferedReader(new FileReader(\"dataSets//Continents.csv\")); \r\n while ((line = br.readLine()) != null){\r\n String[] lineArr= line.split(\",\"); \r\n if(lineArr[0].equals(region)){\r\n String[] rez= new String[lineArr.length-1];\r\n for(int i=0; i!=rez.length; i++){\r\n rez[i]=lineArr[i+1];\r\n }\r\n return rez;\r\n }\r\n }\r\n }\r\n catch (IOException e){} \r\n return new String[]{\"Error404\"};\r\n }", "public LineSegment[] segments() {\r\n LineSegment[] toReturn = new LineSegment[lineSegments.length];\r\n System.arraycopy(lineSegments, 0, toReturn, 0, lineSegments.length);\r\n return toReturn;\r\n }", "private String getAFileFromSegment(Value segment, Repository repository)\n {\n \n RepositoryConnection con = null;\n try\n {\n con = getRepositoryConnection(repository);\n \n String adaptorQuery = \"SELECT ?fileName WHERE { <\" + segment + \"> <http://toif/contains> ?file . \"\n + \"?file <http://toif/type> \\\"toif:File\\\" .\" + \"?file <http://toif/name> ?fileName . }\";\n \n TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery);\n \n TupleQueryResult queryResult = adaptorTupleQuery.evaluate();\n \n while (queryResult.hasNext())\n {\n BindingSet adaptorSet = queryResult.next();\n Value name = adaptorSet.getValue(\"fileName\");\n \n return name.stringValue();\n }\n \n queryResult.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n catch (MalformedQueryException e)\n {\n e.printStackTrace();\n }\n catch (QueryEvaluationException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n con.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n }\n return null;\n }", "IRegion getLineInformation(int line) throws BadLocationException;", "public String[] getInfoData();", "public List<TrackSegment> getSegments() {\n\t\treturn _segments;\n\t}", "public T getInfo(Coordinate where, boolean hit) { // where?\n if (hit) {\n return onHit;\n } \n return myData;\n }", "public speech_formatting.SegmentedTextOuterClass.SentenceSegment getSentenceSegment(int index) {\n if (sentenceSegmentBuilder_ == null) {\n return sentenceSegment_.get(index);\n } else {\n return sentenceSegmentBuilder_.getMessage(index);\n }\n }", "public LineSegment[] segments() {\n return lineSegments.toArray(new LineSegment[numberOfSegments()]);\n }", "com.google.ads.googleads.v6.common.SegmentsOrBuilder getSegmentsOrBuilder();", "public List<Edge> segments() {\n return segments;\n }", "public final float[] exportSegmentation() {\n \tfloat[] seg = new float[nx*ny*nz];\n \tfor (int xyz=0; xyz<nx*ny*nz; xyz++) {\n \t\t//if (mgdmlabels[0][xyz]>-1) {\n\t\t\tif (segmentation[xyz]>-1) {\n\t\t\t\t//seg[xyz] = objLabel[mgdmlabels[0][xyz]];\n\t\t\t\tseg[xyz] = objLabel[segmentation[xyz]];\n\t\t\t}\n \t}\n \treturn seg;\n }", "public List<TrackSegment> segments() {\n\t\t\treturn new NonNullList<>(_segments);\n\t\t}", "@java.lang.Override\n public speech_formatting.SegmentedTextOuterClass.SentenceSegment getSentenceSegment(int index) {\n return sentenceSegment_.get(index);\n }", "public ServiceInstanceInner deserializeInstanceData(String lastPathSeg, byte[] data)\n/* */ {\n/* 138 */ return null;\n/* */ }", "private Map<String, Object> getSectorData() {\r\n Map<String, Object> data = new LinkedHashMap<String, Object>();\r\n for (String key : sectorData) {\r\n if (lineData.containsKey(key)) {\r\n if (channelMap.containsKey(key)) {\r\n channelMap.put(key, channelMap.get(key) + 1);\r\n }\r\n data.put(key, lineData.get(key));\r\n }\r\n }\r\n return data;\r\n }", "private Vector getSpeedSeg(Stroke theStroke)\n\t{\n\t\tdouble[] speedData = theStroke.getSpeedData();\n\t\tm_speedSeg = new SpeedBasedDetection(speedData);\n\t\tVector segPt_speed = m_speedSeg.detectSegmentPoints();\n\t\treturn segPt_speed;\n\t}", "public LineSegment[] segments() {\n LineSegment[] re = new LineSegment[lines.size()];\n lines.toArray(re);\n return re;\n }", "public Observable<Stop> getStartPoints() {\n\n return loadRoutesData()\n .flatMap(availableRoutes ->\n Observable.from(availableRoutes.routes()))\n .flatMap(route -> Observable.from(route.segments()).first())\n .map(segment -> segment.stops().get(0));\n\n\n }", "public SegmentList getSegmentList()\n\t{\n\t\treturn segmentList;\n\t}", "public ContentSpan getData(){\n return this.data;\n }", "Segment createSegment();", "private static final int[] getPoint(int point) {\n int[] ret = new int[2];\n if (point >= firstPoint && point <= endPoint) {\n ret = getPoint(ruteData[point + 2]);//ruteData[point + 2]);\n }\n return ret;\n }", "public List<Node> segments() {\n return segments;\n }", "public byte[] getData(String path, Stat stat, Watcher watcher) throws KeeperException.NoNodeException {\n return dataTree.getData(path, stat, watcher);\n }", "java.util.List<speech_formatting.SegmentedTextOuterClass.SentenceSegment> \n getSentenceSegmentList();", "public int getData(int index) {\n return data_.get(index);\n }", "public List<Segmentation> getSegmentations()\n\t\t\tthrows InvalidParametersException;", "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}", "public Data getDefinedDataAfter(Address addr);", "public LineSegment[] segments() {\n return lineSegments.clone();\n }", "double clientData(final int index, final int data);", "private SensorData collectFSInfo() throws SigarException {\n \n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Collecting File System Information\");\n }\n \n SensorData data = new SensorData();\n \n FileSystem[] fileSystems = sigar.getFileSystemList();\n \n List<FileSystemInfo> fsInfoList = new ArrayList<FileSystemInfo>();\n \n for (FileSystem fs : fileSystems) {\n \n FileSystemInfo info = new FileSystemInfo();\n \n info.setDiskName(fs.getDevName());\n info.setLocation(fs.getDirName());\n info.setType(fs.getSysTypeName());\n \n FileSystemUsage fsu = sigar.getFileSystemUsage(fs.getDirName());\n \n info.setTotalMB(fsu.getTotal() / 1024);\n info.setUsedMB(fsu.getUsed() / 1024);\n \n fsInfoList.add(info);\n }\n \n data.add(SensorAttributeConstants.FileSystemConstants.FS_DATA, fsInfoList);\n \n return data;\n }", "E getData(int index);", "AMuonSegmentData(AHashMap p, AEvent e) {\n super(p,e);\n String assocKey = getName() + getStoreGateKey();\n event.getAssociationManager().add(new AAssociation(assocKey, \"MDT\", numHits, hits, event));\n event.getAssociationManager().add(new AAssociation(assocKey, \"RPC\", numHits, hits, event));\n event.getAssociationManager().add(new AAssociation(assocKey, \"TGC\", numHits, hits, event));\n event.getAssociationManager().add(new AAssociation(assocKey, \"CSC\", numHits, hits, event));\n }", "public void getSegmentSimPositions()\n {\n Wormsim.getBody(wormBody);\n float s = (float)Agar.SIZE.width * Agar.SCALE / 0.001f;\n for (int i = 0; i < NBAR; i++)\n {\n double x = ((wormBody[i * 3]) * s) + agar.x_off;\n double y = ((wormBody[i * 3 + 1]) * s) + agar.y_off;\n wormVerts[i] = new Point2D.Double(x, y);\n }\n double w = (double)Agar.SIZE.width / (double)Agar.GRID_SIZE.width;\n double h = (double)Agar.SIZE.height / (double)Agar.GRID_SIZE.height;\n for (int i = 0; i < NUM_SEGMENTS; i++)\n {\n double x = 0.0;\n double y = 0.0;\n for (int j = 0, k = i * 4; j < 4; j++, k++)\n {\n x += wormVerts[k].x;\n y += wormVerts[k].y;\n }\n x /= 4.0;\n y /= 4.0;\n segmentSimPositions[i] = new Point((int)(x / w), (int)(y / h));\n }\n }", "public Data getData(HelperDataType type);", "public ArrayList <Segment> getSegmentList () {\n\t\treturn mSegmentList;\n\t}", "private final List<PLineSegment> getLineSegmentsForSplitLine(SplitLine splitLine) {\n int lineIndex = splitLine.getLineIndex();\n List<PLineSegment> segments = getLineSegments(lineIndex);\n int index = 0;\n ArrayList<PLineSegment> result = new ArrayList<PLineSegment>();\n int start = splitLine.getOffset();\n int end = start + splitLine.getLength();\n \n for (int i = 0; index < end && i < segments.size(); ++i) {\n PLineSegment segment = segments.get(i);\n if (start >= index + segment.getModelTextLength()) {\n index += segment.getModelTextLength();\n continue;\n }\n if (start > index) {\n int skip = start - index;\n segment = segment.subSegment(skip);\n index += skip;\n }\n if (end < index + segment.getModelTextLength()) {\n segment = segment.subSegment(0, end - index);\n }\n result.add(segment);\n index += segment.getModelTextLength();\n }\n return result;\n }", "public static FeatureDatasetPoint getPointDataset(HttpServletRequest request, HttpServletResponse response, String path) throws IOException {\n TdsRequestedDataset trd = new TdsRequestedDataset(request, null);\n if (path != null) trd.path = path;\n return trd.openAsPointDataset(request, response);\n }", "public static Segment findSegment( QueryService queryService, PageParameters parameters ) {\n if ( parameters.containsKey( SEGMENT_PARM ) )\n try {\n return queryService.find( Segment.class, parameters.getLong( SEGMENT_PARM ) );\n } catch ( StringValueConversionException ignored ) {\n LOG.warn( \"Invalid segment specified in parameters. Using default.\" );\n } catch ( NotFoundException ignored ) {\n LOG.warn( \"Unknown segment specified in parameters. Using default.\" );\n } catch ( ClassCastException ignored ) {\n LOG.warn( \"Other object specified as segment in parameters. Using default.\" );\n }\n return null;\n }", "public abstract double[] getVector(int[] location);" ]
[ "0.54849744", "0.5204074", "0.51483893", "0.5120178", "0.51145875", "0.49306226", "0.49301243", "0.48790368", "0.48746943", "0.48664212", "0.4863594", "0.48634988", "0.4843385", "0.4836435", "0.48091453", "0.4792197", "0.4774053", "0.47703472", "0.47700855", "0.47569308", "0.4756062", "0.47433856", "0.47328785", "0.4732691", "0.47212973", "0.46650675", "0.46358192", "0.4635161", "0.46232894", "0.4601688", "0.4595813", "0.459417", "0.45911646", "0.45702925", "0.45689297", "0.45609158", "0.4559405", "0.45489046", "0.4541816", "0.45304835", "0.45168725", "0.45164442", "0.45080078", "0.4502297", "0.44944707", "0.4488549", "0.44844568", "0.4469514", "0.4468791", "0.44641125", "0.4453693", "0.44444478", "0.4420165", "0.4414334", "0.44057995", "0.44050416", "0.43909365", "0.43866283", "0.43587485", "0.4356258", "0.43532765", "0.4351351", "0.4336992", "0.43320668", "0.4331562", "0.43289065", "0.43110147", "0.43101645", "0.43036133", "0.42970556", "0.4296551", "0.42955542", "0.42954606", "0.42907467", "0.42861277", "0.42675492", "0.42613843", "0.42585984", "0.42525718", "0.42388535", "0.4237713", "0.42365205", "0.42347497", "0.4228293", "0.42272207", "0.42204997", "0.42187047", "0.42185977", "0.42121664", "0.42096165", "0.4207681", "0.42074198", "0.4205712", "0.4200657", "0.41914368", "0.4182497", "0.41788548", "0.4175042", "0.41740507", "0.41712317" ]
0.8149713
0
crateAndShowGUI method which calla initcomponrnt method
private void createAndShowGUI(){ initComponents(); openMazefile.addActionListener(this); solveMaze.addActionListener(this); clearSolution.addActionListener(this); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); pack(); setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void initAndShowGUI() {\n }", "public void init(){\r\n\t\t\r\n\t\ttry {\r\n\t\t\tSwingUtilities.invokeAndWait(new Runnable() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tbuildWindow();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.err.println(\"createGUI didn't complete successfully\");\r\n\t\t}\r\n\t}", "public Gui() { \n preInitComponents(); \n initComponents();\n postInitComponents(); \n setVisible(true);\n appInitialization();\n }", "protected void initializeGUI() {\n\n\t}", "@Override\n public void initGUI() {\n\n }", "public orgGui() {\n initComponents();\n }", "public gui() {\n initComponents();\n }", "public gui() {\n initComponents();\n }", "@Override\n public void initGui()\n {\n super.initGui();\n }", "public void initGui()\n {\n StringTranslate var1 = StringTranslate.getInstance();\n int var2 = this.func_73907_g();\n\n for (int var3 = 0; var3 < this.options.keyBindings.length; ++var3)\n {\n this.controlList.add(new GuiSmallButton(var3, var2 + var3 % 2 * 160, this.height / 6 + 24 * (var3 >> 1), 70, 20, this.options.getOptionDisplayString(var3)));\n }\n\n this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey(\"gui.done\")));\n this.screenTitle = var1.translateKey(\"controls.minimap.title\");\n }", "public void initGui()\n {\n StringTranslate var2 = StringTranslate.getInstance();\n int var4 = this.height / 4 + 48;\n\n this.controlList.add(new GuiButton(1, this.width / 2 - 100, var4 + 24 * 1, \"Offline Mode\"));\n this.controlList.add(new GuiButton(2, this.width / 2 - 100, var4, \"Online Mode\"));\n\n this.controlList.add(new GuiButton(3, this.width / 2 - 100, var4 + 48, var2.translateKey(\"menu.mods\")));\n\t\tthis.controlList.add(new GuiButton(0, this.width / 2 - 100, var4 + 72 + 12, 98, 20, var2.translateKey(\"menu.options\")));\n\t\tthis.controlList.add(new GuiButton(4, this.width / 2 + 2, var4 + 72 + 12, 98, 20, var2.translateKey(\"menu.quit\")));\n this.controlList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var4 + 72 + 12));\n }", "public GUI() {\n initComponents();\n this.setVisible(true);\n }", "public GUI() {\n initComponents();\n }", "public GUI() {\n initComponents();\n }", "private GUI()\n {\n makeGUI();\n }", "public void init()\n\t{\n\t\ttry\n\t\t{\n\t\t\tjavax.swing.SwingUtilities.invokeAndWait(new Runnable()\n\t\t\t{\n\t\t\t\tpublic void run()\n\t\t\t\t{\n\t\t\t\t\tcreateGUI();\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tSystem.err.println(\"createGUI didn't successfully complete: \"\n\t\t\t\t\t+ e.toString());\n\t\t}\n\t}", "private void initGui(){\n // TODO: add code for GUI initialization for a given auction\n }", "public GUI() {\n\t\tinitComponents();\n\t}", "public CovidGUI(){\n initComponents();\n }", "public BBDJPAAdminGUI() {\n initComponents();\n\n myInit();\n }", "public History_GUI(){\n super();\n InitializeComponents();\n ConfigureWin();\n\n }", "@Override\n\tpublic void initGui() {\n\t\tfield_154330_a.init();\n\t\tsuper.initGui();\n\t}", "private void initializateGUI() {\n\t\t\n\t\t\n\t\tthis.menuBar = buildMenuBar();\n\t\t\n\t\tthis.toolBar = buildToolBar();\n\t\t\n\t\tthis.container = (JComponent) ContainerViewFactory.getInstance().getContainerView(null);\n\t\t\n\t\tthis.status = buildStatusBar();\n\t\t\n\t\tscrollPane = new JScrollPane();\n\t\tscrollPane.getViewport().add(this.container);\n\t\t\n\t\ttextResources.getString(\"application.title\").ifPresent(super::setTitle);\n\n\t\tif (this.menuBar != null) {\n\t\t\tsuper.setJMenuBar(this.menuBar);\n\t\t}\n\t\tsuper.setPreferredSize(MINIMUM_SIZE);\n\t\tsuper.setMinimumSize(MINIMUM_SIZE);\n\t\tsuper.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));\n\n\t\tsuper.getRootPane().setPreferredSize(MINIMUM_SIZE);\n\t\tsuper.getRootPane().setMinimumSize(MINIMUM_SIZE);\t\t\n\t\tsuper.getRootPane().setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));\n\t\t\n\t\tsuper.setLayout(new BorderLayout());\n\t\t\n\t\tsuper.add(toolBar, BorderLayout.NORTH);\n\t\tsuper.add(scrollPane, BorderLayout.CENTER);\n\t\tsuper.add(status, BorderLayout.SOUTH);\n\t\t\n\t\tsuper.addWindowListener(new WindowAdapter() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\tinitializationDialog = buildInitializationAction();\n\t\t\t\tinitializationDialog.setVisible(true);\n\t\t\t\tinitializationDialog.toFront();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tconfirmExitAction();\n\t\t\t}\n\t\t});\n\t\tthis.handlerInitializateGUI();\n\t}", "public GUI() {\n initComponents();\n }", "public MainGui() {\n initComponents();\n this.setVisible(true);\n configuracoesSalvas();\n }", "public void initGui()\n {\n Keyboard.enableRepeatEvents(true);\n this.buttons.clear();\n GuiButton guibutton = this.addButton(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 24 + 12, I18n.format(\"selectWorld.edit.resetIcon\")));\n this.buttons.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 48 + 12, I18n.format(\"selectWorld.edit.openFolder\")));\n this.buttons.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format(\"selectWorld.edit.save\")));\n this.buttons.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format(\"gui.cancel\")));\n guibutton.enabled = this.mc.getSaveLoader().getFile(this.worldId, \"icon.png\").isFile();\n ISaveFormat isaveformat = this.mc.getSaveLoader();\n WorldInfo worldinfo = isaveformat.getWorldInfo(this.worldId);\n String s = worldinfo == null ? \"\" : worldinfo.getWorldName();\n this.nameEdit = new GuiTextField(2, this.fontRenderer, this.width / 2 - 100, 60, 200, 20);\n this.nameEdit.setFocused(true);\n this.nameEdit.setText(s);\n }", "private void initUI() {\n }", "public soal2GUI() {\n initComponents();\n }", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "public ExecutantGui() {\n initComponents();\n }", "private GUIReminder() {\n\n initComponents();\n initOthers();\n\n }", "public RagaiGUI() {\n initComponents();\n \n }", "public void initGui() {\r\n\t\tEventQueue.invokeLater(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tGuiWindow window = new GuiWindow(Controller.this);\r\n\t\t\t\t\tlinkedGuiWindow = window;\r\n\t\t\t\t\twindow.setVisible(true);\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}\r\n\t\t});\r\n\t}", "private GUIAltaHabitacion() {\r\n\t initComponents();\r\n\t }", "public void initComponents();", "public adivinaGUI() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public Mainwindow(){\n \n try \n {\n //LookAndFeel asd = new SyntheticaAluOxideLookAndFeel();\n //UIManager.setLookAndFeel(asd);\n } \n catch (Exception e) \n {\n e.printStackTrace();\n }\n initComponents();\n \n \n userinitComponents();\n \n \n }", "void initUI();", "public guiProntuarioVirtual() {\n initComponents();\n \n }", "public void init() {\n try {\n java.awt.EventQueue.invokeAndWait(new Runnable() {\n public void run() {\n initComponents();\n }\n });\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public MyGUI() {\n \t super(\"Mastermind\");\n \t guiManager = new GUIManager();\n createMenuComponents();\n createMastermindComponents(this,2);\n \n }", "public mainUI() {\n initComponents();\n }", "public ClienteGUI() {\n initComponents();\n }", "private static void createAndShowGUI() {\n\t\tgui = new GUI();\n\t}", "public ClientGUI() {\n initComponents();\n }", "public ClientGUI() {\n initComponents();\n }", "public main() {\n initComponents();\n btnSalvar3.setVisible(false);\n lerConfig();\n }", "public GUI() {\n app = new Aplikasi();\n initComponents();\n }", "public void init()\n {\n buildUI(getContentPane());\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public GUI_IntroDatos() {\n initComponents();\n }", "public AplicationGUI() {\n initComponents();\n }", "public void initGui() {\r\n\t\tSpieler sieger = dasSpiel.getSieger();\r\n\t\tPopupGUI siegerAnzeigen = new PopupGUI(dasSpiel);\r\n\t\tString anzeige = sieger.getName() + \", hat das Spiel gewonnen! Du kannst nun keine Aktionen mehr durchfuehren ausser dir die Karte anzuschauen.\";\r\n\t\tfor (int i = 0; i < dasSpiel.getSpielerListe().size(); i++) {\r\n\t\t\tsiegerAnzeigen.textAnzeigen(anzeige, dasSpiel.getSpielerListe().get(i));\r\n\t\t}\r\n\t}", "public Gui() {\n initComponents();\n }", "public void initGUI(){\n\t\t\n\t\t//the layout is a new BorderLayout\n\t\tsetLayout(new BorderLayout());\n\t\t\n\t\t//the label will be north\t\n\t\tadd(createHeroList(), BorderLayout.NORTH);\n\t\t\n\t\t//the questions will be displayed center\t\t\n\t\tadd(createQuestions(), BorderLayout.CENTER);\n\t\t//the button panel should be south\n\t\tadd(createAnswerButtonPanel(), BorderLayout.SOUTH);\n\t\t\n\t\t\n\t\t \n\t}", "private void initComponents() {\n\t\tthis.setTitle(\"Boggle\");\n\t\tthis.setDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tthis.setMinimumSize(new Dimension(600, 575));\n\t\t\n\t\tinitMenuBar();\n\t\tinitDiceGridPanel();\n\t\tinitInputPanel();\n\t\tinitInfoPanel();\n\t\taddPanels();\n\t\t\n\t\tthis.setVisible(true);\n\t}", "public GUI() {\n \n initComponents();\n custIDError.setVisible(false);\n custNameError.setVisible(false);\n custLoginError.setVisible(false);\n custPasswordError.setVisible(false);\n prodIDError.setVisible(false);\n prodNameError.setVisible(false);\n prodDescriptionError.setVisible(false);\n prodCostError.setVisible(false);\n \n }", "private void initilize()\n\t{\n\t\tdimXNet = project.getNoC().getNumRotX();\n\t\tdimYNet = project.getNoC().getNumRotY();\n\t\t\n\t\taddProperties();\n\t\taddComponents();\n\t\tsetVisible(true);\n\t}", "private void initialize() {\n\t\tjLabel3 = new JLabel();\n\t\tjLabel = new JLabel();\n\t\tthis.setLayout(null);\n\t\tthis.setBounds(new java.awt.Rectangle(0, 0, 486, 377));\n\t\tjLabel.setText(PluginServices.getText(this,\n\t\t\t\t\"Areas_de_influencia._Introduccion_de_datos\") + \":\");\n\t\tjLabel.setBounds(5, 20, 343, 21);\n\t\tjLabel3.setText(PluginServices.getText(this, \"Cobertura_de_entrada\")\n\t\t\t\t+ \":\");\n\t\tjLabel3.setBounds(6, 63, 190, 21);\n\t\tthis.add(jLabel, null);\n\t\tthis.add(jLabel3, null);\n\t\tthis.add(getLayersComboBox(), null);\n\t\tthis.add(getSelectedOnlyCheckBox(), null);\n\t\tthis.add(getMethodSelectionPanel(), null);\n\t\tthis.add(getResultSelectionPanel(), null);\n\t\tthis.add(getExtendedOptionsPanel(), null);\n\t\tconfButtonGroup();\n\t\tlayersComboBox.setSelectedIndex(0);\n\t\tinitSelectedItemsJCheckBox();\n\t\tdistanceBufferRadioButton.setSelected(true);\n\t\tlayerFieldsComboBox.setEnabled(false);\n\t\tverifyTypeBufferComboEnabled();\n\t}", "public Dashboard() {\n initComponents();\n// initComponents();\n build_GUI();\n }", "public void init() {\n //Execute a job on the event-dispatching thread; creating this applet's GUI.\n setSize(500, 150);\n \ttry {\n SwingUtilities.invokeAndWait(new Runnable() {\n public void run() {\n createGUI();\n }\n });\n } catch (Exception e) { \n System.err.println(\"createGUI didn't complete successfully\");\n }\n \n }", "public CustomerGUI() {\n\t initComponents();\n\t }", "private void createAndShowGUI (){\n\n JustawieniaPowitalne = new JUstawieniaPowitalne();\n }", "public mythologyBattleGui() {\n initComponents();\n labelClear();\n groupBoardArea();\n playBoard.initGame();\n initRan(18);\n }", "public void buildGui() {\n\t}", "private void initialize() {\r\n\t\t\r\n\t\tfinal List<Caixa> listaCaixa = new CaixaService(JPAUtil.createEntityManager()).getList();\r\n\t\t\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 321, 190);\r\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tfinal JComboBox cmbCaixa = new JComboBox();\r\n\t\tcmbCaixa.setBounds(10, 11, 285, 20);\r\n\t\tframe.getContentPane().add(cmbCaixa);\r\n\t\t\r\n\t\tString[] itensCombo = new String[listaCaixa.size()];\r\n\t\tfor(int i=0;i<listaCaixa.size();i++) {\r\n\t\t\titensCombo[i]=listaCaixa.get(i).getNome();\r\n\t\t}\r\n\t\t\r\n\t\tDefaultComboBoxModel<String> comboBoxModel = new DefaultComboBoxModel<String>(itensCombo);\r\n\t\tcmbCaixa.setModel(comboBoxModel);\r\n\t\t\r\n\t\t\r\n\t\tJButton btnVerTodos = new JButton(\"Ver todos os caixas\");\r\n\t\tbtnVerTodos.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tTelaCaixaVendaRelatorio tela = new TelaCaixaVendaRelatorio();\r\n\t\t\t\ttela.getFrame().setVisible(true);\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnVerTodos.setBounds(10, 117, 285, 23);\r\n\t\tframe.getContentPane().add(btnVerTodos);\r\n\t\t\r\n\t\tJButton btnVerCaixaSelecionado = new JButton(\"Ver caixa selecionado\");\r\n\t\tbtnVerCaixaSelecionado.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tTelaCaixaVendaRelatorio telaCaixaVendaRelatorio = new TelaCaixaVendaRelatorio(listaCaixa.get(cmbCaixa.getSelectedIndex()));\r\n\t\t\t\t\ttelaCaixaVendaRelatorio.getFrame().setVisible(true);\r\n\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnVerCaixaSelecionado.setBounds(10, 83, 285, 23);\r\n\t\tframe.getContentPane().add(btnVerCaixaSelecionado);\r\n\t}", "public PrincipalGUIOpcional() {\r\n initComponents();\r\n AtributosGUI.setColoresEstandar();\r\n codigoInicial();\r\n }", "public PropsGUI() {\n initComponents();\n }", "private void initComponents() {\n // Create the RGB and the HSB radio buttons.\n createRgbHsbButtons();\n\n \n \n ColorData initial = new ColorData(new RGB(255, 255, 255), 255);\n\n // Create the upper color wheel for the display.\n upperColorWheel = new ColorWheelComp(shell, this, upperWheelTitle);\n // upperColorWheel.setColor(colorArray.get(0));\n upperColorWheel.setColor(initial);\n\n // Create the color bar object that is displayed\n // in the middle of the dialog.\n colorBar = new ColorBarViewer(shell, this, sliderText, cmapParams);\n\n // Create the lower color wheel for the display.\n lowerColorWheel = new ColorWheelComp(shell, this, lowerWheelTitle);\n // lowerColorWheel.setColor(colorArray.get(colorArray.size() - 1));\n lowerColorWheel.setColor(initial);\n\n // Create the bottom control buttons.\n createBottomButtons();\n }", "public Gui() {\n\t\tsuper();\n\t\tinitGUI();\n\t}", "public User_gui() {\n initComponents();\n }", "public GUIRegistrationRest() {\n initComponents();\n setLocationRelativeTo(null);\n initIcons();\n }", "public AcudienteGUI() {\n initComponents();\n }", "private void initComponents() {\n LOOGER.info(\"Get init components\");\n this.loadButton = new JButton(\"Load\");\n this.fillButton = new JButton(\"Fill\");\n this.deleteButton = new JButton(\"Delete\");\n this.setLayout(new FlowLayout());\n LOOGER.info(\"components exit\");\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Libros() {\n initComponents();\n }", "public DatabaseGUI() {\n initComponents();\n refreshDatabaseTables();\n\n }", "private void init (){\n ///compoennetes\n // cuadros de texto\n txCodigo = new JTextField(10);\n txNombre = new JTextField(10);\n // etiquetas\n lbCodigo = new JLabel(\"codigo: \");\n lbNombre = new JLabel(\"nombre: \");\n // boton \n btAcpetar = new JButton(\"aceptar\");\n btAcpetar.setToolTipText(\"realizar insert\");\n btAcpetar.addActionListener(this);\n // paneles contenedores\n JPanel pCodigo = new JPanel();\n JPanel pNombre = new JPanel();\n // cambio de layout\n BoxLayout bx = new BoxLayout(this.getContentPane(), BoxLayout.PAGE_AXIS);\n this.setLayout(bx);\n // annadir a los paneles\n pCodigo.add(lbCodigo);\n pCodigo.add(txCodigo);\n pNombre.add(lbNombre);\n pNombre.add(txNombre);\n // annadir al dialogo\n add(pCodigo);\n add(pNombre);\n add(btAcpetar);\n }", "private void initGui() {\n initSeekBar();\n initDateFormatSpinner();\n GuiHelper.defineButtonOnClickListener(view, R.id.settings_buttonSave, this);\n\n }", "public mainpagee() {\n initComponents();\n }", "private void init() {\n List<Contructor> list = servisContructor.getAllContructors();\n for (Contructor prod : list) {\n contructor.add(new ContructorViewer(prod));\n }\n\n Label label = new Label(\"Catalog Contructors\");\n label.setLayoutX(140);\n label.setLayoutY(20);\n label.setStyle(\"-fx-font-size:20px\");\n\n initTable();\n table.setLayoutX(120);\n table.setLayoutY(60);\n table.setStyle(\"-fx-font-size:16px\");\n\n GridPane control = new ControlPanel(this, 2).getPanel();\n control.setLayoutX(120);\n control.setLayoutY(300);\n\n panel.setAlignment(Pos.CENTER);\n panel.add(label, 0, 0);\n panel.add(table, 0, 1);\n panel.add(control, 0, 2);\n }", "public Test_GUI() {\n initComponents();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public GUI_Edit_Tour(){\n init();\n }", "public ViewInvoicesGUI() {\n initComponents();\n updateDatabase();\n this.setLocationRelativeTo(null);\n \n }", "public ClientGUI() {\n initComponents();\n PopulateList();\n }", "public void initGui()\r\n\t{\r\n\t\tthis.viewportTexture = new DynamicTexture(256, 256);\r\n\t\tthis.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation(\"background\", this.viewportTexture);\r\n\t\tthis.widthCopyright = this.fontRenderer.getStringWidth(\"Copyright Mojang AB. Do not distribute!\");\r\n\t\tthis.widthCopyrightRest = this.width - this.widthCopyright - 2;\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(new Date());\r\n\r\n\t\tif (calendar.get(2) + 1 == 12 && calendar.get(5) == 24)\r\n\t\t{\r\n\t\t\tthis.splashText = \"Merry X-mas!\";\r\n\t\t}\r\n\t\telse if (calendar.get(2) + 1 == 1 && calendar.get(5) == 1)\r\n\t\t{\r\n\t\t\tthis.splashText = \"Happy new year!\";\r\n\t\t}\r\n\t\telse if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31)\r\n\t\t{\r\n\t\t\tthis.splashText = \"OOoooOOOoooo! Spooky!\";\r\n\t\t}\r\n\r\n\t\tint i = 24;\r\n\t\tint j = this.height / 4 + 48;\r\n\r\n\t\tif (this.mc.isDemo())\r\n\t\t{\r\n\t\t\tthis.addDemoButtons(j, 24);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.addSingleplayerMultiplayerButtons(j, 24);\r\n\t\t}\r\n\r\n\t\tthis.buttonList.add(new GuiButton(0, this.width / 2 - 100, j + 72 + 12, 98, 20, I18n.format(\"menu.options\")));\r\n\t\tthis.buttonList.add(new GuiButton(4, this.width / 2 + 2, j + 72 + 12, 98, 20, I18n.format(\"menu.quit\")));\r\n\r\n\t\tsynchronized (this.threadLock)\r\n\t\t{\r\n\t\t\tthis.openGLWarning1Width = this.fontRenderer.getStringWidth(this.openGLWarning1);\r\n\t\t\tthis.openGLWarning2Width = this.fontRenderer.getStringWidth(this.openGLWarning2);\r\n\t\t\tint k = Math.max(this.openGLWarning1Width, this.openGLWarning2Width);\r\n\t\t\tthis.openGLWarningX1 = (this.width - k) / 2;\r\n\t\t\tthis.openGLWarningY1 = (this.buttonList.get(0)).y - 24;\r\n\t\t\tthis.openGLWarningX2 = this.openGLWarningX1 + k;\r\n\t\t\tthis.openGLWarningY2 = this.openGLWarningY1 + 24;\r\n\t\t}\r\n\r\n\t\tthis.mc.setConnectedToRealms(false);\r\n\r\n\t\tif (Minecraft.getMinecraft().gameSettings.getOptionOrdinalValue(GameSettings.Options.REALMS_NOTIFICATIONS) && !this.hasCheckedForRealmsNotification)\r\n\t\t{\r\n\t\t\tRealmsBridge realmsbridge = new RealmsBridge();\r\n\t\t\tthis.realmsNotification = realmsbridge.getNotificationScreen(this);\r\n\t\t\tthis.hasCheckedForRealmsNotification = true;\r\n\t\t}\r\n\r\n\t\tif (this.areRealmsNotificationsEnabled())\r\n\t\t{\r\n\t\t\tthis.realmsNotification.setGuiSize(this.width, this.height);\r\n\t\t\tthis.realmsNotification.initGui();\r\n\t\t}\r\n\t}", "public studentGUI() {\n\t\ttry {\n\t\t\tinitialize();\n\t\t} catch (AccessException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (NotBoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialize() {\n\t\tthis.setSize(430, 280);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setUndecorated(true);\n\t\tthis.setModal(true);\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setTitle(\"Datos del Invitado\");\n\t\tthis.addComponentListener(this);\n\t}", "private void myInit() {\n\n// System.setProperty(\"pool_host\", \"localhost\");\n// System.setProperty(\"pool_db\", \"db_cis_cosca\");\n// System.setProperty(\"pool_password\", \"password\");\n\n// MyUser.setUser_id(\"2\");\n tf_search.grabFocus();\n jPanel7.setVisible(false);\n init_key();\n hover();\n search();\n init();\n init_tbl_users();\n\n focus();\n jLabel3.setVisible(false);\n cb_lvl.setVisible(false);\n jPanel2.setVisible(false);\n\n init_tbl_user_default_previleges();\n data_cols_default();\n init_tbl_user_default_priveleges(tbl_user_default_priveleges);\n\n init_tbl_user_previleges();\n init_tbl_user_default_previlege_others(tbl_user_default_previlege_others);\n Field.Combo cb = (Field.Combo) tf_from_location1;\n cb.setText(\"Transactions\");\n cb.setId(\"1\");\n\n data_cols();\n }", "private void initialize() {\n\t\tfrmHipermercadoGuadalquivir = new JFrame();\n\n\t\tfrmHipermercadoGuadalquivir.addWindowListener(new WindowAdapter() {\n\n\t\t\t@Override\n\t\t\tpublic void windowClosing(WindowEvent arg0) {\n\t\t\t\tfrmHipermercadoGuadalquivir\n\t\t\t\t\t\t.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);\n\t\t\t\tsalir();\n\t\t\t}\n\t\t});\n\t\tfrmHipermercadoGuadalquivir.setResizable(false);\n\n\t\tfrmHipermercadoGuadalquivir.setIconImage(Toolkit.getDefaultToolkit()\n\t\t\t\t.getImage(PrincipalGUI.class.getResource(\"/img/icono.png\")));\n\t\tfrmHipermercadoGuadalquivir.getContentPane().setBackground(Color.WHITE);\n\t\tfrmHipermercadoGuadalquivir.setTitle(\"Hipermercado Guadalquivir\");\n\t\tfrmHipermercadoGuadalquivir.setBounds(100, 100, 457, 319);\n\t\tfrmHipermercadoGuadalquivir\n\t\t\t\t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tJMenuBar menuBar = new JMenuBar();\n\t\tfrmHipermercadoGuadalquivir.setJMenuBar(menuBar);\n\n\t\tJMenu mnInicio = new JMenu(\"Inicio\");\n\t\tmenuBar.add(mnInicio);\n\n\t\tJMenuItem mntmNuevo = new JMenuItem(\"Nuevo\");\n\t\tmntmNuevo.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/nuevo.png\")));\n\t\tmntmNuevo.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tnuevo();\n\t\t\t}\n\t\t});\n\t\tmnInicio.add(mntmNuevo);\n\n\t\tJMenuItem mntmAbrir = new JMenuItem(\"Abrir\");\n\t\tmntmAbrir.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/abrir.png\")));\n\t\tmntmAbrir.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tabrir();\n\t\t\t}\n\t\t});\n\t\tmnInicio.add(mntmAbrir);\n\n\t\tJMenuItem mntmGuardar = new JMenuItem(\"Guardar\");\n\t\tmntmGuardar.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/guardar.png\")));\n\t\tmntmGuardar.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tguardar();\n\t\t\t}\n\t\t});\n\t\tmnInicio.add(mntmGuardar);\n\n\t\tJMenuItem mntmGuardarComo = new JMenuItem(\"Guardar como\");\n\t\tmntmGuardarComo.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/guardarcomo.jpg\")));\n\t\tmntmGuardarComo.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tguardarComo();\n\t\t\t}\n\t\t});\n\t\tmnInicio.add(mntmGuardarComo);\n\n\t\tJSeparator separator = new JSeparator();\n\t\tmnInicio.add(separator);\n\n\t\tJMenuItem mntmSalir = new JMenuItem(\"Salir\");\n\t\tmntmSalir.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/salir.jpg\")));\n\t\tmntmSalir.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tsalir();\n\t\t\t}\n\t\t});\n\t\tmnInicio.add(mntmSalir);\n\n\t\tJMenu mnComercio = new JMenu(\"Comercio\");\n\t\tmenuBar.add(mnComercio);\n\n\t\tJMenuItem mntmAadirProducto = new JMenuItem(\"Comprar productos\");\n\t\tmntmAadirProducto.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tComprarProductos comprarproductos = new ComprarProductos();\n\t\t\t\tcomprarproductos.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tmntmAadirProducto.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C,\n\t\t\t\tInputEvent.CTRL_MASK));\n\t\tmntmAadirProducto.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/comprar.png\")));\n\t\tmnComercio.add(mntmAadirProducto);\n\n\t\tJMenuItem mntmVenderProductos = new JMenuItem(\"Vender productos\");\n\t\tmntmVenderProductos.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif (General.hipermercado.size() == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frmHipermercadoGuadalquivir,\n\t\t\t\t\t\t\t\"Hipermercado vacio\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tVenderProducto venderproducto = new VenderProducto();\n\t\t\t\t\tvenderproducto.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmntmVenderProductos.setAccelerator(KeyStroke.getKeyStroke(\n\t\t\t\tKeyEvent.VK_V, InputEvent.CTRL_MASK));\n\t\tmntmVenderProductos.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/vender.png\")));\n\t\tmnComercio.add(mntmVenderProductos);\n\n\t\tJMenu mnVisor = new JMenu(\"B\\u00FAsqueda\");\n\t\tmenuBar.add(mnVisor);\n\n\t\tJMenuItem mntmMostrarHipermercado = new JMenuItem(\n\t\t\t\t\"Mostrar Hipermercado\");\n\t\tmntmMostrarHipermercado.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (General.hipermercado.size() == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frmHipermercadoGuadalquivir,\n\t\t\t\t\t\t\t\"Hipermercado vacio\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tMostrarHipermercado mostrar = new MostrarHipermercado();\n\t\t\t\t\tmostrar.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmntmMostrarHipermercado.setAccelerator(KeyStroke.getKeyStroke(\n\t\t\t\tKeyEvent.VK_M, InputEvent.CTRL_MASK));\n\t\tmntmMostrarHipermercado.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/mostrar.png\")));\n\t\tmnVisor.add(mntmMostrarHipermercado);\n\n\t\tJMenu mnPorZona = new JMenu(\"Por Zona\");\n\t\tmnPorZona.setMnemonic('Z');\n\t\tmnPorZona.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/zonas.png\")));\n\t\tmnVisor.add(mnPorZona);\n\n\t\tJMenuItem mntmDeportes = new JMenuItem(\"Ropa\");\n\t\tmntmDeportes.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (General.hipermercado.size() == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frmHipermercadoGuadalquivir,\n\t\t\t\t\t\t\t\"Hipermercado vacio\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tVerRopa verropa = new VerRopa();\n\t\t\t\t\tverropa.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmntmDeportes.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/ropa.gif\")));\n\t\tmnPorZona.add(mntmDeportes);\n\n\t\tJMenuItem mntmTecnologa = new JMenuItem(\"Tecnolog\\u00EDa\");\n\t\tmntmTecnologa.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (General.hipermercado.size() == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frmHipermercadoGuadalquivir,\n\t\t\t\t\t\t\t\"Hipermercado vacio\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tVerTecnologia vertecnologia = new VerTecnologia();\n\t\t\t\t\tvertecnologia.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmntmTecnologa.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/tecnologia.gif\")));\n\t\tmnPorZona.add(mntmTecnologa);\n\n\t\tJMenuItem mntmAlimentacin = new JMenuItem(\"Alimentaci\\u00F3n\");\n\t\tmntmAlimentacin.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif (General.hipermercado.size() == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frmHipermercadoGuadalquivir,\n\t\t\t\t\t\t\t\"Hipermercado vacio\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tVerAlimentacion veralimentacion = new VerAlimentacion();\n\t\t\t\t\tveralimentacion.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmntmAlimentacin.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/alimentacion.png\")));\n\t\tmnPorZona.add(mntmAlimentacin);\n\n\t\tJMenuItem mntmFrutera = new JMenuItem(\"Fruter\\u00EDa\");\n\t\tmntmFrutera.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (General.hipermercado.size() == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frmHipermercadoGuadalquivir,\n\t\t\t\t\t\t\t\"Hipermercado vacio\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tVerFruteria verfruteria = new VerFruteria();\n\t\t\t\t\tverfruteria.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmntmFrutera.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/fruteria.png\")));\n\t\tmnPorZona.add(mntmFrutera);\n\n\t\tJMenuItem mntmVideojuegos = new JMenuItem(\"Videojuegos\");\n\t\tmntmVideojuegos.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (General.hipermercado.size() == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frmHipermercadoGuadalquivir,\n\t\t\t\t\t\t\t\"Hipermercado vacio\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tVerVideojuegos vervideojuegos = new VerVideojuegos();\n\t\t\t\t\tvervideojuegos.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmntmVideojuegos.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/videojuegos.png\")));\n\t\tmnPorZona.add(mntmVideojuegos);\n\n\t\tJMenuItem mntmPorCdigoDe = new JMenuItem(\"Por c\\u00F3digo de barras\");\n\t\tmntmPorCdigoDe.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif (General.hipermercado.size() == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frmHipermercadoGuadalquivir,\n\t\t\t\t\t\t\t\"Hipermercado vacio\", \"Error\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tBuscarArticulo buscararticulo = new BuscarArticulo();\n\t\t\t\t\tbuscararticulo.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmntmPorCdigoDe.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/codigobarras.jpg\")));\n\t\tmnVisor.add(mntmPorCdigoDe);\n\n\t\tJMenu mnAyuda = new JMenu(\"Ayuda\");\n\t\tmenuBar.add(mnAyuda);\n\n\t\tJMenuItem mntmVerLaAyuda = new JMenuItem(\"Ver la ayuda\");\n\t\tmntmVerLaAyuda.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/ayuda.jpeg\")));\n\t\tmntmVerLaAyuda.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tayuda.setVisible(true);\n\n\t\t\t}\n\t\t});\n\n\t\tJMenuItem mntmAcercaDe = new JMenuItem(\"Acerca De\");\n\t\tmntmAcercaDe.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tacercade.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tmnAyuda.add(mntmAcercaDe);\n\t\tmnAyuda.add(mntmVerLaAyuda);\n\t\tfrmHipermercadoGuadalquivir.getContentPane().setLayout(\n\t\t\t\tnew BorderLayout(0, 0));\n\n\t\tJPanel panel = new JPanel();\n\t\tfrmHipermercadoGuadalquivir.getContentPane().add(panel,\n\t\t\t\tBorderLayout.NORTH);\n\t\tFlowLayout fl_panel = new FlowLayout(FlowLayout.LEFT, 5, 5);\n\t\tpanel.setLayout(fl_panel);\n\n\t\tJButton button_1 = new JButton(\"\");\n\t\tbutton_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tnuevo();\n\t\t\t}\n\t\t});\n\t\tbutton_1.setToolTipText(\"Nuevo\");\n\t\tbutton_1.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/nuevo.png\")));\n\t\tpanel.add(button_1);\n\n\t\tJButton btnNewButton = new JButton(\"\");\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tabrir();\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setToolTipText(\"Abrir\");\n\t\tbtnNewButton.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/abrir.png\")));\n\t\tpanel.add(btnNewButton);\n\n\t\tJButton btnNewButton_1 = new JButton(\"\");\n\t\tbtnNewButton_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tguardar();\n\t\t\t}\n\t\t});\n\t\tbtnNewButton_1.setToolTipText(\"Guardar\");\n\t\tbtnNewButton_1.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/guardar.png\")));\n\t\tpanel.add(btnNewButton_1);\n\n\t\tJButton btnNewButton_2 = new JButton(\"\");\n\t\tbtnNewButton_2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tguardarComo();\n\t\t\t}\n\t\t});\n\t\tbtnNewButton_2.setToolTipText(\"Guardar Como\");\n\t\tbtnNewButton_2.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/guardarcomo.jpg\")));\n\t\tpanel.add(btnNewButton_2);\n\n\t\tJButton button = new JButton(\"\");\n\t\tbutton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tsalir();\n\t\t\t}\n\t\t});\n\t\tbutton.setToolTipText(\"Salir\");\n\t\tbutton.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/salir.jpg\")));\n\t\tpanel.add(button);\n\n\t\tJPanel panel_1 = new JPanel();\n\t\tpanel_1.setBackground(Color.WHITE);\n\t\tfrmHipermercadoGuadalquivir.getContentPane().add(panel_1,\n\t\t\t\tBorderLayout.CENTER);\n\t\tpanel_1.setLayout(null);\n\n\t\tJLabel label = new JLabel(\"\");\n\t\tlabel.setIcon(new ImageIcon(PrincipalGUI.class\n\t\t\t\t.getResource(\"/img/logo.png\")));\n\t\tlabel.setBounds(58, 11, 431, 260);\n\t\tpanel_1.add(label);\n\t}", "public FrameIntroGUI() {\n\t\ttry {\n\t\t\tjbInit();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initComponents() {\n\n\t\tkDefLabel = new javax.swing.JLabel();\n\t\tjSeparator1 = new javax.swing.JSeparator();\n\t\tcancelButton = new javax.swing.JButton();\n\t\tkLabel = new javax.swing.JLabel();\n\t\tsaveButton = new javax.swing.JButton();\n\t\tTitleLabel = new javax.swing.JLabel();\n\t\tjSeparator2 = new javax.swing.JSeparator();\n\t\tkTextField = new javax.swing.JTextField();\n\t\tkLabel1 = new javax.swing.JLabel();\n\t\tkTextField1 = new javax.swing.JTextField();\n\t\tkDefLabel1 = new javax.swing.JLabel();\n\n\t\t//setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\t\tsetTitle(\"Configuración de Algoritmo\");\n\n\t\tkDefLabel.setText(\"(default = 10)\");\n\n\t\tcancelButton.setText(\"Cancelar\");\n\t\tcancelButton.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdispose();\n\t\t\t}\n\t\t});\n\n\t\tkLabel.setText(\"Número de reglas a buscar:\");\n\n\t\tkLabel1.setText(\"Confianza mínima de una regla: \");\n\n\t\tsaveButton.setText(\"Guardar\");\n\t\tsaveButton.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tGlobalData.getInstance().setCurrentTechnique(FuzzyDataMining.MODEL_FUZZY_APRIORI);\n\t\t\t\tHashMap<String, Object> options = new HashMap<String, Object>();\n\t\t\t\tif(!kTextField.getText().isEmpty())\n\t\t\t\t\toptions.put(\"nr\", kTextField.getText());\n\t\t\t\telse\n\t\t\t\t\toptions.put(\"nr\", \"10\");\n\t\t\t\tif(!kTextField1.getText().isEmpty())\n\t\t\t\t\toptions.put(\"mc\", kTextField1.getText());\n\t\t\t\telse\n\t\t\t\t\toptions.put(\"mc\", \"0.9\");\n\t\t\t\tGlobalData.getInstance().setConfiguredTechnique(options);\n\t\t\t\tdispose();\n\t\t\t}\n\t\t});\n\n\t\tTitleLabel.setText(\"Configuración de Apriori Difuso\");\n\n\t\tkDefLabel1.setText(\"(default = 0.9)\");\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n\t\tgetContentPane().setLayout(layout);\n\t\tlayout.setHorizontalGroup(\n\t\t\t\tlayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addComponent(jSeparator1)\n\t\t\t\t\t\t\t\t\t\t.addContainerGap())\n\t\t\t\t\t\t\t\t\t\t.addComponent(TitleLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(kLabel1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(kLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(kTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(kDefLabel1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(kTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(kDefLabel)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(0, 9, Short.MAX_VALUE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(jSeparator2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addContainerGap())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(0, 0, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(saveButton)\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.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(cancelButton)\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.addContainerGap())))\n\t\t\t\t);\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n\t\t\t\t.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t.addComponent(TitleLabel)\n\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n\t\t\t\t\t\t\t\t.addComponent(kLabel)\n\t\t\t\t\t\t\t\t.addComponent(kTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(kDefLabel))\n\t\t\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(kLabel1)\n\t\t\t\t\t\t\t\t\t\t.addComponent(kTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(kDefLabel1))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(cancelButton)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(saveButton))\n\t\t\t\t\t\t\t\t\t\t\t\t.addContainerGap())\n\t\t\t\t);\n\n\t\tpack();\n\t}", "private void initialize() {\r\n\r\n\t\tfrmHistoriasDeZagas = new JFrame();\r\n\t\tfrmHistoriasDeZagas.getContentPane().setBackground(Color.BLACK);\r\n\t\tfrmHistoriasDeZagas.setTitle(\"Historias de Zagas\");\r\n\t\tfrmHistoriasDeZagas.setBackground(Color.WHITE);\r\n\t\tfrmHistoriasDeZagas\r\n\t\t\t\t.setIconImage(Toolkit\r\n\t\t\t\t\t\t.getDefaultToolkit()\r\n\t\t\t\t\t\t.getImage(\r\n\t\t\t\t\t\t\t\tArmas.class\r\n\t\t\t\t\t\t\t\t\t\t.getResource(\"/images/Historias de Zagas, logo.png\")));\r\n\t\tfrmHistoriasDeZagas.setBounds(100, 100, 439, 462);\r\n\t\tfrmHistoriasDeZagas.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);\r\n\t\tfrmHistoriasDeZagas.getContentPane().setLayout(null);\r\n\t\tfrmHistoriasDeZagas.setLocationRelativeTo(null);\r\n\t\tfrmHistoriasDeZagas.setResizable(false);\r\n\r\n\t\tfinal JButton btnNewButton = new JButton(\"JUGAR\");\r\n\t\tif (Loader.usuario.equals(\"\")) {\r\n\t\t\tbtnNewButton.setEnabled(false);\r\n\r\n\t\t}\r\n\t\tbtnNewButton.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tJugar window = new Jugar();\r\n\t\t\t\twindow.getFrmHistoriasDeZagas().setVisible(true);\r\n\t\t\t\tfrmHistoriasDeZagas.dispose();\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tbtnNewButton.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\t\tbtnNewButton.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbtnNewButton.setBorder(new BevelBorder(BevelBorder.RAISED, null, null,\r\n\t\t\t\tnull, null));\r\n\t\tbtnNewButton.setForeground(Color.WHITE);\r\n\t\tbtnNewButton.setBackground(new Color(139, 69, 19));\r\n\t\tbtnNewButton.setFont(mf.MyFont(0, 17));\r\n\t\tbtnNewButton.setBounds(10, 51, 414, 34);\r\n\t\tbtnNewButton.setBorderPainted(false);\r\n\t\tbtnNewButton.setContentAreaFilled(false);\r\n\t\tbtnNewButton.setFocusPainted(false);\r\n\t\tbtnNewButton.setOpaque(false);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnNewButton);\r\n\t\tbtnNewButton.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tbtnNewButton.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\tbtnNewButton.addMouseListener(new MouseAdapter() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\t\t\tbtnNewButton.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\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\tfinal JButton btnCreadorDeNpcs = new JButton(\"CREADOR DE NPCs\");\r\n\t\tbtnCreadorDeNpcs.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\r\n\t\t\t\tStartNPC.atrpoints = new AtributePoints();\r\n\t\t\t\tStartNPC.skpoints = new SkillPoints();\r\n\t\t\t\tStartNPC.atributos = new Atributes(StartNPC.atrpoints);\r\n\t\t\t\tStartNPC.combatSkills = new CombatSkills(StartNPC.skpoints);\r\n\t\t\t\tStartNPC.knowledgeSkills = new KnowledgeSkills(\r\n\t\t\t\t\t\tStartNPC.skpoints);\r\n\t\t\t\tStartNPC.magicSkills = new MagicSkills(StartNPC.skpoints);\r\n\t\t\t\tStartNPC.knowhowSkills = new KnowHowSkills(StartNPC.skpoints);\r\n\t\t\t\tBlessing blessing = new Blessing(\"\");\r\n\t\t\t\tSetbacks setbacks = new Setbacks();\r\n\t\t\t\tPrivileges privileges = new Privileges();\r\n\t\t\t\tRace race = new Race(\"\");\r\n\t\t\t\tEquipment equipment = new Equipment();\r\n\t\t\t\tArrayList<String> posarm = new ArrayList<String>();\r\n\t\t\t\tPossesions posss = new Possesions(posarm);\r\n\t\t\t\tArmor armor = new Armor(\"\", \"\", false,false, posss);\r\n\t\t\t\tStartNPC.character = new Characters(null, race, \"\", 0, 2, 10,\r\n\t\t\t\t\t\t20, 20, StartNPC.atributos, StartNPC.combatSkills,\r\n\t\t\t\t\t\tStartNPC.knowledgeSkills, StartNPC.magicSkills,\r\n\t\t\t\t\t\tStartNPC.knowhowSkills, blessing, privileges, setbacks,\r\n\t\t\t\t\t\tfalse, armor, equipment,null,null,null,null,null,null,null,null,null,null,null,null, 0, 1,0,\"\",\"\",\"\");\r\n\t\t\t\tfrmHistoriasDeZagas.dispose();\r\n\t\t\t\tStartNPC window;\r\n\t\t\t\ttry {\r\n\t\t\t\t\twindow = new StartNPC();\r\n\t\t\t\t\twindow.getFrmHistoriasDeZagas().setVisible(true);\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnCreadorDeNpcs.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tbtnCreadorDeNpcs.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\tbtnCreadorDeNpcs.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnCreadorDeNpcs.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\r\n\t\tbtnCreadorDeNpcs.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbtnCreadorDeNpcs.setBorder(new BevelBorder(BevelBorder.RAISED, null,\r\n\t\t\t\tnull, null, null));\r\n\t\tbtnCreadorDeNpcs.setForeground(Color.WHITE);\r\n\t\tbtnCreadorDeNpcs.setBackground(new Color(139, 69, 19));\r\n\t\tbtnCreadorDeNpcs.setFont(mf.MyFont(0, 17));\r\n\t\tbtnCreadorDeNpcs.setBounds(10, 141, 414, 34);\r\n\t\tbtnCreadorDeNpcs.setBorderPainted(false);\r\n\t\tbtnCreadorDeNpcs.setContentAreaFilled(false);\r\n\t\tbtnCreadorDeNpcs.setFocusPainted(false);\r\n\t\tbtnCreadorDeNpcs.setOpaque(false);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnCreadorDeNpcs);\r\n\r\n\t\tfinal JButton btnCreadorDePersonajes = new JButton(\r\n\t\t\t\t\"CREADOR DE PERSONAJES\");\r\n\t\tbtnCreadorDePersonajes.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tbtnCreadorDePersonajes.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\tbtnCreadorDePersonajes.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnCreadorDePersonajes.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\t\tbtnCreadorDePersonajes.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbtnCreadorDePersonajes.setBorder(new BevelBorder(BevelBorder.RAISED,\r\n\t\t\t\tnull, null, null, null));\r\n\t\tbtnCreadorDePersonajes.setForeground(Color.WHITE);\r\n\t\tbtnCreadorDePersonajes.setBackground(new Color(139, 69, 19));\r\n\t\tbtnCreadorDePersonajes.setBorderPainted(false);\r\n\t\tbtnCreadorDePersonajes.setContentAreaFilled(false);\r\n\t\tbtnCreadorDePersonajes.setFocusPainted(false);\r\n\t\tbtnCreadorDePersonajes.setOpaque(false);\r\n\t\tbtnCreadorDePersonajes.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tcrear = \"pj\";\r\n\t\t\t\tStart.atrpoints = new AtributePoints();\r\n\t\t\t\tStart.skpoints = new SkillPoints();\r\n\t\t\t\tStart.atributos = new Atributes(Start.atrpoints);\r\n\t\t\t\tStart.combatSkills = new CombatSkills(Start.skpoints);\r\n\t\t\t\tStart.knowledgeSkills = new KnowledgeSkills(Start.skpoints);\r\n\t\t\t\tStart.magicSkills = new MagicSkills(Start.skpoints);\r\n\t\t\t\tStart.knowhowSkills = new KnowHowSkills(Start.skpoints);\r\n\t\t\t\tBlessing blessing = new Blessing(\"\");\r\n\t\t\t\tSetbacks setbacks = new Setbacks();\r\n\t\t\t\tPrivileges privileges = new Privileges();\r\n\t\t\t\tRace race = new Race(\"\");\r\n\t\t\t\tEquipment equipment = new Equipment();\r\n\t\t\t\tArrayList<String> posarm = new ArrayList<String>();\r\n\t\t\t\tPossesions posss = new Possesions(posarm);\r\n\t\t\t\tArmor armor = new Armor(\"\", \"\", false,false, posss);\r\n\t\t\t\tStart.character = new Characters(null, race, \"\", 0, 2, 10, 20,\r\n\t\t\t\t\t\t20, Start.atributos, Start.combatSkills,\r\n\t\t\t\t\t\tStart.knowledgeSkills, Start.magicSkills,\r\n\t\t\t\t\t\tStart.knowhowSkills, blessing, privileges, setbacks,\r\n\t\t\t\t\t\tfalse, armor, equipment,null,null,null,null,null,null,null,null,null,null,null,null, 0, 1,0,\"\",\"\",\"\");\r\n\t\t\t\tfrmHistoriasDeZagas.dispose();\r\n\t\t\t\tStart window;\r\n\t\t\t\ttry {\r\n\t\t\t\t\twindow = new Start();\r\n\t\t\t\t\twindow.getFrmHistoriasDeZagas().setVisible(true);\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnCreadorDePersonajes.setFont(mf.MyFont(0, 17));\r\n\t\tbtnCreadorDePersonajes.setBounds(10, 186, 414, 34);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnCreadorDePersonajes);\r\n\r\n\t\tfinal JButton btnCreditos = new JButton(\"CRÉDITOS\");\r\n\t\tbtnCreditos.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tbtnCreditos.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\tbtnCreditos.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnCreditos.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\t\tbtnCreditos.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbtnCreditos.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tCreditos window = new Creditos();\r\n\t\t\t\twindow.getFrame().setVisible(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfinal JButton btnHistoria = new JButton(\"GESTOR DE PARTIDAS\");\r\n\t\tbtnHistoria.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t\r\n\t\t\t\tGestorMain window = new GestorMain();\r\n\t\t\t\twindow.getFrmHistoriasDeZagas().setVisible(true);\r\n\t\t\t\tfrmHistoriasDeZagas.dispose();\r\n\r\n\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnHistoria.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\r\n\t\t\t\tbtnHistoria.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\r\n\t\t\t\tbtnHistoria.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnHistoria.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbtnHistoria.setOpaque(false);\r\n\t\tbtnHistoria.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\t\tbtnHistoria.setForeground(Color.WHITE);\r\n\t\tbtnHistoria.setFont(mf.MyFont(0, 17));\r\n\t\tbtnHistoria.setFocusPainted(false);\r\n\t\tbtnHistoria.setContentAreaFilled(false);\r\n\t\tbtnHistoria.setBorderPainted(false);\r\n\t\tbtnHistoria.setBorder(new BevelBorder(BevelBorder.RAISED, null, null,\r\n\r\n\t\tnull, null));\r\n\t\tbtnHistoria.setBackground(new Color(139, 69, 19));\r\n\t\tbtnHistoria.setBounds(10, 96, 414, 34);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnHistoria);\r\n\t\tbtnCreditos.setBorder(new BevelBorder(BevelBorder.RAISED, null, null,\r\n\t\t\t\tnull, null));\r\n\t\tbtnCreditos.setForeground(Color.WHITE);\r\n\t\tbtnCreditos.setBackground(new Color(139, 69, 19));\r\n\t\tbtnCreditos.setFont(mf.MyFont(0, 17));\r\n\t\tbtnCreditos.setBounds(10, 321, 414, 34);\r\n\t\tbtnCreditos.setBorderPainted(false);\r\n\t\tbtnCreditos.setContentAreaFilled(false);\r\n\t\tbtnCreditos.setFocusPainted(false);\r\n\t\tbtnCreditos.setOpaque(false);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnCreditos);\r\n\r\n\t\tfinal JButton button = new JButton(\"SALIR\");\r\n\t\tbutton.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tbutton.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\tbutton.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\t\t}\r\n\t\t});\r\n\t\tbutton.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\t\tbutton.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tint seleccion = JOptionPane.showOptionDialog(\r\n\t\t\t\t\t\tfrmHistoriasDeZagas,\r\n\t\t\t\t\t\t\"¿Estás seguro de querer cerrar el programa?.\",\r\n\t\t\t\t\t\t\"¡Atención!\", JOptionPane.YES_NO_OPTION,\r\n\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE, null, new Object[] { \"Si\",\r\n\t\t\t\t\t\t\t\t\"No\" }, // null para YES, NO y CANCEL\r\n\t\t\t\t\t\t\"opcion 1\");\r\n\t\t\t\tif (JOptionPane.YES_OPTION == seleccion) {\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\ttxtBienvenidoSeleccioneA = new JLabel();\r\n\t\ttxtBienvenidoSeleccioneA.setOpaque(false);\r\n\t\ttxtBienvenidoSeleccioneA.setForeground(Color.WHITE);\r\n\t\ttxtBienvenidoSeleccioneA.setBackground(new Color(205, 133, 63));\r\n\t\ttxtBienvenidoSeleccioneA.setBorder(null);\r\n\t\ttxtBienvenidoSeleccioneA.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\ttxtBienvenidoSeleccioneA.setFont(mf.MyFont(0, 13));\r\n\t\ttxtBienvenidoSeleccioneA\r\n\t\t\t\t.setText(\"Bienvenido, seleccione a qué servicio desea acceder.\");\r\n\t\ttxtBienvenidoSeleccioneA.setBounds(0, 0, 444, 40);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(txtBienvenidoSeleccioneA);\r\n\t\tbutton.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbutton.setOpaque(false);\r\n\t\tbutton.setForeground(Color.WHITE);\r\n\t\tbutton.setFont(mf.MyFont(0, 17));\r\n\t\tbutton.setFocusPainted(false);\r\n\t\tbutton.setContentAreaFilled(false);\r\n\t\tbutton.setBorderPainted(false);\r\n\t\tbutton.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null,\r\n\t\t\t\tnull));\r\n\t\tbutton.setBackground(new Color(139, 69, 19));\r\n\t\tbutton.setBounds(10, 366, 414, 34);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(button);\r\n\r\n\t\tfinal JButton btnAyuda = new JButton(\"AYUDA\");\r\n\t\tbtnAyuda.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tAyudaPrincipal window = new AyudaPrincipal();\r\n\t\t\t\twindow.getFrame().setVisible(true);\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnAyuda.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\r\n\t\t\t\tbtnAyuda.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\r\n\t\t\t\tbtnAyuda.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnAyuda.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbtnAyuda.setOpaque(false);\r\n\t\tbtnAyuda.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\t\tbtnAyuda.setForeground(Color.WHITE);\r\n\t\tbtnAyuda.setFont(mf.MyFont(0, 17));\r\n\t\tbtnAyuda.setFocusPainted(false);\r\n\t\tbtnAyuda.setContentAreaFilled(false);\r\n\t\tbtnAyuda.setBorderPainted(false);\r\n\t\tbtnAyuda.setBorder(new BevelBorder(BevelBorder.RAISED, null, null,\r\n\r\n\t\tnull, null));\r\n\t\tbtnAyuda.setBackground(new Color(139, 69, 19));\r\n\t\tbtnAyuda.setBounds(10, 276, 414, 34);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnAyuda);\r\n\r\n\t\tfinal JButton btnPerfil = new JButton(\"PERFIL\");\r\n\t\tif (Loader.usuario.equals(\"\")) {\r\n\t\t\tbtnPerfil.setEnabled(false);\r\n\r\n\t\t}\r\n\t\tbtnPerfil.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tbtnPerfil.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\r\n\t\t\t}\r\n\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\tbtnPerfil.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnPerfil.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfrmHistoriasDeZagas.dispose();\r\n\t\t\t\t\tPerfil window = new Perfil();\r\n\t\t\t\t\twindow.getFrmHistoriasDeZagas().setVisible(true);\r\n\t\t\t\t} catch (ClassNotFoundException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t} catch (InstantiationException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t} catch (IllegalAccessException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnPerfil.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbtnPerfil.setOpaque(false);\r\n\t\tbtnPerfil.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\t\tbtnPerfil.setForeground(Color.WHITE);\r\n\t\tbtnPerfil.setFont(mf.MyFont(0, 17));\r\n\t\tbtnPerfil.setFocusPainted(false);\r\n\t\tbtnPerfil.setContentAreaFilled(false);\r\n\t\tbtnPerfil.setBorderPainted(false);\r\n\t\tbtnPerfil.setBorder(new BevelBorder(BevelBorder.RAISED, null, null,\r\n\r\n\t\tnull, null));\r\n\t\tbtnPerfil.setBackground(new Color(139, 69, 19));\r\n\t\tbtnPerfil.setBounds(10, 231, 414, 34);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnPerfil);\r\n\r\n\t\tfinal JButton btnAdministracin = new JButton(\"ADMINISTRACI\\u00D3N\");\r\n\t\tbtnAdministracin.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\r\n\t\t\t\tAdministracionPrinc window = new AdministracionPrinc();\r\n\t\t\t\twindow.getFrame().setVisible(true);\r\n\t\t\t\tfrmHistoriasDeZagas.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnAdministracin.setVisible(false);\r\n\t\tbtnAdministracin.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tbtnAdministracin.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio2.png\")));\r\n\t\t\t}\r\n\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\tbtnAdministracin.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnAdministracin.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/botonesInicio.png\")));\r\n\t\tbtnAdministracin.setOpaque(false);\r\n\t\tbtnAdministracin.setHorizontalTextPosition(SwingConstants.CENTER);\r\n\t\tbtnAdministracin.setForeground(Color.WHITE);\r\n\t\tbtnAdministracin.setFont(mf.MyFont(0, 17));\r\n\t\tbtnAdministracin.setFocusPainted(false);\r\n\t\tbtnAdministracin.setContentAreaFilled(false);\r\n\t\tbtnAdministracin.setBorderPainted(false);\r\n\t\tbtnAdministracin.setBorder(new BevelBorder(BevelBorder.RAISED, null,\r\n\t\t\t\tnull,\r\n\r\n\t\t\t\tnull, null));\r\n\t\tbtnAdministracin.setBackground(new Color(139, 69, 19));\r\n\t\tbtnAdministracin.setBounds(10, 321, 414, 34);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnAdministracin);\r\n\t\r\n\r\n\t\tfinal JButton btnNewButton_1 = new JButton(\"(Desconectar)\");\r\n\t\t\r\n\t\tbtnNewButton_1.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\r\n\t\t\t\tint seleccion = JOptionPane.showOptionDialog(\r\n\t\t\t\t\t\tfrmHistoriasDeZagas,\r\n\t\t\t\t\t\t\"¿Estás seguro de querer desconectarte?.\",\r\n\t\t\t\t\t\t\"¡Atención!\", JOptionPane.YES_NO_OPTION,\r\n\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE, null, new Object[] { \"Si\",\r\n\t\t\t\t\t\t\t\t\"No\" }, // null para YES, NO y CANCEL\r\n\t\t\t\t\t\t\"opcion 1\");\r\n\t\t\t\tif (JOptionPane.YES_OPTION == seleccion) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tif (Loader.usuario.length() == 0) {\r\n\t\t\t\t\t\t\tfrmHistoriasDeZagas.dispose();\r\n\t\t\t\t\t\t\tLoader window = new Loader();\r\n\t\t\t\t\t\t\twindow.getFrmHistoriasDeZagas().setVisible(true);\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\tLoader.usuario = \"\";\r\n\t\t\t\t\t\t\tfrmHistoriasDeZagas.dispose();\r\n\t\t\t\t\t\t\tLoader window = new Loader();\r\n\t\t\t\t\t\t\twindow.getFrmHistoriasDeZagas().setVisible(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (ClassNotFoundException 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} catch (InstantiationException 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} catch (IllegalAccessException 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} catch (SQLException 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} catch (IOException 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\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewButton_1.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\tbtnNewButton_1.setForeground(Color.BLUE);\r\n\t\t\t}\r\n\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\tbtnNewButton_1.setForeground(Color.WHITE);\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewButton_1.setFont(mf.MyFont(3, 11));\r\n\t\tbtnNewButton_1.setFocusPainted(false);\r\n\t\tbtnNewButton_1.setContentAreaFilled(false);\r\n\t\tbtnNewButton_1.setBorderPainted(false);\r\n\t\tbtnNewButton_1.setForeground(Color.WHITE);\r\n\t\tbtnNewButton_1.setBounds(-10, 416, 125, 17);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(btnNewButton_1);\r\n\r\n\t\tJLabel lblNewLabel_1 = new JLabel(Loader.usuario);\r\n\t\tlblNewLabel_1.setForeground(Color.WHITE);\r\n\t\tlblNewLabel_1.setFont(mf.MyFont(0, 11));\r\n\t\tlblNewLabel_1.setBounds(104, 416, 86, 17);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(lblNewLabel_1);\r\n\r\n\t\tJLabel lblNewLabel = new JLabel(\"\");\r\n\t\tlblNewLabel.setIcon(new ImageIcon(Inicio.class\r\n\t\t\t\t.getResource(\"/images/background-inicio.jpg\")));\r\n\t\tlblNewLabel.setBackground(Color.BLACK);\r\n\t\tlblNewLabel.setBounds(0, 0, 444, 472);\r\n\t\tfrmHistoriasDeZagas.getContentPane().add(lblNewLabel);\r\n\t\tif (Loader.admin==1) {\r\n\t\t\tfrmHistoriasDeZagas.setBounds(100, 100, 439, 500);\r\n\t\t\tfrmHistoriasDeZagas.setLocationRelativeTo(null);\r\n\t\t\tbtnCreditos.setBounds(10, 365, 414, 34);\r\n\t\t\tbutton.setBounds(10, 410, 414, 34);\r\n\t\t\tlblNewLabel_1.setBounds(104, 455, 86, 17);\r\n\t\t\tbtnNewButton_1.setBounds(-10, 455, 125, 17);\r\n\t\t\tbtnAdministracin.setVisible(true);\r\n\t\t}\r\n\t}", "private GuiTest() {\n // Load custom resources (fonts, etc.)\n ResourceLoader.loadResources();\n\n // Load the user accounts into the system\n UserController.getInstance().loadUsers();\n\n // Set up GuiController and the main window.\n GuiController.instantiate(1280, 720, \"FPTS\");\n\n char[] password = {'p', 'a', 's', 's', 'w', 'o', 'r', 'd'};\n UserController.getInstance().login(\"rhochmuth\", password);\n\n // Show the screen/window\n PortfolioController.getInstance().showAddHoldingView();\n GuiController.getInstance().showWindow();\n\n // Load the market information and update it every 2 minutes\n MarketController.getInstance().StartTimer();\n }", "public GUIForm() { \n initComponents();\n }" ]
[ "0.8480098", "0.7806668", "0.77624536", "0.7741652", "0.7740828", "0.7693792", "0.7607682", "0.7607682", "0.76051444", "0.75639844", "0.7555557", "0.7551753", "0.7535653", "0.7535653", "0.75193185", "0.75087136", "0.75040853", "0.7502618", "0.7484135", "0.7474913", "0.7473196", "0.7433378", "0.74263567", "0.74088764", "0.73797166", "0.7378337", "0.73734605", "0.7360238", "0.7341204", "0.7341204", "0.733381", "0.7332416", "0.7329278", "0.73167247", "0.73101884", "0.72944874", "0.7286499", "0.72826314", "0.7278374", "0.7274479", "0.7274443", "0.72696865", "0.7252162", "0.72308105", "0.7222807", "0.72133565", "0.7190831", "0.7190831", "0.7184654", "0.7182731", "0.7170396", "0.71696013", "0.7162963", "0.71604854", "0.7153559", "0.7132189", "0.71225864", "0.7106243", "0.7103843", "0.70990247", "0.7086994", "0.7077331", "0.7075449", "0.7067854", "0.7054499", "0.7037223", "0.70370764", "0.70355767", "0.703402", "0.7031961", "0.70300686", "0.7028885", "0.7025372", "0.7019745", "0.70104706", "0.70058054", "0.7004545", "0.7000622", "0.6998953", "0.6994736", "0.6994424", "0.6982898", "0.6978775", "0.69766253", "0.697281", "0.69721603", "0.6970287", "0.6966824", "0.69607276", "0.6959643", "0.6945489", "0.69430465", "0.6940926", "0.69389814", "0.6938349", "0.6933223", "0.6927427", "0.69266576", "0.6926114", "0.69234276" ]
0.6930974
96
initcomponent method to initialize jframe components
private void initComponents(){ JPanel mainPanel=new JPanel(new BorderLayout()); mainPanel.setPreferredSize(new Dimension(600,600)); mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); mainPanel.setBackground(Color.LIGHT_GRAY); mainPanel.add(mazePanel, BorderLayout.CENTER); JPanel flowLayout=new JPanel(); flowLayout.setLayout(new FlowLayout()); flowLayout.add(openMazefile); flowLayout.add(solveMaze); solveMaze.setEnabled(false); flowLayout.add(clearSolution); clearSolution.setEnabled(false); mainPanel.add(flowLayout,BorderLayout.SOUTH); add(mainPanel,BorderLayout.CENTER); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "public void initComponents();", "private void initcomponent() {\n\r\n\t}", "private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}", "private void initMyComponents() {\n this.jPanel1.setLayout(new BoxLayout(this.jPanel1, BoxLayout.Y_AXIS));\n this.jPanel1.add(controller.getPressureController().getEMeasureBasicView());\n this.jPanel1.add(controller.getTemperatureController().getEMeasureBasicView());\n this.controller.getPressureController().getListeners().add(this);\n this.controller.getTemperatureController().getListeners().add(this);\n this.jComboBox1.setModel(new DefaultComboBoxModel(FluidKind.values()));\n this.changeResponce();\n }", "private void initComponents() {\r\n\r\n setLayout(new java.awt.BorderLayout());\r\n }", "private void initComponents() {\n\n setLayout(new java.awt.BorderLayout());\n }", "private void initialize() {\n\t\tthis.setSize(430, 280);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setUndecorated(true);\n\t\tthis.setModal(true);\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setTitle(\"Datos del Invitado\");\n\t\tthis.addComponentListener(this);\n\t}", "@Override\n public void initComponent() {\n }", "@Override\n public void initComponent() {\n }", "@Override\r\n public void initComponent() {\n }", "private void initComponents() {\n LOOGER.info(\"Get init components\");\n this.loadButton = new JButton(\"Load\");\n this.fillButton = new JButton(\"Fill\");\n this.deleteButton = new JButton(\"Delete\");\n this.setLayout(new FlowLayout());\n LOOGER.info(\"components exit\");\n }", "public void init() {\n initComponents();\n initData();\n }", "private void initComponents()\n {\n //LAYOUT\n initLayoutComponents();\n \n //TRANSITION COMPONENTS\n initTransitionComponents();\n \n //SEARCH PANE COMPONENTS\n initSearchComponents();\n \n //RESULTS PANE COMPONENTS\n initResultComponents();\n \n // CRAWLER CONTROLS\n initCrawlerControlsComponents();\n \n // KEYWORD BAR\n initKeywordBarComponents();\n \n //WORKER CONTROLS\n initWorkerComponents();\n \n //URL COMPONENTS\n initURLMenuComponents();\n\n //BASE LAYOUT COMPONENTS\n initBaseLayout();\n }", "public void init() {\n try {\n java.awt.EventQueue.invokeAndWait(new Runnable() {\n public void run() {\n initComponents();\n }\n });\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1100, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tsetUIComponents();\n\t\tsetControllers();\n\n\t}", "private void initComponents() {\n rootLayout = new Grid();\n rootLayout.setWidth(new Extent(100, Extent.PERCENT));\n rootLayout.setSize(2);\n add(rootLayout);\n Empsn_Label= new nextapp.echo2.app.Label();\n Empsn_Label.setText(\"N_TIME_BEAR.EMPSN\");\n rootLayout.add(Empsn_Label);\n \n Empsn_DscField = new dsc.echo2app.component.DscField();\n Empsn_DscField.setId(\"Empsn_DscField\");\n Empsn_DscField.setWidth(new Extent(4, Extent.CM));\n rootLayout.add(Empsn_DscField);\n \n\t}", "public Jframe() {\n initComponents();\n setIndice();\n loadTextBoxs();\n }", "private void initComponents() {\n\n dataScrollPane = new javax.swing.JScrollPane();\n dataTable = new com.cosmos.acacia.gui.AcaciaTable();\n buttonsPanel = new com.cosmos.swingb.JBPanel();\n closeButton = new com.cosmos.swingb.JBButton();\n refreshButton = new com.cosmos.swingb.JBButton();\n deleteButton = new com.cosmos.swingb.JBButton();\n modifyButton = new com.cosmos.swingb.JBButton();\n newButton = new com.cosmos.swingb.JBButton();\n selectButton = new com.cosmos.swingb.JBButton();\n unselectButton = new com.cosmos.swingb.JBButton();\n classifyButton = new com.cosmos.swingb.JBButton();\n specialFunctionalityButton = new com.cosmos.swingb.JBButton();\n filterButton = new com.cosmos.swingb.JBButton();\n\n setName(\"Form\"); // NOI18N\n addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n onKeyPressed(evt);\n }\n });\n setLayout(new java.awt.BorderLayout());\n\n dataScrollPane.setName(\"dataScrollPane\"); // NOI18N\n\n dataTable.setName(\"dataTable\"); // NOI18N\n dataTable.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n onKeyPressed(evt);\n }\n });\n dataScrollPane.setViewportView(dataTable);\n\n add(dataScrollPane, java.awt.BorderLayout.CENTER);\n\n buttonsPanel.setName(\"buttonsPanel\"); // NOI18N\n\n javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(com.cosmos.acacia.crm.gui.AcaciaApplication.class).getContext().getActionMap(AbstractTablePanel.class, this);\n closeButton.setAction(actionMap.get(\"closeAction\")); // NOI18N\n closeButton.setName(\"closeButton\"); // NOI18N\n\n refreshButton.setAction(actionMap.get(\"refreshAction\")); // NOI18N\n refreshButton.setName(\"refreshButton\"); // NOI18N\n\n deleteButton.setAction(actionMap.get(\"deleteAction\")); // NOI18N\n deleteButton.setName(\"deleteButton\"); // NOI18N\n\n modifyButton.setAction(actionMap.get(\"modifyAction\")); // NOI18N\n modifyButton.setName(\"modifyButton\"); // NOI18N\n\n newButton.setAction(actionMap.get(\"newAction\")); // NOI18N\n newButton.setName(\"newButton\"); // NOI18N\n\n selectButton.setAction(actionMap.get(\"selectAction\")); // NOI18N\n selectButton.setName(\"selectButton\"); // NOI18N\n\n unselectButton.setAction(actionMap.get(\"unselectAction\")); // NOI18N\n unselectButton.setName(\"unselectButton\"); // NOI18N\n\n classifyButton.setAction(actionMap.get(\"classifyAction\")); // NOI18N\n org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(com.cosmos.acacia.crm.gui.AcaciaApplication.class).getContext().getResourceMap(AbstractTablePanel.class);\n classifyButton.setText(resourceMap.getString(\"classifyButton.text\")); // NOI18N\n classifyButton.setName(\"classifyButton\"); // NOI18N\n\n specialFunctionalityButton.setAction(actionMap.get(\"specialAction\")); // NOI18N\n specialFunctionalityButton.setName(\"specialFunctionalityButton\"); // NOI18N\n\n filterButton.setAction(actionMap.get(\"filter\")); // NOI18N\n filterButton.setName(\"filterButton\"); // NOI18N\n\n javax.swing.GroupLayout buttonsPanelLayout = new javax.swing.GroupLayout(buttonsPanel);\n buttonsPanel.setLayout(buttonsPanelLayout);\n buttonsPanelLayout.setHorizontalGroup(\n buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, buttonsPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(unselectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE)\n .addComponent(specialFunctionalityButton, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(filterButton, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(classifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(modifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n buttonsPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {closeButton, deleteButton, modifyButton, newButton, refreshButton, selectButton});\n\n buttonsPanelLayout.setVerticalGroup(\n buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, buttonsPanelLayout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(modifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(unselectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(classifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(filterButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(specialFunctionalityButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n buttonsPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {closeButton, deleteButton, modifyButton, newButton, refreshButton, selectButton, unselectButton});\n\n add(buttonsPanel, java.awt.BorderLayout.PAGE_END);\n }", "private void initComponents() {\n // Create the RGB and the HSB radio buttons.\n createRgbHsbButtons();\n\n \n \n ColorData initial = new ColorData(new RGB(255, 255, 255), 255);\n\n // Create the upper color wheel for the display.\n upperColorWheel = new ColorWheelComp(shell, this, upperWheelTitle);\n // upperColorWheel.setColor(colorArray.get(0));\n upperColorWheel.setColor(initial);\n\n // Create the color bar object that is displayed\n // in the middle of the dialog.\n colorBar = new ColorBarViewer(shell, this, sliderText, cmapParams);\n\n // Create the lower color wheel for the display.\n lowerColorWheel = new ColorWheelComp(shell, this, lowerWheelTitle);\n // lowerColorWheel.setColor(colorArray.get(colorArray.size() - 1));\n lowerColorWheel.setColor(initial);\n\n // Create the bottom control buttons.\n createBottomButtons();\n }", "private void initComponents() {\n\t\tthis.setTitle(\"Boggle\");\n\t\tthis.setDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tthis.setMinimumSize(new Dimension(600, 575));\n\t\t\n\t\tinitMenuBar();\n\t\tinitDiceGridPanel();\n\t\tinitInputPanel();\n\t\tinitInfoPanel();\n\t\taddPanels();\n\t\t\n\t\tthis.setVisible(true);\n\t}", "private void initialize() {\r\n\t\t// Initialize main frame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(Constants.C_MAIN_PREFERED_POSITION_X_AT_START, Constants.C_MAIN_PREFERED_POSITION_Y_AT_START, \r\n\t\t\t\tConstants.C_MAIN_PREFERED_SIZE_X, Constants.C_MAIN_PREFERED_SIZE_Y);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.setTitle(Constants.C_MAIN_WINDOW_TITLE);\r\n\t\t\r\n\t\t// Tab panel and their panels\r\n\t\tmainTabbedPane = new JTabbedPane(JTabbedPane.TOP);\r\n\t\tframe.getContentPane().add(mainTabbedPane, BorderLayout.CENTER);\r\n\t\t\r\n\t\tpanelDecision = new DecisionPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_DECISION_TITLE, null, panelDecision, null);\r\n\t\t\r\n\t\tpanelCalculation = new CalculationPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_CALCULATION_TITLE, null, panelCalculation, null);\r\n\t\t\r\n\t\tpanelLibrary = new LibraryPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_LIBRARY_TITLE, null, panelLibrary, null);\r\n\t\t\r\n\t\t// Menu bar\r\n\t\tmenuBar = new JMenuBar();\r\n\t\tframe.setJMenuBar(menuBar);\r\n\t\tcreateMenus();\r\n\t}", "private void initialize()\n {\n this.setTitle( \"SerialComm\" ); // Generated\n this.setSize( 500, 300 );\n this.setContentPane( getJContentPane() );\n }", "public mainframe() {\n initComponents();\n }", "public void init()\n {\n buildUI(getContentPane());\n }", "private void initializeComponent(){\r\n\r\n //Creating a new JFrame\r\n frame = new JFrame(\"Rental System\");\r\n //The program dismisses when the window is closed\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n //Fixes the size of the window (dialogue box)\r\n frame.setResizable(false);\r\n \r\n frame.setLayout(null);\r\n //Components that are added to the frame\r\n addComponents(frame.getContentPane());\r\n \r\n frame.pack();\r\n // Sets the size of the window to 1000px width and 460px height\r\n frame.setSize(1000, 460);\r\n // Shows the window at the center of the screen\r\n frame.setLocationRelativeTo(null);\r\n // Makes the window visible\r\n frame.setVisible(true);\r\n\r\n\r\n }", "private void initialize() {\r\n\t\tthis.setSize(311, 153);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tsetCancelButton( btnCancel );\r\n\t}", "private void initComponents() {\n\t\tfiltersPanel = new FiltersPanel(mainView);\n\t\tdetailsPanel = new DetailsPanel();\n\t\t\n\t\tthis.setStylePrimaryName(\"variantdisplay\");\n\t\tthis.addWest(filtersPanel, 240);\n\n\t\tvarTable = new VarTable(this, colModel);\n\n\t\t\n\t\t//details panel listens to variant selection events generated by the varTable\n\t\tvarTable.addVariantSelectionListener(detailsPanel); \n\t\tvarManager.addListener(this);\n\t\tcolModel.addListener(this);\n\t\tfiltersPanel.addListener(this);\n\t\t\n\t\tthis.addSouth(detailsPanel, 300.0);\n\t\tthis.add(varTable);\n\t}", "private void initialize() {\r\n\t\t// set specific properties and add inner components.\r\n\t\tthis.setBorder(BorderFactory.createEtchedBorder());\r\n\t\tthis.setSize(300, 400);\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\taddComponents();\r\n\t}", "private void initialize() {\n\t\tthis.setLayout(new BorderLayout());\n\t\tthis.setSize(300, 200);\n\t\tthis.add(getJScrollPane(), java.awt.BorderLayout.CENTER);\n\t}", "public FrameControl() {\n initComponents();\n }", "public Mainframe() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"BirdSong\");\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t\tframe.setBounds(100, 100, 400, 200);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tabc = new BirdPanel();\n\t\ttime = new TimePanel();\n\t\tgetContentPane().setLayout(new BoxLayout(frame, BoxLayout.Y_AXIS));\n\n\t\tframe.getContentPane().add(abc, BorderLayout.NORTH);\n\t\tframe.getContentPane().add(time, BorderLayout.CENTER);\n\t}", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\r\n\t\tthis.setBounds(new Rectangle(0, 0, 670, 576));\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setTitle(\"数据入库 \");\r\n\t\tthis.setLocationRelativeTo(getOwner());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "private void initialize() {\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setSize(810, 600);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n\t\tthis.setModal(true);\n\t\tthis.setResizable(false);\n\t\tthis.setName(\"FramePrincipalLR\");\n\t\tthis.setTitle(\"CR - Lista de Regalos\");\n\t\tthis.setLocale(new java.util.Locale(\"es\", \"VE\", \"\"));\n\t\tthis.setUndecorated(false);\n\t}", "private void initComponents() {\n jSplitPane1 = new javax.swing.JSplitPane();\n jPanel1 = new javax.swing.JPanel();\n jPanel3 = new javax.swing.JPanel();\n xActionTextField1 = new com.rameses.rcp.control.XActionTextField();\n xDataTable1 = new com.rameses.rcp.control.XDataTable();\n jPanel2 = new javax.swing.JPanel();\n xActionBar1 = new com.rameses.rcp.control.XActionBar();\n jPanel4 = new javax.swing.JPanel();\n formPanel1 = new com.rameses.rcp.util.FormPanel();\n xTextField1 = new com.rameses.rcp.control.XTextField();\n xTextField2 = new com.rameses.rcp.control.XTextField();\n xCheckBox1 = new com.rameses.rcp.control.XCheckBox();\n xNumberField1 = new com.rameses.rcp.control.XNumberField();\n\n setLayout(new java.awt.BorderLayout());\n\n setPreferredSize(new java.awt.Dimension(748, 396));\n jSplitPane1.setDividerLocation(400);\n jPanel1.setLayout(new java.awt.BorderLayout());\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder1 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder1.setTitle(\"Listing\");\n jPanel1.setBorder(xTitledBorder1);\n jPanel3.setLayout(new java.awt.BorderLayout());\n\n jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 1, 3, 5));\n xActionTextField1.setActionName(\"search\");\n xActionTextField1.setCaptionMnemonic('h');\n xActionTextField1.setHint(\"Search\");\n xActionTextField1.setIndex(-1);\n xActionTextField1.setName(\"searchText\");\n xActionTextField1.setPreferredSize(new java.awt.Dimension(200, 19));\n jPanel3.add(xActionTextField1, java.awt.BorderLayout.WEST);\n\n jPanel1.add(jPanel3, java.awt.BorderLayout.NORTH);\n\n xDataTable1.setHandler(\"listHandler\");\n xDataTable1.setImmediate(true);\n xDataTable1.setName(\"selectedItem\");\n jPanel1.add(xDataTable1, java.awt.BorderLayout.CENTER);\n\n jSplitPane1.setLeftComponent(jPanel1);\n\n jPanel2.setLayout(new java.awt.BorderLayout());\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder2 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder2.setTitle(\"Document\");\n jPanel2.setBorder(xTitledBorder2);\n xActionBar1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 0));\n xActionBar1.setDepends(new String[] {\"selectedItem\"});\n xActionBar1.setName(\"formActions\");\n jPanel2.add(xActionBar1, java.awt.BorderLayout.NORTH);\n\n jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 5, 5));\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder3 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder3.setTitle(\"Property Classification Information\");\n formPanel1.setBorder(xTitledBorder3);\n xTextField1.setCaption(\"Code\");\n xTextField1.setDepends(new String[] {\"selectedItem\"});\n xTextField1.setName(\"entity.propertycode\");\n xTextField1.setPreferredSize(new java.awt.Dimension(80, 18));\n xTextField1.setRequired(true);\n formPanel1.add(xTextField1);\n\n xTextField2.setCaption(\"Description\");\n xTextField2.setDepends(new String[] {\"selectedItem\"});\n xTextField2.setName(\"entity.propertydesc\");\n xTextField2.setPreferredSize(new java.awt.Dimension(0, 18));\n xTextField2.setRequired(true);\n formPanel1.add(xTextField2);\n\n xCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));\n xCheckBox1.setText(\" Is Special?\");\n xCheckBox1.setCaption(\"\");\n xCheckBox1.setCheckValue(1);\n xCheckBox1.setDepends(new String[] {\"selectedItem\"});\n xCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0));\n xCheckBox1.setName(\"entity.special\");\n formPanel1.add(xCheckBox1);\n\n xNumberField1.setCaption(\"Order No\");\n xNumberField1.setDepends(new String[] {\"selectedItem\"});\n xNumberField1.setFieldType(int.class);\n xNumberField1.setName(\"entity.orderno\");\n xNumberField1.setPreferredSize(new java.awt.Dimension(75, 18));\n xNumberField1.setRequired(true);\n formPanel1.add(xNumberField1);\n\n org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel4Layout.createSequentialGroup()\n .add(formPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 328, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(29, Short.MAX_VALUE))\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel4Layout.createSequentialGroup()\n .add(formPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 177, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(166, Short.MAX_VALUE))\n );\n jPanel2.add(jPanel4, java.awt.BorderLayout.CENTER);\n\n jSplitPane1.setRightComponent(jPanel2);\n\n add(jSplitPane1, java.awt.BorderLayout.CENTER);\n\n }", "private void initialize() {\n this.setSize(300, 200);\n this.setContentPane(getJContentPane());\n this.pack();\n }", "public internalFrame() {\r\n initComponents();\r\n }", "private void initialize() {\n\t\tthis.setSize(329, 270);\n\t\tthis.setContentPane(getJContentPane());\n\t}", "public void initComponent(){\n\t\t\n\t\tpanelMiddle.setCaption(\"PROSES:\");\n\t\t\n\t\t//INIT COMPONENT BAWAH\t\n\t\tlabelNotes.setContentMode(ContentMode.HTML);\n\t\tlabelNotes.setValue(\"Notes: <br> Perubahan pada Calender Kerja akan mempengaruhi seluruh sistem <br>.\" );\n\t}", "private void initComponents() {\r\n\r\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\r\n setTitle(title());\r\n setMinimumSize(new java.awt.Dimension(1000, 500));\r\n\r\n toolsPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));\r\n\r\n channelComboBox.setMinimumSize(new java.awt.Dimension(75, 20));\r\n channelComboBox.setPreferredSize(new java.awt.Dimension(100, 20));\r\n channelComboBox.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n channelComboBox_actionPerformed(evt);\r\n }\r\n });\r\n toolsPanel.add(channelComboBox);\r\n\r\n getContentPane().add(toolsPanel, java.awt.BorderLayout.NORTH);\r\n getContentPane().add(tabsPanel, java.awt.BorderLayout.CENTER);\r\n\r\n valuesPanel.setLayout(new javax.swing.BoxLayout(valuesPanel, javax.swing.BoxLayout.Y_AXIS));\r\n getContentPane().add(valuesPanel, java.awt.BorderLayout.EAST);\r\n\r\n pack();\r\n }", "private void initialize() {\r\n\t\tthis.setSize(530, 329);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initComponents() {\n\t\tSplitPane mainSplitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL_TOP_BOTTOM);\n\t\tmainSplitPane.setSeparatorPosition(new Extent(34));\n\t\tnavigator = new AnyRowNavigator();\n\t\tmainSplitPane.add(navigator);\n\t\tSplitPane splitPane = new SplitPane();\n\t\tsplitPane.setOrientation(SplitPane.ORIENTATION_VERTICAL_TOP_BOTTOM);\n\t\tsplitPane.setSeparatorPosition(new Extent(200));\n\t\tsplitPane.setResizable(true);\n\t\tmainSplitPane.add(splitPane);\n\t\tadd(mainSplitPane);\t\t\n rootLayout = new Grid();\n rootLayout.setWidth(new Extent(100, Extent.PERCENT));\n rootLayout.setSize(8);\n splitPane.add(rootLayout);\n EMPSN_CaptionLabel = new nextapp.echo2.app.Label();\n EMPSN_CaptionLabel.setText(\"N_GET_DATA.EMPSN\");\n rootLayout.add(EMPSN_CaptionLabel);\n GridLayoutData infoLayout = new GridLayoutData();\n infoLayout.setColumnSpan(7);\n Row row = new Row();\n row.setLayoutData(infoLayout);\n EMPSN_DscField1 = new dsc.echo2app.component.DscField();\n EMPSN_DscField1.setWidth(new Extent(60));\n EMPSN_DscField1.setId(\"EMPSN_DscField1\");\n row.add(EMPSN_DscField1);\n lblInfo = new DirectHtml();\n row.add(lblInfo);\n rootLayout.add(row);\n// DEPSN_CaptionLabel = new nextapp.echo2.app.Label();\n// rootLayout.add(DEPSN_CaptionLabel);\n// DEPSN_DscField1 = new dsc.echo2app.component.DscField();\n// DEPSN_DscField1.setWidth(new Extent(60));\n// DEPSN_DscField1.setId(\"DEPSN_DscField1\");\n// rootLayout.add(DEPSN_DscField1);\n MONTHS_CaptionLabel = new nextapp.echo2.app.Label();\n MONTHS_CaptionLabel.setText(\"N_GET_DATA.MONTHS\");\n rootLayout.add(MONTHS_CaptionLabel);\n MONTHS_DscField2 = new dsc.echo2app.component.DscField();\n MONTHS_DscField2.setWidth(new Extent(60));\n MONTHS_DscField2.setId(\"MONTHS_DscField2\");\n rootLayout.add(MONTHS_DscField2);\n YEARS_CaptionLabel = new nextapp.echo2.app.Label();\n YEARS_CaptionLabel.setText(\"N_GET_DATA.YEARS\");\n rootLayout.add(YEARS_CaptionLabel);\n YEARS_DscField3 = new dsc.echo2app.component.DscField();\n YEARS_DscField3.setWidth(new Extent(60));\n YEARS_DscField3.setId(\"YEARS_DscField3\");\n rootLayout.add(YEARS_DscField3);\n DUCLS_CaptionLabel = new nextapp.echo2.app.Label();\n DUCLS_CaptionLabel.setText(\"N_GET_DATA.DUCLS\");\n rootLayout.add(DUCLS_CaptionLabel);\n DUCLS_DscField4 = new dsc.echo2app.component.DscField();\n DUCLS_DscField4.setWidth(new Extent(60));\n DUCLS_DscField4.setDisabledBackground(new Color(0xFBF4D4));\n DUCLS_DscField4.setDisabledForeground(new Color(0x2A7FFF));\n DUCLS_DscField4.setId(\"DUCLS_DscField4\");\n rootLayout.add(DUCLS_DscField4);\n NDUCLS_CaptionLabel = new nextapp.echo2.app.Label();\n NDUCLS_CaptionLabel.setText(\"N_GET_DATA.NDUCLS\");\n rootLayout.add(NDUCLS_CaptionLabel);\n NDUCLS_DscField5 = new dsc.echo2app.component.DscField();\n NDUCLS_DscField5.setWidth(new Extent(60));\n NDUCLS_DscField5.setId(\"NDUCLS_DscField5\");\n rootLayout.add(NDUCLS_DscField5);\n ADDHOL_CaptionLabel = new nextapp.echo2.app.Label();\n ADDHOL_CaptionLabel.setText(\"N_GET_DATA.ADDHOL\");\n rootLayout.add(ADDHOL_CaptionLabel);\n ADDHOL_DscField6 = new dsc.echo2app.component.DscField();\n ADDHOL_DscField6.setWidth(new Extent(60));\n ADDHOL_DscField6.setId(\"ADDHOL_DscField6\");\n rootLayout.add(ADDHOL_DscField6);\n ADDCLS1_CaptionLabel = new nextapp.echo2.app.Label();\n ADDCLS1_CaptionLabel.setText(\"N_GET_DATA.ADDCLS1\");\n rootLayout.add(ADDCLS1_CaptionLabel);\n ADDCLS1_DscField7 = new dsc.echo2app.component.DscField();\n ADDCLS1_DscField7.setWidth(new Extent(60));\n ADDCLS1_DscField7.setId(\"ADDCLS1_DscField7\");\n rootLayout.add(ADDCLS1_DscField7);\n NADDCLS_CaptionLabel = new nextapp.echo2.app.Label();\n NADDCLS_CaptionLabel.setText(\"N_GET_DATA.NADDCLS\");\n rootLayout.add(NADDCLS_CaptionLabel);\n NADDCLS_DscField8 = new dsc.echo2app.component.DscField();\n NADDCLS_DscField8.setWidth(new Extent(60));\n NADDCLS_DscField8.setId(\"NADDCLS_DscField8\");\n rootLayout.add(NADDCLS_DscField8);\n LATE_CaptionLabel = new nextapp.echo2.app.Label();\n LATE_CaptionLabel.setText(\"N_GET_DATA.LATE\");\n rootLayout.add(LATE_CaptionLabel);\n LATE_DscField9 = new dsc.echo2app.component.DscField();\n LATE_DscField9.setWidth(new Extent(60));\n LATE_DscField9.setId(\"LATE_DscField9\");\n rootLayout.add(LATE_DscField9);\n SIGN_CaptionLabel = new nextapp.echo2.app.Label();\n SIGN_CaptionLabel.setText(\"N_GET_DATA.SIGN\");\n rootLayout.add(SIGN_CaptionLabel);\n SIGN_DscField10 = new dsc.echo2app.component.DscField();\n SIGN_DscField10.setWidth(new Extent(60));\n SIGN_DscField10.setId(\"SIGN_DscField10\");\n rootLayout.add(SIGN_DscField10);\n ACN_CaptionLabel = new nextapp.echo2.app.Label();\n ACN_CaptionLabel.setText(\"N_GET_DATA.ACN\");\n rootLayout.add(ACN_CaptionLabel);\n ACN_DscField11 = new dsc.echo2app.component.DscField();\n ACN_DscField11.setWidth(new Extent(60));\n ACN_DscField11.setId(\"ACN_DscField11\");\n rootLayout.add(ACN_DscField11);\n ACNM_CaptionLabel = new nextapp.echo2.app.Label();\n ACNM_CaptionLabel.setText(\"N_GET_DATA.ACNM\");\n rootLayout.add(ACNM_CaptionLabel);\n ACNM_DscField12 = new dsc.echo2app.component.DscField();\n ACNM_DscField12.setWidth(new Extent(60));\n ACNM_DscField12.setId(\"ACNM_DscField12\");\n rootLayout.add(ACNM_DscField12);\n REST_CaptionLabel = new nextapp.echo2.app.Label();\n REST_CaptionLabel.setText(\"N_GET_DATA.REST\");\n rootLayout.add(REST_CaptionLabel);\n REST_DscField13 = new dsc.echo2app.component.DscField();\n REST_DscField13.setWidth(new Extent(60));\n REST_DscField13.setId(\"REST_DscField13\");\n rootLayout.add(REST_DscField13);\n REST_PAY_CaptionLabel = new nextapp.echo2.app.Label();\n REST_PAY_CaptionLabel.setText(\"N_GET_DATA.REST_PAY\");\n rootLayout.add(REST_PAY_CaptionLabel);\n REST_PAY_DscField14 = new dsc.echo2app.component.DscField();\n REST_PAY_DscField14.setWidth(new Extent(60));\n REST_PAY_DscField14.setId(\"REST_PAY_DscField14\");\n rootLayout.add(REST_PAY_DscField14);\n REST_SICK_CaptionLabel = new nextapp.echo2.app.Label();\n REST_SICK_CaptionLabel.setText(\"N_GET_DATA.REST_SICK\");\n rootLayout.add(REST_SICK_CaptionLabel);\n REST_SICK_DscField15 = new dsc.echo2app.component.DscField();\n REST_SICK_DscField15.setWidth(new Extent(60));\n REST_SICK_DscField15.setId(\"REST_SICK_DscField15\");\n rootLayout.add(REST_SICK_DscField15);\n OTHER_CaptionLabel = new nextapp.echo2.app.Label();\n OTHER_CaptionLabel.setText(\"N_GET_DATA.OTHER\");\n rootLayout.add(OTHER_CaptionLabel);\n OTHER_DscField16 = new dsc.echo2app.component.DscField();\n OTHER_DscField16.setWidth(new Extent(60));\n OTHER_DscField16.setId(\"OTHER_DscField16\");\n rootLayout.add(OTHER_DscField16);\n NWHOUR_CaptionLabel = new nextapp.echo2.app.Label();\n NWHOUR_CaptionLabel.setText(\"N_GET_DATA.NWHOUR\");\n rootLayout.add(NWHOUR_CaptionLabel);\n NWHOUR_DscField17 = new dsc.echo2app.component.DscField();\n NWHOUR_DscField17.setWidth(new Extent(60));\n NWHOUR_DscField17.setId(\"NWHOUR_DscField17\");\n rootLayout.add(NWHOUR_DscField17);\n ADDHOLN_CaptionLabel = new nextapp.echo2.app.Label();\n ADDHOLN_CaptionLabel.setText(\"N_GET_DATA.ADDHOLN\");\n rootLayout.add(ADDHOLN_CaptionLabel);\n ADDHOLN_DscField18 = new dsc.echo2app.component.DscField();\n ADDHOLN_DscField18.setWidth(new Extent(60));\n ADDHOLN_DscField18.setId(\"ADDHOLN_DscField18\");\n rootLayout.add(ADDHOLN_DscField18);\n LMATER_CaptionLabel = new nextapp.echo2.app.Label();\n LMATER_CaptionLabel.setText(\"N_GET_DATA.LMATER\");\n rootLayout.add(LMATER_CaptionLabel);\n LMATER_DscField19 = new dsc.echo2app.component.DscField();\n LMATER_DscField19.setWidth(new Extent(60));\n LMATER_DscField19.setId(\"LMATER_DscField19\");\n rootLayout.add(LMATER_DscField19);\n LOCKED_CaptionLabel = new nextapp.echo2.app.Label();\n LOCKED_CaptionLabel.setText(\"N_GET_DATA.LOCKED\");\n rootLayout.add(LOCKED_CaptionLabel);\n LOCKED_DscField20 = new dsc.echo2app.component.DscField();\n LOCKED_DscField20.setWidth(new Extent(60));\n LOCKED_DscField20.setId(\"LOCKED_DscField20\");\n rootLayout.add(LOCKED_DscField20);\n// UP_DATE_CaptionLabel = new nextapp.echo2.app.Label();\n// UP_DATE_CaptionLabel.setText(\"N_GET_DATA.UP_DATE\");\n// rootLayout.add(UP_DATE_CaptionLabel);\n// UP_DATE_DscDateField1 = new dsc.echo2app.component.DscDateField();\n// UP_DATE_DscDateField1.setId(\"UP_DATE_DscDateField1\");\n// rootLayout.add(UP_DATE_DscDateField1);\n// UP_USER_CaptionLabel = new nextapp.echo2.app.Label();\n// UP_USER_CaptionLabel.setText(\"N_GET_DATA.UP_USER\");\n// rootLayout.add(UP_USER_CaptionLabel);\n// UP_USER_DscField22 = new dsc.echo2app.component.DscField();\n// UP_USER_DscField22.setId(\"UP_USER_DscField22\");\n// rootLayout.add(UP_USER_DscField22);\n dailyContent = new DataDailyBrowserContent();\n splitPane.add(dailyContent);\n\t}", "public void initComponents() {\n\t\taddButton = new JButton(addFlightText);\n\t\tdelayButton = new JButton(delayFlightText);\n\t\tquitButton = new JButton(quitText);\n\t\t// TODO: Add button instanciations for other operations\n\n\t\t// Initialize display area\n\t\tdisplayArea = new JTextArea(LINE_COUNT, LINE_SIZE);\n\t\tdisplayArea.setEditable(false);\n\t\tscrollPane = new JScrollPane(displayArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,\n\t\t\t\tJScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);\n\t}", "private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)\n );\n }", "public jinventario(){\n initComponents();\n }", "private void initComponents() {\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "private void initComponents() {\n\n\t\tsetName(\"Form\"); // NOI18N\n\t\tsetLayout(new java.awt.BorderLayout());\n\t}", "@Override\r\n\tprotected void initComponent() {\n\t\tint width = 800;\r\n\t\tint height = 600;\r\n\t\tresetSize(width, height);\r\n\t\tcontainer = new JPanel();\r\n\t\tcontainer.setSize(width, height);\r\n\t\tthis.add(container);\r\n\t\tcontainer.setLayout(null);\r\n\r\n\t\tlblCountDown = new JLabel();\r\n\t\tlblCountDown.setBounds(600, 20, 600, 50);\r\n\t\tlblCountDown.setText(\"提示\");\r\n\t\tcontainer.add(lblCountDown);\r\n\r\n\t\tlblMsg = new JLabel();\r\n\t\ttxtQuestion = new JTextArea();\r\n\t\trdoItemA = new JRadioButton();\r\n\t\trdoItemB = new JRadioButton();\r\n\t\tbtnChoise = new ButtonGroup();\r\n\t\trdoItemC = new JRadioButton();\r\n\t\trdoItemD = new JRadioButton();\r\n\t\tbtnLast = new JButton();\r\n\t\tbtnNext = new JButton();\r\n\t\tbtnSubmit = new JButton();\r\n\t}", "private void initFrame() {\n setLayout(new BorderLayout());\n }", "private void initComponents() {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setPreferredSize(new java.awt.Dimension(686, 530));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 699, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 541, Short.MAX_VALUE)\n );\n\n pack();\n }", "public FrameDesign() {\n initComponents();\n }", "private void initComponents(){\n\t\n\t\tthis.setLayout(null);\n\t\t\n\t\tscreensize = Toolkit.getDefaultToolkit().getScreenSize();\n\t\t\n\t\tlogo = new JLabel(getLogoIcon(), JLabel.CENTER); // 500x50\n\t\t\n\t\toptionList = new JComboBox();\n\t\t\n\t\tcreate = new JButton(\"Create\");\n\t\tclose = new JButton(\"Close\");\n\t\t\n\t\tcreate.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tcreateActionPerformed(evt);\n\t\t\t}\n\t\t});\n\t\t\n\t\tclose.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tcloseActionPerformed(evt);\n\t\t\t}\n\t\t});\n\t\t\n\t}", "private void initComponents() {//GEN-BEGIN:initComponents\n\n\n setClosable(true);\n\n setIconifiable(true);\n\n setPreferredSize(new java.awt.Dimension(730, 520));\n\n pack();\n\n }", "private void initialize() {\n\t\tframe = new JFrame(\"DB Filler\");\n\t\tframe.setBounds(100, 100, 700, 500);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tdbc = new DataBaseConnector();\n\t\tcreateFileChooser();\n\n\t\taddTabbedPane();\n\t\tsl_panel = new SpringLayout();\n\t\taddAddFilePanel();\n\t}", "private void initComponents() {\n jScrollPane1 = new javax.swing.JScrollPane();\n xList1 = new com.rameses.rcp.control.XList();\n xActionBar1 = new com.rameses.rcp.control.XActionBar();\n formPanel1 = new com.rameses.rcp.util.FormPanel();\n xTextField1 = new com.rameses.rcp.control.XTextField();\n xComboBox4 = new com.rameses.rcp.control.XComboBox();\n xComboBox1 = new com.rameses.rcp.control.XComboBox();\n xComboBox2 = new com.rameses.rcp.control.XComboBox();\n xComboBox3 = new com.rameses.rcp.control.XComboBox();\n xLookupField1 = new com.rameses.rcp.control.XLookupField();\n\n setLayout(new java.awt.BorderLayout());\n\n setPreferredSize(new java.awt.Dimension(548, 368));\n xList1.setDynamic(true);\n xList1.setExpression(\"#{name}\");\n xList1.setItems(\"filterlist\");\n xList1.setName(\"selectedFilter\");\n jScrollPane1.setViewportView(xList1);\n\n add(jScrollPane1, java.awt.BorderLayout.NORTH);\n\n xActionBar1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 0, 5, 0));\n xActionBar1.setDepends(new String[] {\"selectedFilter\"});\n xActionBar1.setName(\"formActions\");\n xActionBar1.setUseToolBar(false);\n add(xActionBar1, java.awt.BorderLayout.SOUTH);\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder1 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder1.setTitle(\"Filter Information\");\n formPanel1.setBorder(xTitledBorder1);\n xTextField1.setCaption(\"Name\");\n xTextField1.setCaptionWidth(100);\n xTextField1.setName(\"filter.name\");\n xTextField1.setPreferredSize(new java.awt.Dimension(0, 19));\n xTextField1.setRequired(true);\n xTextField1.setTextCase(com.rameses.rcp.constant.TextCase.NONE);\n formPanel1.add(xTextField1);\n\n xComboBox4.setCaption(\"State\");\n xComboBox4.setCaptionWidth(100);\n xComboBox4.setDynamic(true);\n xComboBox4.setItems(\"statelist\");\n xComboBox4.setName(\"filter.info.docstate\");\n xComboBox4.setPreferredSize(new java.awt.Dimension(0, 22));\n formPanel1.add(xComboBox4);\n\n xComboBox1.setCaption(\"Barangay\");\n xComboBox1.setCaptionWidth(100);\n xComboBox1.setDynamic(true);\n xComboBox1.setExpression(\"#{name}\");\n xComboBox1.setItems(\"barangaylist\");\n xComboBox1.setName(\"filter.info.barangay\");\n xComboBox1.setPreferredSize(new java.awt.Dimension(0, 22));\n formPanel1.add(xComboBox1);\n\n xComboBox2.setCaption(\"Classification\");\n xComboBox2.setCaptionWidth(100);\n xComboBox2.setDynamic(true);\n xComboBox2.setExpression(\"#{classname}\");\n xComboBox2.setItems(\"classificationlist\");\n xComboBox2.setName(\"filter.info.classification\");\n xComboBox2.setPreferredSize(new java.awt.Dimension(0, 22));\n formPanel1.add(xComboBox2);\n\n xComboBox3.setCaption(\"Property Type\");\n xComboBox3.setCaptionWidth(100);\n xComboBox3.setDynamic(true);\n xComboBox3.setItems(\"rputypelist\");\n xComboBox3.setName(\"filter.info.rputype\");\n xComboBox3.setPreferredSize(new java.awt.Dimension(0, 22));\n formPanel1.add(xComboBox3);\n\n xLookupField1.setCaption(\"Owner\");\n xLookupField1.setCaptionWidth(100);\n xLookupField1.setExpression(\"#{entityname}\");\n xLookupField1.setHandler(\"lookupOwner\");\n xLookupField1.setName(\"filter.info.owner\");\n xLookupField1.setPreferredSize(new java.awt.Dimension(0, 19));\n formPanel1.add(xLookupField1);\n\n add(formPanel1, java.awt.BorderLayout.CENTER);\n\n }", "public JGSFrame() {\n\tsuper();\n\tinitialize();\n }", "private void initialize() {\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r\n\t\tthis.setTitle(\"Extremum Values\");\r\n\t\tthis.setSize(300,180);\r\n\t\tthis.setLocation(300, 100);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.getRootPane().setDefaultButton(getOkButton());\r\n\t\tthis.setVisible(true);\r\n\t}", "public JFFornecedores() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "private void initialize()\n\t{\n\t\tthis.setModal(true);\t\t\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setSize(450,400);\n\t\tScreenResolution.centerComponent(this);\n\t}", "private void initComponent() {\r\n\t\tjlHistory = new JList<String>(history.get());\r\n\t\tjlHistory.setLayoutOrientation(JList.VERTICAL);\r\n\t\tjlHistory.setVisibleRowCount(history.size());\r\n\t\t\r\n\t\tjspHistory = new JScrollPane(jlHistory);\r\n\t\t\r\n\t\tjbClose = new JButton(\"Close\");\r\n\t\tjbClose.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tdispose();\r\n\t\t\t}\r\n\t\t});\t\r\n\t\t\r\n\t\tjbSave = new JButton(\"Save\");\r\n\t\tjbSave.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\r\n\t\t\t\tsaveHistory();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t// Add the components\r\n\t\tsetLayout(new GridBagLayout());\r\n\t\tGridBagConstraints c = new GridBagConstraints();\r\n\r\n\t\tc.fill = GridBagConstraints.BOTH;\r\n\t\tc.gridx = 0;\r\n\t\tc.gridy = 0;\r\n\t\tc.gridwidth = 2;\r\n\t\tc.weightx = 1;\r\n\t\tc.weighty = 0.99;\r\n\t\tadd(jspHistory, c);\r\n\t\t\r\n\t\tc.fill = GridBagConstraints.VERTICAL;\r\n\t\tc.gridx = 0;\r\n\t\tc.gridy = 1;\r\n\t\tc.gridwidth = 1;\r\n\t\tc.weighty = 0.01;\r\n\t\tadd(jbSave, c);\t\t\r\n\t\t\r\n\t\tc.gridx = 1;\r\n\t\tc.gridy = 1;\r\n\t\tadd(jbClose, c);\r\n\t}", "public void initComponents(){\t\r\n\t\tsetName(\"dialog01\");\r\n\t\tsetTitle(\"Candle Exercise\");\r\n\t\tsetBounds(100, 100, 356, 300);\r\n\t\tgetContentPane().setLayout(new BorderLayout());\r\n\t\tcontentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));\r\n\t\tgetContentPane().add(contentPanel, BorderLayout.CENTER);\r\n\t\tcontentPanel.setLayout(null);\r\n\t\tFont font = new Font(\"Tahoma\", Font.PLAIN, 13);\r\n\r\n\t\tbtnCurrent = new JButton(\"Show Labels\");\r\n\t\tbtnCurrent.setToolTipText(\"shows current best data saved\");\r\n\t\tbtnCurrent.setFont(new Font(\"Tahoma\", Font.PLAIN, 13));\r\n\t\tbtnCurrent.setFocusPainted(false);\r\n\t\tbtnCurrent.setBounds(68, 77, 214, 88);\r\n\t\tcontentPanel.add(btnCurrent);\r\n\r\n\t}", "private void initComponents() {\n\n jButton1 = new javax.swing.JButton();\n\n setLayout(new java.awt.BorderLayout());\n\n org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(CallGraphTopComponent.class, \"NO_VIEW_AVAILABLE\")); // NOI18N\n jButton1.setEnabled(false);\n jButton1.setFocusable(false);\n add(jButton1, java.awt.BorderLayout.CENTER);\n }", "private void initComponents() {\n java.awt.GridBagConstraints gridBagConstraints;\n\n obsahFrame = new cz.wt.convertor.main.gui.ObsahFrame();\n menuBar = new javax.swing.JMenuBar();\n javax.swing.JMenu fileMenu = new javax.swing.JMenu();\n javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();\n javax.swing.JMenu helpMenu = new javax.swing.JMenu();\n helpMenuItem = new javax.swing.JMenuItem();\n javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle(\"cz/wt/convertor/main/gui/Bundle\"); // NOI18N\n setTitle(bundle.getString(\"MainFrame.title\")); // NOI18N\n setMinimumSize(new java.awt.Dimension(300, 30));\n getContentPane().setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n getContentPane().add(obsahFrame, gridBagConstraints);\n\n fileMenu.setText(bundle.getString(\"MainFrame.fileMenu.text\")); // NOI18N\n\n javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance().getContext().getActionMap(MainFrame.class, this);\n exitMenuItem.setAction(actionMap.get(\"quit\")); // NOI18N\n fileMenu.add(exitMenuItem);\n\n menuBar.add(fileMenu);\n\n helpMenu.setText(bundle.getString(\"MainFrame.helpMenu.text\")); // NOI18N\n\n helpMenuItem.setAction(actionMap.get(\"showHelpBox\")); // NOI18N\n helpMenuItem.setText(bundle.getString(\"MainFrame.helpMenuItem.text\")); // NOI18N\n helpMenuItem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n napoveda(evt);\n }\n });\n helpMenu.add(helpMenuItem);\n\n aboutMenuItem.setText(bundle.getString(\"MainFrame.aboutMenuItem.text\")); // NOI18N\n aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n about(evt);\n }\n });\n helpMenu.add(aboutMenuItem);\n\n menuBar.add(helpMenu);\n\n setJMenuBar(menuBar);\n\n pack();\n }", "private void initComponents() {\n java.awt.GridBagConstraints gridBagConstraints;\n\n scroolPane1 = new pkl49.component.ScroolPane();\n panelScroll = new pkl49.component.PanelTransparan();\n panelTabel = new pkl49.component.PanelTransparan();\n panelTransparan2 = new pkl49.component.PanelTransparan();\n label1 = new pkl49.component.Label();\n panelTransparan3 = new pkl49.component.PanelTransparan();\n label2 = new pkl49.component.Label();\n panelTransparan4 = new pkl49.component.PanelTransparan();\n label3 = new pkl49.component.Label();\n label4 = new pkl49.component.Label();\n label5 = new pkl49.component.Label();\n panelTransparan5 = new pkl49.component.PanelTransparan();\n label6 = new pkl49.component.Label();\n label8 = new pkl49.component.Label();\n label10 = new pkl49.component.Label();\n label11 = new pkl49.component.Label();\n label12 = new pkl49.component.Label();\n label39 = new pkl49.component.Label();\n panelTransparan7 = new pkl49.component.PanelTransparan();\n label9 = new pkl49.component.Label();\n label13 = new pkl49.component.Label();\n label14 = new pkl49.component.Label();\n label15 = new pkl49.component.Label();\n label16 = new pkl49.component.Label();\n label17 = new pkl49.component.Label();\n label18 = new pkl49.component.Label();\n panelTransparan13 = new pkl49.component.PanelTransparan();\n label19 = new pkl49.component.Label();\n label21 = new pkl49.component.Label();\n label22 = new pkl49.component.Label();\n label24 = new pkl49.component.Label();\n panelTransparan14 = new pkl49.component.PanelTransparan();\n label26 = new pkl49.component.Label();\n label27 = new pkl49.component.Label();\n label89 = new pkl49.component.Label();\n label90 = new pkl49.component.Label();\n panelTransparan15 = new pkl49.component.PanelTransparan();\n label28 = new pkl49.component.Label();\n label29 = new pkl49.component.Label();\n label30 = new pkl49.component.Label();\n label31 = new pkl49.component.Label();\n label32 = new pkl49.component.Label();\n label33 = new pkl49.component.Label();\n label34 = new pkl49.component.Label();\n label37 = new pkl49.component.Label();\n panelTransparan16 = new pkl49.component.PanelTransparan();\n label35 = new pkl49.component.Label();\n label36 = new pkl49.component.Label();\n label38 = new pkl49.component.Label();\n label40 = new pkl49.component.Label();\n panelTransparan17 = new pkl49.component.PanelTransparan();\n label41 = new pkl49.component.Label();\n label42 = new pkl49.component.Label();\n label43 = new pkl49.component.Label();\n label44 = new pkl49.component.Label();\n label91 = new pkl49.component.Label();\n panelTransparan18 = new pkl49.component.PanelTransparan();\n label49 = new pkl49.component.Label();\n label50 = new pkl49.component.Label();\n label51 = new pkl49.component.Label();\n label52 = new pkl49.component.Label();\n panelTransparan19 = new pkl49.component.PanelTransparan();\n label45 = new pkl49.component.Label();\n label46 = new pkl49.component.Label();\n panelTransparan20 = new pkl49.component.PanelTransparan();\n label47 = new pkl49.component.Label();\n panelTransparan27 = new pkl49.component.PanelTransparan();\n label63 = new pkl49.component.Label();\n panelTransparan23 = new pkl49.component.PanelTransparan();\n label55 = new pkl49.component.Label();\n panelTransparan24 = new pkl49.component.PanelTransparan();\n label56 = new pkl49.component.Label();\n panelTransparan21 = new pkl49.component.PanelTransparan();\n label48 = new pkl49.component.Label();\n panelTransparan22 = new pkl49.component.PanelTransparan();\n label54 = new pkl49.component.Label();\n panelTransparan25 = new pkl49.component.PanelTransparan();\n label57 = new pkl49.component.Label();\n panelTransparan26 = new pkl49.component.PanelTransparan();\n label58 = new pkl49.component.Label();\n panelTransparan28 = new pkl49.component.PanelTransparan();\n label59 = new pkl49.component.Label();\n panelTransparan29 = new pkl49.component.PanelTransparan();\n label60 = new pkl49.component.Label();\n label61 = new pkl49.component.Label();\n panelTransparan30 = new pkl49.component.PanelTransparan();\n label62 = new pkl49.component.Label();\n label64 = new pkl49.component.Label();\n label65 = new pkl49.component.Label();\n label66 = new pkl49.component.Label();\n label67 = new pkl49.component.Label();\n label70 = new pkl49.component.Label();\n panelTransparan31 = new pkl49.component.PanelTransparan();\n label68 = new pkl49.component.Label();\n label69 = new pkl49.component.Label();\n label92 = new pkl49.component.Label();\n label93 = new pkl49.component.Label();\n label104 = new pkl49.component.Label();\n panelTransparan32 = new pkl49.component.PanelTransparan();\n label71 = new pkl49.component.Label();\n label76 = new pkl49.component.Label();\n label105 = new pkl49.component.Label();\n label106 = new pkl49.component.Label();\n label107 = new pkl49.component.Label();\n panelTransparan33 = new pkl49.component.PanelTransparan();\n label77 = new pkl49.component.Label();\n label78 = new pkl49.component.Label();\n label79 = new pkl49.component.Label();\n panelTransparan34 = new pkl49.component.PanelTransparan();\n label72 = new pkl49.component.Label();\n panelTransparan35 = new pkl49.component.PanelTransparan();\n label73 = new pkl49.component.Label();\n panelTransparan36 = new pkl49.component.PanelTransparan();\n label74 = new pkl49.component.Label();\n panelTransparan37 = new pkl49.component.PanelTransparan();\n label75 = new pkl49.component.Label();\n panelTransparan38 = new pkl49.component.PanelTransparan();\n label80 = new pkl49.component.Label();\n panelTransparan39 = new pkl49.component.PanelTransparan();\n label81 = new pkl49.component.Label();\n panelTransparan40 = new pkl49.component.PanelTransparan();\n label82 = new pkl49.component.Label();\n panelTransparan41 = new pkl49.component.PanelTransparan();\n label83 = new pkl49.component.Label();\n panelTransparan42 = new pkl49.component.PanelTransparan();\n label84 = new pkl49.component.Label();\n panelTransparan43 = new pkl49.component.PanelTransparan();\n label85 = new pkl49.component.Label();\n panelTransparan44 = new pkl49.component.PanelTransparan();\n label86 = new pkl49.component.Label();\n panelTransparan45 = new pkl49.component.PanelTransparan();\n label87 = new pkl49.component.Label();\n panelTransparan46 = new pkl49.component.PanelTransparan();\n label88 = new pkl49.component.Label();\n panelTransparan52 = new pkl49.component.PanelTransparan();\n label94 = new pkl49.component.Label();\n panelTransparan53 = new pkl49.component.PanelTransparan();\n txtB9AK2_1 = new pkl49.component.TextField();\n panelTransparan54 = new pkl49.component.PanelTransparan();\n txtB9AK4_26 = new pkl49.component.TextField();\n panelTransparan55 = new pkl49.component.PanelTransparan();\n txtB9AK3_26 = new pkl49.component.TextField();\n txtB9AK3_26Als = new pkl49.component.TextField();\n panelTransparan56 = new pkl49.component.PanelTransparan();\n txtB9AK5_1 = new pkl49.component.TextField();\n txtB9AK5_1Als = new pkl49.component.TextField();\n panelTransparan57 = new pkl49.component.PanelTransparan();\n txtB9AK6_1 = new pkl49.component.TextField();\n panelTransparan58 = new pkl49.component.PanelTransparan();\n txtB9AK7_1 = new pkl49.component.TextField();\n panelTransparan59 = new pkl49.component.PanelTransparan();\n txtB9AK8_1 = new pkl49.component.TextField();\n panelTransparan60 = new pkl49.component.PanelTransparan();\n txtB9AK9_1 = new pkl49.component.TextField();\n panelTransparan61 = new pkl49.component.PanelTransparan();\n txtB9AK10_1 = new pkl49.component.TextField();\n panelTransparan62 = new pkl49.component.PanelTransparan();\n txtB9AK11_1 = new pkl49.component.TextField();\n panelTransparan63 = new pkl49.component.PanelTransparan();\n txtB9AK12_26 = new pkl49.component.TextField();\n panelTransparan64 = new pkl49.component.PanelTransparan();\n txtB9AK13_1 = new pkl49.component.TextField();\n txtB9AK13_1Als = new pkl49.component.TextField();\n panelTransparan70 = new pkl49.component.PanelTransparan();\n label95 = new pkl49.component.Label();\n panelTransparan71 = new pkl49.component.PanelTransparan();\n txtB9AK2_2 = new pkl49.component.TextField();\n panelTransparan72 = new pkl49.component.PanelTransparan();\n panelTransparan73 = new pkl49.component.PanelTransparan();\n panelTransparan74 = new pkl49.component.PanelTransparan();\n txtB9AK5_2 = new pkl49.component.TextField();\n txtB9AK5_2Als = new pkl49.component.TextField();\n panelTransparan75 = new pkl49.component.PanelTransparan();\n txtB9AK6_2 = new pkl49.component.TextField();\n panelTransparan76 = new pkl49.component.PanelTransparan();\n txtB9AK7_2 = new pkl49.component.TextField();\n panelTransparan77 = new pkl49.component.PanelTransparan();\n txtB9AK8_2 = new pkl49.component.TextField();\n panelTransparan78 = new pkl49.component.PanelTransparan();\n txtB9AK9_2 = new pkl49.component.TextField();\n panelTransparan79 = new pkl49.component.PanelTransparan();\n txtB9AK10_2 = new pkl49.component.TextField();\n panelTransparan80 = new pkl49.component.PanelTransparan();\n txtB9AK11_2 = new pkl49.component.TextField();\n panelTransparan81 = new pkl49.component.PanelTransparan();\n panelTransparan82 = new pkl49.component.PanelTransparan();\n txtB9AK13_2 = new pkl49.component.TextField();\n txtB9AK13_2Als = new pkl49.component.TextField();\n panelTransparan88 = new pkl49.component.PanelTransparan();\n label96 = new pkl49.component.Label();\n panelTransparan89 = new pkl49.component.PanelTransparan();\n txtB9AK2_3 = new pkl49.component.TextField();\n panelTransparan90 = new pkl49.component.PanelTransparan();\n panelTransparan91 = new pkl49.component.PanelTransparan();\n panelTransparan92 = new pkl49.component.PanelTransparan();\n txtB9AK5_3 = new pkl49.component.TextField();\n txtB9AK5_3Als = new pkl49.component.TextField();\n panelTransparan93 = new pkl49.component.PanelTransparan();\n txtB9AK6_3 = new pkl49.component.TextField();\n panelTransparan94 = new pkl49.component.PanelTransparan();\n txtB9AK7_3 = new pkl49.component.TextField();\n panelTransparan95 = new pkl49.component.PanelTransparan();\n txtB9AK9_3 = new pkl49.component.TextField();\n panelTransparan96 = new pkl49.component.PanelTransparan();\n txtB9AK8_3 = new pkl49.component.TextField();\n panelTransparan97 = new pkl49.component.PanelTransparan();\n txtB9AK10_3 = new pkl49.component.TextField();\n panelTransparan98 = new pkl49.component.PanelTransparan();\n txtB9AK11_3 = new pkl49.component.TextField();\n panelTransparan99 = new pkl49.component.PanelTransparan();\n panelTransparan100 = new pkl49.component.PanelTransparan();\n txtB9AK13_3 = new pkl49.component.TextField();\n txtB9AK13_3Als = new pkl49.component.TextField();\n panelTransparan106 = new pkl49.component.PanelTransparan();\n label97 = new pkl49.component.Label();\n panelTransparan107 = new pkl49.component.PanelTransparan();\n txtB9AK2_4 = new pkl49.component.TextField();\n panelTransparan108 = new pkl49.component.PanelTransparan();\n panelTransparan109 = new pkl49.component.PanelTransparan();\n panelTransparan110 = new pkl49.component.PanelTransparan();\n txtB9AK5_4 = new pkl49.component.TextField();\n txtB9AK5_4Als = new pkl49.component.TextField();\n panelTransparan111 = new pkl49.component.PanelTransparan();\n txtB9AK6_4 = new pkl49.component.TextField();\n panelTransparan112 = new pkl49.component.PanelTransparan();\n txtB9AK7_4 = new pkl49.component.TextField();\n panelTransparan113 = new pkl49.component.PanelTransparan();\n txtB9AK8_4 = new pkl49.component.TextField();\n panelTransparan114 = new pkl49.component.PanelTransparan();\n txtB9AK9_4 = new pkl49.component.TextField();\n panelTransparan115 = new pkl49.component.PanelTransparan();\n txtB9AK10_4 = new pkl49.component.TextField();\n panelTransparan116 = new pkl49.component.PanelTransparan();\n txtB9AK11_4 = new pkl49.component.TextField();\n panelTransparan117 = new pkl49.component.PanelTransparan();\n panelTransparan118 = new pkl49.component.PanelTransparan();\n txtB9AK13_4 = new pkl49.component.TextField();\n txtB9AK13_4Als = new pkl49.component.TextField();\n panelTransparan124 = new pkl49.component.PanelTransparan();\n label98 = new pkl49.component.Label();\n panelTransparan125 = new pkl49.component.PanelTransparan();\n txtB9AK2_5 = new pkl49.component.TextField();\n panelTransparan126 = new pkl49.component.PanelTransparan();\n panelTransparan127 = new pkl49.component.PanelTransparan();\n panelTransparan128 = new pkl49.component.PanelTransparan();\n txtB9AK5_5 = new pkl49.component.TextField();\n txtB9AK5_5Als = new pkl49.component.TextField();\n panelTransparan129 = new pkl49.component.PanelTransparan();\n txtB9AK6_5 = new pkl49.component.TextField();\n panelTransparan130 = new pkl49.component.PanelTransparan();\n txtB9AK7_5 = new pkl49.component.TextField();\n panelTransparan131 = new pkl49.component.PanelTransparan();\n txtB9AK8_5 = new pkl49.component.TextField();\n panelTransparan132 = new pkl49.component.PanelTransparan();\n txtB9AK9_5 = new pkl49.component.TextField();\n panelTransparan133 = new pkl49.component.PanelTransparan();\n txtB9AK10_5 = new pkl49.component.TextField();\n panelTransparan134 = new pkl49.component.PanelTransparan();\n txtB9AK11_5 = new pkl49.component.TextField();\n panelTransparan135 = new pkl49.component.PanelTransparan();\n panelTransparan136 = new pkl49.component.PanelTransparan();\n txtB9AK13_5 = new pkl49.component.TextField();\n txtB9AK13_5Als = new pkl49.component.TextField();\n panelTransparan142 = new pkl49.component.PanelTransparan();\n label99 = new pkl49.component.Label();\n panelTransparan143 = new pkl49.component.PanelTransparan();\n txtB9AK2_6 = new pkl49.component.TextField();\n panelTransparan144 = new pkl49.component.PanelTransparan();\n panelTransparan145 = new pkl49.component.PanelTransparan();\n panelTransparan146 = new pkl49.component.PanelTransparan();\n txtB9AK5_6 = new pkl49.component.TextField();\n txtB9AK5_6Als = new pkl49.component.TextField();\n panelTransparan147 = new pkl49.component.PanelTransparan();\n txtB9AK6_6 = new pkl49.component.TextField();\n panelTransparan148 = new pkl49.component.PanelTransparan();\n txtB9AK7_6 = new pkl49.component.TextField();\n panelTransparan149 = new pkl49.component.PanelTransparan();\n txtB9AK8_6 = new pkl49.component.TextField();\n panelTransparan150 = new pkl49.component.PanelTransparan();\n txtB9AK9_6 = new pkl49.component.TextField();\n panelTransparan151 = new pkl49.component.PanelTransparan();\n txtB9AK10_6 = new pkl49.component.TextField();\n panelTransparan152 = new pkl49.component.PanelTransparan();\n txtB9AK11_6 = new pkl49.component.TextField();\n panelTransparan153 = new pkl49.component.PanelTransparan();\n panelTransparan154 = new pkl49.component.PanelTransparan();\n txtB9AK13_6 = new pkl49.component.TextField();\n txtB9AK13_6Als = new pkl49.component.TextField();\n panelTransparan160 = new pkl49.component.PanelTransparan();\n label100 = new pkl49.component.Label();\n panelTransparan161 = new pkl49.component.PanelTransparan();\n txtB9AK2_7 = new pkl49.component.TextField();\n panelTransparan162 = new pkl49.component.PanelTransparan();\n panelTransparan163 = new pkl49.component.PanelTransparan();\n panelTransparan164 = new pkl49.component.PanelTransparan();\n txtB9AK5_7 = new pkl49.component.TextField();\n txtB9AK5_7Als = new pkl49.component.TextField();\n panelTransparan165 = new pkl49.component.PanelTransparan();\n txtB9AK6_7 = new pkl49.component.TextField();\n panelTransparan166 = new pkl49.component.PanelTransparan();\n txtB9AK7_7 = new pkl49.component.TextField();\n panelTransparan167 = new pkl49.component.PanelTransparan();\n txtB9AK8_7 = new pkl49.component.TextField();\n panelTransparan168 = new pkl49.component.PanelTransparan();\n txtB9AK9_7 = new pkl49.component.TextField();\n panelTransparan169 = new pkl49.component.PanelTransparan();\n txtB9AK10_7 = new pkl49.component.TextField();\n panelTransparan170 = new pkl49.component.PanelTransparan();\n txtB9AK11_7 = new pkl49.component.TextField();\n panelTransparan171 = new pkl49.component.PanelTransparan();\n panelTransparan172 = new pkl49.component.PanelTransparan();\n txtB9AK13_7 = new pkl49.component.TextField();\n txtB9AK13_7Als = new pkl49.component.TextField();\n panelTransparan178 = new pkl49.component.PanelTransparan();\n label101 = new pkl49.component.Label();\n panelTransparan179 = new pkl49.component.PanelTransparan();\n txtB9AK2_8 = new pkl49.component.TextField();\n panelTransparan180 = new pkl49.component.PanelTransparan();\n panelTransparan181 = new pkl49.component.PanelTransparan();\n panelTransparan182 = new pkl49.component.PanelTransparan();\n txtB9AK5_8 = new pkl49.component.TextField();\n txtB9AK5_8Als = new pkl49.component.TextField();\n panelTransparan183 = new pkl49.component.PanelTransparan();\n txtB9AK6_8 = new pkl49.component.TextField();\n panelTransparan184 = new pkl49.component.PanelTransparan();\n txtB9AK7_8 = new pkl49.component.TextField();\n panelTransparan185 = new pkl49.component.PanelTransparan();\n txtB9AK8_8 = new pkl49.component.TextField();\n panelTransparan186 = new pkl49.component.PanelTransparan();\n txtB9AK9_8 = new pkl49.component.TextField();\n panelTransparan187 = new pkl49.component.PanelTransparan();\n txtB9AK10_8 = new pkl49.component.TextField();\n panelTransparan188 = new pkl49.component.PanelTransparan();\n txtB9AK11_8 = new pkl49.component.TextField();\n panelTransparan189 = new pkl49.component.PanelTransparan();\n panelTransparan190 = new pkl49.component.PanelTransparan();\n txtB9AK13_8 = new pkl49.component.TextField();\n txtB9AK13_8Als = new pkl49.component.TextField();\n panelTransparan196 = new pkl49.component.PanelTransparan();\n label102 = new pkl49.component.Label();\n panelTransparan197 = new pkl49.component.PanelTransparan();\n txtB9AK2_9 = new pkl49.component.TextField();\n panelTransparan198 = new pkl49.component.PanelTransparan();\n panelTransparan199 = new pkl49.component.PanelTransparan();\n panelTransparan200 = new pkl49.component.PanelTransparan();\n txtB9AK5_9 = new pkl49.component.TextField();\n txtB9AK5_9Als = new pkl49.component.TextField();\n panelTransparan201 = new pkl49.component.PanelTransparan();\n txtB9AK6_9 = new pkl49.component.TextField();\n panelTransparan202 = new pkl49.component.PanelTransparan();\n txtB9AK7_9 = new pkl49.component.TextField();\n panelTransparan203 = new pkl49.component.PanelTransparan();\n txtB9AK8_9 = new pkl49.component.TextField();\n panelTransparan204 = new pkl49.component.PanelTransparan();\n txtB9AK9_9 = new pkl49.component.TextField();\n panelTransparan205 = new pkl49.component.PanelTransparan();\n txtB9AK10_9 = new pkl49.component.TextField();\n panelTransparan206 = new pkl49.component.PanelTransparan();\n txtB9AK11_9 = new pkl49.component.TextField();\n panelTransparan207 = new pkl49.component.PanelTransparan();\n panelTransparan208 = new pkl49.component.PanelTransparan();\n txtB9AK13_9 = new pkl49.component.TextField();\n txtB9AK13_9Als = new pkl49.component.TextField();\n panelTransparan214 = new pkl49.component.PanelTransparan();\n label103 = new pkl49.component.Label();\n panelTransparan215 = new pkl49.component.PanelTransparan();\n txtB9AK2_10 = new pkl49.component.TextField();\n panelTransparan216 = new pkl49.component.PanelTransparan();\n panelTransparan217 = new pkl49.component.PanelTransparan();\n panelTransparan218 = new pkl49.component.PanelTransparan();\n txtB9AK5_10 = new pkl49.component.TextField();\n txtB9AK5_10Als = new pkl49.component.TextField();\n panelTransparan219 = new pkl49.component.PanelTransparan();\n txtB9AK6_10 = new pkl49.component.TextField();\n panelTransparan220 = new pkl49.component.PanelTransparan();\n txtB9AK7_10 = new pkl49.component.TextField();\n panelTransparan221 = new pkl49.component.PanelTransparan();\n txtB9AK8_10 = new pkl49.component.TextField();\n panelTransparan222 = new pkl49.component.PanelTransparan();\n txtB9AK9_10 = new pkl49.component.TextField();\n panelTransparan223 = new pkl49.component.PanelTransparan();\n txtB9AK10_10 = new pkl49.component.TextField();\n panelTransparan224 = new pkl49.component.PanelTransparan();\n txtB9AK11_10 = new pkl49.component.TextField();\n panelTransparan225 = new pkl49.component.PanelTransparan();\n panelTransparan226 = new pkl49.component.PanelTransparan();\n txtB9AK13_10 = new pkl49.component.TextField();\n txtB9AK13_10Als = new pkl49.component.TextField();\n panelTransparan227 = new pkl49.component.PanelTransparan();\n label108 = new pkl49.component.Label();\n panelTransparan228 = new pkl49.component.PanelTransparan();\n txtB9AK2_11 = new pkl49.component.TextField();\n panelTransparan229 = new pkl49.component.PanelTransparan();\n panelTransparan230 = new pkl49.component.PanelTransparan();\n panelTransparan231 = new pkl49.component.PanelTransparan();\n txtB9AK5_11 = new pkl49.component.TextField();\n txtB9AK5_11Als = new pkl49.component.TextField();\n panelTransparan232 = new pkl49.component.PanelTransparan();\n txtB9AK6_11 = new pkl49.component.TextField();\n panelTransparan233 = new pkl49.component.PanelTransparan();\n txtB9AK7_11 = new pkl49.component.TextField();\n panelTransparan234 = new pkl49.component.PanelTransparan();\n txtB9AK8_11 = new pkl49.component.TextField();\n panelTransparan235 = new pkl49.component.PanelTransparan();\n txtB9AK9_11 = new pkl49.component.TextField();\n panelTransparan236 = new pkl49.component.PanelTransparan();\n txtB9AK10_11 = new pkl49.component.TextField();\n panelTransparan237 = new pkl49.component.PanelTransparan();\n txtB9AK11_11 = new pkl49.component.TextField();\n panelTransparan238 = new pkl49.component.PanelTransparan();\n panelTransparan239 = new pkl49.component.PanelTransparan();\n txtB9AK13_11 = new pkl49.component.TextField();\n txtB9AK13_11Als = new pkl49.component.TextField();\n panelTransparan240 = new pkl49.component.PanelTransparan();\n label109 = new pkl49.component.Label();\n panelTransparan241 = new pkl49.component.PanelTransparan();\n txtB9AK2_12 = new pkl49.component.TextField();\n panelTransparan242 = new pkl49.component.PanelTransparan();\n panelTransparan243 = new pkl49.component.PanelTransparan();\n txtB9AK5_12 = new pkl49.component.TextField();\n txtB9AK5_12Als = new pkl49.component.TextField();\n panelTransparan244 = new pkl49.component.PanelTransparan();\n txtB9AK6_12 = new pkl49.component.TextField();\n panelTransparan245 = new pkl49.component.PanelTransparan();\n txtB9AK7_12 = new pkl49.component.TextField();\n panelTransparan246 = new pkl49.component.PanelTransparan();\n panelTransparan247 = new pkl49.component.PanelTransparan();\n txtB9AK8_12 = new pkl49.component.TextField();\n panelTransparan248 = new pkl49.component.PanelTransparan();\n txtB9AK9_12 = new pkl49.component.TextField();\n panelTransparan249 = new pkl49.component.PanelTransparan();\n txtB9AK10_12 = new pkl49.component.TextField();\n panelTransparan250 = new pkl49.component.PanelTransparan();\n txtB9AK11_12 = new pkl49.component.TextField();\n panelTransparan251 = new pkl49.component.PanelTransparan();\n panelTransparan252 = new pkl49.component.PanelTransparan();\n txtB9AK13_12 = new pkl49.component.TextField();\n txtB9AK13_12Als = new pkl49.component.TextField();\n panelTransparan253 = new pkl49.component.PanelTransparan();\n label110 = new pkl49.component.Label();\n panelTransparan254 = new pkl49.component.PanelTransparan();\n txtB9AK2_13 = new pkl49.component.TextField();\n panelTransparan255 = new pkl49.component.PanelTransparan();\n panelTransparan256 = new pkl49.component.PanelTransparan();\n txtB9AK5_13 = new pkl49.component.TextField();\n txtB9AK5_13Als = new pkl49.component.TextField();\n panelTransparan257 = new pkl49.component.PanelTransparan();\n txtB9AK6_13 = new pkl49.component.TextField();\n panelTransparan258 = new pkl49.component.PanelTransparan();\n txtB9AK7_13 = new pkl49.component.TextField();\n panelTransparan259 = new pkl49.component.PanelTransparan();\n panelTransparan260 = new pkl49.component.PanelTransparan();\n txtB9AK8_13 = new pkl49.component.TextField();\n panelTransparan261 = new pkl49.component.PanelTransparan();\n txtB9AK9_13 = new pkl49.component.TextField();\n panelTransparan262 = new pkl49.component.PanelTransparan();\n txtB9AK10_13 = new pkl49.component.TextField();\n panelTransparan263 = new pkl49.component.PanelTransparan();\n txtB9AK11_13 = new pkl49.component.TextField();\n panelTransparan264 = new pkl49.component.PanelTransparan();\n panelTransparan265 = new pkl49.component.PanelTransparan();\n txtB9AK13_13 = new pkl49.component.TextField();\n txtB9AK13_13Als = new pkl49.component.TextField();\n panelTransparan266 = new pkl49.component.PanelTransparan();\n label111 = new pkl49.component.Label();\n panelTransparan267 = new pkl49.component.PanelTransparan();\n txtB9AK2_14 = new pkl49.component.TextField();\n panelTransparan268 = new pkl49.component.PanelTransparan();\n panelTransparan269 = new pkl49.component.PanelTransparan();\n txtB9AK5_14 = new pkl49.component.TextField();\n txtB9AK5_14Als = new pkl49.component.TextField();\n panelTransparan270 = new pkl49.component.PanelTransparan();\n txtB9AK6_14 = new pkl49.component.TextField();\n panelTransparan271 = new pkl49.component.PanelTransparan();\n txtB9AK7_14 = new pkl49.component.TextField();\n panelTransparan272 = new pkl49.component.PanelTransparan();\n panelTransparan273 = new pkl49.component.PanelTransparan();\n txtB9AK8_14 = new pkl49.component.TextField();\n panelTransparan274 = new pkl49.component.PanelTransparan();\n txtB9AK9_14 = new pkl49.component.TextField();\n panelTransparan275 = new pkl49.component.PanelTransparan();\n txtB9AK10_14 = new pkl49.component.TextField();\n panelTransparan276 = new pkl49.component.PanelTransparan();\n txtB9AK11_14 = new pkl49.component.TextField();\n panelTransparan277 = new pkl49.component.PanelTransparan();\n panelTransparan278 = new pkl49.component.PanelTransparan();\n txtB9AK13_14 = new pkl49.component.TextField();\n txtB9AK13_14Als = new pkl49.component.TextField();\n panelTransparan279 = new pkl49.component.PanelTransparan();\n label112 = new pkl49.component.Label();\n panelTransparan280 = new pkl49.component.PanelTransparan();\n txtB9AK2_15 = new pkl49.component.TextField();\n panelTransparan281 = new pkl49.component.PanelTransparan();\n panelTransparan282 = new pkl49.component.PanelTransparan();\n panelTransparan283 = new pkl49.component.PanelTransparan();\n txtB9AK5_15 = new pkl49.component.TextField();\n txtB9AK5_15Als = new pkl49.component.TextField();\n panelTransparan284 = new pkl49.component.PanelTransparan();\n txtB9AK6_15 = new pkl49.component.TextField();\n panelTransparan285 = new pkl49.component.PanelTransparan();\n txtB9AK7_15 = new pkl49.component.TextField();\n panelTransparan286 = new pkl49.component.PanelTransparan();\n txtB9AK8_15 = new pkl49.component.TextField();\n panelTransparan287 = new pkl49.component.PanelTransparan();\n txtB9AK9_15 = new pkl49.component.TextField();\n panelTransparan288 = new pkl49.component.PanelTransparan();\n txtB9AK10_15 = new pkl49.component.TextField();\n panelTransparan289 = new pkl49.component.PanelTransparan();\n txtB9AK11_15 = new pkl49.component.TextField();\n panelTransparan290 = new pkl49.component.PanelTransparan();\n panelTransparan291 = new pkl49.component.PanelTransparan();\n txtB9AK13_15 = new pkl49.component.TextField();\n txtB9AK13_15Als = new pkl49.component.TextField();\n panelTransparan292 = new pkl49.component.PanelTransparan();\n label113 = new pkl49.component.Label();\n panelTransparan293 = new pkl49.component.PanelTransparan();\n txtB9AK2_16 = new pkl49.component.TextField();\n panelTransparan294 = new pkl49.component.PanelTransparan();\n panelTransparan295 = new pkl49.component.PanelTransparan();\n panelTransparan296 = new pkl49.component.PanelTransparan();\n txtB9AK5_16 = new pkl49.component.TextField();\n txtB9AK5_16Als = new pkl49.component.TextField();\n panelTransparan297 = new pkl49.component.PanelTransparan();\n txtB9AK6_16 = new pkl49.component.TextField();\n panelTransparan298 = new pkl49.component.PanelTransparan();\n txtB9AK7_16 = new pkl49.component.TextField();\n panelTransparan299 = new pkl49.component.PanelTransparan();\n txtB9AK8_16 = new pkl49.component.TextField();\n panelTransparan300 = new pkl49.component.PanelTransparan();\n txtB9AK9_16 = new pkl49.component.TextField();\n panelTransparan301 = new pkl49.component.PanelTransparan();\n txtB9AK10_16 = new pkl49.component.TextField();\n panelTransparan302 = new pkl49.component.PanelTransparan();\n txtB9AK11_16 = new pkl49.component.TextField();\n panelTransparan303 = new pkl49.component.PanelTransparan();\n panelTransparan304 = new pkl49.component.PanelTransparan();\n txtB9AK13_16 = new pkl49.component.TextField();\n txtB9AK13_16Als = new pkl49.component.TextField();\n panelTransparan305 = new pkl49.component.PanelTransparan();\n label114 = new pkl49.component.Label();\n panelTransparan306 = new pkl49.component.PanelTransparan();\n txtB9AK2_17 = new pkl49.component.TextField();\n panelTransparan307 = new pkl49.component.PanelTransparan();\n panelTransparan308 = new pkl49.component.PanelTransparan();\n panelTransparan309 = new pkl49.component.PanelTransparan();\n txtB9AK5_17 = new pkl49.component.TextField();\n txtB9AK5_17Als = new pkl49.component.TextField();\n panelTransparan310 = new pkl49.component.PanelTransparan();\n txtB9AK6_17 = new pkl49.component.TextField();\n panelTransparan311 = new pkl49.component.PanelTransparan();\n txtB9AK7_17 = new pkl49.component.TextField();\n panelTransparan312 = new pkl49.component.PanelTransparan();\n txtB9AK8_17 = new pkl49.component.TextField();\n panelTransparan313 = new pkl49.component.PanelTransparan();\n txtB9AK9_17 = new pkl49.component.TextField();\n panelTransparan314 = new pkl49.component.PanelTransparan();\n txtB9AK10_17 = new pkl49.component.TextField();\n panelTransparan315 = new pkl49.component.PanelTransparan();\n txtB9AK11_17 = new pkl49.component.TextField();\n panelTransparan316 = new pkl49.component.PanelTransparan();\n panelTransparan317 = new pkl49.component.PanelTransparan();\n txtB9AK13_17 = new pkl49.component.TextField();\n txtB9AK13_17Als = new pkl49.component.TextField();\n panelTransparan318 = new pkl49.component.PanelTransparan();\n label115 = new pkl49.component.Label();\n panelTransparan319 = new pkl49.component.PanelTransparan();\n txtB9AK2_18 = new pkl49.component.TextField();\n panelTransparan320 = new pkl49.component.PanelTransparan();\n panelTransparan321 = new pkl49.component.PanelTransparan();\n panelTransparan322 = new pkl49.component.PanelTransparan();\n txtB9AK5_18 = new pkl49.component.TextField();\n txtB9AK5_18Als = new pkl49.component.TextField();\n panelTransparan323 = new pkl49.component.PanelTransparan();\n txtB9AK6_18 = new pkl49.component.TextField();\n panelTransparan324 = new pkl49.component.PanelTransparan();\n txtB9AK7_18 = new pkl49.component.TextField();\n panelTransparan325 = new pkl49.component.PanelTransparan();\n txtB9AK8_18 = new pkl49.component.TextField();\n panelTransparan326 = new pkl49.component.PanelTransparan();\n txtB9AK9_18 = new pkl49.component.TextField();\n panelTransparan327 = new pkl49.component.PanelTransparan();\n txtB9AK10_18 = new pkl49.component.TextField();\n panelTransparan328 = new pkl49.component.PanelTransparan();\n txtB9AK11_18 = new pkl49.component.TextField();\n panelTransparan329 = new pkl49.component.PanelTransparan();\n panelTransparan330 = new pkl49.component.PanelTransparan();\n txtB9AK13_18 = new pkl49.component.TextField();\n txtB9AK13_18Als = new pkl49.component.TextField();\n panelTransparan331 = new pkl49.component.PanelTransparan();\n label116 = new pkl49.component.Label();\n panelTransparan332 = new pkl49.component.PanelTransparan();\n txtB9AK2_19 = new pkl49.component.TextField();\n panelTransparan333 = new pkl49.component.PanelTransparan();\n panelTransparan334 = new pkl49.component.PanelTransparan();\n panelTransparan335 = new pkl49.component.PanelTransparan();\n txtB9AK5_19 = new pkl49.component.TextField();\n txtB9AK5_19Als = new pkl49.component.TextField();\n panelTransparan336 = new pkl49.component.PanelTransparan();\n txtB9AK6_19 = new pkl49.component.TextField();\n panelTransparan337 = new pkl49.component.PanelTransparan();\n txtB9AK7_19 = new pkl49.component.TextField();\n panelTransparan338 = new pkl49.component.PanelTransparan();\n txtB9AK8_19 = new pkl49.component.TextField();\n panelTransparan339 = new pkl49.component.PanelTransparan();\n txtB9AK9_19 = new pkl49.component.TextField();\n panelTransparan340 = new pkl49.component.PanelTransparan();\n txtB9AK10_19 = new pkl49.component.TextField();\n panelTransparan341 = new pkl49.component.PanelTransparan();\n txtB9AK11_19 = new pkl49.component.TextField();\n panelTransparan342 = new pkl49.component.PanelTransparan();\n panelTransparan343 = new pkl49.component.PanelTransparan();\n txtB9AK13_19 = new pkl49.component.TextField();\n txtB9AK13_19Als = new pkl49.component.TextField();\n panelTransparan344 = new pkl49.component.PanelTransparan();\n label117 = new pkl49.component.Label();\n panelTransparan345 = new pkl49.component.PanelTransparan();\n txtB9AK2_20 = new pkl49.component.TextField();\n panelTransparan346 = new pkl49.component.PanelTransparan();\n panelTransparan347 = new pkl49.component.PanelTransparan();\n panelTransparan348 = new pkl49.component.PanelTransparan();\n txtB9AK5_20 = new pkl49.component.TextField();\n txtB9AK5_20Als = new pkl49.component.TextField();\n panelTransparan349 = new pkl49.component.PanelTransparan();\n txtB9AK6_20 = new pkl49.component.TextField();\n panelTransparan350 = new pkl49.component.PanelTransparan();\n txtB9AK7_20 = new pkl49.component.TextField();\n panelTransparan351 = new pkl49.component.PanelTransparan();\n txtB9AK8_20 = new pkl49.component.TextField();\n panelTransparan352 = new pkl49.component.PanelTransparan();\n txtB9AK9_20 = new pkl49.component.TextField();\n panelTransparan353 = new pkl49.component.PanelTransparan();\n txtB9AK10_20 = new pkl49.component.TextField();\n panelTransparan354 = new pkl49.component.PanelTransparan();\n txtB9AK11_20 = new pkl49.component.TextField();\n panelTransparan355 = new pkl49.component.PanelTransparan();\n panelTransparan356 = new pkl49.component.PanelTransparan();\n txtB9AK13_20 = new pkl49.component.TextField();\n txtB9AK13_20Als = new pkl49.component.TextField();\n panelTransparan357 = new pkl49.component.PanelTransparan();\n label118 = new pkl49.component.Label();\n panelTransparan358 = new pkl49.component.PanelTransparan();\n txtB9AK2_21 = new pkl49.component.TextField();\n panelTransparan359 = new pkl49.component.PanelTransparan();\n panelTransparan360 = new pkl49.component.PanelTransparan();\n panelTransparan361 = new pkl49.component.PanelTransparan();\n txtB9AK5_21 = new pkl49.component.TextField();\n txtB9AK5_21Als = new pkl49.component.TextField();\n panelTransparan362 = new pkl49.component.PanelTransparan();\n txtB9AK6_21 = new pkl49.component.TextField();\n panelTransparan363 = new pkl49.component.PanelTransparan();\n txtB9AK7_21 = new pkl49.component.TextField();\n panelTransparan364 = new pkl49.component.PanelTransparan();\n txtB9AK8_21 = new pkl49.component.TextField();\n panelTransparan365 = new pkl49.component.PanelTransparan();\n txtB9AK9_21 = new pkl49.component.TextField();\n panelTransparan366 = new pkl49.component.PanelTransparan();\n txtB9AK10_21 = new pkl49.component.TextField();\n panelTransparan367 = new pkl49.component.PanelTransparan();\n txtB9AK11_21 = new pkl49.component.TextField();\n panelTransparan368 = new pkl49.component.PanelTransparan();\n panelTransparan369 = new pkl49.component.PanelTransparan();\n txtB9AK13_21 = new pkl49.component.TextField();\n txtB9AK13_21Als = new pkl49.component.TextField();\n panelTransparan370 = new pkl49.component.PanelTransparan();\n label119 = new pkl49.component.Label();\n panelTransparan371 = new pkl49.component.PanelTransparan();\n txtB9AK2_22 = new pkl49.component.TextField();\n panelTransparan372 = new pkl49.component.PanelTransparan();\n panelTransparan373 = new pkl49.component.PanelTransparan();\n panelTransparan374 = new pkl49.component.PanelTransparan();\n txtB9AK5_22 = new pkl49.component.TextField();\n txtB9AK5_22Als = new pkl49.component.TextField();\n panelTransparan375 = new pkl49.component.PanelTransparan();\n txtB9AK6_22 = new pkl49.component.TextField();\n panelTransparan376 = new pkl49.component.PanelTransparan();\n txtB9AK7_22 = new pkl49.component.TextField();\n panelTransparan377 = new pkl49.component.PanelTransparan();\n txtB9AK8_22 = new pkl49.component.TextField();\n panelTransparan378 = new pkl49.component.PanelTransparan();\n txtB9AK9_22 = new pkl49.component.TextField();\n panelTransparan379 = new pkl49.component.PanelTransparan();\n txtB9AK10_22 = new pkl49.component.TextField();\n panelTransparan380 = new pkl49.component.PanelTransparan();\n txtB9AK11_22 = new pkl49.component.TextField();\n panelTransparan381 = new pkl49.component.PanelTransparan();\n panelTransparan382 = new pkl49.component.PanelTransparan();\n txtB9AK13_22 = new pkl49.component.TextField();\n txtB9AK13_22Als = new pkl49.component.TextField();\n panelTransparan383 = new pkl49.component.PanelTransparan();\n label120 = new pkl49.component.Label();\n panelTransparan384 = new pkl49.component.PanelTransparan();\n txtB9AK2_23 = new pkl49.component.TextField();\n panelTransparan385 = new pkl49.component.PanelTransparan();\n panelTransparan386 = new pkl49.component.PanelTransparan();\n panelTransparan387 = new pkl49.component.PanelTransparan();\n txtB9AK5_23 = new pkl49.component.TextField();\n txtB9AK5_23Als = new pkl49.component.TextField();\n panelTransparan388 = new pkl49.component.PanelTransparan();\n txtB9AK6_23 = new pkl49.component.TextField();\n panelTransparan389 = new pkl49.component.PanelTransparan();\n txtB9AK7_23 = new pkl49.component.TextField();\n panelTransparan390 = new pkl49.component.PanelTransparan();\n txtB9AK8_23 = new pkl49.component.TextField();\n panelTransparan391 = new pkl49.component.PanelTransparan();\n txtB9AK9_23 = new pkl49.component.TextField();\n panelTransparan392 = new pkl49.component.PanelTransparan();\n txtB9AK10_23 = new pkl49.component.TextField();\n panelTransparan393 = new pkl49.component.PanelTransparan();\n txtB9AK11_23 = new pkl49.component.TextField();\n panelTransparan394 = new pkl49.component.PanelTransparan();\n panelTransparan395 = new pkl49.component.PanelTransparan();\n txtB9AK13_23 = new pkl49.component.TextField();\n txtB9AK13_23Als = new pkl49.component.TextField();\n panelTransparan396 = new pkl49.component.PanelTransparan();\n label121 = new pkl49.component.Label();\n panelTransparan397 = new pkl49.component.PanelTransparan();\n txtB9AK2_24 = new pkl49.component.TextField();\n panelTransparan398 = new pkl49.component.PanelTransparan();\n panelTransparan399 = new pkl49.component.PanelTransparan();\n panelTransparan400 = new pkl49.component.PanelTransparan();\n txtB9AK5_24 = new pkl49.component.TextField();\n txtB9AK5_24Als = new pkl49.component.TextField();\n panelTransparan401 = new pkl49.component.PanelTransparan();\n txtB9AK6_24 = new pkl49.component.TextField();\n panelTransparan402 = new pkl49.component.PanelTransparan();\n txtB9AK7_24 = new pkl49.component.TextField();\n panelTransparan403 = new pkl49.component.PanelTransparan();\n txtB9AK8_24 = new pkl49.component.TextField();\n panelTransparan404 = new pkl49.component.PanelTransparan();\n txtB9AK9_24 = new pkl49.component.TextField();\n panelTransparan405 = new pkl49.component.PanelTransparan();\n txtB9AK10_24 = new pkl49.component.TextField();\n panelTransparan406 = new pkl49.component.PanelTransparan();\n txtB9AK11_24 = new pkl49.component.TextField();\n panelTransparan407 = new pkl49.component.PanelTransparan();\n panelTransparan408 = new pkl49.component.PanelTransparan();\n txtB9AK13_24 = new pkl49.component.TextField();\n txtB9AK13_24Als = new pkl49.component.TextField();\n panelTransparan409 = new pkl49.component.PanelTransparan();\n label122 = new pkl49.component.Label();\n panelTransparan410 = new pkl49.component.PanelTransparan();\n txtB9AK2_25 = new pkl49.component.TextField();\n panelTransparan411 = new pkl49.component.PanelTransparan();\n panelTransparan412 = new pkl49.component.PanelTransparan();\n panelTransparan413 = new pkl49.component.PanelTransparan();\n txtB9AK5_25 = new pkl49.component.TextField();\n txtB9AK5_25Als = new pkl49.component.TextField();\n panelTransparan414 = new pkl49.component.PanelTransparan();\n txtB9AK6_25 = new pkl49.component.TextField();\n panelTransparan415 = new pkl49.component.PanelTransparan();\n txtB9AK7_25 = new pkl49.component.TextField();\n panelTransparan416 = new pkl49.component.PanelTransparan();\n txtB9AK8_25 = new pkl49.component.TextField();\n panelTransparan417 = new pkl49.component.PanelTransparan();\n txtB9AK9_25 = new pkl49.component.TextField();\n panelTransparan418 = new pkl49.component.PanelTransparan();\n txtB9AK10_25 = new pkl49.component.TextField();\n panelTransparan419 = new pkl49.component.PanelTransparan();\n txtB9AK11_25 = new pkl49.component.TextField();\n panelTransparan420 = new pkl49.component.PanelTransparan();\n panelTransparan421 = new pkl49.component.PanelTransparan();\n txtB9AK13_25 = new pkl49.component.TextField();\n txtB9AK13_25Als = new pkl49.component.TextField();\n panelTransparan422 = new pkl49.component.PanelTransparan();\n panelTransparan423 = new pkl49.component.PanelTransparan();\n panelTransparan424 = new pkl49.component.PanelTransparan();\n panelTransparan425 = new pkl49.component.PanelTransparan();\n panelTransparan426 = new pkl49.component.PanelTransparan();\n panelTransparan427 = new pkl49.component.PanelTransparan();\n panelTransparan428 = new pkl49.component.PanelTransparan();\n panelTransparan429 = new pkl49.component.PanelTransparan();\n panelTransparan430 = new pkl49.component.PanelTransparan();\n panelTransparan431 = new pkl49.component.PanelTransparan();\n panelTransparan432 = new pkl49.component.PanelTransparan();\n panelTransparan433 = new pkl49.component.PanelTransparan();\n panelTransparan434 = new pkl49.component.PanelTransparan();\n\n setOpaque(false);\n setLayout(new java.awt.BorderLayout());\n\n panelTabel.setLayout(new java.awt.GridBagLayout());\n\n panelTransparan2.setAlpha(70);\n panelTransparan2.setLayout(new java.awt.GridBagLayout());\n\n label1.setText(\"VIII. PENGETAHUAN TENTANG PROGRAM KESEHATAN GRATIS, PROGRAM PENDIDIKAN GRATIS, DAN PENGETAHUAN TENTANG KESEHATAN\"); // NOI18N\n label1.setFont(new java.awt.Font(\"Tahoma\", 1, 12));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan2.add(label1, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridwidth = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan2, gridBagConstraints);\n\n panelTransparan3.setAlpha(70);\n panelTransparan3.setLayout(new java.awt.GridBagLayout());\n\n label2.setText(\"VIII.A KESEHATAN DAN PENDIDIKAN GRATIS DALAM SATU TAHUN TERAKHIR\"); // NOI18N\n label2.setFont(new java.awt.Font(\"Tahoma\", 1, 12));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan3.add(label2, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.gridwidth = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan3, gridBagConstraints);\n\n panelTransparan4.setAlpha(50);\n panelTransparan4.setLayout(new java.awt.GridBagLayout());\n\n label3.setText(\"No.\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan4.add(label3, gridBagConstraints);\n\n label4.setText(\"ART\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan4.add(label4, gridBagConstraints);\n\n label5.setText(\"Urut\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan4.add(label5, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.gridheight = 4;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan4, gridBagConstraints);\n\n panelTransparan5.setAlpha(50);\n panelTransparan5.setLayout(new java.awt.GridBagLayout());\n\n label6.setText(\"Apakah ART\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan5.add(label6, gridBagConstraints);\n\n label8.setText(\"mempunyai jaminan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan5.add(label8, gridBagConstraints);\n\n label10.setText(\"pembiayaan/asuransi\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan5.add(label10, gridBagConstraints);\n\n label11.setText(\"kesehatan untuk di\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan5.add(label11, gridBagConstraints);\n\n label12.setText(\"[Isikan kode]\"); // NOI18N\n label12.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan5.add(label12, gridBagConstraints);\n\n label39.setText(\"bawah ini?\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan5.add(label39, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan5, gridBagConstraints);\n\n panelTransparan7.setAlpha(50);\n panelTransparan7.setLayout(new java.awt.GridBagLayout());\n\n label9.setText(\"0. Tidak punya\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan7.add(label9, gridBagConstraints);\n\n label13.setText(\"1. Askes\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan7.add(label13, gridBagConstraints);\n\n label14.setText(\"2. Asabri\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan7.add(label14, gridBagConstraints);\n\n label15.setText(\"4. Jamsostek\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan7.add(label15, gridBagConstraints);\n\n label16.setText(\"8. Jamkes Swasta\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan7.add(label16, gridBagConstraints);\n\n label17.setText(\"16. Jamkesmas\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan7.add(label17, gridBagConstraints);\n\n label18.setText(\"32. Jamkes Mandiri\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan7.add(label18, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.gridheight = 3;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan7, gridBagConstraints);\n\n panelTransparan13.setAlpha(50);\n panelTransparan13.setLayout(new java.awt.GridBagLayout());\n\n label19.setText(\"Apakah ada ART yang\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan13.add(label19, gridBagConstraints);\n\n label21.setText(\"mengetahui tentang\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan13.add(label21, gridBagConstraints);\n\n label22.setText(\"program pemerintah\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan13.add(label22, gridBagConstraints);\n\n label24.setText(\"Jamsoskes semesta?\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan13.add(label24, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan13, gridBagConstraints);\n\n panelTransparan14.setAlpha(50);\n panelTransparan14.setLayout(new java.awt.GridBagLayout());\n\n label26.setText(\"1=ya [Sumber informasi]\"); // NOI18N\n label26.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan14.add(label26, gridBagConstraints);\n\n label27.setText(\"2=tidak\"); // NOI18N\n label27.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan14.add(label27, gridBagConstraints);\n\n label89.setText(\"[Jika kode=2,\"); // NOI18N\n label89.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan14.add(label89, gridBagConstraints);\n\n label90.setText(\"lanjut ke K.12]\"); // NOI18N\n label90.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan14.add(label90, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.gridheight = 3;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan14, gridBagConstraints);\n\n panelTransparan15.setAlpha(50);\n panelTransparan15.setLayout(new java.awt.GridBagLayout());\n\n label28.setText(\"Apakah ada ART\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan15.add(label28, gridBagConstraints);\n\n label29.setText(\"tentang siapa\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan15.add(label29, gridBagConstraints);\n\n label30.setText(\"yang mengetahui\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan15.add(label30, gridBagConstraints);\n\n label31.setText(\"yang berhak\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan15.add(label31, gridBagConstraints);\n\n label32.setText(\"pelayanan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan15.add(label32, gridBagConstraints);\n\n label33.setText(\"Jamsoskes\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan15.add(label33, gridBagConstraints);\n\n label34.setText(\"semesta?\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 7;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan15.add(label34, gridBagConstraints);\n\n label37.setText(\"mendapatkan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan15.add(label37, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan15, gridBagConstraints);\n\n panelTransparan16.setAlpha(50);\n panelTransparan16.setLayout(new java.awt.GridBagLayout());\n\n label35.setText(\"1=ya\"); // NOI18N\n label35.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 0;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan16.add(label35, gridBagConstraints);\n\n label36.setText(\"2=tidak\"); // NOI18N\n label36.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan16.add(label36, gridBagConstraints);\n\n label38.setText(\"[Isikan jika\"); // NOI18N\n label38.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan16.add(label38, gridBagConstraints);\n\n label40.setText(\"K.3=1]\"); // NOI18N\n label40.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan16.add(label40, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.gridheight = 3;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan16, gridBagConstraints);\n\n panelTransparan17.setAlpha(50);\n panelTransparan17.setLayout(new java.awt.GridBagLayout());\n\n label41.setText(\"Apakah ART\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan17.add(label41, gridBagConstraints);\n\n label42.setText(\"[Isikan jika K.2=0 dan\"); // NOI18N\n label42.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan17.add(label42, gridBagConstraints);\n\n label43.setText(\"jamsoskes?\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan17.add(label43, gridBagConstraints);\n\n label44.setText(\"K.3=1]\"); // NOI18N\n label44.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan17.add(label44, gridBagConstraints);\n\n label91.setText(\"memanfaatkan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan17.add(label91, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan17, gridBagConstraints);\n\n panelTransparan18.setAlpha(50);\n panelTransparan18.setLayout(new java.awt.GridBagLayout());\n\n label49.setText(\"1=ya\"); // NOI18N\n label49.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 0;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan18.add(label49, gridBagConstraints);\n\n label50.setText(\"2=tidak [alasan]\"); // NOI18N\n label50.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan18.add(label50, gridBagConstraints);\n\n label51.setText(\"[jika kode=2 Lanjut\"); // NOI18N\n label51.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan18.add(label51, gridBagConstraints);\n\n label52.setText(\"ke K12]\"); // NOI18N\n label52.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan18.add(label52, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.gridheight = 3;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan18, gridBagConstraints);\n\n panelTransparan19.setAlpha(50);\n panelTransparan19.setLayout(new java.awt.GridBagLayout());\n\n label45.setText(\"Jenis pelayanan yang pernah didapatkan dengan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan19.add(label45, gridBagConstraints);\n\n label46.setText(\"memanfaatkan jamsoskes\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan19.add(label46, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.gridwidth = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan19, gridBagConstraints);\n\n panelTransparan20.setAlpha(50);\n panelTransparan20.setLayout(new java.awt.GridBagLayout());\n\n label47.setText(\"1=ya 2=tidak\"); // NOI18N\n label47.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan20.add(label47, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.gridwidth = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan20, gridBagConstraints);\n\n panelTransparan27.setAlpha(50);\n panelTransparan27.setLayout(new java.awt.GridBagLayout());\n\n label63.setText(\"Rawat Jalan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan27.add(label63, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.gridwidth = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan27, gridBagConstraints);\n\n panelTransparan23.setAlpha(50);\n panelTransparan23.setLayout(new java.awt.GridBagLayout());\n\n label55.setText(\"Rawat Inap\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan23.add(label55, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.gridwidth = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan23, gridBagConstraints);\n\n panelTransparan24.setAlpha(50);\n panelTransparan24.setLayout(new java.awt.GridBagLayout());\n\n label56.setText(\"Gawat Darurat\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan24.add(label56, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.gridwidth = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan24, gridBagConstraints);\n\n panelTransparan21.setAlpha(50);\n panelTransparan21.setLayout(new java.awt.GridBagLayout());\n\n label48.setText(\"Tahap 1\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan21.add(label48, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan21, gridBagConstraints);\n\n panelTransparan22.setAlpha(50);\n panelTransparan22.setLayout(new java.awt.GridBagLayout());\n\n label54.setText(\"Lanjutan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan22.add(label54, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan22, gridBagConstraints);\n\n panelTransparan25.setAlpha(50);\n panelTransparan25.setLayout(new java.awt.GridBagLayout());\n\n label57.setText(\"Tahap 1\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan25.add(label57, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan25, gridBagConstraints);\n\n panelTransparan26.setAlpha(50);\n panelTransparan26.setLayout(new java.awt.GridBagLayout());\n\n label58.setText(\"Lanjutan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan26.add(label58, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan26, gridBagConstraints);\n\n panelTransparan28.setAlpha(50);\n panelTransparan28.setLayout(new java.awt.GridBagLayout());\n\n label59.setText(\"Puskesmas\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan28.add(label59, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan28, gridBagConstraints);\n\n panelTransparan29.setAlpha(50);\n panelTransparan29.setLayout(new java.awt.GridBagLayout());\n\n label60.setText(\"Rumah\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan29.add(label60, gridBagConstraints);\n\n label61.setText(\"Sakit\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan29.add(label61, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan29, gridBagConstraints);\n\n panelTransparan30.setAlpha(50);\n panelTransparan30.setLayout(new java.awt.GridBagLayout());\n\n label62.setText(\"Apakah ada ART\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan30.add(label62, gridBagConstraints);\n\n label64.setText(\"tentang\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan30.add(label64, gridBagConstraints);\n\n label65.setText(\"yang mengetahui\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan30.add(label65, gridBagConstraints);\n\n label66.setText(\"program\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan30.add(label66, gridBagConstraints);\n\n label67.setText(\"gratis?\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 5;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan30.add(label67, gridBagConstraints);\n\n label70.setText(\"pendidikan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan30.add(label70, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan30, gridBagConstraints);\n\n panelTransparan31.setAlpha(50);\n panelTransparan31.setLayout(new java.awt.GridBagLayout());\n\n label68.setText(\"1=ya\"); // NOI18N\n label68.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan31.add(label68, gridBagConstraints);\n\n label69.setText(\"[Jika kode=2\"); // NOI18N\n label69.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan31.add(label69, gridBagConstraints);\n\n label92.setText(\"Blok IX.B]\"); // NOI18N\n label92.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan31.add(label92, gridBagConstraints);\n\n label93.setText(\"2=tidak\"); // NOI18N\n label93.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan31.add(label93, gridBagConstraints);\n\n label104.setText(\"lanjut ke\"); // NOI18N\n label104.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan31.add(label104, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.gridheight = 3;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan31, gridBagConstraints);\n\n panelTransparan32.setAlpha(50);\n panelTransparan32.setLayout(new java.awt.GridBagLayout());\n\n label71.setText(\"Apakah ART\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan32.add(label71, gridBagConstraints);\n\n label76.setText(\"pendidikan gratis?\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan32.add(label76, gridBagConstraints);\n\n label105.setText(\"memanfaatkan\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan32.add(label105, gridBagConstraints);\n\n label106.setText(\"7-18 tahun]\"); // NOI18N\n label106.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 4;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan32.add(label106, gridBagConstraints);\n\n label107.setText(\"[Ditanyakan untuk ART\"); // NOI18N\n label107.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan32.add(label107, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan32, gridBagConstraints);\n\n panelTransparan33.setAlpha(50);\n panelTransparan33.setLayout(new java.awt.GridBagLayout());\n\n label77.setText(\"1=ya\"); // NOI18N\n label77.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan33.add(label77, gridBagConstraints);\n\n label78.setText(\"alasan jika K.12=1]\"); // NOI18N\n label78.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 2;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan33.add(label78, gridBagConstraints);\n\n label79.setText(\"2=tidak [tanyakan\"); // NOI18N\n label79.setFont(new java.awt.Font(\"Tahoma\", 2, 11));\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan33.add(label79, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 3;\n gridBagConstraints.gridheight = 3;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan33, gridBagConstraints);\n\n panelTransparan34.setAlpha(30);\n panelTransparan34.setLayout(new java.awt.GridBagLayout());\n\n label72.setText(\"(1)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan34.add(label72, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan34, gridBagConstraints);\n\n panelTransparan35.setAlpha(30);\n panelTransparan35.setLayout(new java.awt.GridBagLayout());\n\n label73.setText(\"(2)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan35.add(label73, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan35, gridBagConstraints);\n\n panelTransparan36.setAlpha(30);\n panelTransparan36.setLayout(new java.awt.GridBagLayout());\n\n label74.setText(\"(3)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan36.add(label74, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan36, gridBagConstraints);\n\n panelTransparan37.setAlpha(30);\n panelTransparan37.setLayout(new java.awt.GridBagLayout());\n\n label75.setText(\"(4)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan37.add(label75, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan37, gridBagConstraints);\n\n panelTransparan38.setAlpha(30);\n panelTransparan38.setLayout(new java.awt.GridBagLayout());\n\n label80.setText(\"(5)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan38.add(label80, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan38, gridBagConstraints);\n\n panelTransparan39.setAlpha(30);\n panelTransparan39.setLayout(new java.awt.GridBagLayout());\n\n label81.setText(\"(6)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan39.add(label81, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan39, gridBagConstraints);\n\n panelTransparan40.setAlpha(30);\n panelTransparan40.setLayout(new java.awt.GridBagLayout());\n\n label82.setText(\"(7)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan40.add(label82, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan40, gridBagConstraints);\n\n panelTransparan41.setAlpha(30);\n panelTransparan41.setLayout(new java.awt.GridBagLayout());\n\n label83.setText(\"(8)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan41.add(label83, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan41, gridBagConstraints);\n\n panelTransparan42.setAlpha(30);\n panelTransparan42.setLayout(new java.awt.GridBagLayout());\n\n label84.setText(\"(9)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan42.add(label84, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan42, gridBagConstraints);\n\n panelTransparan43.setAlpha(30);\n panelTransparan43.setLayout(new java.awt.GridBagLayout());\n\n label85.setText(\"(10)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan43.add(label85, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan43, gridBagConstraints);\n\n panelTransparan44.setAlpha(30);\n panelTransparan44.setLayout(new java.awt.GridBagLayout());\n\n label86.setText(\"(11)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan44.add(label86, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan44, gridBagConstraints);\n\n panelTransparan45.setAlpha(30);\n panelTransparan45.setLayout(new java.awt.GridBagLayout());\n\n label87.setText(\"(12)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan45.add(label87, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan45, gridBagConstraints);\n\n panelTransparan46.setAlpha(30);\n panelTransparan46.setLayout(new java.awt.GridBagLayout());\n\n label88.setText(\"(13)\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan46.add(label88, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 6;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan46, gridBagConstraints);\n\n panelTransparan52.setLayout(new java.awt.GridBagLayout());\n\n label94.setText(\"1\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan52.add(label94, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan52, gridBagConstraints);\n\n txtB9AK2_1.setColumns(3);\n txtB9AK2_1.setLength(2);\n txtB9AK2_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan53.add(txtB9AK2_1);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan53, gridBagConstraints);\n\n panelTransparan54.setAlpha(70);\n panelTransparan54.setLayout(new java.awt.GridBagLayout());\n\n txtB9AK4_26.setColumns(2);\n txtB9AK4_26.setMaxDigit('2');\n txtB9AK4_26.setMinDigit('1');\n txtB9AK4_26.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan54.add(txtB9AK4_26, new java.awt.GridBagConstraints());\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan54, gridBagConstraints);\n\n panelTransparan55.setAlpha(70);\n panelTransparan55.setLayout(new java.awt.GridBagLayout());\n\n txtB9AK3_26.setColumns(2);\n txtB9AK3_26.setMaxDigit('2');\n txtB9AK3_26.setMinDigit('1');\n txtB9AK3_26.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(0, 2, 0, 2);\n panelTransparan55.add(txtB9AK3_26, gridBagConstraints);\n\n txtB9AK3_26Als.setColumns(3);\n txtB9AK3_26Als.setCharType(1);\n txtB9AK3_26Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n txtB9AK3_26AlsfocusTxt(evt);\n }\n });\n panelTransparan55.add(txtB9AK3_26Als, new java.awt.GridBagConstraints());\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan55, gridBagConstraints);\n\n txtB9AK5_1.setColumns(2);\n txtB9AK5_1.setMaxDigit('2');\n txtB9AK5_1.setMinDigit('1');\n txtB9AK5_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan56.add(txtB9AK5_1);\n\n txtB9AK5_1Als.setColumns(3);\n txtB9AK5_1Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan56.add(txtB9AK5_1Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan56, gridBagConstraints);\n\n txtB9AK6_1.setColumns(2);\n txtB9AK6_1.setMaxDigit('2');\n txtB9AK6_1.setMinDigit('1');\n txtB9AK6_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan57.add(txtB9AK6_1);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan57, gridBagConstraints);\n\n txtB9AK7_1.setColumns(2);\n txtB9AK7_1.setMaxDigit('2');\n txtB9AK7_1.setMinDigit('1');\n txtB9AK7_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan58.add(txtB9AK7_1);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan58, gridBagConstraints);\n\n txtB9AK8_1.setColumns(2);\n txtB9AK8_1.setMaxDigit('2');\n txtB9AK8_1.setMinDigit('1');\n txtB9AK8_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan59.add(txtB9AK8_1);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan59, gridBagConstraints);\n\n txtB9AK9_1.setColumns(2);\n txtB9AK9_1.setMaxDigit('2');\n txtB9AK9_1.setMinDigit('1');\n txtB9AK9_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan60.add(txtB9AK9_1);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan60, gridBagConstraints);\n\n txtB9AK10_1.setColumns(2);\n txtB9AK10_1.setMaxDigit('2');\n txtB9AK10_1.setMinDigit('1');\n txtB9AK10_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan61.add(txtB9AK10_1);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan61, gridBagConstraints);\n\n txtB9AK11_1.setColumns(2);\n txtB9AK11_1.setMaxDigit('2');\n txtB9AK11_1.setMinDigit('1');\n txtB9AK11_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan62.add(txtB9AK11_1);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan62, gridBagConstraints);\n\n panelTransparan63.setAlpha(70);\n panelTransparan63.setLayout(new java.awt.GridBagLayout());\n\n txtB9AK12_26.setColumns(2);\n txtB9AK12_26.setMaxDigit('2');\n txtB9AK12_26.setMinDigit('1');\n txtB9AK12_26.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan63.add(txtB9AK12_26, new java.awt.GridBagConstraints());\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan63, gridBagConstraints);\n\n txtB9AK13_1.setColumns(2);\n txtB9AK13_1.setMaxDigit('2');\n txtB9AK13_1.setMinDigit('1');\n txtB9AK13_1.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan64.add(txtB9AK13_1);\n\n txtB9AK13_1Als.setColumns(3);\n txtB9AK13_1Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan64.add(txtB9AK13_1Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 8;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan64, gridBagConstraints);\n\n panelTransparan70.setLayout(new java.awt.GridBagLayout());\n\n label95.setText(\"4\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan70.add(label95, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan70, gridBagConstraints);\n\n txtB9AK2_2.setColumns(3);\n txtB9AK2_2.setLength(2);\n txtB9AK2_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan71.add(txtB9AK2_2);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan71, gridBagConstraints);\n\n panelTransparan72.setAlpha(70);\n panelTransparan72.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan72, gridBagConstraints);\n\n panelTransparan73.setAlpha(70);\n panelTransparan73.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan73, gridBagConstraints);\n\n txtB9AK5_2.setColumns(2);\n txtB9AK5_2.setMaxDigit('2');\n txtB9AK5_2.setMinDigit('1');\n txtB9AK5_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan74.add(txtB9AK5_2);\n\n txtB9AK5_2Als.setColumns(3);\n txtB9AK5_2Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan74.add(txtB9AK5_2Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan74, gridBagConstraints);\n\n txtB9AK6_2.setColumns(2);\n txtB9AK6_2.setMaxDigit('2');\n txtB9AK6_2.setMinDigit('1');\n txtB9AK6_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan75.add(txtB9AK6_2);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan75, gridBagConstraints);\n\n txtB9AK7_2.setColumns(2);\n txtB9AK7_2.setMaxDigit('2');\n txtB9AK7_2.setMinDigit('1');\n txtB9AK7_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan76.add(txtB9AK7_2);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan76, gridBagConstraints);\n\n txtB9AK8_2.setColumns(2);\n txtB9AK8_2.setMaxDigit('2');\n txtB9AK8_2.setMinDigit('1');\n txtB9AK8_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan77.add(txtB9AK8_2);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan77, gridBagConstraints);\n\n txtB9AK9_2.setColumns(2);\n txtB9AK9_2.setMaxDigit('2');\n txtB9AK9_2.setMinDigit('1');\n txtB9AK9_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan78.add(txtB9AK9_2);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan78, gridBagConstraints);\n\n txtB9AK10_2.setColumns(2);\n txtB9AK10_2.setMaxDigit('2');\n txtB9AK10_2.setMinDigit('1');\n txtB9AK10_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan79.add(txtB9AK10_2);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan79, gridBagConstraints);\n\n txtB9AK11_2.setColumns(2);\n txtB9AK11_2.setMaxDigit('2');\n txtB9AK11_2.setMinDigit('1');\n txtB9AK11_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan80.add(txtB9AK11_2);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan80, gridBagConstraints);\n\n panelTransparan81.setAlpha(70);\n panelTransparan81.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan81, gridBagConstraints);\n\n txtB9AK13_2.setColumns(2);\n txtB9AK13_2.setMaxDigit('2');\n txtB9AK13_2.setMinDigit('1');\n txtB9AK13_2.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan82.add(txtB9AK13_2);\n\n txtB9AK13_2Als.setColumns(3);\n txtB9AK13_2Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan82.add(txtB9AK13_2Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan82, gridBagConstraints);\n\n panelTransparan88.setLayout(new java.awt.GridBagLayout());\n\n label96.setText(\"5\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan88.add(label96, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan88, gridBagConstraints);\n\n txtB9AK2_3.setColumns(3);\n txtB9AK2_3.setLength(2);\n txtB9AK2_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan89.add(txtB9AK2_3);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan89, gridBagConstraints);\n\n panelTransparan90.setAlpha(70);\n panelTransparan90.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan90, gridBagConstraints);\n\n panelTransparan91.setAlpha(70);\n panelTransparan91.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan91, gridBagConstraints);\n\n txtB9AK5_3.setColumns(2);\n txtB9AK5_3.setMaxDigit('2');\n txtB9AK5_3.setMinDigit('1');\n txtB9AK5_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan92.add(txtB9AK5_3);\n\n txtB9AK5_3Als.setColumns(3);\n txtB9AK5_3Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan92.add(txtB9AK5_3Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan92, gridBagConstraints);\n\n txtB9AK6_3.setColumns(2);\n txtB9AK6_3.setMaxDigit('2');\n txtB9AK6_3.setMinDigit('1');\n txtB9AK6_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan93.add(txtB9AK6_3);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan93, gridBagConstraints);\n\n txtB9AK7_3.setColumns(2);\n txtB9AK7_3.setMaxDigit('2');\n txtB9AK7_3.setMinDigit('1');\n txtB9AK7_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan94.add(txtB9AK7_3);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan94, gridBagConstraints);\n\n txtB9AK9_3.setColumns(2);\n txtB9AK9_3.setMaxDigit('2');\n txtB9AK9_3.setMinDigit('1');\n txtB9AK9_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan95.add(txtB9AK9_3);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan95, gridBagConstraints);\n\n txtB9AK8_3.setColumns(2);\n txtB9AK8_3.setMaxDigit('2');\n txtB9AK8_3.setMinDigit('1');\n txtB9AK8_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan96.add(txtB9AK8_3);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan96, gridBagConstraints);\n\n txtB9AK10_3.setColumns(2);\n txtB9AK10_3.setMaxDigit('2');\n txtB9AK10_3.setMinDigit('1');\n txtB9AK10_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan97.add(txtB9AK10_3);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan97, gridBagConstraints);\n\n txtB9AK11_3.setColumns(2);\n txtB9AK11_3.setMaxDigit('2');\n txtB9AK11_3.setMinDigit('1');\n txtB9AK11_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan98.add(txtB9AK11_3);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan98, gridBagConstraints);\n\n panelTransparan99.setAlpha(70);\n panelTransparan99.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan99, gridBagConstraints);\n\n txtB9AK13_3.setColumns(2);\n txtB9AK13_3.setMaxDigit('2');\n txtB9AK13_3.setMinDigit('1');\n txtB9AK13_3.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan100.add(txtB9AK13_3);\n\n txtB9AK13_3Als.setColumns(3);\n txtB9AK13_3Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan100.add(txtB9AK13_3Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan100, gridBagConstraints);\n\n panelTransparan106.setLayout(new java.awt.GridBagLayout());\n\n label97.setText(\"3\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan106.add(label97, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 10;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan106, gridBagConstraints);\n\n txtB9AK2_4.setColumns(3);\n txtB9AK2_4.setLength(2);\n txtB9AK2_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan107.add(txtB9AK2_4);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan107, gridBagConstraints);\n\n panelTransparan108.setAlpha(70);\n panelTransparan108.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan108, gridBagConstraints);\n\n panelTransparan109.setAlpha(70);\n panelTransparan109.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan109, gridBagConstraints);\n\n txtB9AK5_4.setColumns(2);\n txtB9AK5_4.setMaxDigit('2');\n txtB9AK5_4.setMinDigit('1');\n txtB9AK5_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan110.add(txtB9AK5_4);\n\n txtB9AK5_4Als.setColumns(3);\n txtB9AK5_4Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan110.add(txtB9AK5_4Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan110, gridBagConstraints);\n\n txtB9AK6_4.setColumns(2);\n txtB9AK6_4.setMaxDigit('2');\n txtB9AK6_4.setMinDigit('1');\n txtB9AK6_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan111.add(txtB9AK6_4);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan111, gridBagConstraints);\n\n txtB9AK7_4.setColumns(2);\n txtB9AK7_4.setMaxDigit('2');\n txtB9AK7_4.setMinDigit('1');\n txtB9AK7_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan112.add(txtB9AK7_4);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan112, gridBagConstraints);\n\n txtB9AK8_4.setColumns(2);\n txtB9AK8_4.setMaxDigit('2');\n txtB9AK8_4.setMinDigit('1');\n txtB9AK8_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan113.add(txtB9AK8_4);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan113, gridBagConstraints);\n\n txtB9AK9_4.setColumns(2);\n txtB9AK9_4.setMaxDigit('2');\n txtB9AK9_4.setMinDigit('1');\n txtB9AK9_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan114.add(txtB9AK9_4);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan114, gridBagConstraints);\n\n txtB9AK10_4.setColumns(2);\n txtB9AK10_4.setMaxDigit('2');\n txtB9AK10_4.setMinDigit('1');\n txtB9AK10_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan115.add(txtB9AK10_4);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan115, gridBagConstraints);\n\n txtB9AK11_4.setColumns(2);\n txtB9AK11_4.setMaxDigit('2');\n txtB9AK11_4.setMinDigit('1');\n txtB9AK11_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan116.add(txtB9AK11_4);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan116, gridBagConstraints);\n\n panelTransparan117.setAlpha(70);\n panelTransparan117.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan117, gridBagConstraints);\n\n txtB9AK13_4.setColumns(2);\n txtB9AK13_4.setMaxDigit('2');\n txtB9AK13_4.setMinDigit('1');\n txtB9AK13_4.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan118.add(txtB9AK13_4);\n\n txtB9AK13_4Als.setColumns(3);\n txtB9AK13_4Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan118.add(txtB9AK13_4Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 11;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan118, gridBagConstraints);\n\n panelTransparan124.setLayout(new java.awt.GridBagLayout());\n\n label98.setText(\"6\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan124.add(label98, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan124, gridBagConstraints);\n\n txtB9AK2_5.setColumns(3);\n txtB9AK2_5.setLength(2);\n txtB9AK2_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan125.add(txtB9AK2_5);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan125, gridBagConstraints);\n\n panelTransparan126.setAlpha(70);\n panelTransparan126.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan126, gridBagConstraints);\n\n panelTransparan127.setAlpha(70);\n panelTransparan127.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan127, gridBagConstraints);\n\n txtB9AK5_5.setColumns(2);\n txtB9AK5_5.setMaxDigit('2');\n txtB9AK5_5.setMinDigit('1');\n txtB9AK5_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan128.add(txtB9AK5_5);\n\n txtB9AK5_5Als.setColumns(3);\n txtB9AK5_5Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan128.add(txtB9AK5_5Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan128, gridBagConstraints);\n\n txtB9AK6_5.setColumns(2);\n txtB9AK6_5.setMaxDigit('2');\n txtB9AK6_5.setMinDigit('1');\n txtB9AK6_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan129.add(txtB9AK6_5);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan129, gridBagConstraints);\n\n txtB9AK7_5.setColumns(2);\n txtB9AK7_5.setMaxDigit('2');\n txtB9AK7_5.setMinDigit('1');\n txtB9AK7_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan130.add(txtB9AK7_5);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan130, gridBagConstraints);\n\n txtB9AK8_5.setColumns(2);\n txtB9AK8_5.setMaxDigit('2');\n txtB9AK8_5.setMinDigit('1');\n txtB9AK8_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan131.add(txtB9AK8_5);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan131, gridBagConstraints);\n\n txtB9AK9_5.setColumns(2);\n txtB9AK9_5.setMaxDigit('2');\n txtB9AK9_5.setMinDigit('1');\n txtB9AK9_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan132.add(txtB9AK9_5);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan132, gridBagConstraints);\n\n txtB9AK10_5.setColumns(2);\n txtB9AK10_5.setMaxDigit('2');\n txtB9AK10_5.setMinDigit('1');\n txtB9AK10_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan133.add(txtB9AK10_5);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan133, gridBagConstraints);\n\n txtB9AK11_5.setColumns(2);\n txtB9AK11_5.setMaxDigit('2');\n txtB9AK11_5.setMinDigit('1');\n txtB9AK11_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan134.add(txtB9AK11_5);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan134, gridBagConstraints);\n\n panelTransparan135.setAlpha(70);\n panelTransparan135.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan135, gridBagConstraints);\n\n txtB9AK13_5.setColumns(2);\n txtB9AK13_5.setMaxDigit('2');\n txtB9AK13_5.setMinDigit('1');\n txtB9AK13_5.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan136.add(txtB9AK13_5);\n\n txtB9AK13_5Als.setColumns(3);\n txtB9AK13_5Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan136.add(txtB9AK13_5Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 12;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan136, gridBagConstraints);\n\n panelTransparan142.setLayout(new java.awt.GridBagLayout());\n\n label99.setText(\"2\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan142.add(label99, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 9;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan142, gridBagConstraints);\n\n txtB9AK2_6.setColumns(3);\n txtB9AK2_6.setLength(2);\n txtB9AK2_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan143.add(txtB9AK2_6);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan143, gridBagConstraints);\n\n panelTransparan144.setAlpha(70);\n panelTransparan144.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan144, gridBagConstraints);\n\n panelTransparan145.setAlpha(70);\n panelTransparan145.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan145, gridBagConstraints);\n\n txtB9AK5_6.setColumns(2);\n txtB9AK5_6.setMaxDigit('2');\n txtB9AK5_6.setMinDigit('1');\n txtB9AK5_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan146.add(txtB9AK5_6);\n\n txtB9AK5_6Als.setColumns(3);\n txtB9AK5_6Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan146.add(txtB9AK5_6Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan146, gridBagConstraints);\n\n txtB9AK6_6.setColumns(2);\n txtB9AK6_6.setMaxDigit('2');\n txtB9AK6_6.setMinDigit('1');\n txtB9AK6_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan147.add(txtB9AK6_6);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan147, gridBagConstraints);\n\n txtB9AK7_6.setColumns(2);\n txtB9AK7_6.setMaxDigit('2');\n txtB9AK7_6.setMinDigit('1');\n txtB9AK7_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan148.add(txtB9AK7_6);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan148, gridBagConstraints);\n\n txtB9AK8_6.setColumns(2);\n txtB9AK8_6.setMaxDigit('2');\n txtB9AK8_6.setMinDigit('1');\n txtB9AK8_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan149.add(txtB9AK8_6);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan149, gridBagConstraints);\n\n txtB9AK9_6.setColumns(2);\n txtB9AK9_6.setMaxDigit('2');\n txtB9AK9_6.setMinDigit('1');\n txtB9AK9_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan150.add(txtB9AK9_6);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan150, gridBagConstraints);\n\n txtB9AK10_6.setColumns(2);\n txtB9AK10_6.setMaxDigit('2');\n txtB9AK10_6.setMinDigit('1');\n txtB9AK10_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan151.add(txtB9AK10_6);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan151, gridBagConstraints);\n\n txtB9AK11_6.setColumns(2);\n txtB9AK11_6.setMaxDigit('2');\n txtB9AK11_6.setMinDigit('1');\n txtB9AK11_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan152.add(txtB9AK11_6);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan152, gridBagConstraints);\n\n panelTransparan153.setAlpha(70);\n panelTransparan153.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan153, gridBagConstraints);\n\n txtB9AK13_6.setColumns(2);\n txtB9AK13_6.setMaxDigit('2');\n txtB9AK13_6.setMinDigit('1');\n txtB9AK13_6.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan154.add(txtB9AK13_6);\n\n txtB9AK13_6Als.setColumns(3);\n txtB9AK13_6Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan154.add(txtB9AK13_6Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 13;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan154, gridBagConstraints);\n\n panelTransparan160.setLayout(new java.awt.GridBagLayout());\n\n label100.setText(\"7\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan160.add(label100, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan160, gridBagConstraints);\n\n txtB9AK2_7.setColumns(3);\n txtB9AK2_7.setLength(2);\n txtB9AK2_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan161.add(txtB9AK2_7);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan161, gridBagConstraints);\n\n panelTransparan162.setAlpha(70);\n panelTransparan162.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan162, gridBagConstraints);\n\n panelTransparan163.setAlpha(70);\n panelTransparan163.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan163, gridBagConstraints);\n\n txtB9AK5_7.setColumns(2);\n txtB9AK5_7.setMaxDigit('2');\n txtB9AK5_7.setMinDigit('1');\n txtB9AK5_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan164.add(txtB9AK5_7);\n\n txtB9AK5_7Als.setColumns(3);\n txtB9AK5_7Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan164.add(txtB9AK5_7Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan164, gridBagConstraints);\n\n txtB9AK6_7.setColumns(2);\n txtB9AK6_7.setMaxDigit('2');\n txtB9AK6_7.setMinDigit('1');\n txtB9AK6_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan165.add(txtB9AK6_7);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan165, gridBagConstraints);\n\n txtB9AK7_7.setColumns(2);\n txtB9AK7_7.setMaxDigit('2');\n txtB9AK7_7.setMinDigit('1');\n txtB9AK7_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan166.add(txtB9AK7_7);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan166, gridBagConstraints);\n\n txtB9AK8_7.setColumns(2);\n txtB9AK8_7.setMaxDigit('2');\n txtB9AK8_7.setMinDigit('1');\n txtB9AK8_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan167.add(txtB9AK8_7);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan167, gridBagConstraints);\n\n txtB9AK9_7.setColumns(2);\n txtB9AK9_7.setMaxDigit('2');\n txtB9AK9_7.setMinDigit('1');\n txtB9AK9_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan168.add(txtB9AK9_7);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan168, gridBagConstraints);\n\n txtB9AK10_7.setColumns(2);\n txtB9AK10_7.setMaxDigit('2');\n txtB9AK10_7.setMinDigit('1');\n txtB9AK10_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan169.add(txtB9AK10_7);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan169, gridBagConstraints);\n\n txtB9AK11_7.setColumns(2);\n txtB9AK11_7.setMaxDigit('2');\n txtB9AK11_7.setMinDigit('1');\n txtB9AK11_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan170.add(txtB9AK11_7);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan170, gridBagConstraints);\n\n panelTransparan171.setAlpha(70);\n panelTransparan171.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan171, gridBagConstraints);\n\n txtB9AK13_7.setColumns(2);\n txtB9AK13_7.setMaxDigit('2');\n txtB9AK13_7.setMinDigit('1');\n txtB9AK13_7.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan172.add(txtB9AK13_7);\n\n txtB9AK13_7Als.setColumns(3);\n txtB9AK13_7Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan172.add(txtB9AK13_7Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 14;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan172, gridBagConstraints);\n\n panelTransparan178.setLayout(new java.awt.GridBagLayout());\n\n label101.setText(\"8\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan178.add(label101, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan178, gridBagConstraints);\n\n txtB9AK2_8.setColumns(3);\n txtB9AK2_8.setLength(2);\n txtB9AK2_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan179.add(txtB9AK2_8);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan179, gridBagConstraints);\n\n panelTransparan180.setAlpha(70);\n panelTransparan180.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan180, gridBagConstraints);\n\n panelTransparan181.setAlpha(70);\n panelTransparan181.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan181, gridBagConstraints);\n\n txtB9AK5_8.setColumns(2);\n txtB9AK5_8.setMaxDigit('2');\n txtB9AK5_8.setMinDigit('1');\n txtB9AK5_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan182.add(txtB9AK5_8);\n\n txtB9AK5_8Als.setColumns(3);\n txtB9AK5_8Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan182.add(txtB9AK5_8Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan182, gridBagConstraints);\n\n txtB9AK6_8.setColumns(2);\n txtB9AK6_8.setMaxDigit('2');\n txtB9AK6_8.setMinDigit('1');\n txtB9AK6_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan183.add(txtB9AK6_8);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan183, gridBagConstraints);\n\n txtB9AK7_8.setColumns(2);\n txtB9AK7_8.setMaxDigit('2');\n txtB9AK7_8.setMinDigit('1');\n txtB9AK7_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan184.add(txtB9AK7_8);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan184, gridBagConstraints);\n\n txtB9AK8_8.setColumns(2);\n txtB9AK8_8.setMaxDigit('2');\n txtB9AK8_8.setMinDigit('1');\n txtB9AK8_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan185.add(txtB9AK8_8);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan185, gridBagConstraints);\n\n txtB9AK9_8.setColumns(2);\n txtB9AK9_8.setMaxDigit('2');\n txtB9AK9_8.setMinDigit('1');\n txtB9AK9_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan186.add(txtB9AK9_8);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan186, gridBagConstraints);\n\n txtB9AK10_8.setColumns(2);\n txtB9AK10_8.setMaxDigit('2');\n txtB9AK10_8.setMinDigit('1');\n txtB9AK10_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan187.add(txtB9AK10_8);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan187, gridBagConstraints);\n\n txtB9AK11_8.setColumns(2);\n txtB9AK11_8.setMaxDigit('2');\n txtB9AK11_8.setMinDigit('1');\n txtB9AK11_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan188.add(txtB9AK11_8);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan188, gridBagConstraints);\n\n panelTransparan189.setAlpha(70);\n panelTransparan189.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan189, gridBagConstraints);\n\n txtB9AK13_8.setColumns(2);\n txtB9AK13_8.setMaxDigit('2');\n txtB9AK13_8.setMinDigit('1');\n txtB9AK13_8.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan190.add(txtB9AK13_8);\n\n txtB9AK13_8Als.setColumns(3);\n txtB9AK13_8Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan190.add(txtB9AK13_8Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 15;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan190, gridBagConstraints);\n\n panelTransparan196.setLayout(new java.awt.GridBagLayout());\n\n label102.setText(\"9\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan196.add(label102, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan196, gridBagConstraints);\n\n txtB9AK2_9.setColumns(3);\n txtB9AK2_9.setLength(2);\n txtB9AK2_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan197.add(txtB9AK2_9);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan197, gridBagConstraints);\n\n panelTransparan198.setAlpha(70);\n panelTransparan198.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan198, gridBagConstraints);\n\n panelTransparan199.setAlpha(70);\n panelTransparan199.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan199, gridBagConstraints);\n\n txtB9AK5_9.setColumns(2);\n txtB9AK5_9.setMaxDigit('2');\n txtB9AK5_9.setMinDigit('1');\n txtB9AK5_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan200.add(txtB9AK5_9);\n\n txtB9AK5_9Als.setColumns(3);\n txtB9AK5_9Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan200.add(txtB9AK5_9Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan200, gridBagConstraints);\n\n txtB9AK6_9.setColumns(2);\n txtB9AK6_9.setMaxDigit('2');\n txtB9AK6_9.setMinDigit('1');\n txtB9AK6_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan201.add(txtB9AK6_9);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan201, gridBagConstraints);\n\n txtB9AK7_9.setColumns(2);\n txtB9AK7_9.setMaxDigit('2');\n txtB9AK7_9.setMinDigit('1');\n txtB9AK7_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan202.add(txtB9AK7_9);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan202, gridBagConstraints);\n\n txtB9AK8_9.setColumns(2);\n txtB9AK8_9.setMaxDigit('2');\n txtB9AK8_9.setMinDigit('1');\n txtB9AK8_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan203.add(txtB9AK8_9);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan203, gridBagConstraints);\n\n txtB9AK9_9.setColumns(2);\n txtB9AK9_9.setMaxDigit('2');\n txtB9AK9_9.setMinDigit('1');\n txtB9AK9_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan204.add(txtB9AK9_9);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan204, gridBagConstraints);\n\n txtB9AK10_9.setColumns(2);\n txtB9AK10_9.setMaxDigit('2');\n txtB9AK10_9.setMinDigit('1');\n txtB9AK10_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan205.add(txtB9AK10_9);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan205, gridBagConstraints);\n\n txtB9AK11_9.setColumns(2);\n txtB9AK11_9.setMaxDigit('2');\n txtB9AK11_9.setMinDigit('1');\n txtB9AK11_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan206.add(txtB9AK11_9);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan206, gridBagConstraints);\n\n panelTransparan207.setAlpha(70);\n panelTransparan207.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan207, gridBagConstraints);\n\n txtB9AK13_9.setColumns(2);\n txtB9AK13_9.setMaxDigit('2');\n txtB9AK13_9.setMinDigit('1');\n txtB9AK13_9.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan208.add(txtB9AK13_9);\n\n txtB9AK13_9Als.setColumns(3);\n txtB9AK13_9Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan208.add(txtB9AK13_9Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 16;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan208, gridBagConstraints);\n\n panelTransparan214.setLayout(new java.awt.GridBagLayout());\n\n label103.setText(\"10\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan214.add(label103, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan214, gridBagConstraints);\n\n txtB9AK2_10.setColumns(3);\n txtB9AK2_10.setLength(2);\n txtB9AK2_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan215.add(txtB9AK2_10);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan215, gridBagConstraints);\n\n panelTransparan216.setAlpha(70);\n panelTransparan216.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan216, gridBagConstraints);\n\n panelTransparan217.setAlpha(70);\n panelTransparan217.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan217, gridBagConstraints);\n\n txtB9AK5_10.setColumns(2);\n txtB9AK5_10.setMaxDigit('2');\n txtB9AK5_10.setMinDigit('1');\n txtB9AK5_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan218.add(txtB9AK5_10);\n\n txtB9AK5_10Als.setColumns(3);\n txtB9AK5_10Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan218.add(txtB9AK5_10Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan218, gridBagConstraints);\n\n txtB9AK6_10.setColumns(2);\n txtB9AK6_10.setMaxDigit('2');\n txtB9AK6_10.setMinDigit('1');\n txtB9AK6_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan219.add(txtB9AK6_10);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan219, gridBagConstraints);\n\n txtB9AK7_10.setColumns(2);\n txtB9AK7_10.setMaxDigit('2');\n txtB9AK7_10.setMinDigit('1');\n txtB9AK7_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan220.add(txtB9AK7_10);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan220, gridBagConstraints);\n\n txtB9AK8_10.setColumns(2);\n txtB9AK8_10.setMaxDigit('2');\n txtB9AK8_10.setMinDigit('1');\n txtB9AK8_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan221.add(txtB9AK8_10);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan221, gridBagConstraints);\n\n txtB9AK9_10.setColumns(2);\n txtB9AK9_10.setMaxDigit('2');\n txtB9AK9_10.setMinDigit('1');\n txtB9AK9_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan222.add(txtB9AK9_10);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan222, gridBagConstraints);\n\n txtB9AK10_10.setColumns(2);\n txtB9AK10_10.setMaxDigit('2');\n txtB9AK10_10.setMinDigit('1');\n txtB9AK10_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan223.add(txtB9AK10_10);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan223, gridBagConstraints);\n\n txtB9AK11_10.setColumns(2);\n txtB9AK11_10.setMaxDigit('2');\n txtB9AK11_10.setMinDigit('1');\n txtB9AK11_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan224.add(txtB9AK11_10);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan224, gridBagConstraints);\n\n panelTransparan225.setAlpha(70);\n panelTransparan225.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan225, gridBagConstraints);\n\n txtB9AK13_10.setColumns(2);\n txtB9AK13_10.setMaxDigit('2');\n txtB9AK13_10.setMinDigit('1');\n txtB9AK13_10.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan226.add(txtB9AK13_10);\n\n txtB9AK13_10Als.setColumns(3);\n txtB9AK13_10Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan226.add(txtB9AK13_10Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 18;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan226, gridBagConstraints);\n\n panelTransparan227.setLayout(new java.awt.GridBagLayout());\n\n label108.setText(\"11\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan227.add(label108, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan227, gridBagConstraints);\n\n txtB9AK2_11.setColumns(3);\n txtB9AK2_11.setLength(2);\n txtB9AK2_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan228.add(txtB9AK2_11);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan228, gridBagConstraints);\n\n panelTransparan229.setAlpha(70);\n panelTransparan229.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan229, gridBagConstraints);\n\n panelTransparan230.setAlpha(70);\n panelTransparan230.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan230, gridBagConstraints);\n\n txtB9AK5_11.setColumns(2);\n txtB9AK5_11.setMaxDigit('2');\n txtB9AK5_11.setMinDigit('1');\n txtB9AK5_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan231.add(txtB9AK5_11);\n\n txtB9AK5_11Als.setColumns(3);\n txtB9AK5_11Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan231.add(txtB9AK5_11Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan231, gridBagConstraints);\n\n txtB9AK6_11.setColumns(2);\n txtB9AK6_11.setMaxDigit('2');\n txtB9AK6_11.setMinDigit('1');\n txtB9AK6_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan232.add(txtB9AK6_11);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan232, gridBagConstraints);\n\n txtB9AK7_11.setColumns(2);\n txtB9AK7_11.setMaxDigit('2');\n txtB9AK7_11.setMinDigit('1');\n txtB9AK7_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan233.add(txtB9AK7_11);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan233, gridBagConstraints);\n\n txtB9AK8_11.setColumns(2);\n txtB9AK8_11.setMaxDigit('2');\n txtB9AK8_11.setMinDigit('1');\n txtB9AK8_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan234.add(txtB9AK8_11);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan234, gridBagConstraints);\n\n txtB9AK9_11.setColumns(2);\n txtB9AK9_11.setMaxDigit('2');\n txtB9AK9_11.setMinDigit('1');\n txtB9AK9_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan235.add(txtB9AK9_11);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan235, gridBagConstraints);\n\n txtB9AK10_11.setColumns(2);\n txtB9AK10_11.setMaxDigit('2');\n txtB9AK10_11.setMinDigit('1');\n txtB9AK10_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan236.add(txtB9AK10_11);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan236, gridBagConstraints);\n\n txtB9AK11_11.setColumns(2);\n txtB9AK11_11.setMaxDigit('2');\n txtB9AK11_11.setMinDigit('1');\n txtB9AK11_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan237.add(txtB9AK11_11);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan237, gridBagConstraints);\n\n panelTransparan238.setAlpha(70);\n panelTransparan238.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan238, gridBagConstraints);\n\n txtB9AK13_11.setColumns(2);\n txtB9AK13_11.setMaxDigit('2');\n txtB9AK13_11.setMinDigit('1');\n txtB9AK13_11.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan239.add(txtB9AK13_11);\n\n txtB9AK13_11Als.setColumns(3);\n txtB9AK13_11Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan239.add(txtB9AK13_11Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 20;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan239, gridBagConstraints);\n\n panelTransparan240.setLayout(new java.awt.GridBagLayout());\n\n label109.setText(\"12\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan240.add(label109, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan240, gridBagConstraints);\n\n txtB9AK2_12.setColumns(3);\n txtB9AK2_12.setLength(2);\n txtB9AK2_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan241.add(txtB9AK2_12);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan241, gridBagConstraints);\n\n panelTransparan242.setAlpha(70);\n panelTransparan242.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan242, gridBagConstraints);\n\n txtB9AK5_12.setColumns(2);\n txtB9AK5_12.setMaxDigit('2');\n txtB9AK5_12.setMinDigit('1');\n txtB9AK5_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan243.add(txtB9AK5_12);\n\n txtB9AK5_12Als.setColumns(3);\n txtB9AK5_12Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan243.add(txtB9AK5_12Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan243, gridBagConstraints);\n\n txtB9AK6_12.setColumns(2);\n txtB9AK6_12.setMaxDigit('2');\n txtB9AK6_12.setMinDigit('1');\n txtB9AK6_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan244.add(txtB9AK6_12);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan244, gridBagConstraints);\n\n txtB9AK7_12.setColumns(2);\n txtB9AK7_12.setMaxDigit('2');\n txtB9AK7_12.setMinDigit('1');\n txtB9AK7_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan245.add(txtB9AK7_12);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan245, gridBagConstraints);\n\n panelTransparan246.setAlpha(70);\n panelTransparan246.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan246, gridBagConstraints);\n\n txtB9AK8_12.setColumns(2);\n txtB9AK8_12.setMaxDigit('2');\n txtB9AK8_12.setMinDigit('1');\n txtB9AK8_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan247.add(txtB9AK8_12);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan247, gridBagConstraints);\n\n txtB9AK9_12.setColumns(2);\n txtB9AK9_12.setMaxDigit('2');\n txtB9AK9_12.setMinDigit('1');\n txtB9AK9_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan248.add(txtB9AK9_12);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan248, gridBagConstraints);\n\n txtB9AK10_12.setColumns(2);\n txtB9AK10_12.setMaxDigit('2');\n txtB9AK10_12.setMinDigit('1');\n txtB9AK10_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan249.add(txtB9AK10_12);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan249, gridBagConstraints);\n\n txtB9AK11_12.setColumns(2);\n txtB9AK11_12.setMaxDigit('2');\n txtB9AK11_12.setMinDigit('1');\n txtB9AK11_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan250.add(txtB9AK11_12);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan250, gridBagConstraints);\n\n panelTransparan251.setAlpha(70);\n panelTransparan251.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan251, gridBagConstraints);\n\n txtB9AK13_12.setColumns(2);\n txtB9AK13_12.setMaxDigit('2');\n txtB9AK13_12.setMinDigit('1');\n txtB9AK13_12.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan252.add(txtB9AK13_12);\n\n txtB9AK13_12Als.setColumns(3);\n txtB9AK13_12Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan252.add(txtB9AK13_12Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 21;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan252, gridBagConstraints);\n\n panelTransparan253.setLayout(new java.awt.GridBagLayout());\n\n label110.setText(\"13\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan253.add(label110, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan253, gridBagConstraints);\n\n txtB9AK2_13.setColumns(3);\n txtB9AK2_13.setLength(2);\n txtB9AK2_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan254.add(txtB9AK2_13);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan254, gridBagConstraints);\n\n panelTransparan255.setAlpha(70);\n panelTransparan255.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan255, gridBagConstraints);\n\n txtB9AK5_13.setColumns(2);\n txtB9AK5_13.setMaxDigit('2');\n txtB9AK5_13.setMinDigit('1');\n txtB9AK5_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan256.add(txtB9AK5_13);\n\n txtB9AK5_13Als.setColumns(3);\n txtB9AK5_13Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan256.add(txtB9AK5_13Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan256, gridBagConstraints);\n\n txtB9AK6_13.setColumns(2);\n txtB9AK6_13.setMaxDigit('2');\n txtB9AK6_13.setMinDigit('1');\n txtB9AK6_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan257.add(txtB9AK6_13);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan257, gridBagConstraints);\n\n txtB9AK7_13.setColumns(2);\n txtB9AK7_13.setMaxDigit('2');\n txtB9AK7_13.setMinDigit('1');\n txtB9AK7_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan258.add(txtB9AK7_13);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan258, gridBagConstraints);\n\n panelTransparan259.setAlpha(70);\n panelTransparan259.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan259, gridBagConstraints);\n\n txtB9AK8_13.setColumns(2);\n txtB9AK8_13.setMaxDigit('2');\n txtB9AK8_13.setMinDigit('1');\n txtB9AK8_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan260.add(txtB9AK8_13);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan260, gridBagConstraints);\n\n txtB9AK9_13.setColumns(2);\n txtB9AK9_13.setMaxDigit('2');\n txtB9AK9_13.setMinDigit('1');\n txtB9AK9_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan261.add(txtB9AK9_13);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan261, gridBagConstraints);\n\n txtB9AK10_13.setColumns(2);\n txtB9AK10_13.setMaxDigit('2');\n txtB9AK10_13.setMinDigit('1');\n txtB9AK10_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan262.add(txtB9AK10_13);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan262, gridBagConstraints);\n\n txtB9AK11_13.setColumns(2);\n txtB9AK11_13.setMaxDigit('2');\n txtB9AK11_13.setMinDigit('1');\n txtB9AK11_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan263.add(txtB9AK11_13);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan263, gridBagConstraints);\n\n panelTransparan264.setAlpha(70);\n panelTransparan264.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan264, gridBagConstraints);\n\n txtB9AK13_13.setColumns(2);\n txtB9AK13_13.setMaxDigit('2');\n txtB9AK13_13.setMinDigit('1');\n txtB9AK13_13.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan265.add(txtB9AK13_13);\n\n txtB9AK13_13Als.setColumns(3);\n txtB9AK13_13Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan265.add(txtB9AK13_13Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 22;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan265, gridBagConstraints);\n\n panelTransparan266.setLayout(new java.awt.GridBagLayout());\n\n label111.setText(\"14\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan266.add(label111, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan266, gridBagConstraints);\n\n txtB9AK2_14.setColumns(3);\n txtB9AK2_14.setLength(2);\n txtB9AK2_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan267.add(txtB9AK2_14);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan267, gridBagConstraints);\n\n panelTransparan268.setAlpha(70);\n panelTransparan268.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan268, gridBagConstraints);\n\n txtB9AK5_14.setColumns(2);\n txtB9AK5_14.setMaxDigit('2');\n txtB9AK5_14.setMinDigit('1');\n txtB9AK5_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan269.add(txtB9AK5_14);\n\n txtB9AK5_14Als.setColumns(3);\n txtB9AK5_14Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan269.add(txtB9AK5_14Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan269, gridBagConstraints);\n\n txtB9AK6_14.setColumns(2);\n txtB9AK6_14.setMaxDigit('2');\n txtB9AK6_14.setMinDigit('1');\n txtB9AK6_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan270.add(txtB9AK6_14);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan270, gridBagConstraints);\n\n txtB9AK7_14.setColumns(2);\n txtB9AK7_14.setMaxDigit('2');\n txtB9AK7_14.setMinDigit('1');\n txtB9AK7_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan271.add(txtB9AK7_14);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan271, gridBagConstraints);\n\n panelTransparan272.setAlpha(70);\n panelTransparan272.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan272, gridBagConstraints);\n\n txtB9AK8_14.setColumns(2);\n txtB9AK8_14.setMaxDigit('2');\n txtB9AK8_14.setMinDigit('1');\n txtB9AK8_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan273.add(txtB9AK8_14);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan273, gridBagConstraints);\n\n txtB9AK9_14.setColumns(2);\n txtB9AK9_14.setMaxDigit('2');\n txtB9AK9_14.setMinDigit('1');\n txtB9AK9_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan274.add(txtB9AK9_14);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan274, gridBagConstraints);\n\n txtB9AK10_14.setColumns(2);\n txtB9AK10_14.setMaxDigit('2');\n txtB9AK10_14.setMinDigit('1');\n txtB9AK10_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan275.add(txtB9AK10_14);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan275, gridBagConstraints);\n\n txtB9AK11_14.setColumns(2);\n txtB9AK11_14.setMaxDigit('2');\n txtB9AK11_14.setMinDigit('1');\n txtB9AK11_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan276.add(txtB9AK11_14);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan276, gridBagConstraints);\n\n panelTransparan277.setAlpha(70);\n panelTransparan277.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan277, gridBagConstraints);\n\n txtB9AK13_14.setColumns(2);\n txtB9AK13_14.setMaxDigit('2');\n txtB9AK13_14.setMinDigit('1');\n txtB9AK13_14.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan278.add(txtB9AK13_14);\n\n txtB9AK13_14Als.setColumns(3);\n txtB9AK13_14Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan278.add(txtB9AK13_14Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 24;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan278, gridBagConstraints);\n\n panelTransparan279.setLayout(new java.awt.GridBagLayout());\n\n label112.setText(\"15\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan279.add(label112, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan279, gridBagConstraints);\n\n txtB9AK2_15.setColumns(3);\n txtB9AK2_15.setLength(2);\n txtB9AK2_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan280.add(txtB9AK2_15);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan280, gridBagConstraints);\n\n panelTransparan281.setAlpha(70);\n panelTransparan281.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan281, gridBagConstraints);\n\n panelTransparan282.setAlpha(70);\n panelTransparan282.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan282, gridBagConstraints);\n\n txtB9AK5_15.setColumns(2);\n txtB9AK5_15.setMaxDigit('2');\n txtB9AK5_15.setMinDigit('1');\n txtB9AK5_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan283.add(txtB9AK5_15);\n\n txtB9AK5_15Als.setColumns(3);\n txtB9AK5_15Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan283.add(txtB9AK5_15Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan283, gridBagConstraints);\n\n txtB9AK6_15.setColumns(2);\n txtB9AK6_15.setMaxDigit('2');\n txtB9AK6_15.setMinDigit('1');\n txtB9AK6_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan284.add(txtB9AK6_15);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan284, gridBagConstraints);\n\n txtB9AK7_15.setColumns(2);\n txtB9AK7_15.setMaxDigit('2');\n txtB9AK7_15.setMinDigit('1');\n txtB9AK7_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan285.add(txtB9AK7_15);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan285, gridBagConstraints);\n\n txtB9AK8_15.setColumns(2);\n txtB9AK8_15.setMaxDigit('2');\n txtB9AK8_15.setMinDigit('1');\n txtB9AK8_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan286.add(txtB9AK8_15);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan286, gridBagConstraints);\n\n txtB9AK9_15.setColumns(2);\n txtB9AK9_15.setMaxDigit('2');\n txtB9AK9_15.setMinDigit('1');\n txtB9AK9_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan287.add(txtB9AK9_15);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan287, gridBagConstraints);\n\n txtB9AK10_15.setColumns(2);\n txtB9AK10_15.setMaxDigit('2');\n txtB9AK10_15.setMinDigit('1');\n txtB9AK10_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan288.add(txtB9AK10_15);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan288, gridBagConstraints);\n\n txtB9AK11_15.setColumns(2);\n txtB9AK11_15.setMaxDigit('2');\n txtB9AK11_15.setMinDigit('1');\n txtB9AK11_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan289.add(txtB9AK11_15);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan289, gridBagConstraints);\n\n panelTransparan290.setAlpha(70);\n panelTransparan290.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan290, gridBagConstraints);\n\n txtB9AK13_15.setColumns(2);\n txtB9AK13_15.setMaxDigit('2');\n txtB9AK13_15.setMinDigit('1');\n txtB9AK13_15.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan291.add(txtB9AK13_15);\n\n txtB9AK13_15Als.setColumns(3);\n txtB9AK13_15Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan291.add(txtB9AK13_15Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan291, gridBagConstraints);\n\n panelTransparan292.setLayout(new java.awt.GridBagLayout());\n\n label113.setText(\"16\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan292.add(label113, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan292, gridBagConstraints);\n\n txtB9AK2_16.setColumns(3);\n txtB9AK2_16.setLength(2);\n txtB9AK2_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan293.add(txtB9AK2_16);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan293, gridBagConstraints);\n\n panelTransparan294.setAlpha(70);\n panelTransparan294.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan294, gridBagConstraints);\n\n panelTransparan295.setAlpha(70);\n panelTransparan295.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan295, gridBagConstraints);\n\n txtB9AK5_16.setColumns(2);\n txtB9AK5_16.setMaxDigit('2');\n txtB9AK5_16.setMinDigit('1');\n txtB9AK5_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan296.add(txtB9AK5_16);\n\n txtB9AK5_16Als.setColumns(3);\n txtB9AK5_16Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan296.add(txtB9AK5_16Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan296, gridBagConstraints);\n\n txtB9AK6_16.setColumns(2);\n txtB9AK6_16.setMaxDigit('2');\n txtB9AK6_16.setMinDigit('1');\n txtB9AK6_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan297.add(txtB9AK6_16);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan297, gridBagConstraints);\n\n txtB9AK7_16.setColumns(2);\n txtB9AK7_16.setMaxDigit('2');\n txtB9AK7_16.setMinDigit('1');\n txtB9AK7_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan298.add(txtB9AK7_16);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan298, gridBagConstraints);\n\n txtB9AK8_16.setColumns(2);\n txtB9AK8_16.setMaxDigit('2');\n txtB9AK8_16.setMinDigit('1');\n txtB9AK8_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan299.add(txtB9AK8_16);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan299, gridBagConstraints);\n\n txtB9AK9_16.setColumns(2);\n txtB9AK9_16.setMaxDigit('2');\n txtB9AK9_16.setMinDigit('1');\n txtB9AK9_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan300.add(txtB9AK9_16);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan300, gridBagConstraints);\n\n txtB9AK10_16.setColumns(2);\n txtB9AK10_16.setMaxDigit('2');\n txtB9AK10_16.setMinDigit('1');\n txtB9AK10_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan301.add(txtB9AK10_16);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan301, gridBagConstraints);\n\n txtB9AK11_16.setColumns(2);\n txtB9AK11_16.setMaxDigit('2');\n txtB9AK11_16.setMinDigit('1');\n txtB9AK11_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan302.add(txtB9AK11_16);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 25;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan302, gridBagConstraints);\n\n panelTransparan303.setAlpha(70);\n panelTransparan303.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan303, gridBagConstraints);\n\n txtB9AK13_16.setColumns(2);\n txtB9AK13_16.setMaxDigit('2');\n txtB9AK13_16.setMinDigit('1');\n txtB9AK13_16.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan304.add(txtB9AK13_16);\n\n txtB9AK13_16Als.setColumns(3);\n txtB9AK13_16Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan304.add(txtB9AK13_16Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 26;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan304, gridBagConstraints);\n\n panelTransparan305.setLayout(new java.awt.GridBagLayout());\n\n label114.setText(\"17\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan305.add(label114, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan305, gridBagConstraints);\n\n txtB9AK2_17.setColumns(3);\n txtB9AK2_17.setLength(2);\n txtB9AK2_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan306.add(txtB9AK2_17);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan306, gridBagConstraints);\n\n panelTransparan307.setAlpha(70);\n panelTransparan307.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan307, gridBagConstraints);\n\n panelTransparan308.setAlpha(70);\n panelTransparan308.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan308, gridBagConstraints);\n\n txtB9AK5_17.setColumns(2);\n txtB9AK5_17.setMaxDigit('2');\n txtB9AK5_17.setMinDigit('1');\n txtB9AK5_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan309.add(txtB9AK5_17);\n\n txtB9AK5_17Als.setColumns(3);\n txtB9AK5_17Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan309.add(txtB9AK5_17Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan309, gridBagConstraints);\n\n txtB9AK6_17.setColumns(2);\n txtB9AK6_17.setMaxDigit('2');\n txtB9AK6_17.setMinDigit('1');\n txtB9AK6_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan310.add(txtB9AK6_17);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan310, gridBagConstraints);\n\n txtB9AK7_17.setColumns(2);\n txtB9AK7_17.setMaxDigit('2');\n txtB9AK7_17.setMinDigit('1');\n txtB9AK7_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan311.add(txtB9AK7_17);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan311, gridBagConstraints);\n\n txtB9AK8_17.setColumns(2);\n txtB9AK8_17.setMaxDigit('2');\n txtB9AK8_17.setMinDigit('1');\n txtB9AK8_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan312.add(txtB9AK8_17);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan312, gridBagConstraints);\n\n txtB9AK9_17.setColumns(2);\n txtB9AK9_17.setMaxDigit('2');\n txtB9AK9_17.setMinDigit('1');\n txtB9AK9_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan313.add(txtB9AK9_17);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan313, gridBagConstraints);\n\n txtB9AK10_17.setColumns(2);\n txtB9AK10_17.setMaxDigit('2');\n txtB9AK10_17.setMinDigit('1');\n txtB9AK10_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan314.add(txtB9AK10_17);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan314, gridBagConstraints);\n\n txtB9AK11_17.setColumns(2);\n txtB9AK11_17.setMaxDigit('2');\n txtB9AK11_17.setMinDigit('1');\n txtB9AK11_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan315.add(txtB9AK11_17);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan315, gridBagConstraints);\n\n panelTransparan316.setAlpha(70);\n panelTransparan316.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan316, gridBagConstraints);\n\n txtB9AK13_17.setColumns(2);\n txtB9AK13_17.setMaxDigit('2');\n txtB9AK13_17.setMinDigit('1');\n txtB9AK13_17.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan317.add(txtB9AK13_17);\n\n txtB9AK13_17Als.setColumns(3);\n txtB9AK13_17Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan317.add(txtB9AK13_17Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 27;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan317, gridBagConstraints);\n\n panelTransparan318.setLayout(new java.awt.GridBagLayout());\n\n label115.setText(\"18\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan318.add(label115, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan318, gridBagConstraints);\n\n txtB9AK2_18.setColumns(3);\n txtB9AK2_18.setLength(2);\n txtB9AK2_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan319.add(txtB9AK2_18);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan319, gridBagConstraints);\n\n panelTransparan320.setAlpha(70);\n panelTransparan320.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan320, gridBagConstraints);\n\n panelTransparan321.setAlpha(70);\n panelTransparan321.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan321, gridBagConstraints);\n\n txtB9AK5_18.setColumns(2);\n txtB9AK5_18.setMaxDigit('2');\n txtB9AK5_18.setMinDigit('1');\n txtB9AK5_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan322.add(txtB9AK5_18);\n\n txtB9AK5_18Als.setColumns(3);\n txtB9AK5_18Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan322.add(txtB9AK5_18Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan322, gridBagConstraints);\n\n txtB9AK6_18.setColumns(2);\n txtB9AK6_18.setMaxDigit('2');\n txtB9AK6_18.setMinDigit('1');\n txtB9AK6_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan323.add(txtB9AK6_18);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan323, gridBagConstraints);\n\n txtB9AK7_18.setColumns(2);\n txtB9AK7_18.setMaxDigit('2');\n txtB9AK7_18.setMinDigit('1');\n txtB9AK7_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan324.add(txtB9AK7_18);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan324, gridBagConstraints);\n\n txtB9AK8_18.setColumns(2);\n txtB9AK8_18.setMaxDigit('2');\n txtB9AK8_18.setMinDigit('1');\n txtB9AK8_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan325.add(txtB9AK8_18);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan325, gridBagConstraints);\n\n txtB9AK9_18.setColumns(2);\n txtB9AK9_18.setMaxDigit('2');\n txtB9AK9_18.setMinDigit('1');\n txtB9AK9_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan326.add(txtB9AK9_18);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan326, gridBagConstraints);\n\n txtB9AK10_18.setColumns(2);\n txtB9AK10_18.setMaxDigit('2');\n txtB9AK10_18.setMinDigit('1');\n txtB9AK10_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan327.add(txtB9AK10_18);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan327, gridBagConstraints);\n\n txtB9AK11_18.setColumns(2);\n txtB9AK11_18.setMaxDigit('2');\n txtB9AK11_18.setMinDigit('1');\n txtB9AK11_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan328.add(txtB9AK11_18);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan328, gridBagConstraints);\n\n panelTransparan329.setAlpha(70);\n panelTransparan329.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan329, gridBagConstraints);\n\n txtB9AK13_18.setColumns(2);\n txtB9AK13_18.setMaxDigit('2');\n txtB9AK13_18.setMinDigit('1');\n txtB9AK13_18.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan330.add(txtB9AK13_18);\n\n txtB9AK13_18Als.setColumns(3);\n txtB9AK13_18Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan330.add(txtB9AK13_18Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 28;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan330, gridBagConstraints);\n\n panelTransparan331.setLayout(new java.awt.GridBagLayout());\n\n label116.setText(\"19\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan331.add(label116, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan331, gridBagConstraints);\n\n txtB9AK2_19.setColumns(3);\n txtB9AK2_19.setLength(2);\n txtB9AK2_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan332.add(txtB9AK2_19);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan332, gridBagConstraints);\n\n panelTransparan333.setAlpha(70);\n panelTransparan333.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan333, gridBagConstraints);\n\n panelTransparan334.setAlpha(70);\n panelTransparan334.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan334, gridBagConstraints);\n\n txtB9AK5_19.setColumns(2);\n txtB9AK5_19.setMaxDigit('2');\n txtB9AK5_19.setMinDigit('1');\n txtB9AK5_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan335.add(txtB9AK5_19);\n\n txtB9AK5_19Als.setColumns(3);\n txtB9AK5_19Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan335.add(txtB9AK5_19Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan335, gridBagConstraints);\n\n txtB9AK6_19.setColumns(2);\n txtB9AK6_19.setMaxDigit('2');\n txtB9AK6_19.setMinDigit('1');\n txtB9AK6_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan336.add(txtB9AK6_19);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan336, gridBagConstraints);\n\n txtB9AK7_19.setColumns(2);\n txtB9AK7_19.setMaxDigit('2');\n txtB9AK7_19.setMinDigit('1');\n txtB9AK7_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan337.add(txtB9AK7_19);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan337, gridBagConstraints);\n\n txtB9AK8_19.setColumns(2);\n txtB9AK8_19.setMaxDigit('2');\n txtB9AK8_19.setMinDigit('1');\n txtB9AK8_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan338.add(txtB9AK8_19);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan338, gridBagConstraints);\n\n txtB9AK9_19.setColumns(2);\n txtB9AK9_19.setMaxDigit('2');\n txtB9AK9_19.setMinDigit('1');\n txtB9AK9_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan339.add(txtB9AK9_19);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan339, gridBagConstraints);\n\n txtB9AK10_19.setColumns(2);\n txtB9AK10_19.setMaxDigit('2');\n txtB9AK10_19.setMinDigit('1');\n txtB9AK10_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan340.add(txtB9AK10_19);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan340, gridBagConstraints);\n\n txtB9AK11_19.setColumns(2);\n txtB9AK11_19.setMaxDigit('2');\n txtB9AK11_19.setMinDigit('1');\n txtB9AK11_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan341.add(txtB9AK11_19);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan341, gridBagConstraints);\n\n panelTransparan342.setAlpha(70);\n panelTransparan342.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan342, gridBagConstraints);\n\n txtB9AK13_19.setColumns(2);\n txtB9AK13_19.setMaxDigit('2');\n txtB9AK13_19.setMinDigit('1');\n txtB9AK13_19.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan343.add(txtB9AK13_19);\n\n txtB9AK13_19Als.setColumns(3);\n txtB9AK13_19Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan343.add(txtB9AK13_19Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 29;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan343, gridBagConstraints);\n\n panelTransparan344.setLayout(new java.awt.GridBagLayout());\n\n label117.setText(\"20\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan344.add(label117, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan344, gridBagConstraints);\n\n txtB9AK2_20.setColumns(3);\n txtB9AK2_20.setLength(2);\n txtB9AK2_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan345.add(txtB9AK2_20);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan345, gridBagConstraints);\n\n panelTransparan346.setAlpha(70);\n panelTransparan346.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan346, gridBagConstraints);\n\n panelTransparan347.setAlpha(70);\n panelTransparan347.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan347, gridBagConstraints);\n\n txtB9AK5_20.setColumns(2);\n txtB9AK5_20.setMaxDigit('2');\n txtB9AK5_20.setMinDigit('1');\n txtB9AK5_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan348.add(txtB9AK5_20);\n\n txtB9AK5_20Als.setColumns(3);\n txtB9AK5_20Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan348.add(txtB9AK5_20Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan348, gridBagConstraints);\n\n txtB9AK6_20.setColumns(2);\n txtB9AK6_20.setMaxDigit('2');\n txtB9AK6_20.setMinDigit('1');\n txtB9AK6_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan349.add(txtB9AK6_20);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan349, gridBagConstraints);\n\n txtB9AK7_20.setColumns(2);\n txtB9AK7_20.setMaxDigit('2');\n txtB9AK7_20.setMinDigit('1');\n txtB9AK7_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan350.add(txtB9AK7_20);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan350, gridBagConstraints);\n\n txtB9AK8_20.setColumns(2);\n txtB9AK8_20.setMaxDigit('2');\n txtB9AK8_20.setMinDigit('1');\n txtB9AK8_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan351.add(txtB9AK8_20);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan351, gridBagConstraints);\n\n txtB9AK9_20.setColumns(2);\n txtB9AK9_20.setMaxDigit('2');\n txtB9AK9_20.setMinDigit('1');\n txtB9AK9_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan352.add(txtB9AK9_20);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan352, gridBagConstraints);\n\n txtB9AK10_20.setColumns(2);\n txtB9AK10_20.setMaxDigit('2');\n txtB9AK10_20.setMinDigit('1');\n txtB9AK10_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan353.add(txtB9AK10_20);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan353, gridBagConstraints);\n\n txtB9AK11_20.setColumns(2);\n txtB9AK11_20.setMaxDigit('2');\n txtB9AK11_20.setMinDigit('1');\n txtB9AK11_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan354.add(txtB9AK11_20);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan354, gridBagConstraints);\n\n panelTransparan355.setAlpha(70);\n panelTransparan355.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan355, gridBagConstraints);\n\n txtB9AK13_20.setColumns(2);\n txtB9AK13_20.setMaxDigit('2');\n txtB9AK13_20.setMinDigit('1');\n txtB9AK13_20.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan356.add(txtB9AK13_20);\n\n txtB9AK13_20Als.setColumns(3);\n txtB9AK13_20Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan356.add(txtB9AK13_20Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 30;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan356, gridBagConstraints);\n\n panelTransparan357.setLayout(new java.awt.GridBagLayout());\n\n label118.setText(\"21\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan357.add(label118, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan357, gridBagConstraints);\n\n txtB9AK2_21.setColumns(3);\n txtB9AK2_21.setLength(2);\n txtB9AK2_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan358.add(txtB9AK2_21);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan358, gridBagConstraints);\n\n panelTransparan359.setAlpha(70);\n panelTransparan359.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan359, gridBagConstraints);\n\n panelTransparan360.setAlpha(70);\n panelTransparan360.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan360, gridBagConstraints);\n\n txtB9AK5_21.setColumns(2);\n txtB9AK5_21.setMaxDigit('2');\n txtB9AK5_21.setMinDigit('1');\n txtB9AK5_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan361.add(txtB9AK5_21);\n\n txtB9AK5_21Als.setColumns(3);\n txtB9AK5_21Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan361.add(txtB9AK5_21Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan361, gridBagConstraints);\n\n txtB9AK6_21.setColumns(2);\n txtB9AK6_21.setMaxDigit('2');\n txtB9AK6_21.setMinDigit('1');\n txtB9AK6_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan362.add(txtB9AK6_21);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan362, gridBagConstraints);\n\n txtB9AK7_21.setColumns(2);\n txtB9AK7_21.setMaxDigit('2');\n txtB9AK7_21.setMinDigit('1');\n txtB9AK7_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan363.add(txtB9AK7_21);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan363, gridBagConstraints);\n\n txtB9AK8_21.setColumns(2);\n txtB9AK8_21.setMaxDigit('2');\n txtB9AK8_21.setMinDigit('1');\n txtB9AK8_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan364.add(txtB9AK8_21);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan364, gridBagConstraints);\n\n txtB9AK9_21.setColumns(2);\n txtB9AK9_21.setMaxDigit('2');\n txtB9AK9_21.setMinDigit('1');\n txtB9AK9_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan365.add(txtB9AK9_21);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan365, gridBagConstraints);\n\n txtB9AK10_21.setColumns(2);\n txtB9AK10_21.setMaxDigit('2');\n txtB9AK10_21.setMinDigit('1');\n txtB9AK10_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan366.add(txtB9AK10_21);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan366, gridBagConstraints);\n\n txtB9AK11_21.setColumns(2);\n txtB9AK11_21.setMaxDigit('2');\n txtB9AK11_21.setMinDigit('1');\n txtB9AK11_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan367.add(txtB9AK11_21);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan367, gridBagConstraints);\n\n panelTransparan368.setAlpha(70);\n panelTransparan368.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan368, gridBagConstraints);\n\n txtB9AK13_21.setColumns(2);\n txtB9AK13_21.setMaxDigit('2');\n txtB9AK13_21.setMinDigit('1');\n txtB9AK13_21.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan369.add(txtB9AK13_21);\n\n txtB9AK13_21Als.setColumns(3);\n txtB9AK13_21Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan369.add(txtB9AK13_21Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 32;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan369, gridBagConstraints);\n\n panelTransparan370.setLayout(new java.awt.GridBagLayout());\n\n label119.setText(\"22\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan370.add(label119, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan370, gridBagConstraints);\n\n txtB9AK2_22.setColumns(3);\n txtB9AK2_22.setLength(2);\n txtB9AK2_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan371.add(txtB9AK2_22);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan371, gridBagConstraints);\n\n panelTransparan372.setAlpha(70);\n panelTransparan372.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan372, gridBagConstraints);\n\n panelTransparan373.setAlpha(70);\n panelTransparan373.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan373, gridBagConstraints);\n\n txtB9AK5_22.setColumns(2);\n txtB9AK5_22.setMaxDigit('2');\n txtB9AK5_22.setMinDigit('1');\n txtB9AK5_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan374.add(txtB9AK5_22);\n\n txtB9AK5_22Als.setColumns(3);\n txtB9AK5_22Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan374.add(txtB9AK5_22Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan374, gridBagConstraints);\n\n txtB9AK6_22.setColumns(2);\n txtB9AK6_22.setMaxDigit('2');\n txtB9AK6_22.setMinDigit('1');\n txtB9AK6_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan375.add(txtB9AK6_22);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan375, gridBagConstraints);\n\n txtB9AK7_22.setColumns(2);\n txtB9AK7_22.setMaxDigit('2');\n txtB9AK7_22.setMinDigit('1');\n txtB9AK7_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan376.add(txtB9AK7_22);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan376, gridBagConstraints);\n\n txtB9AK8_22.setColumns(2);\n txtB9AK8_22.setMaxDigit('2');\n txtB9AK8_22.setMinDigit('1');\n txtB9AK8_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan377.add(txtB9AK8_22);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan377, gridBagConstraints);\n\n txtB9AK9_22.setColumns(2);\n txtB9AK9_22.setMaxDigit('2');\n txtB9AK9_22.setMinDigit('1');\n txtB9AK9_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan378.add(txtB9AK9_22);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan378, gridBagConstraints);\n\n txtB9AK10_22.setColumns(2);\n txtB9AK10_22.setMaxDigit('2');\n txtB9AK10_22.setMinDigit('1');\n txtB9AK10_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan379.add(txtB9AK10_22);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan379, gridBagConstraints);\n\n txtB9AK11_22.setColumns(2);\n txtB9AK11_22.setMaxDigit('2');\n txtB9AK11_22.setMinDigit('1');\n txtB9AK11_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan380.add(txtB9AK11_22);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan380, gridBagConstraints);\n\n panelTransparan381.setAlpha(70);\n panelTransparan381.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan381, gridBagConstraints);\n\n txtB9AK13_22.setColumns(2);\n txtB9AK13_22.setMaxDigit('2');\n txtB9AK13_22.setMinDigit('1');\n txtB9AK13_22.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan382.add(txtB9AK13_22);\n\n txtB9AK13_22Als.setColumns(3);\n txtB9AK13_22Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan382.add(txtB9AK13_22Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan382, gridBagConstraints);\n\n panelTransparan383.setLayout(new java.awt.GridBagLayout());\n\n label120.setText(\"23\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan383.add(label120, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan383, gridBagConstraints);\n\n txtB9AK2_23.setColumns(3);\n txtB9AK2_23.setLength(2);\n txtB9AK2_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan384.add(txtB9AK2_23);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan384, gridBagConstraints);\n\n panelTransparan385.setAlpha(70);\n panelTransparan385.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan385, gridBagConstraints);\n\n panelTransparan386.setAlpha(70);\n panelTransparan386.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan386, gridBagConstraints);\n\n txtB9AK5_23.setColumns(2);\n txtB9AK5_23.setMaxDigit('2');\n txtB9AK5_23.setMinDigit('1');\n txtB9AK5_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan387.add(txtB9AK5_23);\n\n txtB9AK5_23Als.setColumns(3);\n txtB9AK5_23Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan387.add(txtB9AK5_23Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan387, gridBagConstraints);\n\n txtB9AK6_23.setColumns(2);\n txtB9AK6_23.setMaxDigit('2');\n txtB9AK6_23.setMinDigit('1');\n txtB9AK6_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan388.add(txtB9AK6_23);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan388, gridBagConstraints);\n\n txtB9AK7_23.setColumns(2);\n txtB9AK7_23.setMaxDigit('2');\n txtB9AK7_23.setMinDigit('1');\n txtB9AK7_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan389.add(txtB9AK7_23);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan389, gridBagConstraints);\n\n txtB9AK8_23.setColumns(2);\n txtB9AK8_23.setMaxDigit('2');\n txtB9AK8_23.setMinDigit('1');\n txtB9AK8_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan390.add(txtB9AK8_23);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan390, gridBagConstraints);\n\n txtB9AK9_23.setColumns(2);\n txtB9AK9_23.setMaxDigit('2');\n txtB9AK9_23.setMinDigit('1');\n txtB9AK9_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan391.add(txtB9AK9_23);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan391, gridBagConstraints);\n\n txtB9AK10_23.setColumns(2);\n txtB9AK10_23.setMaxDigit('2');\n txtB9AK10_23.setMinDigit('1');\n txtB9AK10_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan392.add(txtB9AK10_23);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan392, gridBagConstraints);\n\n txtB9AK11_23.setColumns(2);\n txtB9AK11_23.setMaxDigit('2');\n txtB9AK11_23.setMinDigit('1');\n txtB9AK11_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan393.add(txtB9AK11_23);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan393, gridBagConstraints);\n\n panelTransparan394.setAlpha(70);\n panelTransparan394.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 33;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan394, gridBagConstraints);\n\n txtB9AK13_23.setColumns(2);\n txtB9AK13_23.setMaxDigit('2');\n txtB9AK13_23.setMinDigit('1');\n txtB9AK13_23.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan395.add(txtB9AK13_23);\n\n txtB9AK13_23Als.setColumns(3);\n txtB9AK13_23Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan395.add(txtB9AK13_23Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 34;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan395, gridBagConstraints);\n\n panelTransparan396.setLayout(new java.awt.GridBagLayout());\n\n label121.setText(\"24\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan396.add(label121, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan396, gridBagConstraints);\n\n txtB9AK2_24.setColumns(3);\n txtB9AK2_24.setLength(2);\n txtB9AK2_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan397.add(txtB9AK2_24);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan397, gridBagConstraints);\n\n panelTransparan398.setAlpha(70);\n panelTransparan398.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan398, gridBagConstraints);\n\n panelTransparan399.setAlpha(70);\n panelTransparan399.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan399, gridBagConstraints);\n\n txtB9AK5_24.setColumns(2);\n txtB9AK5_24.setMaxDigit('2');\n txtB9AK5_24.setMinDigit('1');\n txtB9AK5_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan400.add(txtB9AK5_24);\n\n txtB9AK5_24Als.setColumns(3);\n txtB9AK5_24Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan400.add(txtB9AK5_24Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan400, gridBagConstraints);\n\n txtB9AK6_24.setColumns(2);\n txtB9AK6_24.setMaxDigit('2');\n txtB9AK6_24.setMinDigit('1');\n txtB9AK6_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan401.add(txtB9AK6_24);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan401, gridBagConstraints);\n\n txtB9AK7_24.setColumns(2);\n txtB9AK7_24.setMaxDigit('2');\n txtB9AK7_24.setMinDigit('1');\n txtB9AK7_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan402.add(txtB9AK7_24);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan402, gridBagConstraints);\n\n txtB9AK8_24.setColumns(2);\n txtB9AK8_24.setMaxDigit('2');\n txtB9AK8_24.setMinDigit('1');\n txtB9AK8_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan403.add(txtB9AK8_24);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan403, gridBagConstraints);\n\n txtB9AK9_24.setColumns(2);\n txtB9AK9_24.setMaxDigit('2');\n txtB9AK9_24.setMinDigit('1');\n txtB9AK9_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan404.add(txtB9AK9_24);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan404, gridBagConstraints);\n\n txtB9AK10_24.setColumns(2);\n txtB9AK10_24.setMaxDigit('2');\n txtB9AK10_24.setMinDigit('1');\n txtB9AK10_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan405.add(txtB9AK10_24);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan405, gridBagConstraints);\n\n txtB9AK11_24.setColumns(2);\n txtB9AK11_24.setMaxDigit('2');\n txtB9AK11_24.setMinDigit('1');\n txtB9AK11_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan406.add(txtB9AK11_24);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan406, gridBagConstraints);\n\n panelTransparan407.setAlpha(70);\n panelTransparan407.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan407, gridBagConstraints);\n\n txtB9AK13_24.setColumns(2);\n txtB9AK13_24.setMaxDigit('2');\n txtB9AK13_24.setMinDigit('1');\n txtB9AK13_24.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan408.add(txtB9AK13_24);\n\n txtB9AK13_24Als.setColumns(3);\n txtB9AK13_24Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan408.add(txtB9AK13_24Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 35;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan408, gridBagConstraints);\n\n panelTransparan409.setLayout(new java.awt.GridBagLayout());\n\n label122.setText(\"25\"); // NOI18N\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n panelTransparan409.add(label122, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan409, gridBagConstraints);\n\n txtB9AK2_25.setColumns(3);\n txtB9AK2_25.setLength(2);\n txtB9AK2_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan410.add(txtB9AK2_25);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan410, gridBagConstraints);\n\n panelTransparan411.setAlpha(70);\n panelTransparan411.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan411, gridBagConstraints);\n\n panelTransparan412.setAlpha(70);\n panelTransparan412.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan412, gridBagConstraints);\n\n txtB9AK5_25.setColumns(2);\n txtB9AK5_25.setMaxDigit('2');\n txtB9AK5_25.setMinDigit('1');\n txtB9AK5_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan413.add(txtB9AK5_25);\n\n txtB9AK5_25Als.setColumns(3);\n txtB9AK5_25Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan413.add(txtB9AK5_25Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan413, gridBagConstraints);\n\n txtB9AK6_25.setColumns(2);\n txtB9AK6_25.setMaxDigit('2');\n txtB9AK6_25.setMinDigit('1');\n txtB9AK6_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan414.add(txtB9AK6_25);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan414, gridBagConstraints);\n\n txtB9AK7_25.setColumns(2);\n txtB9AK7_25.setMaxDigit('2');\n txtB9AK7_25.setMinDigit('1');\n txtB9AK7_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan415.add(txtB9AK7_25);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan415, gridBagConstraints);\n\n txtB9AK8_25.setColumns(2);\n txtB9AK8_25.setMaxDigit('2');\n txtB9AK8_25.setMinDigit('1');\n txtB9AK8_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan416.add(txtB9AK8_25);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan416, gridBagConstraints);\n\n txtB9AK9_25.setColumns(2);\n txtB9AK9_25.setMaxDigit('2');\n txtB9AK9_25.setMinDigit('1');\n txtB9AK9_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan417.add(txtB9AK9_25);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan417, gridBagConstraints);\n\n txtB9AK10_25.setColumns(2);\n txtB9AK10_25.setMaxDigit('2');\n txtB9AK10_25.setMinDigit('1');\n txtB9AK10_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan418.add(txtB9AK10_25);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan418, gridBagConstraints);\n\n txtB9AK11_25.setColumns(2);\n txtB9AK11_25.setMaxDigit('2');\n txtB9AK11_25.setMinDigit('1');\n txtB9AK11_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan419.add(txtB9AK11_25);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan419, gridBagConstraints);\n\n panelTransparan420.setAlpha(70);\n panelTransparan420.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan420, gridBagConstraints);\n\n txtB9AK13_25.setColumns(2);\n txtB9AK13_25.setMaxDigit('2');\n txtB9AK13_25.setMinDigit('1');\n txtB9AK13_25.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan421.add(txtB9AK13_25);\n\n txtB9AK13_25Als.setColumns(3);\n txtB9AK13_25Als.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n focusTxt(evt);\n }\n });\n panelTransparan421.add(txtB9AK13_25Als);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 37;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan421, gridBagConstraints);\n\n panelTransparan422.setAlpha(70);\n panelTransparan422.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan422, gridBagConstraints);\n\n panelTransparan423.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 1;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan423, gridBagConstraints);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan424, gridBagConstraints);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan425, gridBagConstraints);\n\n panelTransparan426.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 4;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan426, gridBagConstraints);\n\n panelTransparan427.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 5;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan427, gridBagConstraints);\n\n panelTransparan428.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 6;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan428, gridBagConstraints);\n\n panelTransparan429.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 7;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan429, gridBagConstraints);\n\n panelTransparan430.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 8;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan430, gridBagConstraints);\n\n panelTransparan431.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 9;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan431, gridBagConstraints);\n\n panelTransparan432.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 10;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan432, gridBagConstraints);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 11;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan433, gridBagConstraints);\n\n panelTransparan434.setAlpha(70);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 12;\n gridBagConstraints.gridy = 38;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n panelTabel.add(panelTransparan434, gridBagConstraints);\n\n javax.swing.GroupLayout panelScrollLayout = new javax.swing.GroupLayout(panelScroll);\n panelScroll.setLayout(panelScrollLayout);\n panelScrollLayout.setHorizontalGroup(\n panelScrollLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(panelScrollLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(panelTabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(275, Short.MAX_VALUE))\n );\n panelScrollLayout.setVerticalGroup(\n panelScrollLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(panelScrollLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(panelTabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(31, Short.MAX_VALUE))\n );\n\n scroolPane1.setViewportView(panelScroll);\n\n add(scroolPane1, java.awt.BorderLayout.CENTER);\n }", "private void initialize() {\r\n\t\tthis.setSize(497, 316);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tthis.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "public JFcotiza() {\n initComponents();\n }", "private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}", "public addStFrame() {\n initComponents();\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "public void initializeFrame() {\n frame.getContentPane().removeAll();\n createComponents(frame.getContentPane());\n// frame.setSize(new Dimension(1000, 600));\n }", "private void initComponents() {\n xActionBar1 = new com.rameses.rcp.control.XActionBar();\n jPanel1 = new javax.swing.JPanel();\n formPanel1 = new com.rameses.rcp.util.FormPanel();\n xNumberField1 = new com.rameses.rcp.control.XNumberField();\n jTabbedPane1 = new javax.swing.JTabbedPane();\n jPanel2 = new javax.swing.JPanel();\n xDataTable5 = new com.rameses.rcp.control.XDataTable();\n xDataTable4 = new com.rameses.rcp.control.XDataTable();\n xLabel1 = new com.rameses.rcp.control.XLabel();\n jPanel3 = new javax.swing.JPanel();\n jPanel4 = new javax.swing.JPanel();\n xDataTable6 = new com.rameses.rcp.control.XDataTable();\n jTabbedPane2 = new javax.swing.JTabbedPane();\n jPanel5 = new javax.swing.JPanel();\n xDataTable7 = new com.rameses.rcp.control.XDataTable();\n xDataTable8 = new com.rameses.rcp.control.XDataTable();\n jPanel6 = new javax.swing.JPanel();\n xDataTable9 = new com.rameses.rcp.control.XDataTable();\n xLabel2 = new com.rameses.rcp.control.XLabel();\n jPanel7 = new javax.swing.JPanel();\n xButton2 = new com.rameses.rcp.control.XButton();\n xButton3 = new com.rameses.rcp.control.XButton();\n xButton4 = new com.rameses.rcp.control.XButton();\n xDataTable10 = new com.rameses.rcp.control.XDataTable();\n\n setLayout(new java.awt.BorderLayout());\n\n xActionBar1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 0));\n xActionBar1.setDepends(new String[] {\"selectedItem\"});\n xActionBar1.setName(\"formActions\");\n add(xActionBar1, java.awt.BorderLayout.NORTH);\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder1 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder1.setTitle(\"Land RY Setting\");\n jPanel1.setBorder(xTitledBorder1);\n\n formPanel1.setCaptionWidth(100);\n xNumberField1.setEditable(false);\n xNumberField1.setCaption(\"Revision Year\");\n xNumberField1.setCaptionWidth(100);\n xNumberField1.setEnabled(false);\n xNumberField1.setFieldType(Integer.class);\n xNumberField1.setName(\"entity.ry\");\n xNumberField1.setPreferredSize(new java.awt.Dimension(80, 19));\n xNumberField1.setRequired(true);\n formPanel1.add(xNumberField1);\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder2 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder2.setTitle(\"If not Special, the applicable Assessment Levels\");\n xDataTable5.setBorder(xTitledBorder2);\n xDataTable5.setDepends(new String[] {\"selectedAssessLevel\"});\n xDataTable5.setDynamic(true);\n xDataTable5.setHandler(\"rangeLevelListHandler\");\n xDataTable5.setImmediate(true);\n xDataTable5.setName(\"selectedRangeLevel\");\n\n xDataTable4.setHandler(\"assessLevelListHandler\");\n xDataTable4.setImmediate(true);\n xDataTable4.setName(\"selectedAssessLevel\");\n\n xLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n xLabel1.setForeground(new java.awt.Color(153, 0, 0));\n xLabel1.setFont(new java.awt.Font(\"Arial\", 1, 12));\n xLabel1.setName(\"assessLevelMsg\");\n xLabel1.setPreferredSize(new java.awt.Dimension(104, 22));\n\n org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel2Layout.createSequentialGroup()\n .add(xDataTable4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 399, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(xDataTable5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE))\n .add(xLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 768, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)\n .add(xDataTable5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)\n .add(xDataTable4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(xLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n jTabbedPane1.addTab(\"Assessment Levels\", jPanel2);\n\n jPanel3.setLayout(new java.awt.BorderLayout());\n\n xDataTable6.setHandler(\"lcuvListHandler\");\n xDataTable6.setImmediate(true);\n xDataTable6.setName(\"selectedLCUV\");\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder3 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder3.setTitle(\"Specific Class\");\n xDataTable7.setBorder(xTitledBorder3);\n xDataTable7.setHandler(\"specificClassListHandler\");\n xDataTable7.setImmediate(true);\n xDataTable7.setName(\"selectedSpecificClass\");\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder4 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder4.setTitle(\"Sub Class\");\n xDataTable8.setBorder(xTitledBorder4);\n xDataTable8.setHandler(\"subClassListHandler\");\n xDataTable8.setImmediate(true);\n xDataTable8.setName(\"selectedSubClass\");\n\n org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);\n jPanel5.setLayout(jPanel5Layout);\n jPanel5Layout.setHorizontalGroup(\n jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup()\n .addContainerGap()\n .add(xDataTable7, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(xDataTable8, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)\n .addContainerGap())\n );\n jPanel5Layout.setVerticalGroup(\n jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup()\n .addContainerGap()\n .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)\n .add(org.jdesktop.layout.GroupLayout.LEADING, xDataTable7, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE)\n .add(org.jdesktop.layout.GroupLayout.LEADING, xDataTable8, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE))\n .addContainerGap())\n );\n jTabbedPane2.addTab(\"Specific and Sub Classes\", jPanel5);\n\n com.rameses.rcp.control.border.XTitledBorder xTitledBorder5 = new com.rameses.rcp.control.border.XTitledBorder();\n xTitledBorder5.setTitle(\"Stripping\");\n xDataTable9.setBorder(xTitledBorder5);\n xDataTable9.setHandler(\"strippingListHandler\");\n xDataTable9.setImmediate(true);\n xDataTable9.setName(\"selectedStripping\");\n\n org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);\n jPanel6.setLayout(jPanel6Layout);\n jPanel6Layout.setHorizontalGroup(\n jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel6Layout.createSequentialGroup()\n .addContainerGap()\n .add(xDataTable9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 297, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(287, Short.MAX_VALUE))\n );\n jPanel6Layout.setVerticalGroup(\n jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel6Layout.createSequentialGroup()\n .addContainerGap()\n .add(xDataTable9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 373, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jTabbedPane2.addTab(\"Stripping\", jPanel6);\n\n xLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n xLabel2.setForeground(new java.awt.Color(153, 0, 0));\n xLabel2.setFont(new java.awt.Font(\"Arial\", 1, 12));\n xLabel2.setName(\"lcuvMsg\");\n xLabel2.setPreferredSize(new java.awt.Dimension(104, 22));\n\n org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel4Layout.createSequentialGroup()\n .addContainerGap()\n .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(xLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 768, Short.MAX_VALUE)\n .add(jPanel4Layout.createSequentialGroup()\n .add(xDataTable6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 163, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jTabbedPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 599, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel4Layout.createSequentialGroup()\n .addContainerGap()\n .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(xDataTable6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)\n .add(jTabbedPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(xLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\n );\n jPanel3.add(jPanel4, java.awt.BorderLayout.CENTER);\n\n jTabbedPane1.addTab(\"LCUV\", jPanel3);\n\n xButton2.setMnemonic('n');\n xButton2.setText(\"New\");\n xButton2.setName(\"createLandAdjustment\");\n\n xButton3.setMnemonic('o');\n xButton3.setText(\"Open\");\n xButton3.setName(\"openLandAdjustment\");\n\n xButton4.setMnemonic('r');\n xButton4.setText(\"Remove\");\n xButton4.setName(\"removeLandAdjustment\");\n\n xDataTable10.setHandler(\"landAdjustmentListHandler\");\n xDataTable10.setName(\"selectedLandAdjustment\");\n\n org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7);\n jPanel7.setLayout(jPanel7Layout);\n jPanel7Layout.setHorizontalGroup(\n jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel7Layout.createSequentialGroup()\n .addContainerGap()\n .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(xDataTable10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 768, Short.MAX_VALUE)\n .add(jPanel7Layout.createSequentialGroup()\n .add(xButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(xButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(xButton4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n jPanel7Layout.setVerticalGroup(\n jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel7Layout.createSequentialGroup()\n .addContainerGap()\n .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)\n .add(xButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(xButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(xButton4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(xDataTable10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 411, Short.MAX_VALUE)\n .addContainerGap())\n );\n jTabbedPane1.addTab(\"Land Adjustment\", jPanel7);\n\n org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel1Layout.createSequentialGroup()\n .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel1Layout.createSequentialGroup()\n .add(29, 29, 29)\n .add(formPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\n .add(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 793, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jPanel1Layout.createSequentialGroup()\n .add(formPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)\n .addContainerGap())\n );\n add(jPanel1, java.awt.BorderLayout.CENTER);\n\n }", "public HoaDonJPanel() {\n initComponents(); \n this.init();\n }", "private void initComponents() {\n\n setBackground(java.awt.Color.lightGray);\n setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 394, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 294, Short.MAX_VALUE)\n );\n }", "private void initializeFrame() {\n add(container);\n setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n pack();\n }", "private void initialize() {\r\n this.setSize(new Dimension(800,600));\r\n this.setContentPane(getJPanel());\r\n\r\n List<String> title = new ArrayList<String>();\r\n title.add(\"Select\");\r\n title.add(\"Field Id\");\r\n title.add(\"Field Name\");\r\n title.add(\"Field Type\");\r\n title.add(\"Image\");\r\n\r\n List<JComponent> componentList = new ArrayList<JComponent>();\r\n componentList.add(checkInit);\r\n componentList.add(fieldIdInit);\r\n componentList.add(filedNameInit);\r\n componentList.add(fieldTypeInit);\r\n componentList.add(imageButton);\r\n\r\n String []arrColumn = {\"SELECT\", \"FIELD_ID\", \"FIELD_NAME\", \"FIELD_TYPE\", \"FIELD_VALUE\"};\r\n String []arrTitle = {\"SELECT\", \"FIELD_ID\", \"FIELD_NAME\", \"FIELD_TYPE\", \"FIELD_VALUE\"};\r\n // init grid\r\n grid = new GridUtils(pageSheet, title, componentList, arrColumn, preButton, afterButton, 5, arrTitle);\r\n // set title\r\n grid.setPageInfo(pageInfoLbl);\r\n \r\n searchDetailList();\r\n \r\n initComboBox();\r\n \r\n setTitle(\"Page Select page\");\r\n\t}", "private void initialize() {\n\t\tthis.setLayout(new BorderLayout());\n\t\tthis.setSize(300,200);\n\t\tthis.add(getJPanel(), java.awt.BorderLayout.CENTER);\n\t\tthis.add(getJPanel1(), java.awt.BorderLayout.SOUTH);\n\t}", "public CFJInternalFrame( ) {\n initComponents();\n \n refresh();\n }", "public MainFrame() {\n initComponents();\n \n }", "public MainFrame() {\n initComponents();\n\n\n }", "private void init() {\n initComponents();\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(calendarPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(calendarPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));\n setVisible(true);\n setLocationRelativeTo(null);\n }", "private void initialize() {\r\n\r\n\t\ttitleFont = new Font(\"宋体\", Font.BOLD + Font.PLAIN, 16);\r\n\t\tfont = new Font(\"宋体\", Font.PLAIN, 12);\r\n\t\ttry {\r\n\t\t\tcolor = new Color(Integer.parseInt(\"D3D3D3\", 16));\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\t// codes to deal with this exception\r\n\t\t}\r\n\t\tdaojLabel = new JLabel();\r\n\t\tdaojLabel.setBounds(new Rectangle(255, 33, 15, 18));\r\n\t\tdaojLabel.setText(\"到\");\r\n\t\tdaojLabel.setFont(font);\r\n\t\tdaojLabel.setForeground(color);\r\n\t\tcxsjjLabel = new JLabel();\r\n\t\tcxsjjLabel.setBounds(new Rectangle(92, 33, 59, 18));\r\n\t\tcxsjjLabel.setText(\"查询时间:\");\r\n\t\tcxsjjLabel.setFont(font);\r\n\t\tcxsjjLabel.setForeground(color);\r\n\t\t// 设置导航panel\r\n\t\tnavigatePanel = new JPanel();\r\n\t\tnavigatePanel.setLayout(null);\r\n\t\tnavigatePanel.add(this.getProjButton());\r\n\t\tnavigatePanel.add(this.getNextjButton());\r\n\t\tnavigatePanel.setBounds(new Rectangle(95, 510, 788, 20));\r\n\t\tColor color = new Color(35, 35, 35);\r\n\t\t// navigatePanel.setBackground(Color.GRAY);\r\n\t\tnavigatePanel.setBackground(color);\r\n\t\tthis.add(navigatePanel);\r\n\r\n\t\tthis.setSize(976, 601);\r\n\t\tthis.setLayout(null);\r\n\t\tthis.add(cxsjjLabel, null);\r\n\t\tthis.add(getBegjTextField(), null);\r\n\t\tthis.add(daojLabel, null);\r\n\t\tthis.add(getEndjTextField(), null);\r\n\t\tthis.add(getCxjButton(), null);\r\n\r\n\t\tgetylcs = new GetYlcs();\r\n\t\tthis.add(getMainjPanel(), null);\r\n\r\n\t}", "private void initialize() {\r\n\t\tthis.setSize(392, 496);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"Informações\");\r\n\t}", "private void initialize() {\n this.setLayout(new BorderLayout());\n this.setSize(300, 200);\n this.setPreferredSize(new java.awt.Dimension(450, 116));\n this.add(getListPanel(), java.awt.BorderLayout.CENTER);\n this.add(getButtonPanel(), java.awt.BorderLayout.SOUTH);\n }", "private void init() {\n\t\tcontentPane=getContentPane();\n\t\ttopPanel= new JPanel();\n\t\tcontentPane.setLayout(new BorderLayout());\n\t\tlabel = new JLabel(\"Username\");\n\t\ttextfield = new JTextField(\"Type Username\", 15);\n\t\ttextfield.addActionListener(aListener);\n\t\tconnectButton = new JButton(\"Connect to Server\");\n\t\tconnectButton.addActionListener(aListener);\n\t\ttopPanel.setLayout(new FlowLayout());\n\t\tlabel.setVerticalAlignment(FlowLayout.LEFT);\n\t\ttopPanel.add(label);\n\t\ttopPanel.add(textfield);\n\t\ttopPanel.add(connectButton);\n\t\tsetSize(600, 600);\n\t\tcontentPane.add(topPanel, BorderLayout.NORTH);\n\t\tsetVisible(true);\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\t\tthis.addWindowListener(framListener);\n\t}", "public CardLayoutJFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tjLabel3 = new JLabel();\n\t\tjLabel = new JLabel();\n\t\tthis.setLayout(null);\n\t\tthis.setBounds(new java.awt.Rectangle(0, 0, 486, 377));\n\t\tjLabel.setText(PluginServices.getText(this,\n\t\t\t\t\"Areas_de_influencia._Introduccion_de_datos\") + \":\");\n\t\tjLabel.setBounds(5, 20, 343, 21);\n\t\tjLabel3.setText(PluginServices.getText(this, \"Cobertura_de_entrada\")\n\t\t\t\t+ \":\");\n\t\tjLabel3.setBounds(6, 63, 190, 21);\n\t\tthis.add(jLabel, null);\n\t\tthis.add(jLabel3, null);\n\t\tthis.add(getLayersComboBox(), null);\n\t\tthis.add(getSelectedOnlyCheckBox(), null);\n\t\tthis.add(getMethodSelectionPanel(), null);\n\t\tthis.add(getResultSelectionPanel(), null);\n\t\tthis.add(getExtendedOptionsPanel(), null);\n\t\tconfButtonGroup();\n\t\tlayersComboBox.setSelectedIndex(0);\n\t\tinitSelectedItemsJCheckBox();\n\t\tdistanceBufferRadioButton.setSelected(true);\n\t\tlayerFieldsComboBox.setEnabled(false);\n\t\tverifyTypeBufferComboEnabled();\n\t}", "private void initComponents() {\n java.awt.GridBagConstraints gridBagConstraints;\n\n m_jPanContainer = new javax.swing.JPanel();\n m_jOptions = new javax.swing.JPanel();\n m_jButtons = new javax.swing.JPanel();\n m_jTicketId = new javax.swing.JLabel();\n btnSplit = new javax.swing.JButton();\n m_prTicket = new javax.swing.JButton();\n m_jPanelScripts = new javax.swing.JPanel();\n m_jButtonsExt = new javax.swing.JPanel();\n jPanel1 = new javax.swing.JPanel();\n m_jbtnScale = new javax.swing.JButton();\n m_jPanelBag = new javax.swing.JPanel();\n m_jPanTicket = new javax.swing.JPanel();\n jPanel5 = new javax.swing.JPanel();\n jPanel2 = new javax.swing.JPanel();\n m_jUp = new javax.swing.JButton();\n m_jDown = new javax.swing.JButton();\n m_jDelete = new javax.swing.JButton();\n m_jList = new javax.swing.JButton();\n jButton1 = new javax.swing.JButton();\n m_jEditLine = new javax.swing.JButton();\n m_jPanelCentral = new javax.swing.JPanel();\n jPanel4 = new javax.swing.JPanel();\n m_jPanTotals = new javax.swing.JPanel();\n m_jTotalEuros = new javax.swing.JLabel();\n m_jLblTotalEuros1 = new javax.swing.JLabel();\n m_jSubtotalEuros = new javax.swing.JLabel();\n m_jTaxesEuros = new javax.swing.JLabel();\n m_jLblTotalEuros2 = new javax.swing.JLabel();\n m_jLblTotalEuros3 = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n m_jContEntries = new javax.swing.JPanel();\n m_jPanEntries = new javax.swing.JPanel();\n m_jNumberKeys = new com.openbravo.beans.JNumberKeys();\n jPanel9 = new javax.swing.JPanel();\n m_jPrice = new javax.swing.JLabel();\n m_jPor = new javax.swing.JLabel();\n m_jEnter = new javax.swing.JButton();\n m_jTax = new javax.swing.JComboBox();\n m_jaddtax = new javax.swing.JToggleButton();\n m_jKeyFactory = new javax.swing.JTextField();\n catcontainer = new javax.swing.JPanel();\n\n setBackground(new java.awt.Color(255, 204, 153));\n setLayout(new java.awt.CardLayout());\n\n m_jPanContainer.setLayout(new java.awt.BorderLayout());\n\n m_jOptions.setLayout(new java.awt.BorderLayout());\n\n m_jTicketId.setBackground(java.awt.Color.white);\n m_jTicketId.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n m_jTicketId.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor(\"Button.darkShadow\")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));\n m_jTicketId.setOpaque(true);\n m_jTicketId.setPreferredSize(new java.awt.Dimension(160, 25));\n m_jTicketId.setRequestFocusEnabled(false);\n m_jButtons.add(m_jTicketId);\n\n btnSplit.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/editcut.png\"))); // NOI18N\n btnSplit.setToolTipText(\"QT Split\");\n btnSplit.setFocusPainted(false);\n btnSplit.setFocusable(false);\n btnSplit.setMargin(new java.awt.Insets(8, 14, 8, 14));\n btnSplit.setRequestFocusEnabled(false);\n btnSplit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSplitActionPerformed(evt);\n }\n });\n m_jButtons.add(btnSplit);\n\n m_prTicket.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/tick1.PNG\"))); // NOI18N\n m_prTicket.setToolTipText(\"QT list\");\n m_prTicket.setFocusPainted(false);\n m_prTicket.setFocusable(false);\n m_prTicket.setMargin(new java.awt.Insets(8, 14, 8, 14));\n m_prTicket.setRequestFocusEnabled(false);\n m_prTicket.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n m_prTicketActionPerformed(evt);\n }\n });\n m_jButtons.add(m_prTicket);\n\n m_jOptions.add(m_jButtons, java.awt.BorderLayout.LINE_START);\n\n m_jPanelScripts.setLayout(new java.awt.BorderLayout());\n\n m_jButtonsExt.setLayout(new javax.swing.BoxLayout(m_jButtonsExt, javax.swing.BoxLayout.LINE_AXIS));\n\n m_jbtnScale.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/ark216.png\"))); // NOI18N\n m_jbtnScale.setText(AppLocal.getIntString(\"button.scale\")); // NOI18N\n m_jbtnScale.setFocusPainted(false);\n m_jbtnScale.setFocusable(false);\n m_jbtnScale.setMargin(new java.awt.Insets(8, 14, 8, 14));\n m_jbtnScale.setRequestFocusEnabled(false);\n m_jbtnScale.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n m_jbtnScaleActionPerformed(evt);\n }\n });\n jPanel1.add(m_jbtnScale);\n\n m_jButtonsExt.add(jPanel1);\n\n m_jPanelScripts.add(m_jButtonsExt, java.awt.BorderLayout.LINE_END);\n\n m_jOptions.add(m_jPanelScripts, java.awt.BorderLayout.LINE_END);\n\n m_jPanelBag.setLayout(new java.awt.BorderLayout());\n m_jOptions.add(m_jPanelBag, java.awt.BorderLayout.CENTER);\n\n m_jPanContainer.add(m_jOptions, java.awt.BorderLayout.NORTH);\n\n m_jPanTicket.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));\n m_jPanTicket.setLayout(new java.awt.BorderLayout());\n\n jPanel5.setLayout(new java.awt.BorderLayout());\n\n jPanel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 5));\n jPanel2.setLayout(new java.awt.GridLayout(0, 1, 5, 5));\n\n m_jUp.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/1uparrow22.png\"))); // NOI18N\n m_jUp.setFocusPainted(false);\n m_jUp.setFocusable(false);\n m_jUp.setMargin(new java.awt.Insets(8, 14, 8, 14));\n m_jUp.setRequestFocusEnabled(false);\n m_jUp.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n m_jUpActionPerformed(evt);\n }\n });\n jPanel2.add(m_jUp);\n\n m_jDown.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/1downarrow22.png\"))); // NOI18N\n m_jDown.setFocusPainted(false);\n m_jDown.setFocusable(false);\n m_jDown.setMargin(new java.awt.Insets(8, 14, 8, 14));\n m_jDown.setRequestFocusEnabled(false);\n m_jDown.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n m_jDownActionPerformed(evt);\n }\n });\n jPanel2.add(m_jDown);\n\n m_jDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/locationbar_erase.png\"))); // NOI18N\n m_jDelete.setToolTipText(\"Remove\");\n m_jDelete.setFocusPainted(false);\n m_jDelete.setFocusable(false);\n m_jDelete.setMargin(new java.awt.Insets(8, 14, 8, 14));\n m_jDelete.setRequestFocusEnabled(false);\n m_jDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n m_jDeleteActionPerformed(evt);\n }\n });\n jPanel2.add(m_jDelete);\n\n m_jList.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/search22.png\"))); // NOI18N\n m_jList.setToolTipText(\"Find Product\");\n m_jList.setFocusPainted(false);\n m_jList.setFocusable(false);\n m_jList.setMargin(new java.awt.Insets(8, 14, 8, 14));\n m_jList.setRequestFocusEnabled(false);\n m_jList.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n m_jListActionPerformed(evt);\n }\n });\n jPanel2.add(m_jList);\n\n jButton1.setText(\"QT\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n jPanel2.add(jButton1);\n\n m_jEditLine.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/color_line.png\"))); // NOI18N\n m_jEditLine.setToolTipText(\"Remark\");\n m_jEditLine.setFocusPainted(false);\n m_jEditLine.setFocusable(false);\n m_jEditLine.setMargin(new java.awt.Insets(8, 14, 8, 14));\n m_jEditLine.setRequestFocusEnabled(false);\n m_jEditLine.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n m_jEditLineActionPerformed(evt);\n }\n });\n jPanel2.add(m_jEditLine);\n\n jPanel5.add(jPanel2, java.awt.BorderLayout.NORTH);\n\n m_jPanTicket.add(jPanel5, java.awt.BorderLayout.LINE_END);\n\n m_jPanelCentral.setLayout(new java.awt.BorderLayout());\n\n jPanel4.setLayout(new java.awt.BorderLayout());\n\n m_jTotalEuros.setBackground(java.awt.Color.white);\n m_jTotalEuros.setFont(new java.awt.Font(\"Dialog\", 1, 14));\n m_jTotalEuros.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);\n m_jTotalEuros.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor(\"Button.darkShadow\")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));\n m_jTotalEuros.setOpaque(true);\n m_jTotalEuros.setPreferredSize(new java.awt.Dimension(150, 25));\n m_jTotalEuros.setRequestFocusEnabled(false);\n\n m_jLblTotalEuros1.setText(AppLocal.getIntString(\"label.totalcash\")); // NOI18N\n\n m_jSubtotalEuros.setBackground(java.awt.Color.white);\n m_jSubtotalEuros.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);\n m_jSubtotalEuros.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor(\"Button.darkShadow\")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));\n m_jSubtotalEuros.setOpaque(true);\n m_jSubtotalEuros.setPreferredSize(new java.awt.Dimension(150, 25));\n m_jSubtotalEuros.setRequestFocusEnabled(false);\n\n m_jTaxesEuros.setBackground(java.awt.Color.white);\n m_jTaxesEuros.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);\n m_jTaxesEuros.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor(\"Button.darkShadow\")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));\n m_jTaxesEuros.setOpaque(true);\n m_jTaxesEuros.setPreferredSize(new java.awt.Dimension(150, 25));\n m_jTaxesEuros.setRequestFocusEnabled(false);\n\n m_jLblTotalEuros2.setText(AppLocal.getIntString(\"label.taxcash\")); // NOI18N\n\n m_jLblTotalEuros3.setText(AppLocal.getIntString(\"label.subtotalcash\")); // NOI18N\n\n jLabel1.setText(\"Curr.Op.Bal\");\n\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n org.jdesktop.layout.GroupLayout m_jPanTotalsLayout = new org.jdesktop.layout.GroupLayout(m_jPanTotals);\n m_jPanTotals.setLayout(m_jPanTotalsLayout);\n m_jPanTotalsLayout.setHorizontalGroup(\n m_jPanTotalsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(m_jPanTotalsLayout.createSequentialGroup()\n .add(m_jPanTotalsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(m_jPanTotalsLayout.createSequentialGroup()\n .add(m_jLblTotalEuros2)\n .add(5, 5, 5)\n .add(m_jTaxesEuros, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(36, 36, 36)\n .add(m_jLblTotalEuros3)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)\n .add(m_jSubtotalEuros, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE))\n .add(m_jPanTotalsLayout.createSequentialGroup()\n .add(jLabel1)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 101, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(42, 42, 42)\n .add(m_jLblTotalEuros1)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 8, Short.MAX_VALUE)\n .add(m_jTotalEuros, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n m_jPanTotalsLayout.setVerticalGroup(\n m_jPanTotalsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(m_jPanTotalsLayout.createSequentialGroup()\n .add(m_jPanTotalsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(m_jPanTotalsLayout.createSequentialGroup()\n .add(5, 5, 5)\n .add(m_jPanTotalsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(m_jSubtotalEuros, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(m_jLblTotalEuros2)\n .add(m_jTaxesEuros, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))\n .add(m_jPanTotalsLayout.createSequentialGroup()\n .addContainerGap()\n .add(m_jLblTotalEuros3)))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(m_jPanTotalsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)\n .add(m_jPanTotalsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)\n .add(jLabel1)\n .add(m_jLblTotalEuros1)\n .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\n .add(m_jTotalEuros, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))\n );\n\n jPanel4.add(m_jPanTotals, java.awt.BorderLayout.LINE_END);\n\n m_jPanelCentral.add(jPanel4, java.awt.BorderLayout.SOUTH);\n\n m_jPanTicket.add(m_jPanelCentral, java.awt.BorderLayout.CENTER);\n\n m_jPanContainer.add(m_jPanTicket, java.awt.BorderLayout.CENTER);\n\n m_jContEntries.setLayout(new java.awt.BorderLayout());\n\n m_jPanEntries.setLayout(new javax.swing.BoxLayout(m_jPanEntries, javax.swing.BoxLayout.Y_AXIS));\n\n m_jNumberKeys.addJNumberEventListener(new com.openbravo.beans.JNumberEventListener() {\n public void keyPerformed(com.openbravo.beans.JNumberEvent evt) {\n m_jNumberKeysKeyPerformed(evt);\n }\n });\n m_jPanEntries.add(m_jNumberKeys);\n\n jPanel9.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));\n jPanel9.setLayout(new java.awt.GridBagLayout());\n\n m_jPrice.setBackground(java.awt.Color.white);\n m_jPrice.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n m_jPrice.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor(\"Button.darkShadow\")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));\n m_jPrice.setOpaque(true);\n m_jPrice.setPreferredSize(new java.awt.Dimension(100, 22));\n m_jPrice.setRequestFocusEnabled(false);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 0;\n gridBagConstraints.gridwidth = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n jPanel9.add(m_jPrice, gridBagConstraints);\n\n m_jPor.setBackground(java.awt.Color.white);\n m_jPor.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n m_jPor.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor(\"Button.darkShadow\")), javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));\n m_jPor.setOpaque(true);\n m_jPor.setPreferredSize(new java.awt.Dimension(22, 22));\n m_jPor.setRequestFocusEnabled(false);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 0;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);\n jPanel9.add(m_jPor, gridBagConstraints);\n\n m_jEnter.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/openbravo/images/barcode.png\"))); // NOI18N\n m_jEnter.setFocusPainted(false);\n m_jEnter.setFocusable(false);\n m_jEnter.setRequestFocusEnabled(false);\n m_jEnter.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n m_jEnterActionPerformed(evt);\n }\n });\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 3;\n gridBagConstraints.gridy = 0;\n gridBagConstraints.gridheight = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);\n jPanel9.add(m_jEnter, gridBagConstraints);\n\n m_jTax.setFocusable(false);\n m_jTax.setRequestFocusEnabled(false);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.gridwidth = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);\n jPanel9.add(m_jTax, gridBagConstraints);\n\n m_jaddtax.setText(\"+\");\n m_jaddtax.setFocusPainted(false);\n m_jaddtax.setFocusable(false);\n m_jaddtax.setRequestFocusEnabled(false);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 2;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 0);\n jPanel9.add(m_jaddtax, gridBagConstraints);\n\n m_jPanEntries.add(jPanel9);\n\n m_jKeyFactory.setBackground(javax.swing.UIManager.getDefaults().getColor(\"Panel.background\"));\n m_jKeyFactory.setForeground(javax.swing.UIManager.getDefaults().getColor(\"Panel.background\"));\n m_jKeyFactory.setBorder(null);\n m_jKeyFactory.setCaretColor(javax.swing.UIManager.getDefaults().getColor(\"Panel.background\"));\n m_jKeyFactory.setPreferredSize(new java.awt.Dimension(1, 1));\n m_jKeyFactory.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n m_jKeyFactoryKeyTyped(evt);\n }\n });\n m_jPanEntries.add(m_jKeyFactory);\n\n m_jContEntries.add(m_jPanEntries, java.awt.BorderLayout.NORTH);\n\n m_jPanContainer.add(m_jContEntries, java.awt.BorderLayout.LINE_END);\n\n catcontainer.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));\n catcontainer.setLayout(new java.awt.BorderLayout());\n m_jPanContainer.add(catcontainer, java.awt.BorderLayout.SOUTH);\n\n add(m_jPanContainer, \"ticket\");\n }", "private void initialize() {\r\n\t\tthis.setSize(378, 283);\r\n\t\tthis.setJMenuBar(getMenubar());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JAVIER\");\r\n\t}", "private void initComponents() {\n\t\talbumPanel1 = new AlbumPanel();\n\t\t\n\t\t//设置用户在此窗体上发起 \"close\" 时默认执行的操作。\n\t\tsetDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n\t\tsetTitle(\"电子相册\");\n\t\t\n\t\t//getContentPane()返回此窗体的 contentPane 对象\n\t\tGroupLayout layout = new GroupLayout(getContentPane());\n\t\tgetContentPane().setLayout(layout);\n\t\t//设置沿水平轴确定组件位置和大小的 Group。\n\t\tlayout.setHorizontalGroup(\n\t\t\t\tlayout.createParallelGroup(GroupLayout.Alignment.LEADING)\n\t\t\t\t.addComponent(albumPanel1, GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE)\n\t\t);\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(GroupLayout.Alignment.LEADING)\n\t\t\t\t.addComponent(albumPanel1, GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE)\n\t\t);\n\t\t//调整此窗口的大小,以适合其子组件的首选大小和布局。\n\t\tpack();\n\t}", "public NewJFrame() {\r\n initComponents();\r\n }", "public launchFrame() {\n \n initComponents();\n \n }", "@Override\r\n\tpublic void init() {\n\t\tsetSize(new Dimension(450,250));\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetResizable(false);\r\n\t\tsetLocationRelativeTo(null);\r\n\t\tinitPanel();\r\n\t\t\r\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(374, 288));\r\n this.setContentPane(getJPanel());\r\n this.setResizable(false);\r\n this.setModal(true);\r\n this.setTitle(\"颜色选择面板\");\r\n addJPanel();\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"Media Inventory\");\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initFrameComponents()\n\t{\n\t\tmenuBar \t\t\t= new JMenuBar();\n\t\tmenuFile \t\t\t= new JMenu(\"File\");\n\t\tmenuFileSave\t\t= new JMenuItem(\"Save/Commit Changes\");\n\t\tmenuFileExitNoSave \t= new JMenuItem(\"Exit Without Commiting Changes\");\n\t\tmenuHelp \t\t\t= new JMenu(\"Help\");\n\t\tmenuHelpAbout \t\t= new JMenuItem(\"About\");\n\t\tmenuRecord\t\t\t= new JMenu(\"Record\");\n\t\tmenuRecordDelete\t= new JMenuItem(\"Delete Selected Record...\");\n\t\tmenuRecordCreate\t= new JMenuItem(\"Create a New Record...\");\n\t\t/*Instruction Text*/\n\t\tinstructionTxt \t\t= \" Select the criteria, enter search input, and press the 'Submit' button. \";\n\t\twindowImagePath \t= \"./images/NoID_resized.png\";\n\t\twindowImageLabel \t= new JLabel(new ImageIcon(windowImagePath)); \n\t\tinstructionTxtPane \t= new JTextPane();\n\t\t\tinstructionTxtPane.setText(instructionTxt);\n\t\t\tinstructionTxtPane.setEditable(false);\n\t\t\tinstructionTxtPane.setBackground(null);\t\n\t\t/*Radio Buttons - Select category to search.*/\n\t\trBtnID \t\t= new JRadioButton(\"1. Student ID\", true);\t\t\n\t\trBtnLast \t= new JRadioButton(\"2. Last Name\");\n\t\trBtnFirst \t= new JRadioButton(\"3. First Name\");\n\t\trBtnEntries = new JRadioButton(\"4. # Entries (min,max)\");\t\n\t\t/*Input Fields*/\n\t\tinputFieldLabel = new JLabel(\"Search for: \");\n\t\t\tinputFieldLabel.setFocusable(false);\t\t\n\t\tinputField \t\t= new JTextField(30);\n\t\tbtnSubmit \t\t= new JButton(\"Submit.\");\n\t\t/*Further Examination*/\n\t\tbtnExamine \t\t= new JButton(\"Examine Record...\");\n\t\tbtnCreate \t\t= new JButton(\"Create Record...\");\n\t\t/*Status Bar*/\n\t\tstatusBar = new JTextField();\n\t\t\tstatusBar.setEditable(false);\n\t\t\tstatusBar.setBorder(null);\n\t\t\t\n\t\tinputFieldLabel.setDisplayedMnemonic('S');\n\t\tmenuHelp.setMnemonic('H');\n\t\tmenuFile.setMnemonic('F');\n\t\tmenuRecord.setMnemonic('R');\n\t\tmenuHelpAbout.setMnemonic('A');\n\t\tbtnExamine.setMnemonic('E');\n\t\tbtnCreate.setMnemonic('C');\n\t\trBtnID.setMnemonic('1');\n\t\trBtnLast.setMnemonic('2');\n\t\trBtnFirst.setMnemonic('3');\n\t\trBtnEntries.setMnemonic('4');\n\t\t\n\t\tinputField.setFocusAccelerator('S');\n\t\tmenuFileSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK));\n\t\tmenuFileExitNoSave.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, Event.CTRL_MASK));\n\t\tmenuRecordCreate.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK));\n\t\tmenuRecordDelete.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK));\n\t\t\n\t\tmenuFile.add(menuFileSave);\n\t\tmenuFile.add(menuFileExitNoSave);\n\t\tmenuHelp.add(menuHelpAbout);\n\t\tmenuBar.add(menuFile);\n\t\tmenuBar.add(menuHelp);\n\t\tmenuBar.add(menuRecord);\n\t\tmenuRecord.add(menuRecordCreate);\n\t\tmenuRecord.add(menuRecordDelete);\n\t\t\n\t\tmenuFileExitNoSave.addActionListener(new MenuFileExitNoSaveListener());\n\t\tmenuFileSave.addActionListener(new MenuFileSaveListener());\n\t\tmenuHelpAbout.addActionListener(new MenuHelpAboutListener());\n\t\tmenuRecordDelete.addActionListener(new MenuRecordDeleteListener());\n\t\tmenuRecordCreate.addActionListener(new BtnCreateSearchListener());\n\t\tinputField.addActionListener(new BtnSubmitSearchListener());\n\t\trBtnID.addActionListener(new RBtnListener());\n\t\trBtnFirst.addActionListener(new RBtnListener());\n\t\trBtnLast.addActionListener(new RBtnListener());\n\t\trBtnEntries.addActionListener(new RBtnListener());\n\t\tbtnCreate.addActionListener(new BtnCreateSearchListener());\n\t\tbtnExamine.addActionListener(new BtnExamineSearchListener());\n\t\tbtnSubmit.addActionListener(new BtnSubmitSearchListener());\n\n\t\trBtnID.setActionCommand(Information.FIELDID+\"\");\n\t\trBtnFirst.setActionCommand(Information.FIELDFIRST+\"\");\n\t\trBtnLast.setActionCommand(Information.FIELDLAST+\"\");\n\t\trBtnEntries.setActionCommand(Information.FIELDENTRIES+\"\");\n\t\n\t\t/*\n\t\t * JTable - Contains the results of the search.\n\t\t */\n\t\trecordTable = new JTable(){/*OVERRIDES METHODS FOR FUNCTIONALITY*/\n\t\t\tstatic final long serialVersionUID=0;\t//Get rid of warning.\n\t\t\tpublic boolean getScrollableTracksViewportWidth()\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\t//Makes it scrollable.\n\t\tmodelDefault = new DefaultTableModel() {/*OVERRIDES METHODS FOR FUNCTIONALITY*/\n\t\t\tstatic final long serialVersionUID=0;\t//Get rid of warning.\n\t\t\tpublic boolean isCellEditable(int row, int col)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};//DefaultTableModel\n\t\t\trecordTable.setModel(modelDefault);\n\t\t\trecordTable.setRowHeight(15);\n\t\t\trecordTable.setFillsViewportHeight(false);\n\t\t\trecordTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\t\t\trecordTable.setRowSelectionAllowed(true);\n\t\t\trecordTable.getTableHeader().setReorderingAllowed(false);\n\t\t\t//recordTable.setAutoCreateRowSorter(true);\n\t\t\tTableRowSorter<DefaultTableModel> sorter = new TableRowSorter<DefaultTableModel>(modelDefault);\t//Create a sort\n\t\t\trecordTable.setRowSorter(sorter);\t\t\t\t\t\t\t//Sort!\n\t\t\tToolTipManager.sharedInstance().unregisterComponent(recordTable);\n\t\t\tToolTipManager.sharedInstance().unregisterComponent(recordTable.getTableHeader());\n\t\t//Orders the columns according to global settings (prevents mismanipulation due to programmer oversight).\n\t\tfor(int index=0;index<4;index++)\n\t\t{\n\t\t\tswitch(index)\n\t\t\t{\n\t\t\tcase Information.FIELDID:\n\t\t\t\tmodelDefault.addColumn(\"Student ID #\");\n\t\t\t\tbreak;\n\t\t\tcase Information.FIELDFIRST:\n\t\t\t\tmodelDefault.addColumn(\"First Name\");\n\t\t\t\tbreak;\n\t\t\tcase Information.FIELDLAST:\n\t\t\t\tmodelDefault.addColumn(\"Last Name\");\n\t\t\t\tbreak;\n\t\t\tcase Information.FIELDENTRIES:\n\t\t\t\tmodelDefault.addColumn(\"# Entries\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tsorter.setComparator(Information.FIELDID, new StudentIDComparator());\n\t\tsorter.setComparator(Information.FIELDLAST, new LastNameComparator());\n\t\tsorter.setComparator(Information.FIELDFIRST, new FirstNameComparator());\n\t\tsorter.setComparator(Information.FIELDENTRIES, new EntriesComparator());\n\n\t\tsetEnabledExamine(false);\n\t}" ]
[ "0.82662046", "0.82662046", "0.81144494", "0.8003483", "0.7816289", "0.77415437", "0.7723887", "0.7681508", "0.76777273", "0.7511491", "0.7511491", "0.750007", "0.7460865", "0.7358176", "0.7346595", "0.7330486", "0.72797245", "0.7276444", "0.7261864", "0.72598773", "0.7257779", "0.72381014", "0.72316915", "0.72155946", "0.72113514", "0.72087747", "0.7197242", "0.7181695", "0.7172698", "0.71676356", "0.71533185", "0.7151903", "0.7150188", "0.7148342", "0.71340024", "0.7131591", "0.7128808", "0.7125643", "0.712544", "0.7123371", "0.711103", "0.7110642", "0.7095038", "0.7093756", "0.70855224", "0.70847857", "0.7079726", "0.70794433", "0.70740414", "0.70681083", "0.7067251", "0.70662296", "0.70642185", "0.70603764", "0.7048253", "0.7043448", "0.704082", "0.7038004", "0.70314443", "0.7029376", "0.7029133", "0.7024289", "0.7014892", "0.7014892", "0.70124626", "0.70123017", "0.7008798", "0.7006925", "0.7003949", "0.7002555", "0.6998824", "0.69977444", "0.6994171", "0.69859916", "0.69855535", "0.6976257", "0.6972884", "0.6972731", "0.69678825", "0.6967004", "0.69472945", "0.69445604", "0.693945", "0.6927531", "0.69170654", "0.69083", "0.6905042", "0.6904721", "0.6899423", "0.68988854", "0.6893688", "0.68935406", "0.6880786", "0.68806285", "0.6878805", "0.68699884", "0.686987", "0.68683463", "0.6862185", "0.68612546", "0.68591636" ]
0.0
-1
actionPerformrd method called when button is clicked
public void actionPerformed(ActionEvent ae) { if(ae.getSource()==openMazefile){ JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory()); FileNameExtensionFilter filter = new FileNameExtensionFilter("TEXT FILES", "txt", "text"); j.setFileFilter(filter); // invoke the showsOpenDialog function to show the save dialog int r = j.showOpenDialog(null); // if the user selects a file if (r == JFileChooser.APPROVE_OPTION) { File inputFile=j.getSelectedFile(); mazePanel.readMaze(inputFile); solveMaze.setEnabled(true); } } else if (ae.getSource() == solveMaze){ mazePanel.solveMaze(); solveMaze.setEnabled(false); clearSolution.setEnabled(true); } else if (ae.getSource() == clearSolution){ mazePanel.clearMazePath(); solveMaze.setEnabled(true); clearSolution.setEnabled(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "public void performAction() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) \n\t\t{\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n if (e.getActionCommand() == \"查询\") {\n //String order = e.getActionCommand();\n try {\n new Inquiry(username);\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n //new Login(e.getActionCommand());\n } else if (e.getActionCommand() == \"存款\") {\n new SaveMoney(username);\n //new Login(e.getActionCommand());\n } else if (e.getActionCommand() == \"取款\") {\n new DrawMoney(username);\n } else if (e.getActionCommand() == \"转账\") {\n new Transfer(username);\n } else if (e.getActionCommand() == \"改密\") {\n new Modify(username);\n }\n else if (e.getActionCommand() == \"查询记录\") {\n new Test1();\n }\n else if (e.getActionCommand() == \"退卡\") {\n new Menu();\n // System.exit(0);\n }\n\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "void btnGenReport_actionPerformed(ActionEvent e) {\n JButtonQueryButtonAction(e);\r\n }", "public void buttonClicked();", "public abstract void executeActionButton();", "public void actionPerformed(ActionEvent e) {\n action.actionPerformed(e);\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n adaptee.btnIDSearch_actionPerformed(e);\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n \n // YOUR CODE HERE\n\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfireDetailEvent(new DetailEvent(this,'P'));\r\n\t\t\t}", "private void ViewActionPerformed(ActionEvent e) {\n\t}", "public void actionPerformed(ActionEvent arg0) {\r\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) \n\t\t{\n\t\t\t\n\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n myButtonActionPerformed(arg0);\n }", "public void actionPerformed(ActionEvent e){\n\n }", "@Override\r\n \t\tpublic void actionPerformed(ActionEvent e) {\n \t\t}", "public void actionPerformed(ActionEvent e) {\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "public void actionPerformed(ActionEvent e) {\r\n\t\t\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfireDetailEvent(new DetailEvent(this, 'R'));\r\n\t\t\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\tObject source=arg0.getSource();\r\n\t\tif(source==deleteButton){\r\n\t\t\tdeleteExec();\r\n\t\t}else if(source==addNewButton){\r\n\t\t\ttry {\r\n\t\t\t\tViewManager.goToSubFunctionScreen(new AddDiscountPanel());\r\n\t\t\t} catch (ServiceNotFoundException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}else if(source==searchButton){\r\n\t\t\tsearchExec();\r\n\t\t}else if(source==modifyButton){\r\n\t\t\tmodifyExec();\r\n\t\t}\r\n\t\t\r\n\t}", "public void actionPerformed( ActionEvent event )\n {\n \n }", "public void buttonShowComplete(ActionEvent actionEvent) {\n }", "private void designBtnActionPerformed(ActionEvent evt) {\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstart_click(e);\r\n\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\taddAction();\n\t\t\t}", "public void actionPerformed(ActionEvent e)\n {\n }", "public void actionPerformed(ActionEvent event) {\n this.actionPerformed(event);\n\n }", "@Override\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t public void actionPerformed(ActionEvent e){\n\t }", "@Override //se repita\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t\t\n\t}", "public void actionPerformed(ActionEvent e)\n {\n }", "public void actionPerformed(ActionEvent e){}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tButtonPress();\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n adaptee.btnOrderTicket_actionPerformed(e);\r\n\t}", "private void devBtnActionPerformed(ActionEvent evt) {\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t}", "@Override\r\n public void actionPerformed(ActionEvent e)\r\n {\n \r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tgetControleur(). ConsultOuvrage() ;}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "public void actionPerformed(ActionEvent e){\n\t}", "void viewButton_actionPerformed(ActionEvent e) {\n doView();\n }", "public void actionPerformed(ActionEvent arg0)\n {\n\t \n }", "public void actionPerformed(ActionEvent e) {\n\r\n\t\t\t}", "public void performAction();", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}", "public void buttonLoadList(ActionEvent actionEvent) {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}" ]
[ "0.73483115", "0.7288863", "0.7288863", "0.72728217", "0.7227184", "0.7223184", "0.7223184", "0.7204628", "0.71946466", "0.7178697", "0.7178255", "0.71649075", "0.7135138", "0.7114336", "0.71069396", "0.7087141", "0.7082831", "0.70582485", "0.704907", "0.7045917", "0.7045917", "0.7045917", "0.7045917", "0.7039244", "0.7039244", "0.70237255", "0.70110774", "0.70105916", "0.69931847", "0.699037", "0.69875586", "0.6985894", "0.69853586", "0.69853586", "0.69853586", "0.69853586", "0.69853586", "0.69853586", "0.6984237", "0.6980692", "0.69799143", "0.6976937", "0.6975315", "0.6975285", "0.69657385", "0.69640195", "0.69640195", "0.69640195", "0.6955678", "0.6955678", "0.6955678", "0.6955678", "0.6955678", "0.6955678", "0.6955678", "0.6955678", "0.69545805", "0.6952015", "0.69283783", "0.6927245", "0.69252557", "0.69116247", "0.69033825", "0.6896285", "0.68943727", "0.6889402", "0.68555856", "0.6831761", "0.68278587", "0.6818838", "0.68172574", "0.6815025", "0.680841", "0.6807374", "0.6805111", "0.68027186", "0.68027186", "0.68027186", "0.68027186", "0.68027186", "0.68027186", "0.68027186", "0.68027186", "0.68027186", "0.68027186", "0.680222", "0.67953336", "0.67927146", "0.67816126", "0.6774632", "0.6773987", "0.6773987", "0.6773987", "0.6773918", "0.67641723", "0.67641723", "0.67641723", "0.67608094", "0.67608094", "0.67608094", "0.67608094" ]
0.0
-1
Creates a new memory viewer synchronizer.
public CMemoryViewerSynchronizer(final JHexView hexView, final CMemoryProvider provider, final CDebugPerspectiveModel debugPerspectiveModel) { Preconditions.checkNotNull(hexView, "IE01406: Hex view argument can not be null"); Preconditions.checkNotNull(provider, "IE01407: Provider argument can not be null"); Preconditions.checkNotNull( debugPerspectiveModel, "IE01408: Debug perspective model argument can not be null"); m_hexView = hexView; m_provider = provider; m_debugPerspectiveModel = debugPerspectiveModel; debugPerspectiveModel.addListener(m_debugListener); synchronizeDebugger(null, m_debugPerspectiveModel.getCurrentSelectedDebugger()); m_hexView.addHexListener(m_hexListener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GUIMemoryView(EventManager eventManager) {\r\n super(\"Memory View\");\r\n\r\n this.eventManager = eventManager;\r\n\r\n setup();\r\n\r\n // add events to listen to\r\n EventManager.EVENT[] events = {\r\n EventManager.EVENT.MEMORY_CHANGE,\r\n EventManager.EVENT.EMULATOR_CLEAR,\r\n EventManager.EVENT.EMULATOR_READY\r\n };\r\n\r\n this.eventManager.addEventObserver(events, this);\r\n\r\n // trigger an update\r\n eventManager.sendEvent(EventManager.EVENT.MEMORY_REQUEST_UPDATE);\r\n }", "public void addListener(final IMemoryViewerSynchronizerListener listener) {\n m_listeners.addListener(listener);\n }", "protected abstract StructuredViewer createViewer(Shell shell);", "private VirtualDisplay createVirtualDisplay() {\n // 建立virtualDisplay\n return mediaProjection.createVirtualDisplay(\"MainActivity\", screenWidth, screenHeight, screenDensity,\n DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR, mediaRecorder.getSurface(), null, null);\n }", "VM createVM();", "public Viewer() {\r\n\t\tzoom = DEFAULT_ZOOM;\r\n\t\tisWireframe = false;\r\n\t\tisAxes = true;\r\n\t\tnextRotationAngle = 0;\r\n\t\tnextRotationAxis = null;\r\n\t\trotationMatrix = null;\r\n\t\tscreenWidth = 0;\r\n\t\tscreenHeight = 0;\r\n\t}", "@Override\r\n\tpublic Viewer create(String name) {\n\t\tif(this.isAllDataPresent())\r\n\t\t{\r\n\t\t\treturn new StressViewer(name);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "private void createViewer(Composite parent)\r\n {\n\t\r\n\tviewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);\r\n\tfinal Table table = viewer.getTable();\r\n\ttable.setHeaderVisible(true);\r\n\ttable.setLinesVisible(true);\r\n\r\n\tviewer.setContentProvider(new ArrayContentProvider());\r\n\r\n\tviewer.setInput(manager.getServerContacts());\r\n\r\n\tgetSite().setSelectionProvider(viewer);\r\n\r\n\tviewerLayout();\r\n }", "private void crearVista() {\n\t\tVista vista = Vista.getInstancia();\n\t\tvista.addObservador(this);\n\n\t}", "public static void createAndShowGUI()\n\t{\n\t\tSystem.out.println(\"Starting encFS Manager\");\n\t\tEncFSModel mod = new EncFSModel();\n\t\tEncFSController controller = new EncFSController(mod);\n\t\tEncFSModelRefresher refresher = new EncFSModelRefresher(mod);\n\t\t\t\t\n\t\ttry{\n\t\t\tBufferedImage myPicture = null;\t\t\t\n\t\t\t\n\t\t\tmyPicture = ImageIO.read(mod.getClass().getClassLoader().getResource(\"Lock_tray.png\"));\n\t\t\t\n\t\t\tEncFSTray tray = new EncFSTray(myPicture, mod, controller);\n\t\t\tif(SystemTray.isSupported())\n\t\t\t{\n\t\t\t\tfinal SystemTray stray = SystemTray.getSystemTray();\n\t\t\t\tstray.add(tray);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Tray not supported\");\t\t\t\t\n\t\t\t}\n\t\t\tThread refresherThread = new Thread(refresher);\n\t\t\trefresherThread.start();\n\t\t}\n\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace(System.out);\n\t\t}\n\t}", "@Override\r\n\tpublic Viewer create(String name) {\n\t\tif(this.isAllDataPresent())\r\n\t\t{\r\n\t\t\treturn new ShapeViewer(name);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\t\r\n\t}", "public ScreenMonitor(int cacheTTL, int logSize, String lineSeparator, boolean memory, boolean battery){\n this.cacheTTL = cacheTTL;\n this.logSize = logSize;\n this.lineSeparator = lineSeparator;\n this.memory = memory;\n this.battery = battery;\n this.data = new ArrayList<DisplayableData>();\n this.logs = new VisibleArrayList<String>();\n start();\n }", "protected void createContents() {\n\t\tMonitor primary = this.getDisplay().getPrimaryMonitor();\n\t\tRectangle bounds = primary.getBounds();\n\t\tRectangle rect = getBounds();\n\t\tint x = bounds.x + (bounds.width - rect.width) / 2;\n\t\tint y = bounds.y + (bounds.height - rect.height) / 2;\n\t\tsetLocation(x, y);\n\t}", "public FileManagerController() {\n fileSystemView = FileSystemView.getFileSystemView();\n desktop = Desktop.getDesktop();\n previewFactory = new PreviewFactory();\n initView();\n }", "private void setupVisualizerFxAndUi() {\n mVisualizer = new Visualizer(0); // Using system audio session ID\n mVisualizer.setEnabled(false);\n mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1] );\n mVisualizer.setScalingMode(SCALING_MODE_AS_PLAYED);//SCALING_MODE_NORMALIZED);//\n mVisualizer.setDataCaptureListener(\n new Visualizer.OnDataCaptureListener() {\n public void onWaveFormDataCapture(\n Visualizer visualizer,\n byte[] bytes,\n int samplingRate) {\n // mVisualizerView.updateVisualizer(bytes);\n }\n\n public void onFftDataCapture(\n Visualizer visualizer,\n byte[] bytes,\n int samplingRate) {\n //mVisualizerView.updateVisualizer(bytes);\\\n if(debugModeOn) {\n debugViewModel.update(bytes);\n }\n // Do nothing for now\n }\n }, Visualizer.getMaxCaptureRate()-1 , false, true);\n }", "@Override\n public void run() {\n jmeVisualization = new JMEVisualization();\n jmeVisualization.setRotated(false);\n jmeVisualization.setWidth(getVisualizationPanel().getWidth() - 15);\n jmeVisualization.setHeight(getVisualizationPanel().getHeight() - 30);\n jmeVisualization.startApplication();\n\n /*\n Fetch Canvas from JMEVisualization instance\n */\n jmeCanvas = jmeVisualization.getJmeCanvasContext().getCanvas();\n\n getVisualizationPanel().setLayout(new FlowLayout());\n getVisualizationPanel().add(jmeCanvas);\n getVisualizationPanel().revalidate();\n\n }", "protected SourceViewer createViewer(Composite parent) {\n \t\tSourceViewer viewer= new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);\n \t\tSourceViewerConfiguration configuration= new SourceViewerConfiguration();\n \t\tviewer.configure(configuration);\n \t\tIDocument document= new Document();\n \t\tviewer.setDocument(document);\n \t\treturn viewer;\n \t}", "Monitor createMonitor();", "public ViewFactory(DataManager dm) {\n this.dm = dm;\n }", "private static void createAndShowGUI() {\n\t\t//creating the GUI\n\t\tPhotoViewer myViewer = new PhotoViewer();\n\n\t\t//setting the title\n\t\tmyViewer.setTitle(\"Cameron Chiaramonte (ccc7sej)\");\n\n\t\t//making sure it will close when the x is clicked\n\t\tmyViewer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\t//calling the method to add the components to the pane and then making it visible\n\t\tmyViewer.addComponentsToPane(myViewer.getContentPane());\n\t\tmyViewer.pack();\n\t\tmyViewer.setVisible(true);\n\t}", "Contender createContender();", "public SynopticView() {\n\t\tsuper();\n\t}", "public ReadMemorySynchronizer(final IDebugger debugger,\n final ListenerProvider<IDebugEventListener> listeners) {\n super(debugger, listeners);\n }", "protected SourceViewer createViewer(Composite parent) {\n \t\t\tSourceViewer viewer= new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);\n \t\t\tSourceViewerConfiguration configuration= new SourceViewerConfiguration() {\n \t\t\t\tpublic IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {\n \n \t\t\t\t\tContentAssistant assistant= new ContentAssistant();\n \t\t\t\t\tassistant.enableAutoActivation(true);\n \t\t\t\t\tassistant.enableAutoInsert(true);\n \t\t\t\t\tassistant.setContentAssistProcessor(fTemplateProcessor, IDocument.DEFAULT_CONTENT_TYPE);\n \t\t\t\t\treturn assistant;\n \t\t\t\t}\n \t\t\t};\n \t\t\tviewer.configure(configuration);\n \t\t\treturn viewer;\n \t\t}", "public DataViewerImpl() {\n\t\tsuper();\n\t}", "final void initViewer()\n {\n if (viewer.getViewContext().getStartInStandaloneWindow() == true)\n {\n \n JFrame frame=null; \n // JFrame\n {\n frame = new JFrame();\n frame.setSize(new Dimension(800, 600));\n GuiSettings.placeToCenter(frame);\n }\n\n if (viewer.haveOwnScrollPane() == false)\n {\n // embed viewer in scrollPane \n JScrollPane scrollPane = new JScrollPane();\n scrollPane.setViewportView(viewer.getViewComponent());\n frame.add(scrollPane);\n }\n else\n {\n frame.add(viewer.getViewComponent());\n }\n \n // Viewer\n // viewer.setFrame(frame); \n viewer.initViewer();\n \n ViewerFrameListener listener = new ViewerFrameListener(frame,this);\n frame.addWindowListener(listener);\n frame.addComponentListener(listener); \n \n frame.pack();\n\n frame.setVisible(true);\n // viewer.setFrame(frame); \n }\n else\n {\n viewer.initViewer();\n }\n }", "Reference_Monitor createReference_Monitor();", "private Camera() {\n viewport = new Rectangle();\n dirtyAreas = new ArrayList<Rectangle>();\n renderedAreas = new ArrayList<Rectangle>();\n fullUpdate = false;\n dirtyAreaCounter = 0;\n }", "public DisplayThread(ClientMonitor m, GUI gui){\n\t\tmonitor = m;\n\t\tthis.gui = gui;\n\t}", "@Override\n public Vehicule creer(String immatriculation, String marque, String modele, Client client, int tonnage, int hauteur) {\n return new Camion(immatriculation,marque,modele,client,tonnage,hauteur);\n }", "private void createNewVisualPane(int solverId) {\n }", "public java__awt__Component_ComponentView(final ViewerCreateData vcd) {\r\n super(new BorderLayout());\r\n }", "public static native Mat4 create() /*-{\n return $wnd.mat4.create();\n }-*/;", "public abstract ArchECoreView newView(ArchECoreArchitecture architecture) throws ArchEException;", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tView view = inflater.inflate(R.layout.fragment_topo_structure,\n\t\t\t\tcontainer, false);\n\t\tnodeView = (topoStructureView) view.findViewById(R.id.topoStructureView);\n\t\tif (MainActivity.serialPortConnect)\n\t\t\tnew Thread(new MyThread()).start();\n\t\t\n\t\treturn view;\n\t}", "View createView();", "public ViewerComponent() {\n int images = layout_threads.size();\n int comp_w = 4*w, comp_h = (h*images)/4; if ((images%4) != 0) comp_h += h;\n Dimension dimension = new Dimension(comp_w, comp_h); setPreferredSize(dimension); setMinimumSize(dimension);\n addMouseListener(this); addMouseMotionListener(this);\n }", "protected Object createCraphicalViewInternal() {\n\t\tDesignViewDiagram aviewDiagram = null;\n\t\t\t\n\t\tif (selectedViewType.equalsIgnoreCase(ViewLayout.DECOMPOSITION_VIEW)){\n//\t\t\tSystem.out.println(System.currentTimeMillis());\n\t\t\t\n\t\t\tSparseTree archTree = null;\n//\t\t\tarchTree = ArcheModel.GetInstance().getFullDecompositionArcheModel(\"Architecture1\", rootFactId, bRootMarked); \t\t\t\n\t\t\tarchTree = ArcheModel.GetInstance().getFullDecompositionArcheModel(versionName, rootFactId, bRootMarked); \t\t\t\n\t\t\tif(archTree == null){\n//\t\t\t\tarchTree = ArcheModel.GetInstance().getFullDecompositionArcheModel(versionName, rootFactId, bRootMarked); \t\t\t\t\t\t\t\n//\t\t\t\tif(archTree == null){\n//\t\t\t\t\tSystem.out.println(\"Architecture might not exist in the ArchE database\");\n\t\t\t\t\treturn null;\n//\t\t\t\t}\n\t\t\t}\n\t\t\t\n//\t\t\tSystem.out.println(System.currentTimeMillis());\n\t\n\t\t\tDecompositionViewLayout\tlayout = new DecompositionViewLayout();\n\t\t\taviewDiagram = layout.generateTreeLayout(archTree);\n\t\t}\n\t\telse if (selectedViewType.equalsIgnoreCase(ViewLayout.DEPENDENCY_VIEW)){\n//\t\t\tSystem.out.println(System.currentTimeMillis());\n\t\t\tSparseGraph archGraph = null;\n//\t\t\tarchGraph = model.getFullDependencyArcheModel(\"Architecture1\", rootFactId, bRootMarked, rootFactType); \t\n\t\t\tarchGraph = model.getFullDependencyArcheModel(versionName, rootFactId, bRootMarked, rootFactType); \t\n\t\t\tif(archGraph == null){\n//\t\t\t\tarchGraph = model.getFullDependencyArcheModel(versionName, rootFactId, bRootMarked, rootFactType); \t\n//\t\t\t\tif(archGraph == null){\n//\t\t\t\t\tSystem.out.println(\"Architecture might not exist in the ArchE database\");\n\t\t\t\t\treturn null;\n//\t\t\t\t}\n\t\t\t}\n//\t\t\tSystem.out.println(System.currentTimeMillis());\n\t\t\t\t\t\t\n\t\t\tDependencyViewLayout\tlayout = new DependencyViewLayout();\n\t\t\tif(selectedLayoutType.equals(DependencyViewLayout.FR_LAYOUT)) {\t\n\t\t\t\taviewDiagram = layout.generateFRLayout(archGraph);\n\t\t\t}\n\t\t\telse if (selectedLayoutType.equals(DependencyViewLayout.KK_LAYOUT)) {\n\t\t\t\taviewDiagram = layout.generateKKLayout(archGraph);\n\t\t\t}\n\t\t\telse if (selectedLayoutType.equals(DependencyViewLayout.CIRCLE_LAYOUT)) {\n\t\t\t\taviewDiagram = layout.generateCircleLayout(archGraph);\t\t\t\t\n\t\t\t}\n\t\t}\t\t\n\t\telse if (selectedViewType.equalsIgnoreCase(ViewLayout.CONCURRENCY_VIEW)){\n\t\t\t// TODO: [Extension Point] for concurrency view \n\t\t}\n\t\t// TODO: [Extension Point] for additional views \n\t\t\n\t\tif(aviewDiagram != null){\n\t\t\taviewDiagram.setVersionName(versionName);\n\t\t\taviewDiagram.setVersionID(versionID);\n\t\t\taviewDiagram.setRootNodeFactId(rootFactId);\n\t\t\taviewDiagram.setRootNodeFactType(rootFactType);\n\t\t\taviewDiagram.setSelectedViewType(selectedViewType);\n\t\t\taviewDiagram.setSelectedLayoutType(selectedLayoutType);\t\t\t\n\t\t}\n\t\t\n\t\treturn aviewDiagram;\n\t}", "ManagementLockObject create();", "private static void createAndShowGUI()\r\n {\r\n JFrame f = new JFrame(\"Viewer\");\r\n f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n f.getContentPane().setLayout(new BorderLayout());\r\n \r\n JLabel usageLabel = new JLabel(\"<html>\"\r\n + \"Right mouse drags: Translate<br> \"\r\n + \"Left mouse drags: Create selection shape<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +shift: remove from selection<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +ctrl: add to selection<br>\"\r\n + \"Left mouse clicks: Select single<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +ctrl: toggle single selection<br>\"\r\n + \"Mouse wheel: Zoom uniformly<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +shift: zoom along x<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +ctrl: zoom along y<br>\"\r\n + \"</html>\");\r\n f.getContentPane().add(usageLabel, BorderLayout.NORTH);\r\n \r\n // Create a viewer, with mouse controls where the rotation is\r\n // disabled (left clicks are intended for the selection here)\r\n Viewer viewer = new Viewer();\r\n viewer.setMouseControl(\r\n MouseControls.createDefault(viewer, false, true));\r\n \r\n // Create the selection model\r\n SelectionModel<Point2D> selectionModel = SelectionModels.create();\r\n selectionModel.addSelectionListener(\r\n new LoggingSelectionListener<Point2D>());\r\n\r\n // Create the painter for the test\r\n ViewerSelectionTestPainter viewerSelectionTestPainter = \r\n new ViewerSelectionTestPainter(selectionModel::isSelected);\r\n \r\n // The painter also serves as the point- and shape based selector.\r\n // Make this clear by assigning it to respective variables\r\n PointBasedSelector<Point2D> pointBasedSelector = \r\n viewerSelectionTestPainter;\r\n ShapeBasedSelector<Point2D> shapeBasedSelector = \r\n viewerSelectionTestPainter;\r\n\r\n // Create a selection handler for clicks, and use it to connect\r\n // the viewer and the selection model\r\n SelectionHandler<Point2D> clickSelectionHandler = \r\n SelectionHandlers.createClick(pointBasedSelector);\r\n clickSelectionHandler.connect(viewer, selectionModel);\r\n \r\n // Create a selection handler for a lasso selection, and use it to \r\n // connect the viewer and the selection model\r\n SelectionHandler<Point2D> lassoSelectionHandler = \r\n SelectionHandlers.createLasso(shapeBasedSelector);\r\n lassoSelectionHandler.connect(viewer, selectionModel);\r\n\r\n // Create a selection handler for rectangles, which can be enabled\r\n // via the config panel\r\n SelectionHandler<Point2D> rectangleSelectionHandler = \r\n SelectionHandlers.createRectangle(shapeBasedSelector);\r\n \r\n viewer.addPainter(\r\n viewerSelectionTestPainter);\r\n f.getContentPane().add(viewer, BorderLayout.CENTER);\r\n\r\n JPanel configPanel = createConfigPanel(viewer, selectionModel, \r\n lassoSelectionHandler, rectangleSelectionHandler);\r\n f.getContentPane().add(configPanel, BorderLayout.EAST);\r\n\r\n JLabel infoLabel = new JLabel(\" \");\r\n f.getContentPane().add(infoLabel, BorderLayout.SOUTH);\r\n \r\n viewer.setPreferredSize(new Dimension(500,500));\r\n f.pack();\r\n viewer.setPreferredSize(null);\r\n f.setLocationRelativeTo(null);\r\n f.setVisible(true);\r\n \r\n viewer.setDisplayedWorldArea(-0.1, -0.1, 1.2, 1.2);\r\n }", "public static synchronized IocMonitor createAndStartMonitor() {\n\t\tstopAndDisposeIocMonitor();\n\t\tiocMonitor = new IocMonitor();\n\t\ticsTracker = new InterconnectionServerTracker(iocMonitor);\n\t\t\n\t\tsessionServiceTracker = new ServiceTracker(\n\t\t\t\tActivator.getDefault().getBundleContext(),\n\t\t\t\tISessionService.class.getName(), null) {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Object addingService(ServiceReference reference) {\n\t\t\t\tObject service = super.addingService(reference);\n\t\t\t\ticsTracker.bindService((ISessionService) service);\n\t\t\t\treturn service;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void removedService(ServiceReference reference,\n\t\t\t\t\tObject service) {\n\t\t\t\ticsTracker.unbindService((ISessionService) service);\n\t\t\t\tsuper.removedService(reference, service);\n\t\t\t}\n\t\t};\n\t\tsessionServiceTracker.open();\n\t\treturn iocMonitor;\n\t}", "private void setUpView()\n {\n view = new DefaultDrawingView();\n DrawingEditorProxy editor = new DrawingEditorProxy();\n editor.setTarget(new DefaultDrawingEditor());\n view.addNotify(editor);\n for (Handle h : handles)\n h.setView(view);\n }", "Snapshot create();", "@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 interface Viewer {\n\n\t/**\n\t * Update DataViewer Configuration.\n\t * \n\t * @param config\n\t * DataViewerConfiguration\n\t */\n\tvoid updateConfiguration(DataViewerConfiguration config);\n\n\t/**\n\t * Updates plot data.\n\t * \n\t * @param plotData\n\t * the PlotData\n\t * \n\t */\n\tvoid updatePlot(PlotData plotData);\n\n\t/**\n\t * Removes all the traces from the DataViewer.\n\t */\n\tvoid resetPlot();\n\n\t/**\n\t * Get the Unique ID of the created DataViewer.\n\t */\n\tString getUniqueID();\n\n\t/**\n\t * Get the URL of the DataViewer.\n\t */\n\tString getUrl();\n\n}", "public static ViewMaintenanceList newInstance() {\n ViewMaintenanceList fragment = new ViewMaintenanceList();\n return fragment;\n }", "public Browser()\n\t{\n\t\tinitComponents();\n\t\tlibraryViewer1.setThumbnail(thumbnails1);\n\t\t\n\t\ttimer = new Timer();\n timer.schedule(new CheckFilesTask(libraryViewer1), 5000, 5000);\n\t}", "public Monitor(MonitorOffice of) {\r\n\t\toffice = of;\r\n\t}", "private void setupVisualizerFxAndUI() {\n\n mLinearLayout = (LinearLayout) findViewById(R.id.linearLayoutVisual);\n // Create a VisualizerView to display the audio waveform for the current settings\n mVisualizerView = new VisualizerView(this);\n mVisualizerView.setLayoutParams(new ViewGroup.LayoutParams(\n ViewGroup.LayoutParams.MATCH_PARENT,\n (int) (VISUALIZER_HEIGHT_DIP * getResources().getDisplayMetrics().density)));\n mLinearLayout.addView(mVisualizerView);\n\n // Create the Visualizer object and attach it to our media player.\n\n\n\n\n\n\n mVisualizer = new Visualizer(mMediaPlayer.getAudioSessionId());\n //mVisualizer = new Visualizer(0);\n mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1]);\n\n mVisualizer.setDataCaptureListener(new Visualizer.OnDataCaptureListener() {\n public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes,\n int samplingRate) {\n mVisualizerView.updateVisualizer(bytes);\n }\n\n public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {\n }\n }, Visualizer.getMaxCaptureRate() / 2, true, false);\n }", "public GUIEditorController(GUIView v, ModelEditor m) \n\t{\n\t\tthis.project = m;\n\t\tthis.view = v;\n\t\tproject.attach(v);\n\t}", "private View create(PersistedView pView) {\n DsmSorting sorting = nameToSorting.get(pView.dsmSortingName);\n if (null == sorting) {\n sorting = DsmSorting.values()[0];\n }\n\n View view = new View();\n view.setName(decodeString(pView.name));\n view.setSorting(sorting);\n\n return view;\n }", "public View(Model m) {\n super(\"Group G: Danmarkskort\");\n model = m;\n iconPanel.addObserverToIcons(this);\n routePanel = new RouteView(this, model);\n optionsPanel = new OptionsPanel(this,model);\n /*Three helper functions to set up the AffineTransform object and\n make the buttons and layout for the frame*/\n setScale();\n makeGUI();\n adjustZoomFactor();\n\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\n //This sets up a listener for when the frame is re-sized.\n createComponentListener();\n\n pack();\n canvas.requestFocusInWindow();\n model.addObserver(this);\n }", "public interface MonitorContractor {\n interface View{\n\n }\n interface Presenter{\n void attachView(View view);//viewSet\n void detachView();\n }\n}", "protected StructuredViewer createViewer(Composite parent) {\r\n\t\tProblemTreeViewer result= new ProblemTreeViewer(parent, SWT.MULTI);\r\n\t\tfFilterUpdater= new FilterUpdater(result);\r\n\t\tResourcesPlugin.getWorkspace().addResourceChangeListener(fFilterUpdater);\r\n\t\treturn result;\r\n\t}", "public void regenView() {\r\n\t\ttry { \r\n\r\n\t\t\tFileInputStream fis = new FileInputStream(Preferences.cacheDataFile);\r\n\t\t\tLoadModelTask task = new LoadModelTask(timeRange.getMinTs(), timeRange.getMaxTs(), timeRange.getIniTs(), timeRange.getEndTs(), true, fis, Preferences.RecursivityLevel, this);\r\n\t\t\ttask.execute();\r\n\t\t\tthis.setEnabled(false);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tCommonForms.showError(this, \"Error reading cache\");\r\n\t\t}\r\n\t}", "void run() {\n System.out.println(\"PC Visual application run\");\n data = new Data(this);\n window = new Window(this);\n window.setup();\n mote = new MoteIF(PrintStreamMessenger.err);\n mote.registerListener(new OscilloscopeMsg(), this);\n }", "CreateEventViewModelFactory() {\n super(Storage.class, Authenticator.class);\n }", "public Memory.Component<SharedMemory> newComponent() {\r\n return this._newComponent(new Memory.Requires<SharedMemory>() {}, true);\r\n }", "public ConsumerManagement() {\n\t\tcreateframe(\"\");\n\t}", "public ScreenMonitor(){\n this(Configuration.SCREEN_MONITOR_UPDATE_DELAY,\n\t \t\tConfiguration.SCREEN_MONITOR_LOGS_SIZE, \n\t \t\tConfiguration.SCREEN_MONITOR_LINE_SEPERATOR,\n\t \t\tConfiguration.SCREEN_MONITOR_DATA_MEMORY,\n\t \t\tConfiguration.SCREEN_MONITOR_DATA_POWER);\n }", "public FieldMarshal() {\n \n _emf = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory(\"FieldMarshalMySqlPU\");\n tournamentJpaController = new TournamentJpaController(_emf);\n tournamentManager = new TournamentManager( tournamentJpaController ); \n //playerManager = new PlayerManager( _emf );\n initComponents();\n \n //loadTournamentView.setEntityManager(_em);\n loadView.setManager(tournamentManager);\n //loadView.addPropertyChangeListener(tournamentManager);\n //loadView.updateList();\n \n ///tournamentManager.addObserver(tournamentView);\n ///tournamentManager.addObserver(playersView); \n \n tournamentView.setManager(tournamentManager);\n //playersView.setManager(tournamentManager);\n \n \n //tournamentView.updateView();\n //playersView.updateView();\n playersView.setManager(tournamentManager);\n }", "@Override\r\n\tpublic void run() {\n\t\tshowViewer();\r\n\t}", "public void ponerMarchaTren() {\n\n try {\n this.semLugarTren.acquire(this.capacidadTren); \n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public RegView() {\r\n\t\trc = new RegControl();\r\n\t\t// load the land registry before running the program\r\n\t\tviewLoadLandRegistryFromBackUp();\r\n\t}", "public JanelaPrincipal() {\r\n\t\tsuper(\"Musical Memory\");\r\n\r\n\t\tinitialize();\r\n\t\t//this.setLocationByPlatform(true);\r\n\t\tthis.setVisible(true);\r\n\t\tthis.addKeyListener(this);\r\n\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_synchronize, container, false);\n }", "public VPlexStorageViewInfo createStorageView(String viewName,\n List<PortInfo> targetPortInfo, List<PortInfo> initiatorPortInfo,\n Map<String, Integer> virtualVolumeMap) throws VPlexApiException {\n\n s_logger.info(\"Request for storage view creation on VPlex at {}\", _baseURI);\n\n // A storage view name is required. It must be unique across all\n // clusters of the VPlex. We could do a check here, but it would\n // require an additional request, or perhaps 2 in a Metro/Geo\n // configuration.\n if ((viewName == null) || (viewName.trim().length() == 0)) {\n throw new VPlexApiException(\n \"A name for the storage view must be specified.\");\n }\n\n // Targets are required to create a storage view.\n if (targetPortInfo.isEmpty()) {\n throw new VPlexApiException(\n \"Target ports are required to create a storage view\");\n }\n\n return _exportMgr.createStorageView(viewName, targetPortInfo, initiatorPortInfo,\n virtualVolumeMap);\n }", "private GreenfootMain(String projDir, String shmFilePath, int shmFileSize)\n {\n instance = this;\n try {\n\n projectProperties = new ShadowProjectProperties();\n ActorDelegateIDE.setupAsActorDelegate(projectProperties);\n\n EventQueue.invokeLater(new Runnable() {\n @Override\n @OnThread(value = Tag.Swing, ignoreParent = true)\n public void run() {\n // Initialise JavaFX:\n new JFXPanel();\n Platform.setImplicitExit(false);\n\n // Some first-time initializations\n VMCommsSimulation vmComms = new VMCommsSimulation(projectProperties, shmFilePath, shmFileSize);\n\n WorldHandlerDelegateIDE worldHandlerDelegate = new WorldHandlerDelegateIDE(vmComms);\n WorldHandler.initialise(worldHandlerDelegate);\n WorldHandler worldHandler = WorldHandler.getInstance();\n Simulation.initialize();\n Simulation sim = Simulation.getInstance();\n\n sim.addSimulationListener(new SimulationListener() {\n @OnThread(Tag.Simulation)\n @Override\n public void simulationChangedSync(SyncEvent e)\n {\n if (e == SyncEvent.NEW_ACT_ROUND\n || e == SyncEvent.QUEUED_TASK_BEGIN)\n {\n // New act round - will be followed by another NEW_ACT_ROUND event if the simulation\n // is running, or a STOPPED event if the act round finishes and the simulation goes\n // back to the stopped state.\n vmComms.userCodeStarting();\n }\n else if (e == SyncEvent.END_ACT_ROUND\n || e == SyncEvent.QUEUED_TASK_END)\n {\n vmComms.userCodeStopped(e == SyncEvent.QUEUED_TASK_END);\n }\n else if (e == SyncEvent.DELAY_LOOP_ENTERED)\n {\n vmComms.notifyDelayLoopEntered();\n }\n else if (e == SyncEvent.DELAY_LOOP_COMPLETED)\n {\n vmComms.notifyDelayLoopCompleted();\n }\n }\n\n @Override\n public @OnThread(Tag.Any) void simulationChangedAsync(AsyncEvent e)\n {\n }\n });\n\n sim.addSimulationListener(SoundFactory.getInstance().getSoundCollection());\n \n Simulation.getInstance().setPaused(true);\n // Important to initialise the simulation before attaching world handler\n // as the latter begins simulation thread, and we want to have\n // the world handler delegate setup before then:\n sim.attachWorldHandler(worldHandler);\n\n // Want to execute this after the simulation has been initialised:\n ExecServer.setCustomRunOnThread(r -> Simulation.getInstance().runLater(r::run));\n\n // Config is initialized in GreenfootLauncherDebugVM\n\n }\n });\n }\n catch (Exception exc) {\n Debug.reportError(\"could not create greenfoot main\", exc);\n }\n }", "public static void createDisplay() {\n ContextAttribs attribs = new ContextAttribs(3, 2).withForwardCompatible(true)\n .withProfileCore(true);\n\n try {\n if (!goFullscreen) {\n Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));\n } else {\n Display.setFullscreen(true);\n }\n Display.create(new PixelFormat(), attribs);\n Display.setVSyncEnabled(true);\n Display.setTitle(\"Our First Display!\");\n GL11.glEnable(GL13.GL_MULTISAMPLE);\n } catch (LWJGLException e) {\n e.printStackTrace();\n }\n\n GL11.glViewport(0, 0, Display.getWidth(), Display.getHeight());\n lastFrameTime = getCurrentTime();\n }", "public View(Observer observer) {\n register(observer);\n }", "public View()\r\n\t{\r\n\t\tsetGUI();\r\n\t\tfinal Multithreading m = new Multithreading(this);\t\r\n\t\t\r\n\t\t/**\r\n\t\t * Anonymous Timer class for updating progress bars.\r\n\t\t * @param DELAY the system delay for time in milliseconds \r\n\t\t * @param ActionListener the ActionListener object\r\n\t\t */\r\n\t\tTimer Timer = new Timer(DELAY, new ActionListener()\r\n\t\t{\r\n\t\t\t/**\r\n\t\t\t * Implemented method for ActionListener\r\n\t\t\t * @param event the event occuring\r\n\t\t\t */\r\n\t\t\tpublic void actionPerformed(ActionEvent event)\r\n\t\t\t{\r\n\t\t\t\tbProgress = m.getbProgress();\r\n\t\t\t\tiProgress = m.getiProgress();\r\n\t\t\t\tmProgress = m.getmProgress();\r\n\t\t\t\tqProgress = m.getqProgress();\r\n\t\t\t\trProgress = m.getrProgress();\r\n\t\t\t\tbubblePB.setValue(bProgress);\r\n\t\t\t\tinsertionPB.setValue(iProgress);\r\n\t\t\t\tmergePB.setValue(mProgress);\r\n\t\t\t\tquickPB.setValue(qProgress);\r\n\t\t\t\tradixPB.setValue(rProgress);\r\n\t\t\t}\t\r\n\t\t});\r\n\t\tTimer.start();\r\n\t}", "@Implementation\n protected void __constructor__(IDisplayManager dm) {\n }", "public InputManager(){\n this.view = new View();\n }", "protected void createContents() {\n\t\t\n\t\tshlMailview = new Shell();\n\t\tshlMailview.addShellListener(new ShellAdapter() {\n\t\t\t@Override\n\t\t\tpublic void shellClosed(ShellEvent e) {\n\t\t\t\tdispose();\n\t\t\t}\n\t\t});\n\t\tshlMailview.setBackground(SWTResourceManager.getColor(SWT.COLOR_GRAY));\n\t\tshlMailview.setSize(1124, 800);\n\t\tshlMailview.setText(\"MailView\");\n\t\tshlMailview.setLayout(new BorderLayout(0, 0));\t\t\n\t\t\n\t\tMenu menu = new Menu(shlMailview, SWT.BAR);\n\t\tshlMailview.setMenuBar(menu);\n\t\t\n\t\tMenuItem mntmNewSubmenu = new MenuItem(menu, SWT.CASCADE);\n\t\tmntmNewSubmenu.setText(\"\\u0413\\u043B\\u0430\\u0432\\u043D\\u0430\\u044F\");\n\t\t\n\t\tMenu mainMenu = new Menu(mntmNewSubmenu);\n\t\tmntmNewSubmenu.setMenu(mainMenu);\n\t\t\n\t\tMenuItem menuItem = new MenuItem(mainMenu, SWT.NONE);\n\t\tmenuItem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tmyThready.stop();// interrupt();\n\t\t\t\tmyThready = new Thread(timer);\n\t\t\t\tmyThready.setDaemon(true);\n\t\t\t\tmyThready.start();\n\t\t\t}\n\t\t});\n\t\tmenuItem.setText(\"\\u041E\\u0431\\u043D\\u043E\\u0432\\u0438\\u0442\\u044C\");\n\t\t\n\t\tMenuItem exitMenu = new MenuItem(mainMenu, SWT.NONE);\n\t\texitMenu.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\t\t\t\t\n\t\t\t\tshlMailview.close();\n\t\t\t}\n\t\t});\n\t\texitMenu.setText(\"\\u0412\\u044B\\u0445\\u043E\\u0434\");\n\t\t\n\t\tMenuItem filtrMenu = new MenuItem(menu, SWT.NONE);\n\t\tfiltrMenu.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tfilterDialog fd = new filterDialog(shlMailview, 0);\n\t\t\t\tfd.open();\n\t\t\t}\n\t\t});\n\t\tfiltrMenu.setText(\"\\u0424\\u0438\\u043B\\u044C\\u0442\\u0440\");\n\t\t\n\t\tMenuItem settingsMenu = new MenuItem(menu, SWT.NONE);\n\t\tsettingsMenu.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tsettingDialog sd = new settingDialog(shlMailview, 0);\n\t\t\t\tsd.open();\n\t\t\t}\n\t\t});\n\t\tsettingsMenu.setText(\"\\u041D\\u0430\\u0441\\u0442\\u0440\\u043E\\u0439\\u043A\\u0438\");\n\t\t\n\t\tfinal TabFolder tabFolder = new TabFolder(shlMailview, SWT.NONE);\n\t\ttabFolder.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tif(tabFolder.getSelectionIndex() == 1)\n\t\t\t\t{\n\t\t\t\t\tservice.RepaintAccount(accountsTable);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\ttabFolder.setBackground(SWTResourceManager.getColor(SWT.COLOR_GRAY));\n\t\t\n\t\tTabItem lettersTab = new TabItem(tabFolder, SWT.NONE);\n\t\tlettersTab.setText(\"\\u041F\\u0438\\u0441\\u044C\\u043C\\u0430\");\n\t\t\n\t\tComposite composite_2 = new Composite(tabFolder, SWT.NONE);\n\t\tlettersTab.setControl(composite_2);\n\t\tcomposite_2.setLayout(new FormLayout());\n\t\t\n\t\tComposite composite_4 = new Composite(composite_2, SWT.NONE);\n\t\tFormData fd_composite_4 = new FormData();\n\t\tfd_composite_4.bottom = new FormAttachment(0, 81);\n\t\tfd_composite_4.top = new FormAttachment(0);\n\t\tfd_composite_4.left = new FormAttachment(0);\n\t\tfd_composite_4.right = new FormAttachment(0, 1100);\n\t\tcomposite_4.setLayoutData(fd_composite_4);\n\t\t\n\t\tComposite composite_5 = new Composite(composite_2, SWT.NONE);\n\t\tcomposite_5.setLayout(new BorderLayout(0, 0));\n\t\tFormData fd_composite_5 = new FormData();\n\t\tfd_composite_5.bottom = new FormAttachment(composite_4, 281, SWT.BOTTOM);\n\t\tfd_composite_5.left = new FormAttachment(composite_4, 0, SWT.LEFT);\n\t\tfd_composite_5.right = new FormAttachment(composite_4, 0, SWT.RIGHT);\n\t\tfd_composite_5.top = new FormAttachment(composite_4, 6);\n\t\tcomposite_5.setLayoutData(fd_composite_5);\n\t\t\n\t\tComposite composite_10 = new Composite(composite_2, SWT.NONE);\n\t\tFormData fd_composite_10 = new FormData();\n\t\tfd_composite_10.top = new FormAttachment(composite_5, 6);\n\t\tfd_composite_10.bottom = new FormAttachment(100, -10);\n\t\t\n\t\tlettersTable = new Table(composite_5, SWT.BORDER | SWT.FULL_SELECTION);\n\t\tlettersTable.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tif(lettersTable.getItems().length>0)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tTableItem item = lettersTable.getSelection()[0];\n\t\t\t\t\titem.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.NONE));\n\t\t\t\t\tbox.Preview(Integer.parseInt(item.getText(0)));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tlettersTable.setLinesVisible(true);\n\t\tlettersTable.setHeaderVisible(true);\n\t\tTableColumn msgId = new TableColumn(lettersTable, SWT.NONE);\n\t\tmsgId.setResizable(false);\n\t\tmsgId.setText(\"ID\");\n\t\t\n\t\tTableColumn from = new TableColumn(lettersTable, SWT.NONE);\n\t\tfrom.setWidth(105);\n\t\tfrom.setText(\"\\u041E\\u0442\");\n\t\tfrom.addListener(SWT.Selection, SortListenerFactory.getListener(SortListenerFactory.STRING_COMPARATOR));\n\t\t\n\t\tTableColumn to = new TableColumn(lettersTable, SWT.NONE);\n\t\tto.setWidth(111);\n\t\tto.setText(\"\\u041A\\u043E\\u043C\\u0443\");\n\t\tto.addListener(SWT.Selection, SortListenerFactory.getListener(SortListenerFactory.STRING_COMPARATOR));\n\t\t\n\t\tTableColumn subject = new TableColumn(lettersTable, SWT.NONE);\n\t\tsubject.setWidth(406);\n\t\tsubject.setText(\"\\u0422\\u0435\\u043C\\u0430\");\n\t\tsubject.addListener(SWT.Selection, SortListenerFactory.getListener(SortListenerFactory.STRING_COMPARATOR));\n\t\t\n\t\tTableColumn created = new TableColumn(lettersTable, SWT.NONE);\n\t\tcreated.setWidth(176);\n\t\tcreated.setText(\"\\u0421\\u043E\\u0437\\u0434\\u0430\\u043D\\u043E\");\n\t\tcreated.addListener(SWT.Selection, SortListenerFactory.getListener(SortListenerFactory.DATE_COMPARATOR));\n\t\t\n\t\tTableColumn received = new TableColumn(lettersTable, SWT.NONE);\n\t\treceived.setWidth(194);\n\t\treceived.setText(\"\\u041F\\u043E\\u043B\\u0443\\u0447\\u0435\\u043D\\u043E\");\n\t\treceived.addListener(SWT.Selection, SortListenerFactory.getListener(SortListenerFactory.DATE_COMPARATOR));\t\t\n\t\t\n\t\tMenu popupMenuLetter = new Menu(lettersTable);\n\t\tlettersTable.setMenu(popupMenuLetter);\n\t\t\n\t\tMenuItem miUpdate = new MenuItem(popupMenuLetter, SWT.NONE);\n\t\tmiUpdate.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tmyThready.stop();// interrupt();\n\t\t\t\tmyThready = new Thread(timer);\n\t\t\t\tmyThready.setDaemon(true);\n\t\t\t\tmyThready.start();\n\t\t\t}\n\t\t});\n\t\tmiUpdate.setText(\"\\u041E\\u0431\\u043D\\u043E\\u0432\\u0438\\u0442\\u044C\");\n\t\t\n\t\tfinal MenuItem miDelete = new MenuItem(popupMenuLetter, SWT.NONE);\n\t\tmiDelete.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tif(lettersTable.getItems().length>0)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tTableItem item = lettersTable.getSelection()[0];\n\t\t\t\t\tbox.deleteMessage(Integer.parseInt(item.getText(0)), lettersTable.getSelectionIndex());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmiDelete.setText(\"\\u0412 \\u043A\\u043E\\u0440\\u0437\\u0438\\u043D\\u0443\");\n\t\tfd_composite_10.right = new FormAttachment(composite_4, 0, SWT.RIGHT);\n\t\t\n\t\tfinal Button btnInbox = new Button(composite_4, SWT.NONE);\n\t\tfinal Button btnTrash = new Button(composite_4, SWT.NONE);\n\t\t\n\t\tbtnInbox.setBounds(10, 10, 146, 39);\n\t\tbtnInbox.setEnabled(false);\n\t\tbtnInbox.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tSetting.Instance().SetTab(false);\t\t\t\t\n\t\t\t\tbtnInbox.setEnabled(false);\n\t\t\t\tmiDelete.setText(\"\\u0412 \\u043A\\u043E\\u0440\\u0437\\u0438\\u043D\\u0443\");\n\t\t\t\tbtnTrash.setEnabled(true);\n\t\t\t\tbox.rePaint();\n\t\t\t}\n\t\t});\n\t\tbtnInbox.setText(\"\\u0412\\u0445\\u043E\\u0434\\u044F\\u0449\\u0438\\u0435\");\n\t\tbtnTrash.setLocation(170, 10);\n\t\tbtnTrash.setSize(146, 39);\n\t\tbtnTrash.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tSetting.Instance().SetTab(true);\n\t\t\t\tbtnInbox.setEnabled(true);\n\t\t\t\tmiDelete.setText(\"\\u0423\\u0434\\u0430\\u043B\\u0438\\u0442\\u044C\");\n\t\t\t\tbtnTrash.setEnabled(false);\n\t\t\t\tbox.rePaint();\n\t\t\t}\n\t\t});\n\t\tbtnTrash.setText(\"\\u041A\\u043E\\u0440\\u0437\\u0438\\u043D\\u0430\");\n\t\t\n\t\tButton deleteLetter = new Button(composite_4, SWT.NONE);\n\t\tdeleteLetter.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tif(lettersTable.getItems().length>0)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tTableItem item = lettersTable.getSelection()[0];\n\t\t\t\t\tbox.deleteMessage(Integer.parseInt(item.getText(0)), lettersTable.getSelectionIndex());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tdeleteLetter.setLocation(327, 11);\n\t\tdeleteLetter.setSize(146, 37);\n\t\tdeleteLetter.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\n\t\tdeleteLetter.setText(\"\\u0423\\u0434\\u0430\\u043B\\u0438\\u0442\\u044C\");\n\t\t\n\t\tLabel label = new Label(composite_4, SWT.NONE);\n\t\tlabel.setLocation(501, 17);\n\t\tlabel.setSize(74, 27);\n\t\tlabel.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\n\t\tlabel.setFont(SWTResourceManager.getFont(\"Segoe UI\", 12, SWT.BOLD));\n\t\tlabel.setText(\"\\u0410\\u043A\\u043A\\u0430\\u0443\\u043D\\u0442\");\n\t\t\n\t\tCombo listAccounts = new Combo(composite_4, SWT.NONE);\n\t\tlistAccounts.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.NORMAL));\n\t\tlistAccounts.setLocation(583, 19);\n\t\tlistAccounts.setSize(180, 23);\n\t\tlistAccounts.setItems(new String[] {\"\\u0412\\u0441\\u0435\"});\n\t\tlistAccounts.select(0);\n\t\t\n\t\tprogressBar = new ProgressBar(composite_4, SWT.NONE);\n\t\tprogressBar.setBounds(10, 64, 263, 17);\n\t\tfd_composite_10.left = new FormAttachment(0);\n\t\tcomposite_10.setLayoutData(fd_composite_10);\n\t\t\n\t\theaderMessage = new Text(composite_10, SWT.BORDER);\n\t\theaderMessage.setFont(SWTResourceManager.getFont(\"Segoe UI\", 14, SWT.NORMAL));\n\t\theaderMessage.setBounds(0, 0, 1100, 79);\n\t\t\n\t\tsc = new ScrolledComposite(composite_10, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);\n\t\tsc.setBounds(0, 85, 1100, 230);\n\t\tsc.setExpandHorizontal(true);\n\t\tsc.setExpandVertical(true);\t\t\n\t\t\n\t\tTabItem accountsTab = new TabItem(tabFolder, SWT.NONE);\n\t\taccountsTab.setText(\"\\u0410\\u043A\\u043A\\u0430\\u0443\\u043D\\u0442\\u044B\");\n\t\t\n\t\tComposite accountComposite = new Composite(tabFolder, SWT.NONE);\n\t\taccountsTab.setControl(accountComposite);\n\t\taccountComposite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));\n\t\t\n\t\t\tLabel labelListAccounts = new Label(accountComposite, SWT.NONE);\n\t\t\tlabelListAccounts.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));\n\t\t\tlabelListAccounts.setFont(SWTResourceManager.getFont(\"Segoe UI\", 12, SWT.BOLD));\n\t\t\tlabelListAccounts.setBounds(10, 37, 148, 31);\n\t\t\tlabelListAccounts.setText(\"\\u0421\\u043F\\u0438\\u0441\\u043E\\u043A \\u0430\\u043A\\u043A\\u0430\\u0443\\u043D\\u0442\\u043E\\u0432\");\n\t\t\t\n\t\t\tComposite Actions = new Composite(accountComposite, SWT.NONE);\n\t\t\tActions.setBounds(412, 71, 163, 234);\n\t\t\t\n\t\t\tButton addAccount = new Button(Actions, SWT.NONE);\n\t\t\taddAccount.addSelectionListener(new SelectionAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\tAccountDialog ad = new AccountDialog(shlMailview, accountsTable, true);\n\t\t\t\t\tad.open();\n\t\t\t\t}\n\t\t\t});\n\t\t\taddAccount.setForeground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));\n\t\t\taddAccount.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.BOLD));\n\t\t\taddAccount.setBounds(10, 68, 141, 47);\n\t\t\taddAccount.setText(\"\\u0414\\u043E\\u0431\\u0430\\u0432\\u0438\\u0442\\u044C\");\n\t\t\t\n\t\t\tButton editAccount = new Button(Actions, SWT.NONE);\n\t\t\teditAccount.addSelectionListener(new SelectionAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\tif(accountsTable.getItems().length>0)\n\t\t\t\t\t{\n\t\t\t\t\tAccountDialog ad = new AccountDialog(shlMailview, accountsTable, false);\n\t\t\t\t\tad.open();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\teditAccount.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.BOLD));\n\t\t\teditAccount.setBounds(10, 121, 141, 47);\n\t\t\teditAccount.setText(\"\\u0418\\u0437\\u043C\\u0435\\u043D\\u0438\\u0442\\u044C\");\n\t\t\t\n\t\t\tButton deleteAccount = new Button(Actions, SWT.NONE);\n\t\t\tdeleteAccount.addSelectionListener(new SelectionAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\tif(accountsTable.getItems().length>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tTableItem item = accountsTable.getSelection()[0];\n\t\t\t\t\t\tif(MessageDialog.openConfirm(shlMailview, \"Удаление\", \"Вы хотите удалить учетную запись \" + item.getText(1)+\"?\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tservice.DeleteAccount(item.getText(0));\n\t\t\t\t\t\t\tservice.RepaintAccount(accountsTable);\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\tdeleteAccount.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.BOLD));\t\t\t\n\t\t\tdeleteAccount.setBounds(10, 174, 141, 47);\n\t\t\tdeleteAccount.setText(\"\\u0423\\u0434\\u0430\\u043B\\u0438\\u0442\\u044C\");\n\t\t\t\n\t\t\tfinal Button Include = new Button(Actions, SWT.NONE);\n\t\t\tInclude.addSelectionListener(new SelectionAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\tif(accountsTable.getItems().length>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tTableItem item = accountsTable.getSelection()[0];\n\t\t\t\t\t\tservice.toogleIncludeAccount(item.getText(0));\n\t\t\t\t\t\tservice.RepaintAccount(accountsTable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tInclude.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.BOLD));\n\t\t\tInclude.setBounds(10, 10, 141, 47);\n\t\t\tInclude.setText(\"\\u0412\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u044C\");\n\n\t\t\taccountsTable = new Table(accountComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);\n\t\t\taccountsTable.addSelectionListener(new SelectionAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\tif(accountsTable.getSelection()[0].getText(2)==\"Включен\")\n\t\t\t\t\t{\n\t\t\t\t\t\tInclude.setText(\"\\u0412\\u044B\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u044C\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tInclude.setText(\"\\u0412\\u043A\\u043B\\u044E\\u0447\\u0438\\u0442\\u044C\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\taccountsTable.setBounds(10, 74, 396, 296);\n\t\t\taccountsTable.setHeaderVisible(true);\n\t\t\taccountsTable.setLinesVisible(true);\n\t\t\t\n\t\t\tTableColumn tblclmnId = new TableColumn(accountsTable, SWT.NONE);\n\t\t\ttblclmnId.setWidth(35);\n\t\t\ttblclmnId.setText(\"ID\");\n\t\t\t//accountsTable.setRedraw(false);\n\t\t\t\n\t\t\tTableColumn columnLogin = new TableColumn(accountsTable, SWT.LEFT);\n\t\t\tcolumnLogin.setWidth(244);\n\t\t\tcolumnLogin.setText(\"\\u0410\\u043A\\u043A\\u0430\\u0443\\u043D\\u0442\");\n\t\t\t\n\t\t\tTableColumn columnState = new TableColumn(accountsTable, SWT.LEFT);\n\t\t\tcolumnState.setWidth(100);\n\t\t\tcolumnState.setText(\"\\u0421\\u043E\\u0441\\u0442\\u043E\\u044F\\u043D\\u0438\\u0435\");\n\t}", "@Override\r\n\tpublic String creatorType() {\n\t\treturn \"Stress Viewer\";\r\n\t}", "private void createViewController() {\n if (outputFile.equals(\"out\")) {\n this.fileWriter = new OutputStreamWriter(System.out);\n } else {\n try {\n this.fileWriter = new FileWriter(outputFile);\n } catch (IOException e) {\n // ruh roh\n System.exit(-1);\n }\n }\n\n switch (this.viewType) {\n case PROVIDER:\n this.controller =\n new ProvControllerTextualImitate(\n new HybridView(this.tps),\n new EzAnimatorOpsAdapter(this.model),\n this.fileWriter);\n break;\n case PROVIDER_VISUAL:\n this.controller =\n new ProvControllerImitate(\n new VisualView(this.tps),\n new EzAnimatorOpsAdapter(this.model));\n break;\n case PROVIDER_TEXTUAL:\n this.controller =\n new ProvControllerTextualImitate(\n new TextualView(this.tps),\n new EzAnimatorOpsAdapter(this.model),\n fileWriter);\n break;\n case PROVIDER_SVG:\n this.controller =\n new ProvControllerTextualImitate(\n new SvgAnimationView(this.tps),\n new EzAnimatorOpsAdapter(this.model),\n fileWriter);\n break;\n default:\n throw new IllegalArgumentException(\"Invalid viewtype given\");\n }\n }", "public DisplayManager(Object manager) {\n this.manager = manager;\n }", "protected Scene createView() {\n\t\treturn null;\n\t}", "public AssemblyDeltaVisitor(IProgressMonitor monitor) {\n\t\t\tsuper();\n\t\t\tthis.monitor = monitor;\n\t\t}", "public SessionController() {\n model = new MovieBookingModel();\n Thread t = new Thread(model); //start model thread to notify observers\n t.start();\n \n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setSize(500, 400);\n }", "public TwoLinesPerspective(){\n setTitle(\"Week 5 - perspect of two lines\");\n setSize(600, 400);\n setLocation(200, 200);\n\n // this is new (to ensure compatibility with other OS)\n GLProfile prof = GLProfile.get(GLProfile.GL4);\n GLCapabilities capable = new GLCapabilities(prof);\n // note myCanvas now has the capabilities of GL4\n myCanvas = new GLCanvas(capable);\n \n myCanvas.addGLEventListener(this);\n this.add(myCanvas);\n setVisible(true);\n }", "@Override\n public void create() {\n setScreen(new ServerScreen(\n new RemoteGame(),\n new SocketIoGameServer(HOST, PORT)\n ));\n }", "public MotionViewer(Chip2DMotion chip){\n motionData=chip.getEmptyMotionData();\n try {\n UIManager.setLookAndFeel(new WindowsLookAndFeel());\n } catch (Exception e) {\n log.warning(e.getMessage());\n }\n setName(\"MotionViewer\");\n log.setLevel(Level.INFO);\n initComponents();\n \n setChip(chip);\n makeCanvas();\n statisticsLabel=new DynamicFontSizeJLabel();\n statisticsLabel.setToolTipText(\"Time slice/Absolute time, NumEvents/NumFiltered, events/sec, Frame rate acheived/desired, Time expansion X contraction /, delay after frame, color scale\");\n statisticsPanel.add(statisticsLabel);\n\n loggingButton.setAction(toggleLoggingAction);\n loggingMenuItem.setAction(toggleLoggingAction);\n \n int n=menuBar.getMenuCount();\n for(int i=0;i<n;i++){\n JMenu m=menuBar.getMenu(i);\n m.getPopupMenu().setLightWeightPopupEnabled(false);\n }\n \n String lastFilePath=prefs.get(\"MotionViewer.lastFile\",\"\");\n lastFile=new File(lastFilePath);\n \n // recent files tracks recently used files *and* folders. recentFiles adds the anonymous listener\n // built here to open the selected file\n recentFiles=new RecentFiles(prefs, fileMenu, new ActionListener(){\n public void actionPerformed(ActionEvent evt){\n File f=new File(evt.getActionCommand());\n log.info(\"opening \"+evt.getActionCommand());\n try{\n if(f!=null && f.isFile()){\n getPlayer().startPlayback(f);\n recentFiles.addFile(f);\n }else if(f!=null && f.isDirectory()){\n prefs.put(\"MotionViewer.lastFile\",f.getCanonicalPath());\n getPlayer().openInputFileDialog();\n recentFiles.addFile(f);\n }\n }catch(Exception fnf){\n fnf.printStackTrace();\n// exceptionOccurred(fnf,this);\n recentFiles.removeFile(f);\n }\n }\n });\n \n playerControlPanel.setVisible(false);\n \n pack();\n \n Runtime.getRuntime().addShutdownHook(new Thread(){\n public void run(){\n if(hardware!=null && hardware.isOpen()){\n hardware.close();\n }\n }\n });\n \n setFocusable(true);\n requestFocus();\n viewLoop=new ViewLoop();\n viewLoop.start();\n dropTarget=new DropTarget(imagePanel,this);\n \n fixLoggingControls();\n \n // init menu items that are checkboxes to correct initial state\n loggingPlaybackImmediatelyCheckBoxMenuItem.setSelected(isLoggingPlaybackImmediatelyEnabled());\n pauseRenderingCheckBoxMenuItem.setSelected(isPaused());\n \n }", "public Frm1() {\n initComponents();\n this.getRootPane().setDefaultButton(this.jButton1);\n Servidor s = new Servidor (3050);\n s.addObserver(this);\n Thread t = new Thread(s);\n t.start();\n }", "@Override\n public void run() {\n\n GLMouseListener mouse = viewer.getMouseHandler();\n if (mouse instanceof GLMouseAdapter) {\n ((GLMouseAdapter)mouse).setLaptopConfig();\n }\n \n viewer.addSelectionListener(new SimpleSelectionHandler(renderables));\n\n // Create a animator that drives canvas' display() at the specified FPS.\n final FPSAnimator animator;\n final FPSMonitor fpsMonitor;\n \n if (MultiViewer.doFPS) {\n animator = new FPSAnimator(viewer.getCanvas().getDrawable(), FPS, true);\n animator.setUpdateFPSFrames(3, null);\n animator.start();\n fpsMonitor = new FPSMonitor(title + \" FPS: \", animator);\n new Thread(fpsMonitor).start();\n } else {\n animator = null;\n fpsMonitor = null;\n }\n \n // Create the top-level container\n frame = new JFrame(); // Swing's JFrame or AWT's Frame\n frame.add(viewer.getCanvas().getComponent());\n\n frame.addWindowListener(new WindowAdapter() {\n @Override\n public void windowClosing(WindowEvent e) {\n // Use a dedicate thread to run the stop() to ensure that the\n // animator stops before program exits.\n new Thread() {\n @Override\n public void run() {\n \n if (animator != null && animator.isStarted()) {\n animator.stop();\n }\n if (fpsMonitor != null) { \n fpsMonitor.stop();\n }\n \n try {\n SwingUtilities.invokeAndWait (new Runnable() {\n @Override\n public void run () {\n viewer.dispose ();\n }\n });\n }\n catch (InvocationTargetException e) {\n }\n catch (InterruptedException e) {\n }\n \n closed = true;\n }\n }.start();\n }\n });\n frame.setTitle(title);\n // frame.pack();\n frame.setVisible(true);\n // animator.start(); // start the animation loop\n }", "public void createPartControl(Composite parent) {\n\t\tviewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n\t\tdrillDownAdapter = new DrillDownAdapter(viewer);\n\t\tviewer.setContentProvider(new ViewContentProvider());\n\t\tviewer.setLabelProvider(new ViewLabelProvider());\n\t\tviewer.setSorter(new NameSorter());\n\t\tviewer.setInput(getViewSite());\n\n\t\t// Create the help context id for the viewer's control\n\t\tPlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), \"TreeView.viewer\");\n\t\tmakeActions();\n\t\thookContextMenu();\n\t\thookDoubleClickAction();\n\t\tcontributeToActionBars();\n\t}", "private void cmdGenMonitor() throws NoSystemException {\n MSystem system = system();\n String filename = \"USEMonitor.java\";\n PrintWriter out = null;\n try {\n \tout = new PrintWriter(new BufferedWriter(new FileWriter(\n filename)));\n Log.verbose(\"writing file `\" + filename + \"'...\");\n\n new MonitorAspectGenerator(out, system.model()).write();\n Log.verbose(\"done.\");\n } catch (IOException ex) {\n Log.error(ex.getMessage());\n } finally {\n if (out != null) {\n out.flush();\n if (filename != null)\n out.close();\n }\n }\n }", "public void crearGloboVerde(int tiempo){ \n GloboVerde globov = new GloboVerde();\n globoslista.add(globov);\n double posicionx = generarPosicionX();\n globov.fijarPosicion(posicionx);\n \n gpane.getChildren().addAll(globov);\n MoverGlobo mv = new MoverGlobo(globov,tiempo);\n mov= new Thread(mv);\n mov.start(); \n }", "private static void createAndShowGUI() {\n\t\tgui = new GUI();\n\t}", "public void createPartControl(Composite parent) {\n \t\t// Store the display so we can make async calls from listeners\n \t\tdisplay = parent.getDisplay();\n\t\tviewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n \t\tsetTreeColumns(viewer.getTree());\n \t\tviewer.getTree().setHeaderVisible(true);\n \t\tviewer.setContentProvider(getContentProvider());\n \t\tviewer.setInput(getInput());\n \t\tviewer.setLabelProvider(getLabelProvider());\n \t\tviewer.setComparator(new ViewerComparator());\n \t\tconfigureViewer(viewer);\n \t\taddListeners();\n \t\tmakeActions();\n \t\thookContextMenu();\n \t\thookDoubleClickAction();\n \t\tcontributeToActionBars();\n \t}", "@Override\n public void Create() {\n\n initView();\n }", "private CardReaderMonitorFactory() {\t\t\n\t}", "private Pane initLogWindow()\n {\n listViewMessage = new ListView<String>();\n listViewMessage.setMaxSize(470,300);\n listViewMessage.setItems(listViewMessageItems);\n\n VBox log_window = new VBox();\n Label lbLog = new Label(\"Log window\");\n lbLog.setPadding(new Insets(5,5,5,5));\n log_window.getChildren().addAll(lbLog, listViewMessage);\n log_window.setPadding(new Insets(50, 50, 50, 50));\n log_window.setAlignment(Pos.CENTER);\n\n return log_window;\n }", "AgendaViewModel create(Bundle savedInstanceState);", "private void creaHisotiralPDF(){\r\n Task<Void> task = new Task<Void>() {\r\n @Override\r\n protected Void call() throws Exception {\r\n HistorialPDF histo = new HistorialPDF();\r\n histo.pasoPrincipal();\r\n return null;\r\n }\r\n };\r\n //Maouse en modo esperar\r\n anchorPane.getScene().getRoot().cursorProperty()\r\n .bind(Bindings.when(task.runningProperty())\r\n .then(Cursor.WAIT).otherwise(Cursor.DEFAULT));\r\n \r\n dbExeccutor.submit(task);\r\n }", "public PgMatviews() {\n this(\"pg_matviews\", null);\n }", "public interface Viewer {\n\n int getCurrentView();\n\n}", "protected MessageView createStatusLog(String initialMessage) {\n statusLog = new MessageView(initialMessage);\n\n return statusLog;\n }", "public static IView createView(String viewName, Readable file) throws IllegalArgumentException {\r\n IView<IReadOnlyModel<IMusicNote, IMusicPiece>> outputView = null;\r\n MusicalOperations<IMusicNote, IMusicPiece> mutableModel = MusicReader.parseFile(file, new\r\n MusicModel.ModelBuilder());\r\n IReadOnlyModel<IMusicNote, IMusicPiece> inputModel = new ReadOnlyModel(mutableModel);\r\n\r\n switch (viewName.toLowerCase()) {\r\n case \"midi\":\r\n try {\r\n outputView = new MidiViewer(inputModel, MidiSystem.getSequencer());\r\n } catch (MidiUnavailableException e) {\r\n e.getMessage();\r\n }\r\n break;\r\n\r\n case \"visual\":\r\n outputView = new GUIView(inputModel);\r\n break;\r\n\r\n case \"console\":\r\n outputView = new ConsoleViewer(inputModel);\r\n break;\r\n\r\n case \"composite\":\r\n try {\r\n outputView = new CompositeView(inputModel, MidiSystem.getSequencer());\r\n } catch (MidiUnavailableException e) {\r\n e.getMessage();\r\n }\r\n break;\r\n\r\n default:\r\n throw new IllegalArgumentException(\"Invalid type of view specified!\");\r\n }\r\n\r\n return outputView;\r\n }", "public ReflectMonitor() {\n boundSupport = new PropertyChangeSupport(this);\n }" ]
[ "0.5345097", "0.5275076", "0.51687783", "0.51404446", "0.5137624", "0.508099", "0.5080719", "0.50199", "0.49132177", "0.4888927", "0.48882785", "0.48744354", "0.48630792", "0.48421478", "0.48216435", "0.4809519", "0.48057607", "0.48048973", "0.4774303", "0.47706196", "0.4766874", "0.47586325", "0.47447452", "0.4743743", "0.47333664", "0.4730697", "0.47161773", "0.46893182", "0.46543825", "0.46543443", "0.46375299", "0.46280295", "0.4619632", "0.46024188", "0.45965552", "0.45956454", "0.4594405", "0.45940375", "0.4582822", "0.45800817", "0.45716953", "0.45659152", "0.4564226", "0.45618472", "0.45612407", "0.45506072", "0.4549903", "0.45439693", "0.45439672", "0.45347902", "0.4519316", "0.45087525", "0.45012677", "0.4487093", "0.44842607", "0.4480838", "0.4479648", "0.44776905", "0.44772062", "0.44751823", "0.447391", "0.44687995", "0.44611943", "0.44610548", "0.445988", "0.44576868", "0.44523078", "0.44472557", "0.4446021", "0.44448528", "0.44422555", "0.44404516", "0.4439203", "0.44362083", "0.4434122", "0.44320887", "0.44308248", "0.44307017", "0.44170076", "0.4405658", "0.44009715", "0.44008952", "0.44000852", "0.43957496", "0.43913266", "0.4385958", "0.43847078", "0.43828568", "0.43813026", "0.43772763", "0.43761098", "0.4374352", "0.43741024", "0.43727145", "0.4366633", "0.4362819", "0.43628028", "0.43627924", "0.43620908", "0.4361113" ]
0.58455855
0
Determines the lowest address that can be shown for a given memory map.
private IAddress getFirstAddress(final MemoryMap memoryMap) { for (final MemorySection memorySection : memoryMap) { return memorySection.getStart(); } return new CAddress(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int minMapQ() {\n return mMinMapQ;\n }", "static int findraslot(Memory mem, int addr) {\r\n\t\t// afbf0020 sw [sp +32] = ra\r\n\t\tfor (int n = 0; n < 8; n++) {\r\n\t\t\tint isn = mem.load_word(addr + (n * 4));\r\n\t\t\tif ((isn & 0xffff0000) == 0xafbf0000) {\r\n\t\t\t\tshort imm = (short) isn;\r\n\t\t\t\treturn imm;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "public BSTMapNode findMin() \n\t{\n\t\t\n\t\t\n\t\treturn null;\n\t}", "public long memoryAddress()\r\n/* 143: */ {\r\n/* 144:172 */ throw new UnsupportedOperationException();\r\n/* 145: */ }", "private String findMin(Map<String, Node> nodeList)\n\t{\n\t\tint min = Integer.MAX_VALUE;\n\t\tString sommet = null;\n\t\t\n\t\tfor (String nodeName : nodeList.keySet()) {\n\t\t\tint distance = nodeList.get(nodeName).getDistanceFromOrigin();\n\n\t\t\tif(min > distance) {\n\t\t\t\tmin = distance;\n\t\t\t\tsommet = nodeName;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sommet;\n\t}", "public String getMinKey() {\n if (map.size() == 0)\n return \"\";\n return minKey;\n }", "public long getMapping(Identity identity) {\n\t\tNode node = nodeMap.get(identity);\n\t\tif (node == null)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn node.getId();\n\t}", "private static int[] FindLowest(int[][] terrainMap) {\n\n int[] lowestPosition = {-1, -1};\n int lowestValue = terrainMap[0][0];\n\n int i, j;\n\n for (i = 0; i < terrainMap.length; i++) {\n for (j = 0; j < terrainMap[0].length; j++) {\n if (terrainMap[i][j] < lowestValue) {\n lowestValue = terrainMap[i][j];\n lowestPosition[0] = i;\n lowestPosition[1] = j;\n }\n }\n\n }\n\n return lowestPosition;\n\n }", "Optional<MemoryAddress> lookup(String name);", "public boolean hasMemoryAddress()\r\n/* 138: */ {\r\n/* 139:167 */ return false;\r\n/* 140: */ }", "public int findMemory( int size )\n {\n // represents the smallest available freeBlock within out freeBlock list\n // that will accommodate the size of the entry.\n int smallestFreeBlock = poolSize + 1;\n int position = -1;\n freeBlockList.moveToStart();\n freeBlockList.next();\n while ( !freeBlockList.isAtEnd() )\n {\n Object[] keyArray =\n freeBlockList.getCurrentElement().keySet().toArray();\n Integer key = (Integer)keyArray[0];\n\n if ( ( freeBlockList.getCurrentElement().get( key ) < smallestFreeBlock )\n && ( freeBlockList.getCurrentElement().get( key ) >= size ) )\n {\n position = key;\n smallestFreeBlock = freeBlockList.getCurrentElement().get( key );\n }\n freeBlockList.next();\n }\n\n return position;\n\n }", "static int memory_address_hl(){\n\t\tint hl_address = hexa_to_deci(registers.get('H')+registers.get('L'));\n\t\treturn hl_address;\n\t}", "public String getMinKey() {\n\t\tif(map.isEmpty()){\n\t\t\treturn \"\";\n\t\t}\n\t\treturn tail.prev.key;\n\t}", "public int minXValue (Map <String,ArrayList<Point>> map){\r\n \tint min = 0 , i = 0;\r\n \t\tfor (String key : map.keySet()) {\r\n \t\t\tif ( min < map.get(key).get(i).getX())\r\n \t\t\t\tmin = (int) map.get(key).get(i).getX();\r\n \t\t\ti++;\r\n \t\t}\r\n \treturn min;\t\r\n }", "public int NextMbAddress(int n) {\n\t\tint PicSizeInMapUnits= (sps0.pic_width_in_mbs_minus_1+1)*(sps0.pic_height_in_map_units_minus_1+1);\n\t\t// int FrameHeightInMbs = (2-(sps0.frame_mbs_only_flag ? 1:0))*(sps0.pic_height_in_map_units_minus_1+1);\n \t\t// int PicHeightInMbs = FrameHeightInMbs / (1+(field_pic_flag ? 1:0));\n\n \t\tint PicSizeInMbs = (sps0.pic_width_in_mbs_minus_1+1) * (PicHeightInMbs);\n\t\t// (7-34)\n\t\tint MapUnitsInSliceGroup0 = Math.min(((pps0.slice_group_change_rate_minus1 + 1) * slice_group_change_cycle), \n\t\t\t(PicSizeInMapUnits));\n\t\t// System.out.println(MapUnitsInSliceGroup0);\n\t\tint sizeOfUpperLeftGroup;\n\t\tif(pps0.num_slice_groups_minus1==1&&(pps0.slice_group_map_type==4||pps0.slice_group_map_type==5)){\n\n\t\t\tsizeOfUpperLeftGroup=(pps0.slice_group_change_direction_flag ? (PicSizeInMapUnits - MapUnitsInSliceGroup0)\n\t\t\t\t: MapUnitsInSliceGroup0);\n\t\t}\n\t\tint [] mapUnitToSliceGroupMap=new int[PicSizeInMapUnits];\n\t\tif(pps0.num_slice_groups_minus1==0){\n\t\t\t// System.out.println(\"zero \");\n\t\t\tfor(int i=0;i<pps0.pic_size_in_map_units_minus1+1;i++){\n\t\t\t\tmapUnitToSliceGroupMap[i]=0;\n\t\t\t}\t\t\t\n\t\t}\n\n\t\telse if(pps0.num_slice_groups_minus1!=0){\n\t\t\tif(pps0.slice_group_map_type==0){\n\t\t\t\t// 8.2.2.1\n\t\t\t}\n\t\t\telse if(pps0.slice_group_map_type==1){\n\t\t\t\t// 8.2.2.2\n\t\t\t}else if(pps0.slice_group_map_type==2){\n\t\t\t\t// 8.2.2.3\n\t\t\t}else if(pps0.slice_group_map_type==3){\n\t\t\t\t// 8.2.2.4\n\t\t\t}else if(pps0.slice_group_map_type==4){\n\t\t\t\t// 8.2.2.5\n\t\t\t}\n\t\t\telse if(pps0.slice_group_map_type==5){\n\t\t\t\t// 8.2.2.6\n\t\t\t}\n\t\t\telse if(pps0.slice_group_map_type==6){\n\t\t\t\t// 8.2.2.7\n\t\t\t}\n\t\t}\n\n\n\t\t\t\t\t\t\t\t\t/* 8.2.2.8 */\n \t\tint[] MbToSliceGroupMap=new int[PicSizeInMbs];\n \t\tfor(int i=0;i<PicSizeInMbs;i++){\n \t\t\tif(sps0.frame_mbs_only_flag==true||field_pic_flag==true){\n \t\t\t\t// System.out.println(PicSizeInMbs+\" \"+PicSizeInMapUnits);\n \t\t\t\tMbToSliceGroupMap[i]=mapUnitToSliceGroupMap[i];\n \t\t\t} else if(MbaffFrameFlag){\n \t\t\t\tMbToSliceGroupMap[i]=mapUnitToSliceGroupMap[(int)i/2];\n\n \t\t\t}else if(sps0.frame_mbs_only_flag==false&&sps0.mb_adaptive_frame_field_flag==false&&field_pic_flag==false){\n \t\t\t\tMbToSliceGroupMap[i]=mapUnitToSliceGroupMap[(int)(i/(2*sps0.pic_width_in_mbs_minus_1+1))\n \t\t\t\t*sps0.pic_width_in_mbs_minus_1+1+(i%sps0.pic_width_in_mbs_minus_1+1)];\n \t\t\t}\n\n \t\t}\n\t\t// i = n + 1 \n\t\t// while( i < PicSizeInMbs && MbToSliceGroupMap[ i ] != MbToSliceGroupMap[ n ] )\n\t\t // i++; \n\t\t// nextMbAddress = i\n\t\tint i = n + 1;\n\t\t// int nextMbAddress = i;\n\n\t\twhile(i<PicSizeInMbs &&( MbToSliceGroupMap[i]!=MbToSliceGroupMap[n])) {\n\t\t\ti++;\n\t\t\t// System.out.println(\"here mb address\");\n\t\t\t// nextMbAddress = i;\n\t\t}\n\t\t// System.out.println(\"nextMbAddress \"+i);\n\t\treturn i;\n\t}", "public static int offset_addr() {\n return (0 / 8);\n }", "public static int offsetBits_addr() {\n return 0;\n }", "public static int offset_min() {\n return (56 / 8);\n }", "private double findMin(){\r\n Set<Map.Entry<Double, Double>> list = heap.entrySet();\r\n double minKey = heap.firstKey();\r\n double minVal = MAX_WEIGHT;\r\n if (list != null){\r\n for (Map.Entry<Double, Double> entry: list){\r\n if (minVal > entry.getValue()){\r\n minVal = entry.getValue();\r\n minKey = entry.getKey();\r\n }\r\n }\r\n }\r\n return minKey;\r\n }", "public int allocate_map() {\r\n\t\tp_id = new int[idSize];\r\n\t\tif (p_id == null)\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1;\r\n\t}", "public abstract Address getBootHeapStart();", "public int minYValue (Map <String,ArrayList<Point>> map){\r\n \tint min = 0 , i = 0;\r\n \t\tfor (String key : map.keySet()) {\r\n \t\t\tif ( min < map.get(key).get(i).getY())\r\n \t\t\t\tmin = (int) map.get(key).get(i).getY();\r\n \t\t\ti++;\r\n \t\t}\r\n \treturn min;\t\r\n }", "public String getLowestChromKey();", "public Point getMinimapLocation() {\n Actor c = getAccessor();\n int cX = methods.client.getBaseX() + (c.getLocalLocation().getX() / 32 - 2) / 4;\n int cY = methods.client.getBaseY() + (c.getLocalLocation().getY() / 32 - 2) / 4;\n return methods.calc.worldToMinimap(cX, cY);\n }", "public static int offsetBits_min() {\n return 56;\n }", "public short getCourierMapId() {\n if(mdb == null) {\n return -1;\n }\n return (short)mdb.getInt(\"courierclaimedmap\", -1);\n }", "public static <K, V extends Comparable<? super V>> K minValueKey(Map<K, V> map)\n\t{\n\t\tif (map.size() > 0)\n\t\t{\n\t\t\tList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\t\t\tCollections.sort(list, new Comparator<Map.Entry<K, V>>()\n\t\t\t{\n\t\t\t\tpublic int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2)\n\t\t\t\t{\n\t\t\t\t\treturn (o1.getValue()).compareTo(o2.getValue());\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn list.get(0).getKey();\n\t\t\t}\n\t\t\tcatch (IndexOutOfBoundsException e)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public Double minMemory() {\n return this.minMemory;\n }", "private Point getLower() {\n int lowerX;\n int lowerY;\n lowerY = (int) (-gameCanvas.getHeight() + mapOffsetY * 2);\n lowerX = (int) (-gameCanvas.getWidth() + mapOffsetX * 2);\n return new Point(lowerX, lowerY);\n }", "@Override\n\tpublic State maxStateAbsMapping(State state, MaxNode maxNode) {\n\t\treturn null;\n\t}", "static int findframesize(Memory mem, int addr) {\r\n\t\t// 27bdffc0 addiu sp = sp * -64\r\n\t\tfor (int n = 0; n < 8; n++) {\r\n\t\t\tint isn = mem.load_word(addr + (n * 4));\r\n\t\t\tif ((isn & 0xffff0000) == 0x27bd0000) {\r\n\t\t\t\tshort imm = (short) -isn;\r\n\t\t\t\treturn imm;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// happens for hlt\r\n\t\t//opt.println(\"address but no frame for %s\", f);\r\n\t\treturn -1;\r\n\t}", "public Integer fileLocator(String filename) {\n\n int fileHash = returnHash(filename);\n Integer closestKey = this.IPmap.floorKey(fileHash); //returns the greatest key less than or equal to the given key, or null if there is no such key.\n if (closestKey == null) {\n closestKey = this.IPmap.lastKey(); //returns highest key in this map\n }\n return closestKey; //returns IP associated with this nodeID\n }", "private void findNmap() {\n\t\tString [] command = {\"/bin/which\", \"nmap\"};\n\t Process p;\n\t String commandReturned = new String();\n\t ArrayList<String> readLine = new ArrayList<String>();\n\t\ttry {\n\t // run the command\n\t p = Runtime.getRuntime().exec(command);\n\t BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t // get the result\n\t while((commandReturned = br.readLine()) != null){\n\t \treadLine.add(commandReturned);\n\t \t//System.out.println(commandReturned);\n\t }\n\t p.waitFor();\n\t if(p.exitValue() == 1 ){\n\t \tSystem.out.println (\"Erro ao executar comando \" + command);\n\t }\n\t p.destroy();\n\t } catch (Exception e) {}\n\t\t\n\t this.setNMap(readLine.get(0));\n\t}", "public String getMinKey();", "public Address getLocalApicAddress() {\n return Address.fromIntZeroExtend(mem.getInt(36));\n }", "public char FirstAppearingOnce()\n {\n int minPos = Integer.MAX_VALUE;\n char ch = '#';\n for (int i = 0; i < map.length; i++) {\n if (map[i] >= 0) {\n if (map[i] < minPos) {\n minPos = map[i];\n ch = (char)i;\n }\n }\n }\n return ch;\n }", "public final int getArea()\n\t{\n\t\treturn address >>> 12;\n\t}", "@Nullable\n protected abstract Map.Entry<K, V> onGetLowestEntry();", "String getMapCode();", "private Node lowestCostThrough(List<Node> openSet, Map<Node, Double> costThrough){\n Node lowest = openSet.get(0);\n\n for(Node n: openSet){\n if(costThrough.get(n) < costThrough.get(lowest)){\n lowest = n;\n }\n }\n return lowest;\n }", "public String getMinKey() {\n return dll.head.next == dll.tail ? \"\" : (String) dll.head.next.keySet.iterator().next();\n }", "int freecabInd(int dest) {\n int index = 0;\n int min = 0;\n int minIndex = 0;\n\n for(int i=0;i<freeCab.length;i++){\n\n int matLandmark = matchingLandmark(freeCab[index][0], freeCab[index][1]);\n\n int dis = distance.dijkstra(adjancy, matLandmark, dest);\n\n if (dis < min) {\n min = dis;\n minIndex = index;\n }\n index++;\n\n }\n\n return minIndex;\n\n }", "long getAddress(ByteBuffer buffer);", "public int getLowestChromID();", "@Override\n\tpublic Address getAddress() {\n\t\treturn (Address)map.get(ADDRESS);\n\t}", "public int getStartPC() {\n\t\treturn startPC & 0xffff;\n\t}", "public int askMap();", "public static int m112593a(Map<String, String> map) {\n if (map != null) {\n if (map.containsKey(C43282a.m137313a())) {\n return C34949d.m112623a((String) map.get(C43282a.m137313a()));\n }\n if (map.containsKey(C43282a.m137314b())) {\n return C34949d.m112623a((String) map.get(C43282a.m137314b()));\n }\n }\n return 0;\n }", "public static int getMapWidth() {\r\n\t\treturn 7;\r\n\t}", "public Integer getMapPosition()\n\t{\n\t\treturn mapPosition;\n\t}", "private long solve(List<String> input) {\n final Map<Long, Long> memory = new HashMap<>();\n\n String bitmask = \"\";\n for (String instruction : input) {\n final String valueString = instruction.substring(instruction.lastIndexOf(\" \") + 1).trim();\n if (instruction.startsWith(\"mask\")) {\n // extract the new bitmask from the instruction\n bitmask = leftPad(valueString, 64);\n\n } else if (instruction.startsWith(\"mem\")) {\n final long value = Long.parseLong(valueString);\n\n final int startOfAddress = instruction.indexOf(\"[\") + 1;\n final int endOfAddress = instruction.indexOf(\"]\");\n final String addressBits = leftPad(Long.toBinaryString(\n Long.parseLong(instruction.substring(startOfAddress, endOfAddress).trim())), 64);\n\n // count the number of \"floating\" x characters in the current bitmask\n final int numFloating = (int) Arrays.stream(bitmask.split(\"(?!^)\")).filter(\"x\"::equalsIgnoreCase).count();\n\n // transform baseBitmask to decode all possible address masks that it represents\n final String[] currentBitmaskBits = bitmask.split(\"(?!^)\");\n int numDecodedAddresses = (int) Math.pow(2, numFloating);\n IntStream.range(0, numDecodedAddresses)\n .mapToObj(i -> {\n // generates all address masks between 0 and 2^(numFloating - 1)\n final String binary = leftPad(Long.toBinaryString(i), numFloating);\n int offset = 0;\n final StringBuilder newBitmask = new StringBuilder();\n for (int j = 0; j < currentBitmaskBits.length; j++) {\n final String maskBit = currentBitmaskBits[j];\n if (\"x\".equalsIgnoreCase(maskBit)) {\n if ('1' == addressBits.charAt(j)) {\n newBitmask.append(\"1\");\n } else {\n newBitmask.append(binary.charAt(offset));\n }\n offset++;\n } else {\n newBitmask.append(maskBit);\n }\n }\n return newBitmask.toString();\n })\n .map(addressMask -> {\n // transforms baseBitmask into an address based on the incoming binary string\n final StringBuilder address = new StringBuilder();\n final String[] addressMaskBits = addressMask.split(\"(?!^)\");\n for (int i = 0; i < addressMaskBits.length; i++) {\n if (\"1\".equalsIgnoreCase(addressMaskBits[i])) {\n // any 1s in the bitmask are logically ORd with the address bits\n address.append(\"1\");\n } else {\n // otherwise, we get this bit from the base address\n address.append(addressBits.charAt(i));\n }\n }\n return address.toString();\n })\n .map(address -> new BigInteger(address, 2).longValue())\n .forEach(address -> memory.put(address, value));\n }\n }\n\n // return sum of all values in memory\n return memory.values().stream()\n .reduce(Long::sum)\n .get();\n }", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "int getMapID();", "private String read(int address)\n {\n return MMU.read(VMA.get( address/RAM.getPageSize()) * RAM.getPageSize() + (address % RAM.getPageSize()));\n }", "public ULong getCdtAwdPriXpsTypeMapId() {\n return (ULong) get(0);\n }", "int getMinTileX(Long id) throws RemoteException;", "public static int forwardScanBit(long map, int start)\n {\n if ( start < 64 )\n {\n start = Math.max(start, 0);\n long bit = 1L << start;\n\n for (int i = start; i <= 63; i++, bit <<= 1)\n {\n if ((map & bit) != 0) return i;\n }\n }\n return 64;\n }", "private int getOperandAddress(final CPU6502Instruction instruction) {\r\n // switch address mode\r\n switch (instruction.addressMode) {\r\n case CPU6502Instruction.ZERO:\r\n return this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n case CPU6502Instruction.ZERO_X:\r\n return ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.x) & 0xff;\r\n case CPU6502Instruction.ZERO_Y:\r\n return ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.y) & 0xff;\r\n case CPU6502Instruction.INDIRECT: {\r\n final int lowAddress = this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n final int highAddress = (this.memory[this.currentInstructionAddress + 2] & 0xff) << 8;\r\n\r\n return (readByte(highAddress + lowAddress) & 0xff) + ((readByte(highAddress + ((lowAddress + 1) & 0xff)) & 0xff) << 8);\r\n }\r\n case CPU6502Instruction.INDIRECT_X: {\r\n final int p = ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.x) & 0xff;\r\n\r\n return (this.memory[p] & 0xff) + ((this.memory[(p + 1) & 0xff] & 0xff) << 8);\r\n }\r\n case CPU6502Instruction.INDIRECT_Y: {\r\n // this is the address on the zero page where we read from\r\n final int p = this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n\r\n // if over page boundary then do another access => one more cycle\r\n final int lowAddress = (this.memory[p] & 0xff) + this.y;\r\n\r\n if (instruction.addPageBoundaryCycle && lowAddress > 0xff) {\r\n ++this.cycles;\r\n }\r\n\r\n return (lowAddress + ((this.memory[(p + 1) & 0xff] & 0xff) << 8)) & 0xffff;\r\n }\r\n case CPU6502Instruction.RELATIVE: {\r\n // calculate relative address\r\n final int address = this.memory[this.currentInstructionAddress + 1] + this.pc;\r\n\r\n // add two cycles if crossing page boundary, otherwise one\r\n this.cycles += ((this.pc) & 0xff00) != (address & 0xff00) ? 2 : 1;\r\n return address;\r\n }\r\n case CPU6502Instruction.ABSOLUTE:\r\n return (this.memory[this.currentInstructionAddress + 1] & 0xff) + ((this.memory[this.currentInstructionAddress + 2] & 0xff) << 8);\r\n case CPU6502Instruction.ABSOLUTE_X:\r\n case CPU6502Instruction.ABSOLUTE_Y: {\r\n // read low-byte of the address\r\n final int lowAddress = (this.memory[this.currentInstructionAddress + 1] & 0xff) + (instruction.addressMode == CPU6502Instruction.ABSOLUTE_Y ? this.y : this.x);\r\n\r\n // if over page boundary then do another access => one more cycle\r\n if (instruction.addPageBoundaryCycle && lowAddress > 0xff) {\r\n ++this.cycles;\r\n }\r\n\r\n return (lowAddress + ((this.memory[this.currentInstructionAddress + 2] & 0xff) << 8)) & 0xffff;\r\n }\r\n\r\n default:\r\n throw new RuntimeException(\"Illegal address mode for instruction \" + instruction.toString() + \" ($\" + Integer.toHexString(instruction.opCode) + \")\");\r\n }\r\n }", "public static Integer isMapAvailable(String mapname) {\r\n\t\tfor (Integer i : mapAvailable){\r\n\t\t\tif (maps.get(i).getMapName().toUpperCase().equals(mapname.toUpperCase())) return i;\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "protected int getStartAddress() {\r\n return (readByte(RESET_VECTOR) & 0xff) + ((readByte(RESET_VECTOR + 1) & 0xff) << 8);\r\n }", "protected int askForMapWidth() {return myManager.getMapWidth();}", "private static void findLocalMaxOrMin() {\n // Find the integer with no duplicates\n // Priority Queues / Double ended priority queues are efficient O(1) with remove the min / max\n\n Integer[] a = new Integer[]{0,1,2,3,4,5,6,7,8,7,6};\n// int[] a2 = new int[]{5,4,3,2,1,2,3,4};\n\n MinPQ<Integer> minPQ = new MinPQ<Integer>(a);\n\n System.out.print(minPQ.min());\n }", "public M csmiPlaceMin(Object min){this.put(\"csmiPlaceMin\", min);return this;}", "public int getMinimumPoints() {\n return mWeakMinimumSizeAllowed ? WEAK_MINIMUM_SIZE : MINIMUM_SIZE;\n }", "public static void main(String[] args) {\r\n\t\tFastMinHeap<String> stringHeap = new FastMinHeap();\r\n\t\tstringHeap.insert(\"two\", 2);\r\n\t\tstringHeap.insert(\"four\", 4);\r\n\t\tstringHeap.insert(\"one\", 1);\r\n\t\tstringHeap.insert(\"six\", 6);\r\n\t\tstringHeap.insert(\"neg one\", -1);\r\n\t\tSystem.out.println(stringHeap.locations.toString());\r\n\t\tSystem.out.println(\"min: \" + stringHeap.extractMin());\r\n\t\tSystem.out.println(stringHeap.locations.toString());\r\n\t\tSystem.out.println(stringHeap.toString());\r\n\t\tSystem.out.println(stringHeap.locationOf(\"one\"));\r\n\t}", "private Address getNextAddress(Address addr) {\n\n\t\tInstruction instr = listing.getInstructionAfter(addr);\n\t\tAddress instrAddr = instr != null ? instr.getMinAddress() : null;\n\n\t\treturn instrAddr;\n// ?? ITERATOR HAS BEEN MODIFIED TO ONLY RETURN INSTRUCTION BLOCKS\n\n// Data data = getDefinedDataAfter(addr);\n// Address dataAddr = data != null ? data.getMinAddress() : null;\n// \n// if (instrAddr != null) {\n// \tif (dataAddr != null) {\n// \t\treturn (instrAddr.compareTo(dataAddr) < 0) ? instrAddr : dataAddr;\n// \t}\n// \telse {\n// \t\treturn instrAddr;\n// \t}\n// }\n// return dataAddr;\n\t}", "@Override\n public double getMaxX() {\n return curMap.getMap().getWidth();\n }", "private int getPRFurthestUse() {\n int max = -1;\n int maxPR = -1;\n for (int i = 0; i < numPhysRegs - 1; i++) {\n if (PRNU[i] > max) {\n max = PRNU[i];\n maxPR = i;\n }\n }\n return maxPR; // no free physical register\n }", "private long minKey() {\n if (left.size == 0) return key;\n // make key 'absolute' (i.e. relative to the parent of this):\n return left.minKey() + this.key;\n }", "private static int zzCMap(int input) {\n int offset = input & 255;\n return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset];\n }", "private static int zzCMap(int input) {\n int offset = input & 255;\n return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset];\n }", "private static int zzCMap(int input) {\n int offset = input & 255;\n return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset];\n }", "Unit findPlace() {\n\t\tif (!availableRegister.isEmpty()) {\n\t\t\tUnit result = availableRegister.firstElement();\n\t\t\tavailableRegister.remove(0);\n\t\t\treturn result;\n\t\t} else {\n\t\t\tint memId = localPos;\n\t\t\tlocalPos++;\n\t\t\treturn new UnitMemory(new String(\"local[\" + String.valueOf(memId) + \"]\"), memId);\n\t\t}\n\t}", "Coordinate getMinX();", "public int allocate_map()\n {\n int size = MAX_PID - MIN_PID;\n //allocating memory for the pid map\n pid_map = new boolean[size];\n //incase the map is null i.e allocation is failed we return -1\n if(pid_map == null)\n return -1;\n //initializing the map with false values\n for(int i=0;i<size;i++)\n {\n pid_map[i] = false;\n }\n //returning 1\n return 1;\n }", "private int findBlock(long addr) {\n\t\t// find cache by splitting addr into multiple segs\n\t\tint setIndex = (int) ((addr & 0x7FC0) >>> 6);\n\t\tlong tag = (addr & 0x3FFFFFFFFFFF8000l) >>> 15;\n\t\t// search for the set to check for existence\n\t\tfor (int j = 0; j < 8; j++) {\n\t\t\tif (cache[setIndex][j] == tag) {\n\t\t\t\tpolicies[setIndex].updateAt(j);\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\t\tif(usePrefetch){\n\t\t\t//fetch from memory; preftecher will fetch many other relevant addresses\n\t\t\tArrayList<Long> address = pf.getPrefetchedAddress(addr);\n\t\t\tfor(long add : address) {\n\t\t\t\tsetIndex = (int) ((add & 0x7FC0) >>> 6);\n\t\t\t\ttag = (add & 0x3FFFFFFFFFFF8000l) >>> 15;\n\t\t\t\tint index = policies[setIndex].getNextIndex();\n\t\t\t\tcache[setIndex][index] = tag;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tint index = policies[setIndex].getNextIndex();\n\t\t\tcache[setIndex][index] = tag;\n\t\t}\n\t\t// after all, we need to update the entry\n\t\treturn 4;\n\t}", "private T getMinUnvisited(){\n if (unvisited.isEmpty()) return null;\n T min = unvisited.get(0);\n for (int i = 1; i < unvisited.size(); i++){\n T temp = unvisited.get(i);\n if (distances[vertexIndex(temp)] < distances[vertexIndex(min)]){\n min = temp;\n }\n }\n return min;\n }", "private static int zzCMap(int input) {\n int offset = input & 255;\n return offset == input\n ? ZZ_CMAP_BLOCKS[offset]\n : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset];\n }", "private Node<Integer> minDistance(Map<Node<Integer>, Double> distances, Map<Node<Integer>, Double> unvisitedNodes) {\n Double min = Double.POSITIVE_INFINITY;\n\n Node<Integer> minNode = null;\n for (Map.Entry<Node<Integer>, Double> entry : distances.entrySet()) {\n Double d = entry.getValue();\n if (Double.compare(d, min) < 0 && unvisitedNodes.containsKey(entry.getKey())) {\n min = d;\n minNode = entry.getKey();\n }\n }\n return minNode;\n }", "private byte l() {\r\n\t\treturn left_map;\r\n\t}", "private void m12811c(Map<String, String> map) {\n Rect rect = new Rect();\n this.f10118e.getGlobalVisibleRect(rect);\n map.put(\"pt\", String.valueOf(rect.top));\n map.put(\"pl\", String.valueOf(rect.left));\n map.put(\"ph\", String.valueOf(this.f10118e.getMeasuredHeight()));\n map.put(\"pw\", String.valueOf(this.f10118e.getMeasuredWidth()));\n WindowManager windowManager = (WindowManager) this.f10116c.getSystemService(\"window\");\n DisplayMetrics displayMetrics = new DisplayMetrics();\n windowManager.getDefaultDisplay().getMetrics(displayMetrics);\n map.put(\"vph\", String.valueOf(displayMetrics.heightPixels));\n map.put(\"vpw\", String.valueOf(displayMetrics.widthPixels));\n }", "public String min() // return the value of the minimum key in the tree\r\n {\r\n\t \tif(empty()) {\r\n\t \t\treturn null;\r\n\t \t}\r\n return min(root).info;\r\n }", "int getMinimalPaletteDistance();", "public byte get_min() {\n return (byte)getSIntBEElement(offsetBits_min(), 8);\n }", "public final void onLowMemory() {\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.huawei.hms.maps.MapView) this.getHInstance()).onLowMemory()\");\n ((com.huawei.hms.maps.MapView) this.getHInstance()).onLowMemory();\n } else {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.google.android.gms.maps.MapView) this.getGInstance()).onLowMemory()\");\n ((com.google.android.gms.maps.MapView) this.getGInstance()).onLowMemory();\n }\n }", "public int relativePosTo(long addr) {\n\t\t\tif(addr < this.start)\n\t\t\t\treturn -1;\n\t\t\tif(addr > this.end)\n\t\t\t\treturn 1;\n\t\t\treturn 0;\n\t\t}", "public void printMiniMap() { }", "int minKey(int[] key, Boolean[] mstSet) {\n // Initialize min value\n int min = Integer.MAX_VALUE, min_index = -1;\n\n for (int v = 0; v < VERTICES; v++)\n if (mstSet[v] == false && key[v] < min) {\n min = key[v];\n min_index = v;\n }\n\n return min_index;\n }", "public static Integer getMapWidth() {\n\t\treturn MAPWIDTH;\n\t}" ]
[ "0.57551706", "0.5715829", "0.5705726", "0.5653993", "0.5530469", "0.55277216", "0.55198306", "0.551107", "0.55081886", "0.5491215", "0.54318696", "0.538154", "0.5365744", "0.53300536", "0.5300336", "0.5252973", "0.5248841", "0.52470475", "0.52361125", "0.5200018", "0.5193875", "0.51439196", "0.51259995", "0.511936", "0.51132905", "0.5111485", "0.50909805", "0.5071843", "0.5070504", "0.5066702", "0.50629884", "0.50387657", "0.50383604", "0.5016311", "0.5015869", "0.50117844", "0.50078917", "0.4990149", "0.49849904", "0.49741653", "0.4971161", "0.49670264", "0.4956903", "0.4954033", "0.49516523", "0.49466154", "0.4942182", "0.49352887", "0.49282226", "0.49186298", "0.4912648", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49039346", "0.49017134", "0.4888413", "0.48881906", "0.48831245", "0.48813215", "0.48750913", "0.48729405", "0.48540676", "0.48526508", "0.48516244", "0.4846797", "0.484117", "0.483435", "0.48343027", "0.48340714", "0.4818125", "0.48151216", "0.48151216", "0.48151216", "0.4813195", "0.48130757", "0.47995448", "0.47975406", "0.47973204", "0.4793828", "0.47888356", "0.47881246", "0.47856435", "0.47719613", "0.47698534", "0.47594935", "0.4755414", "0.47471696", "0.47404057", "0.47356442", "0.47342026" ]
0.62411064
0
Adjusts size, base offset, and current offset of the hex view depending on a given address and the memory sections known to the debugger.
private boolean resizeData(final IAddress address) { if (address == null) { return true; } final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger(); if (debugger != null) { final MemorySection section = ProcessHelpers.getSectionWith(debugger.getProcessManager().getMemoryMap(), address); if (section == null) { // No section with the given memory address m_debugPerspectiveModel.setActiveMemoryAddress(null, false); return false; } else { m_hexView.setBaseAddress(section.getStart().toLong()); m_provider.setMemorySize(section.getSize()); m_hexView.gotoOffset(address.toLong()); updateGui(); return true; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBaseAddress(int targetAddress, int baseAddress);", "static void print_the_address(int print_address){\n\t\tSystem.out.print(decimel_to_hexa(print_address)+\" : \");\n\t}", "public void setAddress(int address)\n {\n this.address = address;\n }", "void setAddress(long address) throws Exception {\n if (address < 0x10000) {\n Scales.sendByte((byte) 'A');\n Scales.sendByte((byte) (address >> 8));\n Scales.sendByte((byte) address);\n } else {\n Scales.sendByte((byte) 'H');\n Scales.sendByte((byte) (address >> 16));\n Scales.sendByte((byte) (address >> 8));\n Scales.sendByte((byte) address);\n }\n\n\t /* Should return CR */\n if (Scales.getByte() != '\\r') {\n throw new Exception(\"Setting address for programming operations failed! \" + \"Programmer did not return CR after 'A'-command.\");\n }\n }", "@Override public void incrementAddress( int offset )\n {\n super.incrementAddress( offset );\n if ( getPointer() > m_size )\n throw new RuntimeException( \"address out of range: \" + getPointer() );\n }", "public int addr2offset(Address address) {\n\t\treturn rva2offset(new Address(address.getAddr32()-peOptionalHeader.getImageBase()));\n\t}", "public String memoryDisplayHex()\n {\n int pos = startingPos;\n String ret = \"\";\n while(pos <= endingPos)\n {\n String instruction = mem.getFourBytes(pos);\n ret += \"0x\"+Integer.toHexString(pos) + \": \" + instruction.substring(0,4) + \" \" + instruction.substring(4,8)+\"\\n\";\n pos += 4;\n }\n return ret;\n }", "public int rva2offset(Address address) {\n\t\tint offset = -1;\n\t\tfor(IMAGE_SECTION_HEADER section:peFileSections) {\n\t\t\tif(address.getAddr32() >= section.getVirtualAddress()\n\t\t\t&& address.getAddr32() < section.getVirtualAddress() + section.getVirtualSize()) {\n\t\t\t\toffset = address.getAddr32() - section.getVirtualAddress() + section.getPointerToRawData();\n\t\t\t\treturn offset;\n\t\t\t}\n\t\t}\n\t\tif(address.getAddr32() < peOptionalHeader.getSizeOfHeaders())\n\t\t\treturn address.getAddr32();\n\t\treturn offset;\n\t}", "public void setAddress(int oct0, int oct1, int oct2, int oct3) \n {\n address = new int[4];\n\n oct0 = oct0 > 255 ? 255 : oct0;\n address[0] = oct0 < 0 ? 0 : oct0;\n\n oct1 = oct1 > 255 ? 255 : oct1;\n address[1] = oct1 < 0 ? 0 : oct1;\n\n oct2 = oct2 > 255 ? 255 : oct2;\n address[2] = oct2 < 0 ? 0 : oct2;\n\n oct3 = oct3 > 255 ? 255 : oct3;\n address[3] = oct3 < 0 ? 0 : oct3;\n }", "private int adjustOffsetForUnitTests(int offset)\n\t{\n\t\tif (System.getProperty(\"fdbunit\")==null) //$NON-NLS-1$\n\t\t\treturn offset;\n\t\telse\n\t\t\treturn 0;\n\t}", "public void setReturnAddressOffset(int offset);", "public void resolveAddress(){\n for(int i = 0; i < byteCodeList.size(); i++){\n if(byteCodeList.get(i) instanceof LabelCode){\n LabelCode code = (LabelCode)byteCodeList.get(i);\n labels.put(code.getLabel(), i);\n }else if(byteCodeList.get(i) instanceof LineCode){\n LineCode code = (LineCode)byteCodeList.get(i);\n lineNums.add(code.n);\n }\n }\n \n //walk through byteCodeList and assgin proper address\n for(int i = 0; i < byteCodeList.size(); i++){\n if(byteCodeList.get(i) instanceof GoToCode){\n GoToCode code = (GoToCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getLabel()));\n }else if(byteCodeList.get(i) instanceof FalseBranchCode){\n FalseBranchCode code = (FalseBranchCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getLabel()));\n }else if(byteCodeList.get(i) instanceof CallCode){\n CallCode code = (CallCode)byteCodeList.get(i);\n code.setNum((Integer)labels.get(code.getFuncName()));\n }\n }\n }", "@Override\r\n\tpublic int ModifyAddress(EasybuyAddress address) {\n\t\tString sql=\"update easybuy_address set ad_user_id=?,ad_address=? where ad_id=?\";\r\n\t\treturn super.op(sql, new Object[]{address.getAd_user_id(),address.getAd_address(),address.getAd_id()});\r\n\t}", "public void set_addr(int value) {\n setUIntElement(offsetBits_addr(), 16, value);\n }", "public void setAddress(String newAddress) {\r\n\t\tthis.address = newAddress;\r\n\t}", "public void setInternalAddress(String address);", "@Override\n public final void noteAbsoluteEntryPoint(int address) {\n }", "public void newPreferences(MPrefs prefs, int hexHeight)\n {\n mapComponent.newPreferences(prefs, hexHeight);\n h = hexHeight;\n \n mapComponent.setPreferredSize(new Dimension(mapComponent.getTotalWidth(), mapComponent.getTotalHeight()));\n \n Rule \txRule = new Rule(Rule.HORIZONTAL, h, map.getSizeX(), prefs.hexNumberFontSize);\n Rule\tyRule = new Rule(Rule.VERTICAL, h, map.getSizeY(), prefs.hexNumberFontSize);\n xRule.setPreferredWidth(mapComponent.getTotalWidth());\n yRule.setPreferredHeight(mapComponent.getTotalHeight());\n \n scrollPane.setColumnHeaderView(xRule);\n scrollPane.setRowHeaderView(yRule);\n scrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER, new Corner());\n scrollPane.doLayout();\n scrollPane.repaint();\n \n }", "protected abstract void onAddressAllocated(int logicalAddress);", "public void editAttractionAddress(String address){\r\n this.address = address;\r\n }", "void xsetAnchorOffset(org.apache.xmlbeans.XmlInt anchorOffset);", "public Address updateAddress(Address newAddress);", "public void writeMode(int address, byte value)\n {\n int offset;\n byte newValue[] = new byte[4];\n int startAddress;\n int plane0, plane1, plane2, plane3;\n\n switch (videocard.graphicsController.memoryMapSelect)\n {\n case 1: // 0xA0000 .. 0xAFFFF\n if (address > 0xAFFFF)\n return;\n offset = address - 0xA0000;\n break;\n \n case 2: // 0xB0000 .. 0xB7FFF\n if ((address < 0xB0000) || (address > 0xB7FFF))\n return;\n offset = address - 0xB0000;\n break;\n \n case 3: // 0xB8000 .. 0xBFFFF\n if (address < 0xB8000)\n return;\n offset = address - 0xB8000;\n break;\n \n default: // 0xA0000 .. 0xBFFFF\n offset = address - 0xA0000;\n }\n\n startAddress = (videocard.crtControllerRegister.regArray[0x0C] << 8) | videocard.crtControllerRegister.regArray[0x0D];\n\n if (videocard.graphicsController.alphaNumDisable != 0)\n {\n if (videocard.graphicsController.memoryMapSelect == 3)\n { \n // 0xB8000 .. 0xBFFFF\n int x_tileno, x_tileno2, y_tileno;\n /* CGA 320x200x4 / 640x200x2 start */\n videocard.vgaMemory[offset] = value;\n offset -= startAddress;\n if (offset >= 0x2000)\n {\n y_tileno = offset - 0x2000;\n y_tileno /= (320 / 4);\n y_tileno <<= 1; // 2 * y_tileno;\n y_tileno++;\n x_tileno = (offset - 0x2000) % (320 / 4);\n x_tileno <<= 2; // *= 4;\n }\n else\n {\n y_tileno = offset / (320 / 4);\n y_tileno <<= 1; // 2 * y_tileno;\n x_tileno = offset % (320 / 4);\n x_tileno <<= 2; // *=4;\n }\n x_tileno2 = x_tileno;\n if (videocard.graphicsController.shift256Reg == 0)\n {\n x_tileno *= 2;\n x_tileno2 += 7;\n }\n else\n {\n x_tileno2 += 3;\n }\n if (videocard.sequencer.dotClockRate != 0)\n {\n x_tileno /= (VideoCard.X_TILESIZE / 2);\n x_tileno2 /= (VideoCard.X_TILESIZE / 2);\n }\n else\n {\n x_tileno /= VideoCard.X_TILESIZE;\n x_tileno2 /= VideoCard.X_TILESIZE;\n }\n if (videocard.crtControllerRegister.scanDoubling != 0)\n {\n y_tileno /= (VideoCard.Y_TILESIZE / 2);\n }\n else\n {\n y_tileno /= VideoCard.Y_TILESIZE;\n }\n videocard.vgaMemReqUpdate = true;\n videocard.setTileUpdate(x_tileno, y_tileno, true);\n if (x_tileno2 != x_tileno)\n {\n videocard.setTileUpdate(x_tileno2, y_tileno, true);\n }\n return;\n /* CGA 320x200x4 / 640x200x2 end */\n }\n else if (videocard.graphicsController.memoryMapSelect != 1)\n {\n\n logger.log(Level.SEVERE, \"[\" + MODULE_TYPE + \"]\" + \" mem_write: graphics: mapping = \" + videocard.graphicsController.memoryMapSelect);\n return;\n }\n\n if (videocard.sequencer.chainFourEnable != 0)\n {\n int x_tileno, y_tileno;\n\n // 320 x 200 256 colour mode: chained pixel representation\n videocard.vgaMemory[(offset & ~0x03) + (offset % 4) * 65536] = value;\n if (videocard.lineOffset > 0)\n {\n offset -= startAddress;\n x_tileno = (offset % videocard.lineOffset) / (VideoCard.X_TILESIZE / 2);\n if (videocard.crtControllerRegister.scanDoubling != 0)\n {\n y_tileno = (offset / videocard.lineOffset) / (VideoCard.Y_TILESIZE / 2);\n }\n else\n {\n y_tileno = (offset / videocard.lineOffset) / VideoCard.Y_TILESIZE;\n }\n videocard.vgaMemReqUpdate = true;\n videocard.setTileUpdate(x_tileno, y_tileno, true);\n }\n return;\n }\n }\n\n /* addr between 0xA0000 and 0xAFFFF */\n\n // Set offsets in vga.vgaMemory array for planes\n plane0 = 0 << 16;\n plane1 = 1 << 16;\n plane2 = 2 << 16;\n plane3 = 3 << 16;\n\n int i;\n switch (videocard.graphicsController.writeMode)\n {\n case 0: /* write mode 0 */\n {\n final byte bitmask = videocard.graphicsController.bitMask;\n final byte set_reset = videocard.graphicsController.setReset;\n final byte enable_set_reset = videocard.graphicsController.enableSetReset;\n /* perform rotate on CPU data in case its needed */\n if (videocard.graphicsController.dataRotate != 0)\n {\n value = (byte) ((value >> videocard.graphicsController.dataRotate) | (value << (8 - videocard.graphicsController.dataRotate)));\n }\n newValue[0] = (byte) (videocard.graphicsController.latch[0] & ~bitmask);\n newValue[1] = (byte) (videocard.graphicsController.latch[1] & ~bitmask);\n newValue[2] = (byte) (videocard.graphicsController.latch[2] & ~bitmask);\n newValue[3] = (byte) (videocard.graphicsController.latch[3] & ~bitmask);\n switch (videocard.graphicsController.dataOperation)\n {\n case 0: // replace\n newValue[0] |= (((enable_set_reset & 1) != 0) ? (((set_reset & 1) != 0) ? bitmask : 0) : (value & bitmask));\n newValue[1] |= (((enable_set_reset & 2) != 0) ? (((set_reset & 2) != 0) ? bitmask : 0) : (value & bitmask));\n newValue[2] |= (((enable_set_reset & 4) != 0) ? (((set_reset & 4) != 0) ? bitmask : 0) : (value & bitmask));\n newValue[3] |= (((enable_set_reset & 8) != 0) ? (((set_reset & 8) != 0) ? bitmask : 0) : (value & bitmask));\n break;\n case 1: // AND\n newValue[0] |= (((enable_set_reset & 1) != 0) ? (((set_reset & 1) != 0) ? (videocard.graphicsController.latch[0] & bitmask) : 0)\n : (value & videocard.graphicsController.latch[0]) & bitmask);\n newValue[1] |= (((enable_set_reset & 2) != 0) ? (((set_reset & 2) != 0) ? (videocard.graphicsController.latch[1] & bitmask) : 0)\n : (value & videocard.graphicsController.latch[1]) & bitmask);\n newValue[2] |= (((enable_set_reset & 4) != 0) ? (((set_reset & 4) != 0) ? (videocard.graphicsController.latch[2] & bitmask) : 0)\n : (value & videocard.graphicsController.latch[2]) & bitmask);\n newValue[3] |= (((enable_set_reset & 8) != 0) ? (((set_reset & 8) != 0) ? (videocard.graphicsController.latch[3] & bitmask) : 0)\n : (value & videocard.graphicsController.latch[3]) & bitmask);\n break;\n case 2: // OR\n newValue[0] |= (((enable_set_reset & 1) != 0) ? (((set_reset & 1) != 0) ? bitmask : (videocard.graphicsController.latch[0] & bitmask))\n : ((value | videocard.graphicsController.latch[0]) & bitmask));\n newValue[1] |= (((enable_set_reset & 2) != 0) ? (((set_reset & 2) != 0) ? bitmask : (videocard.graphicsController.latch[1] & bitmask))\n : ((value | videocard.graphicsController.latch[1]) & bitmask));\n newValue[2] |= (((enable_set_reset & 4) != 0) ? (((set_reset & 4) != 0) ? bitmask : (videocard.graphicsController.latch[2] & bitmask))\n : ((value | videocard.graphicsController.latch[2]) & bitmask));\n newValue[3] |= (((enable_set_reset & 8) != 0) ? (((set_reset & 8) != 0) ? bitmask : (videocard.graphicsController.latch[3] & bitmask))\n : ((value | videocard.graphicsController.latch[3]) & bitmask));\n break;\n case 3: // XOR\n newValue[0] |= (((enable_set_reset & 1) != 0) ? (((set_reset & 1) != 0) ? (~videocard.graphicsController.latch[0] & bitmask)\n : (videocard.graphicsController.latch[0] & bitmask)) : (value ^ videocard.graphicsController.latch[0]) & bitmask);\n newValue[1] |= (((enable_set_reset & 2) != 0) ? (((set_reset & 2) != 0) ? (~videocard.graphicsController.latch[1] & bitmask)\n : (videocard.graphicsController.latch[1] & bitmask)) : (value ^ videocard.graphicsController.latch[1]) & bitmask);\n newValue[2] |= (((enable_set_reset & 4) != 0) ? (((set_reset & 4) != 0) ? (~videocard.graphicsController.latch[2] & bitmask)\n : (videocard.graphicsController.latch[2] & bitmask)) : (value ^ videocard.graphicsController.latch[2]) & bitmask);\n newValue[3] |= (((enable_set_reset & 8) != 0) ? (((set_reset & 8) != 0) ? (~videocard.graphicsController.latch[3] & bitmask)\n : (videocard.graphicsController.latch[3] & bitmask)) : (value ^ videocard.graphicsController.latch[3]) & bitmask);\n break;\n default:\n logger.log(Level.SEVERE, \"[\" + MODULE_TYPE + \"]\" + \" vga_mem_write: write mode 0: op = \" + videocard.graphicsController.dataOperation);\n }\n }\n break;\n\n case 1: /* write mode 1 */\n for (i = 0; i < 4; i++)\n {\n newValue[i] = videocard.graphicsController.latch[i];\n }\n break;\n\n case 2: /* write mode 2 */\n {\n final byte bitmask = videocard.graphicsController.bitMask;\n\n newValue[0] = (byte) (videocard.graphicsController.latch[0] & ~bitmask);\n newValue[1] = (byte) (videocard.graphicsController.latch[1] & ~bitmask);\n newValue[2] = (byte) (videocard.graphicsController.latch[2] & ~bitmask);\n newValue[3] = (byte) (videocard.graphicsController.latch[3] & ~bitmask);\n switch (videocard.graphicsController.dataOperation)\n {\n case 0: // write\n newValue[0] |= ((value & 1) != 0) ? bitmask : 0;\n newValue[1] |= ((value & 2) != 0) ? bitmask : 0;\n newValue[2] |= ((value & 4) != 0) ? bitmask : 0;\n newValue[3] |= ((value & 8) != 0) ? bitmask : 0;\n break;\n case 1: // AND\n newValue[0] |= ((value & 1) != 0) ? (videocard.graphicsController.latch[0] & bitmask) : 0;\n newValue[1] |= ((value & 2) != 0) ? (videocard.graphicsController.latch[1] & bitmask) : 0;\n newValue[2] |= ((value & 4) != 0) ? (videocard.graphicsController.latch[2] & bitmask) : 0;\n newValue[3] |= ((value & 8) != 0) ? (videocard.graphicsController.latch[3] & bitmask) : 0;\n break;\n case 2: // OR\n newValue[0] |= ((value & 1) != 0) ? bitmask : (videocard.graphicsController.latch[0] & bitmask);\n newValue[1] |= ((value & 2) != 0) ? bitmask : (videocard.graphicsController.latch[1] & bitmask);\n newValue[2] |= ((value & 4) != 0) ? bitmask : (videocard.graphicsController.latch[2] & bitmask);\n newValue[3] |= ((value & 8) != 0) ? bitmask : (videocard.graphicsController.latch[3] & bitmask);\n break;\n case 3: // XOR\n newValue[0] |= ((value & 1) != 0) ? (~videocard.graphicsController.latch[0] & bitmask) : (videocard.graphicsController.latch[0] & bitmask);\n newValue[1] |= ((value & 2) != 0) ? (~videocard.graphicsController.latch[1] & bitmask) : (videocard.graphicsController.latch[1] & bitmask);\n newValue[2] |= ((value & 4) != 0) ? (~videocard.graphicsController.latch[2] & bitmask) : (videocard.graphicsController.latch[2] & bitmask);\n newValue[3] |= ((value & 8) != 0) ? (~videocard.graphicsController.latch[3] & bitmask) : (videocard.graphicsController.latch[3] & bitmask);\n break;\n }\n }\n break;\n\n case 3: /* write mode 3 */\n {\n final byte bitmask = (byte) (videocard.graphicsController.bitMask & value);\n final byte set_reset = videocard.graphicsController.setReset;\n\n /* perform rotate on CPU data */\n if (videocard.graphicsController.dataRotate != 0)\n {\n value = (byte) ((value >> videocard.graphicsController.dataRotate) | (value << (8 - videocard.graphicsController.dataRotate)));\n }\n newValue[0] = (byte) (videocard.graphicsController.latch[0] & ~bitmask);\n newValue[1] = (byte) (videocard.graphicsController.latch[1] & ~bitmask);\n newValue[2] = (byte) (videocard.graphicsController.latch[2] & ~bitmask);\n newValue[3] = (byte) (videocard.graphicsController.latch[3] & ~bitmask);\n\n value &= bitmask;\n\n switch (videocard.graphicsController.dataOperation)\n {\n case 0: // write\n newValue[0] |= ((set_reset & 1) != 0) ? value : 0;\n newValue[1] |= ((set_reset & 2) != 0) ? value : 0;\n newValue[2] |= ((set_reset & 4) != 0) ? value : 0;\n newValue[3] |= ((set_reset & 8) != 0) ? value : 0;\n break;\n case 1: // AND\n newValue[0] |= (((set_reset & 1) != 0) ? value : 0) & videocard.graphicsController.latch[0];\n newValue[1] |= (((set_reset & 2) != 0) ? value : 0) & videocard.graphicsController.latch[1];\n newValue[2] |= (((set_reset & 4) != 0) ? value : 0) & videocard.graphicsController.latch[2];\n newValue[3] |= (((set_reset & 8) != 0) ? value : 0) & videocard.graphicsController.latch[3];\n break;\n case 2: // OR\n newValue[0] |= (((set_reset & 1) != 0) ? value : 0) | videocard.graphicsController.latch[0];\n newValue[1] |= (((set_reset & 2) != 0) ? value : 0) | videocard.graphicsController.latch[1];\n newValue[2] |= (((set_reset & 4) != 0) ? value : 0) | videocard.graphicsController.latch[2];\n newValue[3] |= (((set_reset & 8) != 0) ? value : 0) | videocard.graphicsController.latch[3];\n break;\n case 3: // XOR\n newValue[0] |= (((set_reset & 1) != 0) ? value : 0) ^ videocard.graphicsController.latch[0];\n newValue[1] |= (((set_reset & 2) != 0) ? value : 0) ^ videocard.graphicsController.latch[1];\n newValue[2] |= (((set_reset & 4) != 0) ? value : 0) ^ videocard.graphicsController.latch[2];\n newValue[3] |= (((set_reset & 8) != 0) ? value : 0) ^ videocard.graphicsController.latch[3];\n break;\n }\n }\n break;\n\n default:\n logger.log(Level.SEVERE, \"[\" + MODULE_TYPE + \"]\" + \" vga_mem_write: write mode \" + videocard.graphicsController.writeMode + \" ?\");\n }\n\n if ((videocard.sequencer.mapMask & 0x0f) != 0)\n {\n videocard.vgaMemReqUpdate = true;\n if (videocard.sequencer.mapMaskArray[0] != 0)\n videocard.vgaMemory[plane0 + offset] = newValue[0];\n if (videocard.sequencer.mapMaskArray[1] != 0)\n videocard.vgaMemory[plane1 + offset] = newValue[1];\n if (videocard.sequencer.mapMaskArray[2] != 0)\n {\n if ((offset & 0xe000) == videocard.sequencer.charMapAddress)\n {\n screen.setByteInCodePage((offset & 0x1fff), newValue[2]);\n }\n videocard.vgaMemory[plane2 + offset] = newValue[2];\n }\n if (videocard.sequencer.mapMaskArray[3] != 0)\n videocard.vgaMemory[plane3 + offset] = newValue[3];\n\n int x_tileno, y_tileno;\n\n if (videocard.graphicsController.shift256Reg == 2)\n {\n offset -= startAddress;\n x_tileno = (offset % videocard.lineOffset) * 4 / (VideoCard.X_TILESIZE / 2);\n if (videocard.crtControllerRegister.scanDoubling != 0)\n {\n y_tileno = (offset / videocard.lineOffset) / (VideoCard.Y_TILESIZE / 2);\n }\n else\n {\n y_tileno = (offset / videocard.lineOffset) / VideoCard.Y_TILESIZE;\n }\n videocard.setTileUpdate(x_tileno, y_tileno, true);\n }\n else\n {\n if (videocard.lineCompare < videocard.verticalDisplayEnd)\n {\n if (videocard.lineOffset > 0)\n {\n if (videocard.sequencer.dotClockRate != 0)\n {\n x_tileno = (offset % videocard.lineOffset) / (VideoCard.X_TILESIZE / 16);\n }\n else\n {\n x_tileno = (offset % videocard.lineOffset) / (VideoCard.X_TILESIZE / 8);\n }\n if (videocard.crtControllerRegister.scanDoubling != 0)\n {\n y_tileno = ((offset / videocard.lineOffset) * 2 + videocard.lineCompare + 1) / VideoCard.Y_TILESIZE;\n }\n else\n {\n y_tileno = ((offset / videocard.lineOffset) + videocard.lineCompare + 1) / VideoCard.Y_TILESIZE;\n }\n videocard.setTileUpdate(x_tileno, y_tileno, true);\n }\n }\n if (offset >= startAddress)\n {\n offset -= startAddress;\n if (videocard.lineOffset > 0)\n {\n if (videocard.sequencer.dotClockRate != 0)\n {\n x_tileno = (offset % videocard.lineOffset) / (VideoCard.X_TILESIZE / 16);\n }\n else\n {\n x_tileno = (offset % videocard.lineOffset) / (VideoCard.X_TILESIZE / 8);\n }\n if (videocard.crtControllerRegister.scanDoubling != 0)\n {\n y_tileno = (offset / videocard.lineOffset) / (VideoCard.Y_TILESIZE / 2);\n }\n else\n {\n y_tileno = (offset / videocard.lineOffset) / VideoCard.Y_TILESIZE;\n }\n videocard.setTileUpdate(x_tileno, y_tileno, true);\n }\n }\n }\n }\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "void setAnchorOffset(int anchorOffset);", "public void setAddress(java.lang.String newAddress) {\n\taddress = newAddress;\n}", "public void setAddress(java.lang.String newAddress) {\n\taddress = newAddress;\n}", "public void incrementAllMemoryLocations(int delta) {\n\t\tthis.continueProgram.incrementPosition(delta); \r\n\t\t\r\n\t\tthis.memoryRW.incrementPosition(delta);\r\n\t\t\r\n\t\tthis.funcVal.incrementPosition(delta);\r\n\t\t\r\n\t\tthis.memNextFuncVal.incrementPosition(delta);\r\n\r\n\t\t// Re-assign all the MemoryAddresses ------------------------\r\n\t\t\r\n\t\tfor(int x = 0; x < fullMemory.length; x++) {\r\n\t\t\tfullMemory[x].getSign().incrementPosition(delta);\r\n\t\t\tfor(ItrAddress i : fullMemory[x].getContents()) {\r\n\t\t\t\ti.incrementPosition(delta);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "@Generated(hash = 607080948)\n public void setAddress(Address address) {\n synchronized (this) {\n this.address = address;\n addressId = address == null ? null : address.getId();\n address__resolvedKey = addressId;\n }\n }", "public void setBillingAddressInCart(Address addr);", "void patchUpReferences(Assembly as, SymbolTable symbols, int Code, int IDat, int UDat, int IDpD, int UDpD, int codeOffset)\n\t{\n\t\tExpressionParser p = new ExpressionParser(symbols);\n\t\t\n\t\t// for each reference, set its branch type to what was passed\n\t\tIterator<AsmLine> it1 = as.iterator();\n\t\t\n\t\twhile (it1.hasNext())\n\t\t{\n\t\t\t// for each line...\n\t\t\tAsmLine line = it1.next();\n\n\t\t\tfor (Iterator i = line.references.iterator(); i.hasNext(); )\n\t\t\t{\n\t\t\t\tReference r = (Reference)i.next(); \n\t\t\t\t\n\t\t\t\tif (r.external == true)\n\t\t\t\t{\n\t\t\t\t\t// look up external reference in symbol table\n\t\t\t\t\tSymbol s = symbols.symbolForName(r.name);\n\t\t\t\t\tif (s == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tline.error = \"unresolved reference to \" + r.name;\n\t\t\t\t\t\terrorCount++;\n\t\t\t\t\t\tif (line.warning != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tline.warning = null;\n\t\t\t\t\t\t\tas.warningCount--;\n\t\t\t\t\t\t\twarningCount--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tint result = 0;\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tresult = p.evaluate(line.expression, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t}\n\t\t\t\t\t\tint locationToPatch = r.offset - line.offset;\n\t\t\t\t\t\tint locationInObjectToPatch = r.offset - as.currentSection.counter;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (s.type.equals(\"code\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// if the symbol is in code, adjust its value according to our reference type\n\t\t\t\t\t\t\tif (r.branchType == Reference.BranchType.absolute)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// pcr relative\n\t\t\t\t\t\t\t\tresult -= (line.offset + line.bytes.size() + codeOffset);\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\t// patch the reference with the value of the symbol\n\t\t\t\t\t\tswitch (r.size)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\t\tline.bytes.set(locationToPatch, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 8) & 0xFF);\n\t\t\t\t\t\t\t\tline.bytes.set(locationToPatch++, (result >> 8) & 0xFF);\n\t\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\t\tline.bytes.set(locationToPatch, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 24) & 0xFF);\n\t\t\t\t\t\t\t\tline.bytes.set(locationToPatch++, (result >> 24) & 0xFF);\n\t\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 16) & 0xFF);\n\t\t\t\t\t\t\t\tline.bytes.set(locationToPatch++, (result >> 16) & 0xFF);\n\t\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 8) & 0xFF);\n\t\t\t\t\t\t\t\tline.bytes.set(locationToPatch++, (result >> 8) & 0xFF);\n\t\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\t\tline.bytes.set(locationToPatch, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tp.setSymbolTable(as.symbols);\n\t\t\t\t\tint result = 0;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = p.evaluate(line.expression, null);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t\tint locationToPatch = r.offset - line.offset;\n\t\t\t\t\tint locationInObjectToPatch = r.offset - as.currentSection.counter;\n\t\t\t\t\t\n\t\t\t\t\t// local reference.\n\t\t\t\t\tswitch (r.size)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\tline.bytes.set(locationToPatch, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 8) & 0xFF);\n\t\t\t\t\t\t\tline.bytes.set(locationToPatch++, (result >> 8) & 0xFF);\n\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\tline.bytes.set(locationToPatch, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 24) & 0xFF);\n\t\t\t\t\t\t\tline.bytes.set(locationToPatch++, (result >> 24) & 0xFF);\n\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 16) & 0xFF);\n\t\t\t\t\t\t\tline.bytes.set(locationToPatch++, (result >> 16) & 0xFF);\n\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 8) & 0xFF);\n\t\t\t\t\t\t\tline.bytes.set(locationToPatch++, (result >> 8) & 0xFF);\n\t\t\t\t\t\t\tas.objectCode.set(locationInObjectToPatch++, (result >> 0) & 0xFF);\n\t\t\t\t\t\t\tline.bytes.set(locationToPatch, (result >> 0) & 0xFF);\n\t\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 void updatePhysicalAddress(String newPhysicalAddress)\r\n {\r\n physicalAddress = newPhysicalAddress;\r\n }", "public void setUpdipaddr(String updipaddr) {\r\n this.updipaddr = updipaddr;\r\n }", "@Override\n public void offsetChange (float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) {\n pixelOffset = xPixelOffset;\n }", "public void zoomOnAddress(){\n adjustZoomLvl(16000);\n adjustZoomFactor();\n }", "public void processMemory()\n {\n try{\n String memory = oReader.readLine();\n int index = 0;\n //adding mememory to and array\n for(int i = 0; i<memory.length()-2; i+=2)\n {\n String hexbyte = memory.substring(i, i+2); //get the byt ein hex\n mem.addEntry(\"0x\"+hexbyte, index, 1);\n index++;\n }\n } catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "public void setOffset(int startOffset, int endOffset);", "private void setAddrInputFields(){\n \ttextFieldCurrents.put(jTextFieldStart, jTextFieldStart.getText());\n\t\ttextFieldCurrents.put(jTextFieldEnd, jTextFieldEnd.getText());\n\t\tselectedFormat = jComboBoxFormat.getSelectedIndex();\n\t\tquickSearch = jCheckBoxQuickSearch.isSelected();\n }", "public int addEntry(String address, boolean isDirty, int data) {\n int pfn = -1;\n int physAddr = Integer.parseInt(address, 16);\n\n if (this.head < ram.length - 1) {\n pfn = this.head;\n ram[this.head][0] = new PageFrame(isDirty, physAddr, data);\n moveHead();\n }\n return pfn;\n }", "public void setDebugAddress(final String debugAddress)\n {\n this.debugAddress = debugAddress;\n }", "private String read(int address)\n {\n return MMU.read(VMA.get( address/RAM.getPageSize()) * RAM.getPageSize() + (address % RAM.getPageSize()));\n }", "private void populateAddressInfo(){\n userNameLabel.setText(userAccount.getUsername());\n address1Label.setText(userAccount.getPerson().getAddress().getAddressLine1());\n address2Label.setText(userAccount.getPerson().getAddress().getAddressLine2());\n cityLabel.setText(userAccount.getPerson().getAddress().getCity());\n stateLabel.setText(userAccount.getPerson().getAddress().getState());\n nationLabel.setText(userAccount.getPerson().getAddress().getCountry());\n zipLabel.setText(userAccount.getPerson().getAddress().getZipcode());\n emailLabel.setText(userAccount.getPerson().getEmail());\n }", "public void LoadHexFile(String filename) throws RuntimeException\n {\n int memPtr = 0;\n Yytoken current_token;\n boolean moreLines = true;\n\n int startingAddress;\n String recordType;\n int valueForMemory;\n\n File theFile = new File(filename);\n if (!theFile.exists())\n throw new RuntimeException(Constants.Error(Constants.FILE_NOT_FOUND) + \" \" + filename);\n try\n {\n //Create token stream from input hex-format file\n FileInputStream is = new FileInputStream(theFile);\n Yylex yy = new Yylex(is); //instantiate lexer object\n current_token = yy.yylex(); //advance first token\n while (moreLines)\n {\n if (memPtr >= PROGRAM_MEMORY_SIZE)\n throw new RuntimeException(Constants.Error(Constants.OUT_OF_MEMORY));\n\n if(current_token.m_index == 0)\n {\n //end of file\n moreLines = false;\n }\n else if(current_token.m_index == 1)\n {\n //get starting address\n startingAddress = Integer.parseInt(current_token.m_text);\n current_token = yy.yylex(); //advance lexer\n //get record type information\n if(current_token.m_index != 2)\n {\n //file semantics incorrect (contract breached by assembler)\n throw new RuntimeException(Constants.Error(Constants.INVALID_HEXFILE));\n }\n recordType = current_token.m_text;\n current_token = yy.yylex(); //advance lexer\n\n //depending upon the record type, select record location\n if(recordType.equalsIgnoreCase(\"data record\"))\n {\n //data record: most of the action happens here\n //set memory pointer to startingAddress\n memPtr = startingAddress;\n\n // Load in the current instruction\n valueForMemory = Integer.parseInt(current_token.m_text,16);\n // Swap the nibbles\n valueForMemory = ((valueForMemory & 0xff) << 8) + ((valueForMemory & 0xff00) >> 8);\n this.setProgramMemory(memPtr++,valueForMemory);\n\n current_token = yy.yylex();\n\n //get record and then load record into memory\n while(current_token.m_index == 3)\n {\n //ASSERTION: data records are two bytes long\n //load record into memory\n valueForMemory = Integer.parseInt(current_token.m_text,16);\n // Swap the nibbles\n valueForMemory = ((valueForMemory & 0xff) << 8) + ((valueForMemory & 0xff00) >> 8);\n this.setProgramMemory(memPtr++,valueForMemory);\n current_token = yy.yylex(); //advance lexer\n }\n\n }\n else if(recordType.equalsIgnoreCase(\"end of file record\"))\n {\n //acknowledged end of file approaching\n current_token = yy.yylex(); //advance lexer\n }\n else if(recordType.equalsIgnoreCase(\"extendedSAR\"))\n {\n //extended segment address record\n //limited use in AVR\n current_token = yy.yylex(); //advance lexer\n }\n else if(recordType.equalsIgnoreCase(\"startSAR\"))\n {\n //start of segment address record\n //limited use in AVR\n current_token = yy.yylex(); //advance lexer\n }\n else if(recordType.equalsIgnoreCase(\"extendedLAR\"))\n {\n //extended linear address record\n //use unknown as yet...\n current_token = yy.yylex(); //advance lexer\n }\n else if(recordType.equalsIgnoreCase(\"startLAR\"))\n {\n //start of linear address record\n //use unknown as yet...\n current_token = yy.yylex(); //advance lexer\n }\n }\n else\n {\n //file semantics incorrect (contract breached by assembler)\n throw new RuntimeException(Constants.Error(Constants.INVALID_HEXFILE));\n }\n } // while more lines\n is.close();\n } // try block\n catch (IOException e)\n {\n throw new RuntimeException(Constants.Error(Constants.INVALID_HEXFILE));\n }\n catch (ArrayIndexOutOfBoundsException e)\n {\n //Something VERY BAD happened in the lexer:\n //failed to recognise data in file.\n throw new RuntimeException(Constants.Error(Constants.INVALID_HEXFILE));\n }\n return;\n }", "public void setAddress(java.lang.String address) {\n\t\t_dmHistoryMaritime.setAddress(address);\n\t}", "public void setAddress(InetAddress address) {\r\n\t\tthis.address = address;\r\n\t}", "public boolean updateAddress(Address newAddress);", "public boolean handleAddress(Address address, String processName) {\n\t\tint pageHit = 0;\n\t\tsynchronized (mainMemory) {\n\t\t\t// Check if address divided by page/frame size is > page/frame size if so break\n\t\t\tif (address.getPage() > VMsim.pageCount) {\n\t\t\t\tSystem.out.println(address.getPage() + \"HERE\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tpageHit = mainMemory.checkPageIfAvailable(address.getPage());\n\t\t}\n\t\t// Check if the address hits\n\t\tif (pageHit > 0) {\n\t\t\tSystem.out.println(processName + \" accesses address \" + address.getAddress() + \" (page number = \" + address.getPage() + \", page offset=\" + address.getOffset() + \") in main memory (frame number = \" + pageHit + \"). \");\n\t\t} else {\n\t\t\tFaultHandlerThread faultHandler = (FaultHandlerThread) VMsim.threadMap.get(\"fault_handler\");\n\t\t\tfaultHandler.handle(address, processName);\n\t\t}\n\t\treturn true;\n\t}", "public void mem_map(long address, long size, int perms) throws UnicornException {\n mem_map(nativeHandle, address, size, perms);\n }", "static void take_memory_values() throws IOException{\n\t\tSystem.out.print(\"ENTER THE ADDRESS : \");\n\t\tString input = scan.readLine();\n\t\tif(input.equals(\"N\"))\n\t\t\treturn;\n\t\taddress = hexa_to_deci(input);\n\t\tprint_the_address(address);\n\t\tinput = scan.readLine();\n\t\tif(input.length()==2)\n\t\t\tmemory.put(address,input);\n\t\telse{\n\t\t\tmemory.put(address,input.substring(2));\n\t\t\tmemory.put(address+1,input.substring(0,2));\n\t\t}\n\t\t//System.out.println(address+\" \"+memory.get(address));\n\t\ttake_memory_values();\n\t}", "void setOffset(com.walgreens.rxit.ch.cda.IVLPPDPQ offset);", "public void setAddress(String address){\n\t\tthis.address = address;\n\t}", "public void setAddress(String address){\n\t\tthis.address = address;\n\t}", "public void updateAddress(Address address) {\n Address entity = dao.findByAddressID(address.getAddressID());\n if(entity!=null){\n entity.setAddressLineOne(address.getAddressLineOne());\n entity.setAddressLineTwo(address.getAddressLineTwo());\n entity.setAddressLineThree(address.getAddressLineThree());\n entity.setCity(address.getCity());\n entity.setState(address.getState());\n entity.setZipCode(address.getZipCode());\n }\n }", "void setOffset(double offset);", "public void setAddress(String address) {\n\t\tthis.address = StringUtils.trimString( address );\n\t}", "public Address offset2rva(int offset) {\n\t\tfor(IMAGE_SECTION_HEADER section:peFileSections) {\n\t\t\tif(section.getPointerToRawData() != 0 && offset >= section.getPointerToRawData()\n\t\t\t&& offset < section.getPointerToRawData() + section.getSizeOfRawData()) {\n\t\t\t\treturn new Address(offset - section.getPointerToRawData() + section.getVirtualAddress());\n\t\t\t}\n\t\t}\n\t\tif(offset < peOptionalHeader.getSizeOfHeaders())\n\t\t\treturn new Address(offset);\n\t\treturn null;\n\t}", "public int addMemoryRestoreWord(int address, int value) {\r\n\t\tbackSteps.push(MEMORY_RESTORE_WORD, pc(), address, value);\r\n\t\treturn value;\r\n\t}", "void setRawOffset(int rawOffset);", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public long memoryAddress()\r\n/* 143: */ {\r\n/* 144:172 */ throw new UnsupportedOperationException();\r\n/* 145: */ }", "void setAddress(String address) throws IllegalArgumentException;", "public void setImagebase(final Address address) throws CouldntSaveDataException {\n try {\n m_module.getConfiguration().setImageBase(new CAddress(address.toLong()));\n } catch (final com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException e) {\n throw new CouldntSaveDataException(e);\n }\n }", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "public void setAdress(Adress adr) {\r\n // Bouml preserved body begin 00040F82\r\n\t this.adress = adr;\r\n // Bouml preserved body end 00040F82\r\n }", "public void setAddress(String address) {\n\t\tthis.address = address;\n\t}", "public void setAddress(String address) {\n\t\tthis.address = address;\n\t}", "public void setAddress(String address) {\n\t\tthis.address = address;\n\t}", "public void setAddress(String address) {\n\t\tthis.address = address;\n\t}", "public void setAddress(String address) {\n\t\tthis.address = address;\n\t}", "protected void offset(int offset) {\n super.offset(offset);\n offsetRange(this.fCloseBodyRange, offset);\n offsetRange(this.fExtendsRange, offset);\n offsetRange(this.fImplementsRange, offset);\n offsetRange(this.fInterfacesRange, offset);\n offsetRange(this.fOpenBodyRange, offset);\n offsetRange(this.fSuperclassRange, offset);\n offsetRange(this.fTypeRange, offset);\n }", "public void setData(int address, String data, int size, String comment) {\n\t\tint bank = address % numOfbank;\n\t\t\n\t\tif (contentInBank.get(bank) != null) {\n\t\t\tEntry d =contentInBank.get(bank).get(address);\n\t\t\td.setData(data);\n\t\t\td.setType(MemoryType.DATA);\n\t\t\td.setSize(size);\n\t\t\tlogger.info(\"data memory update, bank:\" + bank +\", address:\"+ address);\n\t\t\tpublishUpdate(address, data,comment);\n\t\t} else{\n\t\t\tlogger.error(\"invalid data memory address \" + address + \" in bank \" + bank);\n\t\t}\n\t}", "public void setAddress(String address) { this.address = address; }", "private void addBlockAddresses(MemoryBlockDB block, boolean addToAll) {\n\t\tAddress start = block.getStart();\n\t\tAddress end = block.getEnd();\n\t\tif (addToAll) {\n\t\t\tallAddrSet.add(start, end);\n\t\t}\n\t\tif (block.isExternalBlock()) {\n\t\t\taddrSetView.externalBlock.add(start, end);\n\t\t}\n\t\telse if (block.isExecute()) {\n\t\t\taddrSetView.execute.add(start, end);\n\t\t}\n\t\tif (block.isMapped()) {\n\t\t\t// Identify source-blocks which block maps onto and add as a mapped-block to each of these\n\t\t\tAddressRange mappedRange = block.getSourceInfos().get(0).getMappedRange().get();\n\t\t\tfor (MemoryBlockDB b : getBlocks(mappedRange.getMinAddress(),\n\t\t\t\tmappedRange.getMaxAddress())) {\n\t\t\t\tif (!b.isMapped()) {\n\t\t\t\t\tb.addMappedBlock(block);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAddressSet mappedSet = getMappedIntersection(block, addrSetView.initialized);\n\t\t\taddrSetView.initialized.add(mappedSet);\n\t\t\taddrSetView.initializedAndLoaded.add(getMappedIntersection(block, addrSetView.initializedAndLoaded));\n\t\t}\n\t\telse if (block.isInitialized()) {\n\t\t\taddrSetView.initialized.add(block.getStart(), block.getEnd());\n\t\t\tif (block.isLoaded()) {\n\t\t\t\taddrSetView.initializedAndLoaded.add(block.getStart(), block.getEnd());\n\t\t\t}\n\t\t}\n\t}", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "void editAddressUser(String uid, Address address);", "public void addRelocation(int type, int offset) {\n\t\ttypeOffsetList.add(new TypeOffset(type, offset));\n\t\tsizeOfBlock += BinaryReader.SIZEOF_SHORT;\n\t}", "public int addMemoryRestoreRawWord(int address, int value) {\r\n\t\tbackSteps.push(MEMORY_RESTORE_RAW_WORD, pc(), address, value);\r\n\t\treturn value;\r\n\t}", "static protected void copyMemory(int source[],int soffset,int dest[],int doffset,int size)\n\t{\n\t\tSystem.arraycopy(source,soffset,dest,doffset,size);\n\t}", "public void setAddress(String address)\n {\n this.address = address;\n }" ]
[ "0.54886657", "0.5111099", "0.5039299", "0.50077987", "0.50041264", "0.5002547", "0.4974935", "0.4921155", "0.4882381", "0.48686463", "0.48665902", "0.4863958", "0.4819551", "0.4758164", "0.47574627", "0.473516", "0.47286296", "0.47241968", "0.47157735", "0.4710795", "0.46959805", "0.46955192", "0.46926504", "0.4691293", "0.4691293", "0.4691293", "0.46909773", "0.46405375", "0.46405375", "0.46181032", "0.46046132", "0.4577913", "0.45675322", "0.45487142", "0.45454723", "0.45238268", "0.45209932", "0.45141375", "0.45054772", "0.44971022", "0.44964027", "0.4472276", "0.44700226", "0.44469917", "0.44454676", "0.44424975", "0.4436181", "0.44298187", "0.4417196", "0.44147757", "0.44072562", "0.4400891", "0.44002357", "0.44002357", "0.4397148", "0.43897313", "0.43880233", "0.43819836", "0.43811375", "0.43801352", "0.43789345", "0.43789345", "0.4374183", "0.43656993", "0.43595523", "0.4359003", "0.4359003", "0.4359003", "0.43573493", "0.4354393", "0.4354393", "0.4354393", "0.4354393", "0.4354393", "0.4343846", "0.43422458", "0.43395853", "0.43387437", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43247962", "0.43147123", "0.43136322", "0.4313099", "0.43096483", "0.4309602" ]
0.6021372
0
Makes sure that the synchronizer is listening on the active debugger.
private void synchronizeDebugger(final IDebugger oldDebugger, final IDebugger newDebugger) { if (oldDebugger != null) { oldDebugger.getProcessManager().removeListener(m_debuggerListener); final TargetProcessThread activeThread = oldDebugger.getProcessManager().getActiveThread(); if (activeThread != null) { synchronizeThreads(activeThread, null); } } if (newDebugger != null) { newDebugger.getProcessManager().addListener(m_debuggerListener); m_provider.setDebugger(newDebugger); final TargetProcessThread activeThread = newDebugger.getProcessManager().getActiveThread(); if (activeThread != null) { synchronizeThreads(null, activeThread); } } updateGui(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void debug() {\n ProcessRunnerImpl.setGlobalDebug(true);\n }", "private void startDebugControlThread() {\n String dbgCtrlFile = System.getProperty(\"DEBUG_CONTROL\");\n dbgCtrlThread = new DebugControlThread(this, dbgCtrlFile, 1000);\n executorService.submit(dbgCtrlThread);\n }", "public void start() {\n if (Log.isLoggingEnabled())\n log.log(\"Start deadlock detection protocol\");\n }", "public static void possiblyWaitForDatabaseServiceDebugger() {\n if ( false ) {\n android.os.Debug.waitForDebugger();\n int len = new String(\"for setting breakpoint\").length();\n }\n }", "public static void init()\n {\n debugger = new Debugger(\"log\");\n info = true;\n }", "static void debug(boolean b) {\n ProcessRunnerImpl.setGlobalDebug(b);\n }", "public void startListeningForConnection() {\n startInsecureListeningThread();\n }", "public boolean isDebugEnabled();", "public void enableDebug() {\n this.debug = true;\n }", "public static void syncIsDebug(Context context) {\n if (isDebug == null) {\n isDebug = context.getApplicationInfo() != null\n && (context.getApplicationInfo().flags\n & ApplicationInfo.FLAG_DEBUGGABLE) != 0;\n }\n }", "public boolean needsStaticEventDispatcher(ICompilerProject project);", "public boolean needsEventDispatcher(ICompilerProject project);", "public static void enableDebugging(){\n DEBUG = true;\n }", "public void setDebugger(Debugger newDebugger) {\r\n\tdebugger = newDebugger;\r\n}", "public void startListening();", "boolean isDebugEnabled();", "public void startListening() {\r\n\t\tlisten.startListening();\r\n\t}", "public static void setActive(boolean active) {\n ServerConnectionDebugger.active = active;\n }", "public void setDebugReceive( boolean debug_on_off )\n {\n debug_receive = debug_on_off;\n }", "public void setDebugger(final IDebugger debugger) {\n if (m_debugger != null) {\n m_debugger.removeListener(m_listener);\n }\n\n m_debugger = debugger;\n\n if (m_debugger != null) {\n m_debugger.addListener(m_listener);\n }\n }", "@Override\n public void startNotificationListener(DBMSSynchronizer dbmsSynchronizer) {\n Logger.getLogger(ThreadedHousekeeper.class.getName()).setLevel(Level.SEVERE);\n\n this.listener = new PostgresSQLNotificationListener(dbmsSynchronizer);\n\n PGDataSource dataSource = new PGDataSource();\n dataSource.setHost(connectionProperties.getHost());\n dataSource.setPort(connectionProperties.getPort());\n dataSource.setDatabase(connectionProperties.getDatabase());\n dataSource.setUser(connectionProperties.getUser());\n dataSource.setPassword(connectionProperties.getPassword());\n\n try {\n pgConnection = (PGConnection) dataSource.getConnection();\n pgConnection.createStatement().execute(\"LISTEN jabrefLiveUpdate\");\n // Do not use `new PostgresSQLNotificationListener(...)` as the object has to exist continuously!\n // Otherwise the listener is going to be deleted by GC.\n pgConnection.addNotificationListener(listener);\n } catch (SQLException e) {\n LOGGER.error(\"SQL Error: \", e);\n }\n }", "void setDebugEnabled(boolean value) {\r\n debug_enabled = value;\r\n }", "@Override\n\tpublic void StartListening()\n\t{\n\t\t\n\t}", "private RRCPConnectionListener() {\n mainThread = new Thread(this);\n }", "private static void checkDebug() {\n try {\n if (Boolean.getBoolean(\"gfAgentDebug\")) {\n mx4j.log.Log.setDefaultPriority(mx4j.log.Logger.TRACE); // .DEBUG\n }\n } catch (VirtualMachineError err) {\n SystemFailure.initiateFailure(err);\n // If this ever returns, rethrow the error. We're poisoned\n // now, so don't let this thread continue.\n throw err;\n } catch (Throwable t) {\n // Whenever you catch Error or Throwable, you must also\n // catch VirtualMachineError (see above). However, there is\n // _still_ a possibility that you are dealing with a cascading\n // error condition, so you also need to check to see if the JVM\n // is still usable:\n SystemFailure.checkFailure();\n /* ignore */\n }\n }", "public void run(){\r\n\t\tsynchronized(this){\r\n\t\t\tObjectServer db4oServer = Db4o.openServer(FILE, PORT);\r\n\t\t\tdb4oServer.grantAccess(USER, PASS);\r\n\t\t\t\r\n\t\t\t// Using the messaging functionality to redirect all\r\n\t\t\t// messages to this.processMessage\r\n\t\t\tdb4oServer.ext().configure().clientServer().setMessageRecipient(this);\r\n\t\t\t\r\n\t\t\t// to identify the thread in a debugger\r\n\t\t\tThread.currentThread().setName(this.getClass().getName());\r\n\t\t\t\r\n\t\t\t// We only need low priority since the db4o server has\r\n\t\t\t// it's own thread.\r\n\t\t\tThread.currentThread().setPriority(Thread.MIN_PRIORITY);\r\n\t\t\ttry {\r\n\t\t\t\t\tif(! stop){\r\n\t\t\t\t\t\t// wait forever for notify() from close()\r\n\t\t\t\t\t\tthis.wait(Long.MAX_VALUE); \r\n\t\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tdb4oServer.close();\r\n\t\t}\r\n\t}", "@Override\n protected boolean isDebugEnable() {\n return false;\n }", "@SuppressWarnings(\"restriction\")\r\n\tpublic void addProcessConsoleInputListener() {\r\n\t\tboolean debug = true;\r\n\t\tif (debug) return;\r\n\t\tIConsole console = DebugUITools.getConsole(fConsoleInterpreter.getProcess());\r\n\t\tif (console instanceof ProcessConsole) {\r\n\t\t\tfinal ProcessConsole c = (ProcessConsole) console;\r\n\t fProcConsoleStdOut = c.getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);\r\n\t fProcConsoleErrOut = c.getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM);\r\n\t\t try {\r\n\t\t\t\tfConsoleProcWriter = new PrintWriter(new OutputStreamWriter(fProcConsoleStdOut,\"UTF8\"));\r\n//\t\t\t\tfConsoleProcReader = new BufferedReader(new InputStreamReader(fProcConsoleIn,\"UTF8\"));\r\n\t\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\t\tLog.log(IStatus.ERROR, \"RIDE console unsupported encoding\", e);\r\n\t\t\t}\r\n\r\n//\t\t\tfinal List<IConsoleInputListener> participants = ExtensionHelper\r\n//\t\t\t\t\t.getParticipants(ExtensionHelper.APLDEV_DEBUG_CONSOLE_INPUT_LISTENER);\r\n//\t\t\tfinal APLDebugTarget target = this;\r\n\t\t\tc.getDocument().addDocumentListener(new IDocumentListener() {\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void documentAboutToBeChanged(DocumentEvent event) {\r\n\t\t\t\t\t// check if present a new line symbol\r\n\t\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// check if that is user input\r\n\t\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\t\tif (event.fText.length() <= 2) {\r\n\t\t\t\t\t\t\t\t\t\tfinal String inputFound = p.getString();\r\n\t\t\t\t\t\t\t\t\t\tWriteRIDE(\"PROC_TYPE: \" + inputFound);\r\n//\t\t\t\t\t\t\t\t\t\tfor (IConsoleInputListener listener : partcipants) {\r\n//\t\t\t\t\t\t\t\t\t\t\tlistener.newLineReceived(inputFound, target);\r\n//\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error listen input for process console\", e);\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\t@Override\r\n\t\t\t\tpublic void documentChanged(DocumentEvent event) {\r\n\t\t\t\t\tfSessionViewer.getTextWidget().setCaretOffset(Integer.MAX_VALUE);\r\n\t\t\t\t\t// only report when have a new line\r\n\t\t\t\t\tif (event.fText.indexOf('\\r') != -1 || event.fText.indexOf('\\n') != -1) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tITypedRegion partition = event.fDocument.getPartition(event.fOffset);\r\n\t\t\t\t\t\t\tif (partition instanceof IOConsolePartition) {\r\n\t\t\t\t\t\t\t\tIOConsolePartition p = (IOConsolePartition) partition;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif (p.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) {\r\n\t\t\t\t\t\t\t\t\tif (event.fText.length() > 2) {\r\n\t\t\t\t\t\t\t\t\t\t// user pasted something\r\n\t\t\t\t\t\t\t\t\t\tWriteRIDE(\"PROC_PASTE: \" + event.fText);\r\n//\t\t\t\t\t\t\t\t\t\tfor (IOConsoleInputListener listener : participants) {\r\n//\t\t\t\t\t\t\t\t\t\t\tlistener.pasteReceived(event.fText, target);\r\n//\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\tLog.log(IStatus.ERROR, \"Error listen input for process console\", e);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}", "public boolean isDebug();", "void startListening()\n {\n if (outstanding_accept != null || open_connection != null) {\n return;\n }\n \n outstanding_accept = new AcceptThread(bt_adapter, handler);\n outstanding_accept.start();\n }", "protected boolean isDebugEnable() {\n return BlurDialogEngine.DEFAULT_DEBUG_POLICY;\n }", "public Debug() {\n target = getProject().getObjects()\n .property(JavaForkOptions.class);\n port = getProject().getObjects()\n .property(Integer.class).convention(5005);\n server = getProject().getObjects()\n .property(Boolean.class).convention(true);\n suspend = getProject().getObjects()\n .property(Boolean.class).convention(true);\n finalizedBy(target);\n }", "public Debugger getDebugger() {\r\n\treturn debugger;\r\n}", "public void run(){\r\n\t\tsynchronized(this){\r\n\t\t\tObjectServer db4oServer = Db4o.openServer(getDbDirectory() + FILE, PORT);\r\n\t\t\tdb4oServer.grantAccess(USER, PASS);\r\n\r\n\t\t\t// Using the messaging functionality to redirect all\r\n\t\t\t// messages to this.processMessage\r\n\t\t\tdb4oServer.ext().configure().clientServer().setMessageRecipient(this);\r\n\r\n\t\t\t// to identify the thread in a debugger\r\n\t\t\tThread.currentThread().setName(this.getClass().getName());\r\n\r\n\t\t\t// We only need low priority since the db4o server has\r\n\t\t\t// it's own thread.\r\n\t\t\tThread.currentThread().setPriority(Thread.MIN_PRIORITY);\r\n\t\t\ttry {\r\n\t\t\t\t\tif(! stop){\r\n\t\t\t\t\t\t// wait forever for notify() from close()\r\n\t\t\t\t\t\tthis.wait(Long.MAX_VALUE);\r\n\t\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tdb4oServer.close();\r\n\t\t}\r\n\t}", "public static void normalDebug(){\n enableVerbos = false;\n }", "@Override\n\tpublic boolean isDebugEnabled() {\n\t\treturn debugEnabled;\n\t}", "public static boolean debugOn()\r\n {\r\n on = true;\r\n System.out.println(\"Debug Mode On\");\r\n return on;\r\n }", "public boolean isDebugEnabled() {\n return debugEnabled;\n }", "private void listen() {\n try {\n this.console.println(MapControl.checkListen(FireSwamp.getPlayer().getPlayerPosition(),\n FireSwamp.getCurrentGame().getGameMap()));\n } catch (MapControlException ex) {\n Logger.getLogger(GameMenuView.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n\tpublic void startSync() throws Exception {\n\t}", "public boolean set () {\n final ToolsDebugger debugger = (ToolsDebugger) getDebugger ();\n if (debugger.synchronizer == null) return false;\n if (remoteClass != null)\n remove ();\n final String className = getClassName ();\n final int lineNumber = getLineNumber ();\n if ((className == null) || (className.length () < 1) ||\n (lineNumber < 0)) return false;\n try {\n return ((Boolean) new Protector (\"JavaDebugger.addBreakpoint\") { // NOI18N\n public Object protect () throws Exception {\n // in outerclass\n remoteClass = debugger.remoteDebugger.findClass (className);\n if (remoteClass == null) return new Boolean (false);\n remoteLineNumber = lineNumber;\n\n // PATCH for breakpoints in top-level package private classes, try to obtain Line\n CoreBreakpoint breakpoint = getBreakpoint ();\n if ((breakpoint.getLine () == null) && (!breakpoint.isHidden ())) {\n Line newLine = Utils.getLineForSource (className, remoteClass.getSourceFileName (), lineNumber);\n if (newLine != null)\n breakpoint.setLine (newLine);\n }\n // end of PATCH\n\n String s = remoteClass.setBreakpointLine (remoteLineNumber);\n if (s.trim ().equals (\"\")) return new Boolean (true); // NOI18N\n\n // in innerclasses\n String name = Utils.getClassName (className);\n FileObject mainFile = TopManager.getDefault().getRepository ().find (\n Utils.getPackageName (className),\n name,\n \"class\" // NOI18N\n );\n FileObject[] file = mainFile.getParent ().getChildren ();\n\n int i, k = file.length;\n for (i = 0; i < k; i++)\n if (file [i].getName ().startsWith (name) &&\n file [i].getExt ().equals (\"class\") // NOI18N\n ) {\n remoteClass = debugger.remoteDebugger.findClass (file [i].getPackageName ('.'));\n if (remoteClass == null) return new Boolean (false);\n s = remoteClass.setBreakpointLine (lineNumber);\n if (s.trim ().equals (\"\")) return new Boolean (true); // NOI18N\n }\n\n // if (s.trim ().equals (\"\")) return new Boolean (true); // NOI18N\n debugger.println (NbBundle.getBundle (ToolsDebugger.class).getString (\n \"CTL_Cannot_set_breakpoint\") + \": \" + s, // NOI18N\n ToolsDebugger.ERR_OUT\n );\n return new Boolean (false);\n }\n }.throwAndWait (debugger.synchronizer, debugger.killer)).booleanValue ();\n } catch (Exception e) {\n return false;\n }\n }", "public static boolean isDebugAccessible() {\r\n\t\treturn DEBUG_DEPENDENCY;\r\n\t}", "@Override\n\tpublic boolean IsListening() {\n\t\treturn listening;\n\t}", "public synchronized void start()\n {\n pluginMonitor.start();\n }", "void setDebugPort(Integer debugPort);", "public void setDebug(boolean b) { debug = b; }", "public DebuggerTestApplication() {\n this.setTitle(\"Debugger Test Application\");\n initComponents();\n\n counterThread = new Thread(new Runnable() {\n public void run() {\n Thread thisThread = Thread.currentThread();\n while (counterThread == thisThread) {\n updateCounter();\n try {\n Thread.currentThread().sleep(1000);\n if (counterThreadSuspended) {\n synchronized(counterThread) {\n while (counterThreadSuspended) {\n counterThread.wait();\n }\n }\n }\n \n } catch (InterruptedException ie) {\n ie.printStackTrace();\n }\n }\n }\n });\n counterThread.setName(\"counterThread\");\n counterThread.start();\n \n }", "void onListeningStarted();", "@Override\n public void start() {\n System.out.println(\"smart life cycle start\");\n flag = true;\n }", "public boolean isDebugged() {\r\n\t\treturn debugged;\r\n\t}", "public void doMonitor();", "public ReflectMonitor() {\n boundSupport = new PropertyChangeSupport(this);\n }", "public void notifyServerListening() {\r\n nui.notifyHostListening();\r\n }", "@Input\n public boolean isDebuggable() {\n return debug;\n }", "public void setAutoSynchronizationEnabled(boolean b);", "public void setDebugSend( boolean debug_on_off )\n {\n debug_send = debug_on_off;\n }", "@Override\n\tpublic void teleopInit() {\n\t\tbeenEnabled = true;\n\t\tif(!socket){\n\t\t\tlogger.startSocket(); socket = true;\n\t\t}\n\t}", "public void setDebugSuspend(final boolean debugSuspend)\n {\n this.debugSuspend = debugSuspend;\n }", "LabyDebugger getLabyDebugger();", "boolean isDebug();", "boolean isDebug();", "public void setDebugging(boolean on)\n\t{\n\t\t_options.setDebugging(on);\n\t}", "public void continueDebugStep() {\n \tthis.continueDebug = true;\n }", "public void startListening() {\n if (Util.isDebugBuild()) {\n Log.d(TAG, \"mAcceptThread: \" + mAcceptThread);\n }\n\n // Start the AcceptThread which listens for incoming connection requests\n if (mAcceptThread == null) {\n mAcceptThread = new AcceptThread(mContext, mHandler, services, this);\n }\n\n if (Util.isDebugBuild()) {\n Log.d(TAG, \"mAcceptThread.isAlive(): \" + mAcceptThread.isAlive());\n }\n\n if (!mAcceptThread.isAlive()) {\n mAcceptThread.start();\n }\n }", "void enableObserver() {\n dataSourcesPanel.addObserver(this);\n }", "public synchronized boolean isListening() {\n\t\treturn isListening;\n\t}", "public void setDebugEnabled(boolean debugEnabled) {\n this.debugEnabled = debugEnabled;\n }", "public void registerDebugChangeListener(PropertyChangeListener oyente) {\n\n\t\t// seteamos el oyente\n\t\tplanificador.registrarOyenteDepurador(oyente);\n\n\t}", "@Override\n public void run () {\n boolean activateStatus;\n\n startUp(); \n if (loaded) {\n File fi = new File(fileLoadedFrom);\n clientSite = load_object(fileLoadedFrom);\n message(AX_PROGRESS,\"Client Site found: \" + clientSite);\n if (! fi.delete()) {\n message(AX_ERROR,\"Failed to delete temporary file: \" + fileLoadedFrom);\n }\n } else { \n clientSite = insertObjectFromActiveXModes(modes, hWndHandle);\n }\n if (clientSite == AX_NO_CLIENT_SITE) {\n // Just progress because the C code will handle communicating\n // this failure.\n message(AX_PROGRESS, \"Error: client site was null\");\n return;\n }\n NativeMethodBroker.registerProxy(clientSite, this);\n try {\n if((! loaded) || (wrapper.getActivateOnLoad()))\n wrapper.activate();\n if (loaded) {\n addAllActiveXListeners();\n restoreTransientEventSets(); \n }\n }\n catch (ActiveXException e) \n { \n e.printStackTrace();\n }\n while (true) {\n long timeBefore = 0;\n long timeAfter;\n int counter = 0;\n if (messagesWaiting.isEmpty()) {\n try {\n // if (wrapper.isOpenInWindow) {\n // We should want to only call update_stuff when isOpenInWindow\n // is true. However, the call to OnShowWindow, which the only\n // thing which changes the value of isOpenInWindow, obviously\n // must come before the control has shut down. Therefore,\n // we can't immediately stop listening at that point. Perhaps\n // it would work to continue to listen for a few seconds after\n // receiving the notification, or perhaps even not acting on\n // the notification for a few seconds. Either of those seem\n // enormously hacky, however, so for now, every object will\n // just poll constantly.\n \n if (traceTime)\n timeBefore = System.currentTimeMillis(); \n update_stuff();\n \n Thread.sleep(UPDATE_HEARTBEAT);\n\n if (traceTime) {\n timeAfter = System.currentTimeMillis();\n System.out.println(\"Update and sleep took \" + (timeAfter - timeBefore) +\n \"(millis)\");\n }\n } \n catch (InterruptedException e) {\n message(AX_ERROR, \"INTERRUPTED EXCEPTION. \");\n message(AX_DATA_DUMPS, \"(This should never happen.)\");\n } \n }\n notifyMessage = messagesWaiting.pop();\n \n\n if (notifyMessage != null) {\n \n synchronized (notifyMessage) { \n message(AX_PROGRESS, notifyMessage.toString());\n switch (notifyMessage.messageType) {\n case OTR_ERROR:\n message(AX_ERROR, \"ERROR: thread was activated without an action.\\n\");\n return;\n case DELETE:\n try {\n removeAllActiveXListeners();\n }\n catch (ActiveXException e)\n {\n }\n deleteObject(clientSite);\n break; \n case UPDATE: \n update_stuff();\n break;\n case ACTIVATE:\n activateStatus =\n activate_object(clientSite, hWndHandle,\n notifyMessage.top, notifyMessage.left,\n notifyMessage.bottom, notifyMessage.right,\n false);\n if (activateStatus) {\n resize(notifyMessage.top, notifyMessage.left,\n notifyMessage.bottom, notifyMessage.right);\n } else {\n message(AX_ERROR, \"ERROR: unable to activate object. Quitting thread.\");\n return;\n }\n break;\n case RENDER:\n render_object(clientSite, hWndHandle,\n notifyMessage.top, notifyMessage.left,\n notifyMessage.bottom, notifyMessage.right);\n break;\n case RESIZE:\n resize_object(clientSite,\n notifyMessage.top, notifyMessage.left,\n notifyMessage.bottom, notifyMessage.right);\n break;\n case COPY:\n copy_object(clientSite, \n notifyMessage.top, notifyMessage.left,\n notifyMessage.bottom, notifyMessage.right);\n break;\n case INVOKE:\n if (traceTime)\n timeBefore = System.currentTimeMillis();\n comInvokeWithinThread(notifyMessage);\n if (traceTime) {\n timeAfter = System.currentTimeMillis();\n System.out.println(\"Invoke within thread took \" + (timeAfter - timeBefore) +\n \"(millis)\");\n }\n break;\n case SAVE:\n notifyMessage.name = save_object(clientSite, notifyMessage.name);\n break;\n case CHECK_CAST:\n notifyMessage.returnCheck \n = check_cast(clientSite,\n notifyMessage.dispatchPointer,\n notifyMessage.classID);\n break;\n case GET_CLSID:\n notifyMessage.returnClsid = \n get_clsid(clientSite,\n notifyMessage.dispatchPointer);\n break;\n case EVENT_LISTEN:\n event_listen(clientSite, \n notifyMessage.dispatchPointer, \n notifyMessage.classID,\n notifyMessage.add);\n break;\n case EVENT:\n forwardActiveXEvent1(notifyMessage.classID,\n notifyMessage.dispid,\n notifyMessage.eventName,\n notifyMessage.eventArguments);\n break;\n case MARSHAL_INTERFACE:\n notifyMessage.dispatchPointer = \n marshal_interface(clientSite, notifyMessage.dispatchPointer);\n break;\n case GET_MARSHALED_INTERFACE:\n notifyMessage.dispatchPointer = get_marshaled_interface(clientSite, notifyMessage.dispatchPointer);\n break;\n default:\n message(AX_ERROR, \"ERROR: unknown action:\" + notifyMessage);\n } \n notifyMessage.finished = true;\n notifyMessage.notifyAll();\n if ((notifyMessage.messageType == DELETE) ||\n (notifyMessage.messageType == DIE))\n {\n message(AX_PROGRESS, \"*** STOPING ***\");\n return;\n }\n \n }\n }\n }\n }", "protected boolean isDebugging() {\n\t\treturn debugging;\n\t}", "static boolean isGradlePollThread(RecordedThread thread) {\n return (thread != null && thread.getJavaName().startsWith(\"/127.0.0.1\"));\n }", "public static void setDebug(boolean d) {\n\t\tdebug = d;\n\t}", "public boolean start() {\n\t\treturn true;\n\t}", "public void toggleDebug() {\n\t\tdebug = debug ? false : true;\n\t}", "@Override\n\tpublic void setDebug(boolean isDebug) {\n\t\t\n\t}", "@Test\r\n\tpublic void testAddWorkspaceListener() {\r\n\t\tMockWorkspaceListener listener = new MockWorkspaceListener();\r\n\t\tworkspace.addListener(listener);\r\n\t\tworkspace.addSubModule(eBuffer);\r\n\t\tcontent.addDefaultNode(node1);\r\n\r\n\t\tworkspace.receiveLocalAssociation(content);\r\n\r\n\t\tassertEquals(ModuleName.EpisodicBuffer, listener.originatingBuffer);\r\n\t\tassertTrue(listener.content.containsNode(node1));\r\n\t}", "private void debugInConsole() {\n String command = \"\";\n do {\n try {\n command = getCommandWithPrompt();\n doDebugCommand(command);\n } catch (Error e) {\n println(e.getMessage());\n }\n } while (!command.equals(\"exit\"));\n }", "@Override\n\tpublic void setup()\n\t{\n\t\tCoreNotifications.get().addListener(this, ICoreContextOperationListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureInputListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureRuntimeListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureOperationListener.class);\n\t}", "public void start() {\n setClosedLoopControl(true);\n }", "public static void debug(boolean d) {\n D = d;\n }", "protected final boolean hasDebug() {\n return m_debug;\n }", "private void monitor() {\n monitoringActor.tell(new Monitor(), ActorRef.noSender());\n }", "public void start() {\n m_enabled = true;\n }", "public void activateConsoleMode() {\n logger.addHandler(mConsoleHandler);\n }", "public default boolean hasMonitor() {\n\t\treturn false;\n\t}", "void runMonitor() {\n threadMonitor.run();\n }", "public static void setDebug(boolean db) {\n\n\t\tdebug = db;\n\n\t}", "public void initTransport() {\n JDE.signal(procID, MESSAGE, \"Debugger connected to standard I/O socket.\", QUOTE);\n\n final Process process = m_debugger.getVM().process();\n standardInputProcessor = new StandardInputProcessor(process.getOutputStream());\n standardInputProcessor.start();\n\n standardOutputWriter = new StandardOutputWriter(m_sioSocket);\n standardOutputWriter.println(\"*** Process Standard I/O ***\");\n\n standardOutputProcessor = new StandardOutputProcessor(process.getInputStream());\n standardOutputProcessor.start();\n\n standardErrorProcessor = new StandardErrorProcessor(process.getErrorStream());\n standardErrorProcessor.start();\n\n }", "public synchronized void startNotificationListener() {\n\t\tif ((notificationThread != null) && notificationThread.isAlive()) {\n\t\t\tthrow new IllegalStateException(\"The notification listener is already running.\");\n\t\t}\n\t\t\n\t\tif (smtpConfig != null) {\n\t\t\tnotificationThread = new Thread( new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tlistenForNotificationEvents();\n\t\t\t\t}\n\t\t\t}, \"OTM_NotificationListener\" );\n\t\t\t\n\t\t\tshutdownRequested = false;\n\t\t\tnotificationThread.start();\n\t\t\trepositoryListener = new RepositoryNotificationListener( this, manager );\n\t\t\tmanager.addListener( repositoryListener );\n\t\t\t\n\t\t} else {\n\t\t\tlog.warn(\"SMTP configuration not initialized - notification listener not started.\");\n\t\t}\n\t}", "@Override\n\tpublic void testPeriodic() {\n\t\tLiveWindow.run();\n\t\tisAutonomous = false;\n\t\tisTeleoperated = true;\n\t\tisEnabled = true;\n\t}", "public void setDebuggable(boolean debug) {\n this.debug = debug;\n }", "protected static void notifyDebuggers(String message) {\n\n\t\tmessage = ChatColor.DARK_RED + \"(RecipeManager debug) \" + ChatColor.RESET + message;\n\n\t\tfor (Player p : Bukkit.getOnlinePlayers()) {\n\t\t\tif (p.hasPermission(\"recipemanager.debugger\")) {\n\t\t\t\tsend(p, message);\n\t\t\t}\n\t\t}\n\t}", "public void startWatching(){\n this.listWatcher.start();\n }", "void startRecording() {\n synchronized (serviceConnection) {\n startNewTrackRequested = true;\n serviceConnection.startAndBind();\n \n // Binding was already requested before, it either already happened\n // (in which case running the callback manually triggers the actual recording start)\n // or it will happen in the future\n // (in which case running the callback now will have no effect).\n serviceBindCallback.run();\n }\n }", "private void ccListenerStarter(){\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t//spin off new ccListener\n\t\t\t\t\n\t\t\t\tThread listenerThread = new Thread(\n\t\t\t\t\t\tnew ClientCommunicatorListener(\n\t\t\t\t\t\t\t\tccSocket.getInputStream(), db, this));\n\t\t\t\t\n\t\t\t\tlistenerThread.start();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public static void start() {\n enableIncomingMessages(true);\n }", "@Override\r\n public boolean doStartTrackers() {\n boolean result = true;\r\n\r\n Tracker objectTracker = TrackerManager.getInstance().getTracker(ObjectTracker.getClassType());\r\n if (objectTracker != null)\r\n objectTracker.start();\r\n\r\n return result;\r\n }", "@Override\n\tpublic void setDebugMode(boolean debug) {\n\n\t}", "void startPumpingEvents();", "public void startUDPTask() {\r\n \tif(isRunning){\r\n \t\tsetChanged();\r\n \t\tnotifyObservers(isRunning);\r\n \t}\r\n \telse {\r\n \t\tUDPServerThread = new Thread(this);\r\n \t\tUDPServerThread.start();\r\n \t}\r\n }", "public boolean supportsDebugArgument();" ]
[ "0.6031989", "0.57323784", "0.5707055", "0.56907225", "0.55781037", "0.55557895", "0.55156374", "0.54440093", "0.5429324", "0.54229176", "0.53653926", "0.5349516", "0.5344997", "0.53349334", "0.53215927", "0.53104436", "0.53050333", "0.52786183", "0.5269023", "0.52325344", "0.52075297", "0.51837504", "0.5182689", "0.5182238", "0.51820135", "0.5175473", "0.5173444", "0.5171506", "0.51640815", "0.51635766", "0.51563156", "0.5146296", "0.5128161", "0.5120771", "0.50972486", "0.50813186", "0.5081278", "0.50771856", "0.5073912", "0.50644606", "0.50632346", "0.50537467", "0.50370616", "0.50161964", "0.49910587", "0.4989273", "0.49822646", "0.49810997", "0.49769184", "0.4967926", "0.49631193", "0.49361143", "0.49235624", "0.49223253", "0.49209568", "0.49207026", "0.49198034", "0.4919274", "0.491568", "0.49086586", "0.49086586", "0.4906852", "0.49022928", "0.48911554", "0.48890185", "0.48871472", "0.48816106", "0.48802373", "0.48783654", "0.48556107", "0.48429078", "0.48362857", "0.48346666", "0.48317075", "0.4831518", "0.4831297", "0.48306906", "0.4827554", "0.48264936", "0.48252878", "0.4823269", "0.4822527", "0.48216116", "0.48162112", "0.4809149", "0.48079005", "0.4795746", "0.47956362", "0.47851986", "0.4779122", "0.47675082", "0.47674584", "0.47660714", "0.47654814", "0.47649166", "0.4763804", "0.47570312", "0.47537985", "0.47526106", "0.47489616", "0.47486177" ]
0.0
-1
Keeps listeners synchronized with current threads.
private void synchronizeThreads(final TargetProcessThread oldThread, final TargetProcessThread newThread) { if (oldThread != null) { oldThread.removeListener(m_threadListener); } if (newThread != null) { newThread.addListener(m_threadListener); } updateGui(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void startThreads() {\n Listener listener = new Listener();\n Thread listenerThread = new Thread(listener);\n\n listenerThread.start();\n }", "public void notifyListeners() {\n Handler handler = new Handler(Looper.getMainLooper()); // TODO reuse\n // handler\n Runnable runnable = new Runnable() {\n\n @Override\n public void run() {\n synchronized (listeners) {\n for (IContentRequester requester : listeners) {\n requester.contentChanged(Content.this);\n }\n }\n }\n };\n boolean success = handler.post(runnable);\n if (success) {\n // Log.d(TAG,\n // \"Posted notification for all listeners from \"+this.toString()+\" to \"+listeners.size()+\" listeners.\");\n Log.d(TAG, \"Posted notification for all listeners from content id \"\n + id + \" to \" + listeners.size() + \" listeners.\");\n } else {\n Log.e(TAG, \"Failed to post notification for all listeners\");\n }\n }", "private void newListener() {\n (new Thread(this)).start();\n }", "public ThreadedListenerManager() {\n\t\tmanagerNumber = MANAGER_COUNT.getAndIncrement();\n\t\tBasicThreadFactory factory = new BasicThreadFactory.Builder()\n\t\t\t\t.namingPattern(\"listenerPool\" + managerNumber + \"-thread%d\")\n\t\t\t\t.daemon(true)\n\t\t\t\t.build();\n\t\tThreadPoolExecutor defaultPool = (ThreadPoolExecutor) Executors.newCachedThreadPool(factory);\n\t\tdefaultPool.allowCoreThreadTimeOut(true);\n\t\tthis.pool = defaultPool;\n\t}", "public void notifyAllObservers(){\n\t\tthis.notifyAllObservers(null);\n\t}", "private void notifyListeners()\r\n/* 456: */ {\r\n/* 457:547 */ Object listeners = this.listeners;\r\n/* 458:548 */ if (listeners == null) {\r\n/* 459:549 */ return;\r\n/* 460: */ }\r\n/* 461:552 */ EventExecutor executor = executor();\r\n/* 462:553 */ if (executor.inEventLoop())\r\n/* 463: */ {\r\n/* 464:554 */ InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get();\r\n/* 465:555 */ int stackDepth = threadLocals.futureListenerStackDepth();\r\n/* 466:556 */ if (stackDepth < 8)\r\n/* 467: */ {\r\n/* 468:557 */ threadLocals.setFutureListenerStackDepth(stackDepth + 1);\r\n/* 469: */ try\r\n/* 470: */ {\r\n/* 471:559 */ if ((listeners instanceof DefaultFutureListeners))\r\n/* 472: */ {\r\n/* 473:560 */ notifyListeners0(this, (DefaultFutureListeners)listeners);\r\n/* 474: */ }\r\n/* 475: */ else\r\n/* 476: */ {\r\n/* 477:563 */ GenericFutureListener<? extends Future<V>> l = (GenericFutureListener)listeners;\r\n/* 478: */ \r\n/* 479:565 */ notifyListener0(this, l);\r\n/* 480: */ }\r\n/* 481: */ }\r\n/* 482: */ finally\r\n/* 483: */ {\r\n/* 484:568 */ this.listeners = null;\r\n/* 485:569 */ threadLocals.setFutureListenerStackDepth(stackDepth);\r\n/* 486: */ }\r\n/* 487:571 */ return;\r\n/* 488: */ }\r\n/* 489: */ }\r\n/* 490:575 */ if ((listeners instanceof DefaultFutureListeners))\r\n/* 491: */ {\r\n/* 492:576 */ final DefaultFutureListeners dfl = (DefaultFutureListeners)listeners;\r\n/* 493:577 */ execute(executor, new Runnable()\r\n/* 494: */ {\r\n/* 495: */ public void run()\r\n/* 496: */ {\r\n/* 497:580 */ DefaultPromise.notifyListeners0(DefaultPromise.this, dfl);\r\n/* 498:581 */ DefaultPromise.this.listeners = null;\r\n/* 499: */ }\r\n/* 500: */ });\r\n/* 501: */ }\r\n/* 502: */ else\r\n/* 503: */ {\r\n/* 504:586 */ final GenericFutureListener<? extends Future<V>> l = (GenericFutureListener)listeners;\r\n/* 505: */ \r\n/* 506:588 */ execute(executor, new Runnable()\r\n/* 507: */ {\r\n/* 508: */ public void run()\r\n/* 509: */ {\r\n/* 510:591 */ DefaultPromise.notifyListener0(DefaultPromise.this, l);\r\n/* 511:592 */ DefaultPromise.this.listeners = null;\r\n/* 512: */ }\r\n/* 513: */ });\r\n/* 514: */ }\r\n/* 515: */ }", "private void notifyListeners() \n\t{\n\t\tSystem.out.println(\"Event Source: Notifying all listeners\");\n\n\t\tfor(IListener listener : listeners)\n\t\t{\n\t\t\tlistener.eventOccured(new Event(this));//passing and object of source\n\t\t}\n\n\t}", "public void startListener(){\n new Thread(() -> this.run()).start();\n }", "@Override\n\tpublic void run() {\n\t\twhile(true){\n \tlock.lock();\n \ttry{\n\t \tif(observers.isEmpty()){\n\t \t\treturn;\n\t \t}\n \t}\n \tfinally{\n \t\tlock.unlock();\n \t}\n }\n\t}", "@Override\n\tpublic void run() {\n try {\n while (true) {\n Socket socket = listener.accept();\n try {\n \t\n\t\t\t\t\tDataInputStream in = new DataInputStream(\n\t\t\t\t\t\t\tsocket.getInputStream());\n\t\t\t\t\tBufferedReader d = new BufferedReader(\n\t\t\t\t\t\t\tnew InputStreamReader(in));\n\n\t\t\t\t\tString msg = d.readLine();\n\t\t\t\t\t\n third.notifyAllClients(msg);\n \n d.close();\n in.close();\n } finally {\n socket.close();\n }\n }\n } catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n finally {\n try {\n\t\t\t\tlistener.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n\t}", "@SuppressWarnings(\"squid:S3776\") // complexity\r\n\tpublic final void unblock() {\r\n\t\tArrayList<Runnable> listeners;\r\n\t\tsynchronized (this) {\r\n\t\t\tif (unblocked) return;\r\n\t\t\tunblocked = true;\r\n\t\t\tif (listenersInline == null) {\r\n\t\t\t\tthis.notifyAll();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tlisteners = listenersInline;\r\n\t\t\tlistenersInline = new ArrayList<>(2);\r\n\t\t}\r\n\t\tLogger log = Threading.getLogger();\r\n\t\tdo {\r\n\t\t\tif (!log.debug())\r\n\t\t\t\tfor (int i = 0; i < listeners.size(); ++i)\r\n\t\t\t\t\ttry { listeners.get(i).run(); }\r\n\t\t\t\t\tcatch (Exception t) { logListenerError(log, listeners.get(i), t); }\r\n\t\t\telse\r\n\t\t\t\tfor (int i = 0; i < listeners.size(); ++i) {\r\n\t\t\t\t\tRunnable listener = listeners.get(i);\r\n\t\t\t\t\tlong start = System.nanoTime();\r\n\t\t\t\t\ttry { listener.run(); }\r\n\t\t\t\t\tcatch (Exception t) { logListenerError(log, listener, t); }\r\n\t\t\t\t\tThreading.debugListenerCall(listener, System.nanoTime() - start);\r\n\t\t\t\t}\r\n\t\t\tsynchronized (this) {\r\n\t\t\t\tif (listenersInline == null || listenersInline.isEmpty()) {\r\n\t\t\t\t\tlistenersInline = null;\r\n\t\t\t\t\tlisteners = null;\r\n\t\t\t\t\tthis.notifyAll();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlisteners.clear();\r\n\t\t\t\t\tArrayList<Runnable> tmp = listeners;\r\n\t\t\t\t\tlisteners = listenersInline;\r\n\t\t\t\t\tlistenersInline = tmp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} while (listeners != null);\r\n\t}", "private static void notifyListeners0(Future<?> future, DefaultFutureListeners listeners)\r\n/* 518: */ {\r\n/* 519:599 */ GenericFutureListener<?>[] a = listeners.listeners();\r\n/* 520:600 */ int size = listeners.size();\r\n/* 521:601 */ for (int i = 0; i < size; i++) {\r\n/* 522:602 */ notifyListener0(future, a[i]);\r\n/* 523: */ }\r\n/* 524: */ }", "private void notifyListeners() {\n for (SerialConnectionReadyListener listener : listeners) {\n listener.SerialConnectionReady(this);\n }\n }", "public void notifyListeners() {\n Logger logger = LogX;\n logger.d(\"notifyListeners: \" + this.mListeners.size(), false);\n List<IWalletCardBaseInfo> tmpCardInfo = getCardInfo();\n Iterator<OnDataReadyListener> it = this.mListeners.iterator();\n while (it.hasNext()) {\n it.next().refreshData(tmpCardInfo);\n }\n }", "private void notifyListeners() {\n\t\tfor(ModelListener l:listeners) {\n\t\t\tl.update();\t// Tell the listener that something changed\n\t\t}\n\t}", "private void sync() throws Exception {\n final Synchronizer synchronizer = new Synchronizer();\n\n final long start = System.nanoTime();\n synchronizer.synchronize(caller, listener);\n final long stop = System.nanoTime();\n Duration syncDuration = Duration.ofNanos(stop - start);\n\n caller.drainReceivedEventQueue();\n listener.drainReceivedEventQueue();\n\n System.out.printf(\n \"Synced %d events in %d ms%n\",\n caller.getReceivedEvents().size() + listener.getReceivedEvents().size(), syncDuration.toMillis());\n }", "public void resetListeners() {\n\t\tfinal ListenerSupport<AgentShutDownListener> backup = new ListenerSupport<>();\n\n\t\tgetListeners().apply(backup::add);\n\n\t\tbackup.apply(listener -> {\n\t\t\tgetListeners().remove(listener);\n\t\t});\n\t}", "private synchronized static Map getListeners() {\n\t\tif (registeredListeners == null) {\n\t\t\tregisteredListeners = Collections.synchronizedMap(new HashMap());\n\t\t}\n\t\treturn registeredListeners;\n\t}", "public void removeAllListener() {\r\n listeners.clear();\r\n }", "private static void informListeners() {\r\n\t\tfor (ATEListener l : listeners) {\r\n\t\t\tl.classListChanged( );\r\n\t\t}\r\n\t}", "private RRCPConnectionListener() {\n mainThread = new Thread(this);\n }", "public static void clean() {\n keptObservers.put(new Object(), new ArrayList<Runnable>());\n }", "public void clearTaskListeners(){\n if (listeners == null) return;\n listeners.clear();\n }", "private void setListeners() {\n\n }", "private void onPeersCleared()\n {\n for (PeerListener listener : getListeners()) {\n listener.onPeersCleared();\n }\n }", "private final void fire(HashSet<Consumer<SpanNode<T>>> listeners){\n for (Consumer<SpanNode<T>> listener: listeners) listener.accept(this);\n }", "public synchronized List<EventListener> getListeners() {\n \treturn listeners;\n }", "@Override\n\tpublic void run() {\n\t\tLog.i(\"here\",\"listener\");\n\t\twhile(true){\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif((cs=s.accept())!=null)new Thread(new Worker(context,cs)).start();\n\t\t\t\t\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\t\t\t\n\t\t}\n }", "public void run() {\n\t\tfor (ConConsumer consumer : _consumers) {\n\t\t\tconsumer.register();\n\t\t}\n\t\t// commit the channels <\n\t\t// wait for the tasks finish >\n\t\t_monitor.checkFinish();\n\t\t// wait for the tasks finish <\n\t\t_threadPool.shutdown();\n\t}", "public void run()\n {\n CallerContextManager ccm = (CallerContextManager) ManagerManager.getInstance(CallerContextManager.class);\n CallerContext cc = ccm.getCurrentContext();\n CCData data = getCCData(cc);\n if ((data != null) && (data.listeners != null)) data.listeners.notifyChange(event);\n }", "@Override\n protected void runInListenerThread(Runnable runnable) {\n runnable.run();\n }", "private void notifyListenersSkyModelUpdate(SkyModelUpdate status) {\n\t\tif (!deleteListeners.isEmpty()) {\n\t\t\tfor (int id = 0; id < deleteListeners.size(); id++) {\n\t\t\t\tSkyModelUpdateListener l = deleteListeners.get(id);\n\t\t\t\tif (listeners.contains(l)) {\n\t\t\t\t\tlisteners.remove(l);\n\t\t\t\t\tslogger.create().info().level(2).msg(\"Removing listener \" + l).send();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add new listeners\n\t\tif (!addListeners.isEmpty()) {\n\t\t\tfor (int ia = 0; ia < addListeners.size(); ia++) {\n\t\t\t\tSkyModelUpdateListener l = addListeners.get(ia);\n\t\t\t\tif (!listeners.contains(l)) {\n\t\t\t\t\tlisteners.add(l);\n\t\t\t\t\tslogger.create().info().level(2).msg(\"Adding new listener \" + l).send();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// broadcast\n\t\tfor (int il = 0; il < listeners.size(); il++) {\n\t\t\tSkyModelUpdateListener l = null;\n\t\t\ttry {\n\t\t\t\tl = listeners.get(il);\n\t\t\t\tif (status instanceof SkyModelSeeingUpdate) {\n\t\t\t\t\tSkyModelSeeingUpdate seeing = (SkyModelSeeingUpdate) status;\n\t\t\t\t\tl.seeingUpdated(seeing.getStatusTimeStamp(), seeing.getRawSeeing(), seeing.getCorrectedSeeing(),\n\t\t\t\t\t\t\tseeing.getPredictedSeeing(), seeing.getElevation(), seeing.getAzimuth(),\n\t\t\t\t\t\t\tseeing.getWavelength(), seeing.isStandard(), seeing.getSource(), seeing.getTargetName());\n\t\t\t\t} else if (status instanceof SkyModelExtinctionUpdate) {\n\t\t\t\t\tSkyModelExtinctionUpdate photom = (SkyModelExtinctionUpdate) status;\n\t\t\t\t\tl.extinctionUpdated(photom.getStatusTimeStamp(), photom.getExtinction());\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tif (l != null) {\n\t\t\t\t\tdeleteListeners.add(l);\n\t\t\t\t\tslogger.create().info().level(2).msg(\"Adding unresponsive listener: \" + l + \" to kill list\").send();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public synchronized void clearNetworkListener() {\r\n\t\tlistener.clear();\r\n\t}", "static //@Override\n\tpublic void addListener(final Listener listener) {\n\t\tif (null == stListeners) {\n\t\t\tstListeners = new LinkedList<>();\n\t\t}\n\t\tstListeners.add(listener);\n\t}", "public void notifyAllObservers() {\n\t\tfor(Observer observer : observers) {\n\t\t\tobserver.update();\n\t\t}\n\t}", "protected void attachListeners() {\n\t\t\n\t}", "void notifyAllAboutChange();", "protected void notifyChangeListeners() { \n Utilities.invokeLater(new Runnable() {\n public void run() { for(ChangeListener l: _changeListeners) l.apply(this); }\n });\n }", "public boolean notifyListeners(DataEvent<DataElementType> event) {\n try {\n if (null == listenerHashSet) {\n return false;\n }\n Iterator iter = listenerHashSet.iterator();\n ArrayList<Thread> thread_list = new ArrayList<>(listenerHashSet.size());\n while (iter.hasNext()) {\n SensorDataListener<DataElementType> listener =\n (SensorDataListener<DataElementType>) iter.next();\n Runnable task = () -> {\n try {\n listener.SensorDataEvent(event);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n };\n Thread t = new Thread(task);\n t.start();\n thread_list.add(t);\n\n }\n\n for(Thread t:thread_list){\n t.join();\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n\n return true;\n }", "protected void updateAll() {\n for (String key : listenerMap.keySet()) {\n updateValueForKey(key, true);\n }\n }", "protected void notifyStart(\n )\n {\n for(IListener listener : listeners)\n {listener.onStart(this);}\n }", "void registerListeners();", "public ThreadedListenerManager(ExecutorService pool) {\n\t\tmanagerNumber = MANAGER_COUNT.getAndIncrement();\n\t\tthis.pool = pool;\n\t}", "protected void detachListeners() {\n\t\t\n\t}", "protected void notifyListeners(CacheEvent e) {\n synchronized (listeners) {\n for (int i=0; i<listeners.size(); i++) {\n CacheListener l = (CacheListener) listeners.elementAt(i);\n l.cacheUpdated(e);\n }\n }\n }", "public List<String> listeners();", "private void notifyEventListListeners() {\n this.eventListListeners.forEach(listener -> listener.onEventListChange(this.getEventList()));\n }", "public void enable() {\n for (int i = 0; i < listeners.size(); i++) {\n CacheManagerListener listener = (CacheManagerListener) \n listeners.get(i);\n listener.cacheManagerEnabled();\n }\n }", "@Override\n\tpublic void run() {\n\t\tL = new Listener(this.port);\n\t\tthis.listener = new Thread(L);\n\t\tthis.listener.start();\n\n\t\twhile (true) {\n\t\t\twhile (this.workQueue.isEmpty()) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(10);\n\t\t\t\t} catch (InterruptedException 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\tClientRequest req = this.workQueue.poll();\n\t\t\tif (req.getType() == ClientRequestType.START) {\n\t\t\t\tsynchronized (nextWorkerLock) {\n\t\t\t\t\tthis.workers[this.nextWorker++].sendToWorker(req);\n\t\t\t\t\tthis.nextWorker %= this.workers.length;\n\t\t\t\t}\n\t\t\t} else if (req.getType() == ClientRequestType.KILLALL) {\n\t\t\t\tfor (WorkerInfo wi : workers) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\twi.sendControlMessage(new ProcessControlMessage(0,\n\t\t\t\t\t\t\t\tProcessControlCommand.KILLALL, \"\"));\n\t\t\t\t\t\tSystem.out.println(\"Killed one\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tSystem.exit(0);\n\t\t\t} else {\n\t\t\t\tpidsToWorkers.get(req.getProcessId()).sendToWorker(req);\n\t\t\t}\n\t\t}\n\t}", "public void removeListeners() {\n if ( listeners != null ) {\n listeners.clear();\n }\n }", "public void run() {\n // Create a socket to wait for clients.\n try {\n //Set up all the security needed to run an SSLServerSocket for clients to connect to.\n SSLContext context = SSLContext.getInstance(\"TLS\");\n KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(\"SunX509\");\n KeyStore keyStore = KeyStore.getInstance(\"JKS\");\n\n keyStore.load(new FileInputStream(\"./keystore.txt\"), \"storepass\".toCharArray());\n keyManagerFactory.init(keyStore, \"keypass\".toCharArray());\n context.init(keyManagerFactory.getKeyManagers(), null, null);\n\n SSLServerSocketFactory factory = context.getServerSocketFactory();\n SSLServerSocket sslServerSocket = (SSLServerSocket) factory.createServerSocket(conf.SERVER_PORT);\n threads = new HashSet<>();\n\n while (true) {\n //Just keep running until the end of times (or until you're stopped.)\n // Wait for an incoming client-connection request (blocking).\n SSLSocket socket = (SSLSocket) sslServerSocket.accept();\n\n // When a new connection has been established, start a new thread.\n ClientThreadPC ct = new ClientThreadPC(this, socket);\n threads.add(ct);\n new Thread(ct).start();\n System.out.println(\"Num clients: \" + threads.size());\n\n // Simulate lost connections if configured.\n if (conf.doSimulateConnectionLost()) {\n DropClientThread dct = new DropClientThread(ct);\n new Thread(dct).start();\n }\n }\n } catch (IOException | KeyManagementException | KeyStoreException | UnrecoverableKeyException |\n NoSuchAlgorithmException | CertificateException e) {\n e.printStackTrace();\n }\n }", "private void notifyBoardChanged() {\n if(this.boardChangeListenerList == null || this.boardChangeListenerList.isEmpty()) return;\n\n // yes - there are - create a thread and inform them\n (new Thread(new Runnable() {\n @Override\n public void run() {\n for(LocalBoardChangedListener listener : SchiffeVersenkenImpl.this.boardChangeListenerList) {\n listener.changed();\n }\n }\n })).start();\n }", "@Override\n public void run() {\n while (running) {\n try {\n Transaction completedTransaction = pendingUpdates.poll(100, TimeUnit.MINUTES);\n if (completedTransaction == null) {\n continue;\n }\n\n subscribers.forEach(user -> {\n try {\n Socket socket = new Socket(user.getUrl(), (int)(user.getId() + 1024));\n PrintWriter out = new PrintWriter(socket.getOutputStream(), true);\n out.print(MAPPER.writeValueAsString(completedTransaction));\n out.flush();\n System.out.println(\"SENT VALUE: \" + MAPPER.writeValueAsString(completedTransaction));\n socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n\tpublic void run() {\n\n\t\treceiveClients();\n\n\t\tbeginLogging();\n\t}", "synchronized public void addClientListener(ClientListener l)\n {\n \t\tif (listeners == null)\n \t\tlisteners = new ArrayList<ClientListener>();\n \t\tlisteners.add(l);\n }", "public Iterator<Object> listeners() {\n return Arrays.asList(fListeners).iterator();\n }", "public void run()\n {\n parentProvider.getConnection()\n .removeAsyncStanzaListener(this);\n\n // init ssList\n ssContactList.init(contactChangesListener);\n\n // as we have dispatched the contact list and Roster is ready\n // lets start the jingle nodes discovery\n parentProvider.startJingleNodesDiscovery();\n }", "private void delegateTasks() {\n logger.debug(\"task delegation started\");\n\n untilTasksAndThreadsAreAvailable:\n while (true) {\n Optional<Node> selectedNode;\n Optional<WorkerPoolTask> task = workerPool.pollTask();\n\n if (!task.isPresent()) {\n while (true) {\n State prevState = state.get();\n State nextState;\n if (prevState == DURING_DELEGATION) {\n // No more tasks and free threads appeared\n nextState = NO_DELEGATION;\n } else {\n //prevState == DURING_DELEGATION_WITH_SCHEDULED_RE_EXECUTION\n nextState = DURING_DELEGATION;\n }\n if (state.compareAndSet(prevState, nextState)) {\n logger.debug(\"changed from \" + prevState + \" to \" + nextState);\n if (prevState == DURING_DELEGATION) {\n return;\n } else {\n //prevState == DURING_DELEGATION_WITH_SCHEDULED_RE_EXECUTION\n continue untilTasksAndThreadsAreAvailable;\n }\n }\n logger.debug(\"state change missed in delegateTasks when task wasn't present\");\n }\n }\n\n synchronized (nodes) { // Synchronization with HeartBeat nodes.updateAfterHeartBeat method.\n selectedNode = nodes.drainThreadFromNodeHavingHighestPriority();\n if (!selectedNode.isPresent()) {\n workerPool.submitTask(task.get(), true);\n State nextState = AWAITING_FREE_THREADS;\n State prevState = state.getAndSet(nextState);\n logger.debug(\"changed from \" + prevState + \" to \" + nextState);\n return;\n }\n }\n\n if (!delegateTask(selectedNode.get(), task.get())) {\n //If delegation failed we release the thread to keep proper number of free threads up-to-date\n //If HeartBeat happened between draining a thread and returning it, this operation will take no effect\n //as we are working on invalidated version of node.\n nodes.returnThread(selectedNode.get());\n }\n }\n }", "public void notifyObservers(){\r\n\t\tif (this.lastNews != null)\r\n\t\t\tfor (Observer ob: observers){\r\n\t\t\t\tob.updateFromLobby(lastNews);\r\n\t\t\t}\r\n\t}", "public void removeAll() {\n\t\tmListenerSet.clear();\n\t}", "public void joinAll() {\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tif (this.get(i).getClient() != null) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.get(i).join();\n\t\t\t\t\tSystem.out.println(\"Thread \" + i + \" wurde beendet!\");\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tthis.get(i).interrupt();\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void triggerBlockListeners() {\r\n \tfor(IStopBlockListener listener : blockListeners){\r\n \t\tlistener.onStoppedBlock();\r\n \t}\r\n }", "public void addListener( RemoteFileIOListener passedListener ) {\n if(passedListener != null){\n\n synchronized(theTaskListeners){\n if(!theTaskListeners.contains(passedListener)){\n theTaskListeners.add(passedListener);\n }\n }\n }\n }", "private void notifyListeners(RestState state) {\n\t\tfor (RestStateChangeListener l : listener) {\n\t\t\tl.onStateChangedEvent(state);\n\t\t}\n\t}", "@Override\n public void run()\n {\n lock = new Lock();\n messenger = new Messenger(notifier);\n clientList = new ClientList(notifier, messenger, connectionLimit);\n publisher = new Publisher(lock, clientList);\n\n try\n {\n notifier.sendToConsole(\"Server Started\");\n LOGGER.info(\"Server Started\");\n\n // Set up networking\n socketFactory = (SSLServerSocketFactory) SSLServerSocketFactory\n .getDefault();\n serverSocket = (SSLServerSocket) socketFactory\n .createServerSocket(port);\n serverSocket.setEnabledCipherSuites(enabledCipherSuites);\n\n int idCounter = 1;\n\n // Now repeatedly listen for connections\n while (true)\n {\n // Blocks whilst waiting for an incoming connection\n socket = (SSLSocket) serverSocket.accept();\n\n conn = new ClientConnection(socket, idCounter, notifier, lock,\n publisher, clientList, password);\n new Thread((Runnable) conn).start();\n\n LOGGER.info(\"Someone connected: \" + idCounter);\n idCounter++;\n }\n\n } catch (final SocketException e)\n {\n LOGGER.severe(\"Socket Exception: Server closed?\");\n notifier.sendToConsole(\"Server Stopped\");\n } catch (final IOException e)\n {\n LOGGER.severe(e.getMessage());\n notifier.sendError(e);\n } finally\n {\n kill();\n }\n }", "protected void notifyWorkflowStatusListeners() {\n\t\tfor (WorkflowStatusListener listener : workflowStatusListeners) {\n\t\t\tlistener.workflowStatusChanged(this);\n\t\t}\n\t}", "public synchronized void addEventListener(IEventListener listener){\r\n\t\twhile (isBlocked) {\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t\tif (!listeners.contains(listener))\r\n\t\t\tlisteners.add(listener);\r\n\t}", "private void onAccess() {\n ctx.itHolder().checkWeakQueue();\n\n checkRemoved();\n }", "public void notifyListener() {\n\t\tbuffer.putInt(1);\n\t\tbuffer.flip();\n\t\tsocketLock.lock();\n\t\ttry {\n\t\t\tnotifyChannel.write(buffer);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"[Turing Server] Non è stato possibile notificare il client.\");\n\t\t}\n\t\tsocketLock.unlock();\n\t\tbuffer.clear();\n\t}", "@Override\n public void addListener(Runnable runnable, Executor executor) {\n checkNotNull(runnable, \"Runnable was null\");\n checkNotNull(executor, \"Executor was null\");\n\n Listener oldHead = listeners.get();\n if (oldHead != Listener.TOMBSTONE) {\n Listener newHead = new Listener(runnable, executor);\n do {\n newHead.next = oldHead;\n if (listeners.compareAndSet(oldHead, newHead)) {\n return;\n }\n oldHead = listeners.get();\n } while (oldHead != Listener.TOMBSTONE);\n }\n\n // Maybe handle RuntimeExceptions eventually.\n executor.execute(runnable);\n }", "@Override\n\tpublic void removeAllListener() {\n\t\tLog.d(\"HFModuleManager\", \"removeAllListener\");\n\t\tthis.eventListenerList.clear();\n\t}", "Move listen(IListener ll);", "public void removeAllListeners() {\n die();\n }", "default void dispatchConsumers() {\n\t\tthis.getItemListeners().forEach(Runnable::run);\n\t}", "@Override\r\n\tprotected void setListeners() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tsuper.run();\n\t\t\tThread thisThread = currentThread();\n\t\t\ttry {\n\t\t\t\tLog.i(\"con\", \"worked3\");\n\t\t\t\tconnectToServer();\n\t\t\t\tif (connected) {\n\t\t\t\t\tsetUpStreams();\n\t\t\t\t\tsendProfile();\n\t\t\t\t\tLog.i(\"con\", \"worked8\");\n\t\t\t\t\twhile (blinker == thisThread) {\n\t\t\t\t\t\tstartListening();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tLog.e(\"cl\", \"Found IO Exception!: \" + e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tLog.e(\"cl\", \"Found class not found exception!: \" + e);\n\t\t\t}\n\n\t\t}", "public ArrayList getTaskListeners(){\n initListener();\n return listeners;\n }", "void subscribeToEvents(Listener listener);", "ListenerThreads(Process chimera, Chimera chimeraObject, CyLogger logger) {\n\t\tthis.chimera = chimera;\n\t\tthis.chimeraObject = chimeraObject;\n\t\tthis.logger = logger;\n\t\treplyLog = new HashMap<String, List<String>>();\n \t \t// Get a line-oriented reader\n \treadChan = chimera.getInputStream();\n\t\tlineReader = new BufferedReader(new InputStreamReader(readChan));\n\t}", "private void listen() {\n doneSignal.reset();\n mouseListener.startListening();\n\n try { doneSignal.await(); }\n catch (InterruptedException ex) { }\n catch (BrokenBarrierException ex) { }\n\n execute(mouseListener.getLastX(), mouseListener.getLastY());\n }", "@Stop(priority = 99)\n void stop() {\n for (List<ListenerInvocation> list : listenersMap.values()) {\n if (list != null) list.clear();\n }\n\n if (syncProcessor != null) syncProcessor.shutdownNow();\n }", "public void notifyObservers() {}", "public void run(){\n\t\t\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\tSocket s = listener.accept();\n\t\t\t\tnew ServerConnection(chatServ, s).start();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn; // stop listening\n\t\t\t}\n\t\t}\n\t}", "public void removeAllListeners() {\r\n\t\tgetListeners().removeAllListeners();\r\n\t}", "@Override\r\n\tprotected void listeners() {\n\t\t\r\n\t}", "@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private Set<Runnable> getConfDirListeners(final String confDir) {\n assert Thread.holdsLock(confDirectoryListeners) : \"confDirListeners lock not held by thread\";\n Set<Runnable> confDirListeners = confDirectoryListeners.get(confDir);\n if (confDirListeners == null) {\n log.debug(\"watch zkdir {}\", confDir);\n confDirListeners = new HashSet<>();\n confDirectoryListeners.put(confDir, confDirListeners);\n setConfWatcher(confDir, new WatcherImpl(confDir), null);\n }\n return confDirListeners;\n }", "@Override\n public void run() {\n synchronized(_registries) {\n _udpServer.bcast(resp, _registries);\n }\n\n // Update each of the registration lists to remove outdated listeners\n updateRegistrations(_poseListeners);\n updateRegistrations(_imageListeners);\n updateRegistrations(_cameraListeners);\n updateRegistrations(_velocityListeners);\n updateRegistrations(_waypointListeners);\n synchronized(_sensorListeners) {\n for (Map<SocketAddress, Integer> sensorListener : _sensorListeners.values())\n updateRegistrations(sensorListener);\n }\n }", "protected void notifyListeners() {\n // TODO could these be done earlier (or just once?)\n JMeterContext threadContext = getThreadContext();\n JMeterVariables threadVars = threadContext.getVariables();\n SamplePackage pack = (SamplePackage) threadVars.getObject(JMeterThread.PACKAGE_OBJECT);\n if (pack == null) {\n // If child of TransactionController is a ThroughputController and TPC does\n // not sample its children, then we will have this\n // TODO Should this be at warn level ?\n log.warn(\"Could not fetch SamplePackage\");\n } else {\n SampleEvent event = new SampleEvent(res, threadContext.getThreadGroup().getName(),threadVars, true);\n // We must set res to null now, before sending the event for the transaction,\n // so that we can ignore that event in our sampleOccured method\n res = null;\n- // bug 50032 \n- if (!getThreadContext().isReinitializingSubControllers()) {\n- lnf.notifyListeners(event, pack.getSampleListeners());\n- }\n+ lnf.notifyListeners(event, pack.getSampleListeners());\n }\n }", "void storeEvents()\n {\n this.storedPresences = new ArrayList<Presence>();\n this.storeEvents = true;\n }", "protected void started() {\n for(MinMaxListener listener : listeners) {\n listener.started();\n }\n }", "public void listen() throws IOException {\n listen(Thread.currentThread());\n }", "public void run() {\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\t/**\n\t\t\t\t * Sends notifications at timeout intervals every timeout\n\t\t\t\t */\n\t\t\t\tThread.sleep(NOTIFICATION_TIMEOUT);\n\n\t\t\t\t/** Do nothing if the session map is not initialized */\n\t\t\t\tif (EventWebSocketAdapter_R.sessions == null) {\n\t\t\t\t\tlogger.info(\"The sessions map is 'null ... do nothing.\\n\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlogger.info(\"The sessions map length is '%d'\\n\", EventWebSocketAdapter_R.sessions.size());\n\n\t\t\t\t/** Do nothing if there is no connection */\n\t\t\t\tif (EventWebSocketAdapter_R.sessions.size() == 0) {\n\t\t\t\t\tlogger.info(\"The sessions map length is '%d' ... do nothing.\\n\",\n\t\t\t\t\t\t\tEventWebSocketAdapter_R.sessions.size());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/** Sends notifications to all connected clients */\n\t\t\t\tfor (Map.Entry<Integer, Session> entry : EventWebSocketAdapter_R.sessions.entrySet()) {\n\t\t\t\t\tentry.getValue().getRemote().sendString(String.format(\"'%tT' from server '%s'\",\n\t\t\t\t\t\t\tCalendar.getInstance().getTime(), entry.getValue().getLocalAddress()));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Throwable T) {\n\t\t\t/** Trace error */\n\t\t\tlogger.catching(T);\n\t\t} finally {\n\t\t\t/** Trace info */\n\t\t\tlogger.info(String.format(\"Thread '%s' shutdown ... \\n\", Thread.currentThread().getName()));\n\t\t}\n\t}", "public void detachAllObservers();", "public void run()\n {\n try\n {\n logger.debug(\"Starting server-side thread\");\n while (active)\n {\n List<Node> nodesFromQuery = null;\n if (clients.size() > 0)\n {\n nodesFromQuery = BeanLocator.getRouterService().findNodesWithNumberOfMessages(routerId);\n logger.debug(\"Number of nodesFromQuery for this routerId :\" + routerId + \" is:\" + nodesFromQuery.size());\n\n for (Node node : nodesFromQuery)\n {\n // if node exists in map\n if (this.nodes.get(node.getId()) != null)\n {\n logger.debug(\"Node already in map\");\n // check if something has been updated on the node - using hashcode\n\n logger.debug(this.nodes.get(node.getId()).getNumberOfMessagesHandled().toString());\n logger.debug(node.getNumberOfMessagesHandled().toString());\n boolean hasNumberOfMessagesChanged = !this.nodes.get(node.getId()).getNumberOfMessagesHandled().equals(node.getNumberOfMessagesHandled());\n if (hasNumberOfMessagesChanged)\n {\n logger.debug(\"Fire update event..\");\n // if something has changed fire update event\n this.nodes.put(node.getId(), node);\n fireNodeUpdatedEvent(node);\n } else\n {\n // nothing changed - ignore and log\n logger.info(\"Nothing changed on node :\" + node.getId());\n }\n } else\n {\n // else if node does not exist store the node in the map\n logger.debug(\"Storing node in map\");\n this.nodes.put(node.getId(), node);\n fireNodeUpdatedEvent(node);\n }\n }\n } else\n {\n logger.info(\"Thread running but no registered clients\");\n }\n Thread.sleep(CALLBACK_INTERVALL);\n }\n logger.debug(\"Stopping server-side thread. Clearing nodes and clients.\");\n clients.clear();\n nodes.clear();\n }\n catch (InterruptedException ex)\n {\n logger.warn(\"Thread interrupted.\", ex);\n }\n }", "public void addListener(Listener l) {\n if (!listeners.contains(l)) {\n listeners.add(l);\n }\n }", "public void removeAllTuioListeners()\n\t{\n\t\tlistenerList.clear();\n\t}", "protected abstract void startListener();", "protected void removeListeners() {\n }", "public synchronized void start() {\n if (D) Log.d(TAG, \"start\");\n\n // Cancel any thread attempting to make a connection\n if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}\n\n // Cancel any thread currently running a connection\n if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}\n\n setState(STATE_LISTEN);\n }", "public void startWatching(){\n this.listWatcher.start();\n }" ]
[ "0.591322", "0.590361", "0.584275", "0.5773296", "0.5740795", "0.57107645", "0.5581765", "0.5563621", "0.5529067", "0.5527334", "0.5525213", "0.5517249", "0.54943943", "0.5486417", "0.54689574", "0.5408304", "0.535344", "0.5347301", "0.533574", "0.53259283", "0.53258675", "0.53255415", "0.53201264", "0.53182006", "0.53158164", "0.530975", "0.5294046", "0.5280504", "0.527327", "0.52623934", "0.52602744", "0.5235372", "0.51989114", "0.51937896", "0.5193244", "0.5186004", "0.5169605", "0.5149771", "0.5140213", "0.5139467", "0.5138018", "0.5131398", "0.5119391", "0.5112808", "0.5105406", "0.5092359", "0.50916237", "0.5083123", "0.5081555", "0.5072871", "0.50414014", "0.50347954", "0.5024679", "0.50181496", "0.50104815", "0.49996936", "0.49822915", "0.49713692", "0.49693578", "0.4964843", "0.49614933", "0.49542922", "0.49525878", "0.49488544", "0.49431276", "0.4932868", "0.4930869", "0.49190086", "0.4917257", "0.49106532", "0.4908937", "0.4907157", "0.490652", "0.49039653", "0.48985115", "0.4889649", "0.48878255", "0.48833138", "0.4877829", "0.48765728", "0.4873633", "0.48730865", "0.48659799", "0.48607945", "0.4859649", "0.4857019", "0.4856289", "0.48365474", "0.48303646", "0.4829697", "0.48267376", "0.48214775", "0.48075652", "0.48017204", "0.4795621", "0.47893858", "0.4785931", "0.47837132", "0.4778922", "0.47785673", "0.47718588" ]
0.0
-1
Updates the GUI depending on the state of the active debugger.
private void updateGui() { final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger(); final TargetProcessThread thread = debugger == null ? null : debugger.getProcessManager().getActiveThread(); final boolean connected = debugger != null && debugger.isConnected(); final boolean suspended = connected && thread != null; m_hexView.setEnabled(connected && suspended && m_provider.getDataLength() != 0); if (connected) { m_hexView.setDefinitionStatus(DefinitionStatus.DEFINED); } else { // m_hexView.setDefinitionStatus(DefinitionStatus.UNDEFINED); m_provider.setMemorySize(0); m_hexView.setBaseAddress(0); m_hexView.uncolorizeAll(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateGUIStatus() {\r\n\r\n }", "private void updateGUI() {\n\t\tsfrDlg.readSFRTableFromCPU();\n\t\tsourceCodeDlg.updateRowSelection(cpu.PC);\n\t\tsourceCodeDlg.getCyclesLabel().setText(\"Cycles count : \" + cpu.getCyclesCount());\n\t\tdataMemDlg.fillDataMemory();\n\t\t//ioPortsDlg.fillIOPorts();\t\t\n\t\tIterator iter = seg7DlgList.iterator();\n\t\twhile(iter.hasNext())\n\t\t\t((GUI_7SegDisplay)iter.next()).drawSeg();\n\t}", "public void switchToDebug() {\r\n\t\tdebugPane.addEditTabs(editTabs);\r\n\t\tlayout.show(this, \"debugPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "public void updateUI()\n\t{\n\t\tif( isRunning() == false) \n\t\t{\n\t\t\tupdateButton(\"Run\");\n\t\t\tbutton.setClickable(true);\n\t\t\tupdateTextView(Feedback.getMessage(Feedback.TYPE.NEW_TEST, null));\n\t\t}else\n\t\t{\n\t\t\tbutton.setClickable(true);\n\t\t\tupdateButton( \"Stop\" );\n\t\t\tupdateTextView(\"Tests are running.\");\n\n\t\t}\n\t}", "private synchronized void update() {\r\n\t\tIAdaptable adaptable = DebugUITools.getDebugContext();\r\n\t\tfTarget = null;\r\n\t\tfGDBTarget = null;\r\n\t\tif (adaptable != null) {\r\n\t\t\tIDebugElement element = (IDebugElement) adaptable.getAdapter(IDebugElement.class);\r\n\t\t\tif (element != null) {\r\n\t\t\t\tif (element.getModelIdentifier().equals(MDTDebugCorePlugin.ID_MDT_DEBUG_MODEL)) {\r\n\t\t\t\t\tif (element.getDebugTarget() instanceof MDTDebugTarget)\r\n\t\t\t\t\t\tfTarget = (MDTDebugTarget) element.getDebugTarget();\r\n\t\t\t\t\telse if (element.getDebugTarget() instanceof GDBDebugTarget)\r\n\t\t\t\t\t\tfGDBTarget = (GDBDebugTarget) element.getDebugTarget();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (adaptable instanceof GDBStackFrame) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tGDBStackFrame gdbStackFrame = (GDBStackFrame)adaptable;\r\n\t\t\t\t\tGDBThread gdbThread = (GDBThread)gdbStackFrame.getThread();\r\n\t\t\t\t\tgdbThread.setCurrentGDBStackFrame(gdbStackFrame);\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\tMDTDebugCorePlugin.log(null, e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (fTarget != null) {\r\n\t\t\tObject input = null;\r\n\t\t\tif (fTarget.isSuspended()) {\r\n\t\t\t input = fTarget;\r\n\t\t\t}\r\n\t\t\tgetViewer().setInput(input);\r\n\t\t\tfPushAction.setDebugTarget(fTarget);\r\n\t\t\tgetViewer().refresh();\r\n\t\t} else if (fGDBTarget != null) {\r\n\t\t\tObject input = null;\r\n\t\t\tif (fGDBTarget.isSuspended()) {\r\n\t\t\t input = fGDBTarget;\r\n\t\t\t}\r\n\t\t\tgetViewer().setInput(input);\r\n\t\t\tfPushAction.setGDBDebugTarget(fGDBTarget);\r\n\t\t\tgetViewer().refresh();\r\n\t\t}\r\n }", "public void update(){\n\t\tthis.setVisible(true);\n\t}", "public void update()\n {\n for (Container container : containers)\n container.update(false);\n\n Gui.update(BanksGUI.class);\n Gui.update(BankGUI.class);\n Gui.update(ItemsGroupsGUI.class);\n }", "public void updateUI(){}", "public void updateDigitalWindow() {\r\n\t\tif (this.digitalTabItem != null && !this.digitalTabItem.isDisposed()) {\r\n\t\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\t\tthis.digitalTabItem.update(true);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tDataExplorer.this.digitalTabItem.update(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}", "public void setDebug(boolean isDebug)\n {\n this.isDebug = isDebug;\n this.repaint();\n }", "private void setGUI()\r\n\t{\r\n\t\tbubblePB = setProgressBar(bubblePB);\r\n\t\tinsertionPB = setProgressBar(insertionPB);\r\n\t\tmergePB = setProgressBar(mergePB);\r\n\t\tquickPB = setProgressBar(quickPB);\r\n\t\tradixPB = setProgressBar(radixPB);\r\n\t\t\r\n\t\tsetLabels();\r\n\t\tsetPanel();\r\n\t\tsetLabels();\r\n\t\tsetFrame();\r\n\t}", "private void makeGUIVisible(){\n gameState = GameState.LOAD;\n notifyObservers();\n }", "public void updateUI(){\n\t\t\n\t\ttimeTV.setText(\"\"+String.format(\"\" + gameClock%10));\n\t\ttimeTV2.setText(\"\"+ gameClock/10+\".\");\n\t\tif (currentGameEngine!=null) {\n\t\t\tmultLeft.setText(\"multiplier: \"+currentGameEngine.getMultiplier()+\"X\");\n\t\t\tscoreTV.setText(\"\"+currentGameEngine.getScore());\n\t\t} else {\n\t\t\tscoreTV.setText(\"0\");\n\t\t}\n\n\t\t//errorTV.setText(\"\"+mFrameNum);\n\t\t\n\t\t\n\t}", "public void stateChanged() {\r\n if (nextBigStepButton != null) {\r\n nextBigStepButton.setEnabled(!automata.isAtEnd());\r\n }\r\n if (prevBigStepButton != null) {\r\n prevBigStepButton.setEnabled(!automata.isAtStart());\r\n }\r\n\r\n nextStepButton.setEnabled(!automata.isAtEnd());\r\n prevStepButton.setEnabled(!automata.isAtStart());\r\n restartButton.setEnabled(!automata.isAtStart());\r\n\r\n autoButton.setState(controller.getExecutionMode());\r\n autoButton.setEnabled(!automata.isAtEnd());\r\n }", "@Override\r\n public void updateUI() {\r\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tGraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();\n\t\tint width = gd.getDisplayMode().getWidth();\n\t\tint height = gd.getDisplayMode().getHeight();\n\t\tframe.setBounds(width / 3, height / 3, 461, 321);\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\ttextField = new JTextField();\n\t\ttextField.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString text = textField.getText();\n\t\t\t\ttextField.setText(\"\");\n\t\t\t\tif (text.trim().equalsIgnoreCase(\"devwindow\")) {\n\n\t\t\t\t\tDevWindow window = new DevWindow();\n\t\t\t\t\twindow.frame.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\ttextField.setBounds(10, 240, 430, 31);\n\t\tframe.getContentPane().add(textField);\n\n\t\tJLabel label = new JLabel();\n\t\tlabel.setText(\"Command Line (Dev Use Only)\");\n\t\tlabel.setFont(new Font(\"Microsoft Yi Baiti\", Font.PLAIN, 17));\n\t\tlabel.setBounds(10, 220, 204, 17);\n\t\tframe.getContentPane().add(label);\n\n\t\tOptionsController oc = new OptionsController();\n\n\t\tJSlider slider = new JSlider();\n\t\tslider.setBounds(10, 113, 430, 31);\n\t\tslider.setPaintTicks(true);\n\t\tslider.setMaximum(600);\n\t\tslider.setMinimum(1);\n\t\tslider.setValue(Integer.parseInt(oc.getProp().getProperty(\"refreshRate\")));\n\t\tframe.getContentPane().add(slider);\n\n\t\tJLabel lblBackgroundRefreshRate = new JLabel();\n\t\tlblBackgroundRefreshRate.setText(\"Background Refresh Rate\");\n\t\tlblBackgroundRefreshRate.setFont(new Font(\"Microsoft Yi Baiti\", Font.PLAIN, 17));\n\t\tlblBackgroundRefreshRate.setBounds(10, 91, 158, 17);\n\t\tframe.getContentPane().add(lblBackgroundRefreshRate);\n\n\t\tJSlider slider_1 = new JSlider();\n\t\tslider_1.setToolTipText(\"\");\n\t\tslider_1.setBounds(10, 30, 430, 33);\n\t\tslider_1.setMaximum(300);\n\t\tslider_1.setMinimum(1);\n\t\tslider_1.setValue(Integer.parseInt(oc.getProp().getProperty(\"messageFrequency\")));\n\t\tframe.getContentPane().add(slider_1);\n\n\t\tJLabel label_2 = new JLabel();\n\t\tlabel_2.setText(\"New Message Frequency\");\n\t\tlabel_2.setFont(new Font(\"Microsoft Yi Baiti\", Font.PLAIN, 17));\n\t\tlabel_2.setBounds(10, 11, 158, 17);\n\t\tframe.getContentPane().add(label_2);\n\n\t\tJLabel lblNewLabel = new JLabel(\"New label\");\n\t\tlblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\tlblNewLabel.setFont(new Font(\"Microsoft Yi Baiti\", Font.PLAIN, 17));\n\t\tlblNewLabel.setBounds(317, 54, 123, 25);\n\t\tlblNewLabel.setText(oc.getProp().getProperty(\"messageFrequency\") + \" minute(s)\");\n\n\t\tlblNewLabel.addPropertyChangeListener(new PropertyChangeListener() {\n\t\t\tpublic void propertyChange(PropertyChangeEvent arg0) {\n\n\t\t\t\toc.getProp().setProperty(\"messageFrequency\", lblNewLabel.getText().substring(0, 3).trim());\n\t\t\t\toc.saveProperties();\n\t\t\t}\n\t\t});\n\n\t\tframe.getContentPane().add(lblNewLabel);\n\n\t\tJLabel label_3 = new JLabel(\"115 second(s) or 1.92 minute(s)\");\n\t\tlabel_3.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\tlabel_3.setFont(new Font(\"Microsoft Yi Baiti\", Font.PLAIN, 17));\n\t\tlabel_3.setBounds(291, 155, 149, 25);\n\t\tframe.getContentPane().add(label_3);\n\n\t\tJLabel label_1 = new JLabel(oc.getProp().getProperty(\"refreshRate\"));\n\t\tlabel_1.setHorizontalAlignment(SwingConstants.RIGHT);\n\n\t\tlabel_1.setFont(new Font(\"Microsoft Yi Baiti\", Font.BOLD, 17));\n\t\tlabel_1.setBounds(291, 135, 149, 25);\n\t\tDecimalFormat df = new DecimalFormat(\"#.##\");\n\t\tlabel_1.setText(oc.getProp().getProperty(\"refreshRate\") + \" second(s)\");\n\t\tlabel_3.setText(\n\t\t\t\tdf.format(Long.parseLong(oc.getProp().getProperty(\"refreshRate\").trim()) / 60.0) + \" minute(s)\");\n\n\t\tlabel_1.addPropertyChangeListener(new PropertyChangeListener() {\n\t\t\tpublic void propertyChange(PropertyChangeEvent evt) {\n\n\t\t\t\toc.getProp().setProperty(\"refreshRate\", label_1.getText().substring(0, 4).trim());\n\t\t\t\toc.saveProperties();\n\t\t\t}\n\t\t});\n\n\t\tframe.getContentPane().add(label_1);\n\n\t\tJCheckBox chckbxNewCheckBox = new JCheckBox(\"Start On Start Up\");\n\t\tchckbxNewCheckBox.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t\tboolean selected = chckbxNewCheckBox.isSelected();\n\n\t\t\t\toc.getProp().setProperty(\"startOnStartUp\", Boolean.toString(selected));\n\t\t\t\toc.saveProperties();\n\n\t\t\t\tif (selected) {\n\n\t\t\t\t\tif (!StartUp.exists()) {\n\n\t\t\t\t\t\tStartUp.create();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\n\t\t\t\t\tStartUp.delete();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tchckbxNewCheckBox.setFont(new Font(\"Microsoft Yi Baiti\", Font.PLAIN, 15));\n\t\tchckbxNewCheckBox.setBounds(317, 186, 123, 23);\n\t\tchckbxNewCheckBox.setSelected(Boolean.valueOf(oc.getProp().getProperty(\"startOnStartUp\")));\n\t\tframe.getContentPane().add(chckbxNewCheckBox);\n\n\t\tJButton btnNewButton = new JButton(\"Exit Without Refresh\");\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setFont(new Font(\"Microsoft Yi Baiti\", Font.PLAIN, 15));\n\t\tbtnNewButton.setBounds(10, 156, 143, 23);\n\t\tframe.getContentPane().add(btnNewButton);\n\n\t\tJButton btnNewButton_1 = new JButton(\"Help\");\n\t\tbtnNewButton_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t\tInstructionWindow iWindow = new InstructionWindow();\n\t\t\t\tiWindow.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tbtnNewButton_1.setBounds(201, 186, 65, 23);\n\t\tframe.getContentPane().add(btnNewButton_1);\n\n\t\tJButton button = new JButton(\"Refresh Offline MBank\");\n\t\tbutton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t\t@SuppressWarnings(\"unused\")\n\t\t\t\tConnection conn = null;\n\t\t\t\tDatabaseController dbc = DatabaseController.getDBController();\n\t\t\t\tString connectString = dbc.buildConnectionString();\n\n\t\t\t\ttry {\n\t\t\t\t\tconn = DriverManager.getConnection(connectString);\n\t\t\t\t\toc.getProp().setProperty(\"offlineMode\", \"false\");\n\t\t\t\t\toc.saveProperties();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\tStringBuffer buf = new StringBuffer();\n\t\t\t\t\tbuf.append(\"There was a problem with the following connection string: \");\n\t\t\t\t\tbuf.append(connectString);\n\t\t\t\t\tbuf.append(\"\\n\\nHere is the exceptio:\\n\");\n\t\t\t\t\tbuf.append(e.toString());\n\t\t\t\t\tSystem.out.println(buf.toString());\n\t\t\t\t\ttry {\n\t\t\t\t\t\tRuntime.getRuntime()\n\t\t\t\t\t\t\t\t.exec(\"javaw -jar \\\"\" + System.getProperty(\"user.home\") + File.separator + \"Documents\"\n\t\t\t\t\t\t\t\t\t\t+ File.separator + \"SevMessageConfig\" + File.separator\n\t\t\t\t\t\t\t\t\t\t+ \"NowOfflineWindow.jar\\\"\");\n\t\t\t\t\t} catch (IOException e2) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep((long) 3000.0);\n\t\t\t\t\t} catch (InterruptedException e2) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te2.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tFile file = new File(System.getProperty(\"user.home\") + File.separator + \"Documents\" + File.separator\n\t\t\t\t\t\t+ \"SevMessageConfig\" + File.separator + \"offlineMessageBank.txt\");\n\t\t\t\tfile.delete();\n\n\t\t\t\tif (!StartUp.exists()) {\n\n\t\t\t\t\tStartUp.create();\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t\tbutton.setFont(new Font(\"Microsoft Yi Baiti\", Font.PLAIN, 15));\n\t\tbutton.setBounds(10, 186, 165, 23);\n\t\tframe.getContentPane().add(button);\n\n\t\tslider_1.addChangeListener(new ChangeListener() {\n\t\t\tpublic void stateChanged(ChangeEvent arg0) {\n\n\t\t\t\tlblNewLabel.setText(Integer.toString(slider_1.getValue()) + \" minute(s)\");\n\t\t\t}\n\t\t});\n\n\t\tslider.addChangeListener(new ChangeListener() {\n\t\t\tpublic void stateChanged(ChangeEvent arg0) {\n\t\t\t\tDecimalFormat df = new DecimalFormat(\"#.##\");\n\t\t\t\tlabel_1.setText(Integer.toString(slider.getValue()) + \" second(s)\");\n\t\t\t\tlabel_3.setText(df.format(Long.parseLong(oc.getProp().getProperty(\"refreshRate\").trim()) / 60.0)\n\t\t\t\t\t\t+ \" minute(s)\");\n\t\t\t}\n\t\t});\n\t}", "private void updateSetupGUI() {\n\t\tif (isLoggedIn == false) {\n\t\t\trestoreGameLabel.setVisible(false);\n\t\t\trestoreGameButton.setVisible(false);\n\t\t\tcreateAccountButton.setVisible(true);\n\t\t\tcreateAccountLabel.setVisible(true);\n\t\t\tseparator_1.setVisible(true);\n\t\t} else {\n\t\t\tcreateAccountButton.setVisible(false);\n\t\t\tcreateAccountLabel.setVisible(false);\n\t\t\tseparator_1.setVisible(false);\n\t\t\trestoreGameLabel.setVisible(true);\n\t\t\trestoreGameButton.setVisible(true);\n\t\t}\n\t}", "void gui(){\n _hasGUI = true;\n }", "private void updatePanels() // updatePanels method start\n\t{\n\t\tbalanceOutput.setText(log.balanceReport());\n\t\tlogOutput.setText(log.logReport());\n\t\tATBOutput.setText(log.adjustedTrialBalance());\n\t\tISOutput.setText(log.incomeStatement());\n\t\tRESOutput.setText(log.retainedEarningsStatement());\n\t\tBSOutput.setText(log.balanceSheet());\n\t}", "private void updateUi() {\n this.tabDetail.setDisable(false);\n this.lblDisplayName.setText(this.currentChild.getDisplayName());\n this.lblPersonalId.setText(String.format(\"(%s)\", this.currentChild.getPersonalId()));\n this.lblPrice.setText(String.format(\"%.2f\", this.currentChild.getPrice()));\n this.lblAge.setText(String.valueOf(this.currentChild.getAge()));\n this.dtBirthDate.setValue(this.currentChild\n .getBirthDate()\n .toInstant()\n .atZone(ZoneId.systemDefault())\n .toLocalDate());\n this.lblWeight.setText(String.format(\"%.1f kg\", this.currentChild.getWeight()));\n this.sldWeight.setValue(this.currentChild.getWeight());\n this.checkboxTrueRace.setSelected(!this.currentChild.isRace());\n this.imgChildProfile.setImage(this.currentChild.getAvatar());\n if (this.currentChild.getGender().equals(GenderType.MALE)){\n this.imgSex.setImage(FileUtils.loadImage(\"assets/image/gender/boy.png\"));\n this.lblSex.setText(\"Male\");\n }\n else {\n this.imgSex.setImage(FileUtils.loadImage(\"assets/image/gender/girl.png\"));\n this.lblSex.setText(\"Female\");\n }\n if (this.currentChild.isVirginity()){\n this.imgVirginity.setImage(FileUtils.loadImage(\"assets/image/virginity/virgin.png\"));\n this.lblVirginity.setText(\"Virgin\");\n }\n else {\n this.imgVirginity.setImage(FileUtils.loadImage(\"assets/image/virginity/not-virgin.png\"));\n this.lblVirginity.setText(\"Not Virgin\");\n }\n\n // TODO [assignment2] nastavit obrazek/avatar ditete v karte detailu\n // TODO [assignment2] nastavit spravny obrazek pohlavi v karte detailu\n // TODO [assignment2] nastavit spravny obrazek virginity atribut v v karte detailu\n }", "void debug() {\n this.renderer.debug = !this.renderer.debug;\n reload();\n }", "private StartDebuggingButton() {\r\n\t\t\tsetToolTipText(\"Start debugging the currently open tab\");\r\n\t\t\tsetBorder(FlowClient.EMPTY_BORDER);\r\n\t\t\ttry {\r\n\t\t\t\tsetIcon(new ImageIcon(ImageIO.read(ClassLoader.getSystemResource(\"images/debug.png\")).getScaledInstance(FlowClient.BUTTON_ICON_SIZE, FlowClient.BUTTON_ICON_SIZE, Image.SCALE_SMOOTH)));\r\n\t\t\t} catch (IOException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t\taddActionListener(new ActionListener() {\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t * Gets the currently active code and starts the debugging process\r\n\t\t\t\t */\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t\t// TODO Do some stuff to start debugging\r\n\t\t\t\t\tSystem.out.println(\"Debug button pressed!\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "public void GUISetup(){\n simTime.setText(\"50\");\n qMean.setText(\"24\");\n dMean.setText(\"45\");\n pMean.setText(\"55\");\n changeNorth.add(simTime2);\n changeNorth.add(simTime);\n changeNorth.add(pMean2);\n changeNorth.add(pMean);\n changeNorth.add(dMean2);\n changeNorth.add(dMean);\n changeNorth.add(qMean2);\n changeNorth.add(qMean);\n changeSouth.add(okay);\n \n resultDisplay.setEditable(false);\n descriptionDisplay.setEditable(false);\n \n changeFrame.add(changeNorth, BorderLayout.NORTH);\n changeFrame.add(changeSouth, BorderLayout.SOUTH);\n \n center.add(totalCus, BorderLayout.CENTER);\n center.add(doorCus, BorderLayout.CENTER);\n center.add(phoneCus, BorderLayout.CENTER);\n center.add(unhelped, BorderLayout.CENTER);\n\n help.add(programDescription);\n menuBar.add(help);\n north.add(menuBar);\n \n frame.setBounds(650, 400, 500, 200);\n changeFrame.setBounds(500, 400, 1100, 145);\n resultFrame.setBounds(500, 200, 600, 500);\n dFrame.setBounds(500, 200, 600, 500);\n frame.add(north, BorderLayout.NORTH);\n frame.add(south, BorderLayout.SOUTH);\n frame.add(center, BorderLayout.CENTER);\n frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n resultFrame.add(scroll);\n dFrame.add(dScroll);\n showDetails.setEnabled(false);\n \n south.add(runSim);\n south.add(showDetails);\n south.add(changeSimProp);\n \n time = simTime.getText();\n questionT = qMean.getText();\n phoneT = pMean.getText();\n doorT = dMean.getText();\n frame.setVisible(true);\n buttonFunctions();\n }", "@Override\n\tpublic void onToggled() {\n\t\tmc.ingameGUI.addChatMessage(\"gui toggled\");\n\t\tmc.displayGuiScreen(Mystic.getGui());\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\tFineModulationDisplay(FineModulation);\n\t\tAutoGreaseDisplay(AutoGrease);\n\t\tQuickcouplerDisplay(Quickcoupler);\n\t\tRideControlDisplay(RideControl);\n\t\tBeaconLampDisplay(BeaconLamp);\n\t\tMirrorHeatDisplay(MirrorHeat);\n//\t\tFNKeyDisplay(ParentActivity.LockEntertainment);\n\t}", "public void showGui()\n {\n // TODO\n }", "private void refreshScreen() {\n app.getMainMenu().getTextField().clear();\n for (int key = 0; key < 96; key++) {\n app.getWorkSpace().getGridCell(key).unhighlightGridCell();\n app.getWorkSpace().getGridCell(key).updateState(app);\n }\n Storage.getInstance().writeObject(\"workspace\", app.getWorkSpace().getWorkSpaceMap());\n app.show();\n }", "public static void showUI(DebugVirtualMachine vm) {\n System.out.println(\"==============Debug Mode============== (\\\"?\\\" for help)\");\n dvm = vm;\n displayXCode();\n //Start fetch-execute cycle\n while (dvm.isRunning()) {\n if(!stop){\n try {\n //Consol prompt\n System.out.print(\"('?' for help) ~>\");\n BufferedReader reader = new BufferedReader( new InputStreamReader( System.in ) );\n processRequest(reader.readLine().toLowerCase());\n } catch (IOException e) {\n System.out.println(\"Error in displayInterface(): \"+e);\n }\n }else{\n break;\n }\n }\n System.out.println(\"Thank you for using the .x Debugger!\\n===========End Execution============\");\n }", "private static void changeSettings() {\n\t\t\n\t\tfinal Settings sett = config;\n\t\t\n\t\tfinal JDialog settingsDialog = new JDialog(frame, \"Change settings\");\n\t\t\n\t\tsettingsDialog.getContentPane().setLayout(new BorderLayout());\n\t\tsettingsDialog.setPreferredSize(new Dimension(350,150));\n\t\t\n\t\tJPanel settings = new JPanel();\n\t\tsettings.setLayout(new GridLayout(3,2));\n\t\t\n\t\tJLabel lblDB = new JLabel(\"Update DB dynamically\");\n\t\tJRadioButton rbDB = new JRadioButton();\n\t\trbDB.setSelected(sett.isUpdateDB());\n\t\trbDB.addItemListener(new ItemListener(){\n\n\t\t\t@Override\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tif(e.getStateChange() == ItemEvent.SELECTED){\n\t\t\t\t\tsett.setUpdateDB(true);\n\t\t\t\t} else if(e.getStateChange() == ItemEvent.DESELECTED){\n\t\t\t\t\tsett.setUpdateDB(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t});\t\t\n\t\tJLabel lblGUI = new JLabel(\"Use Graphical User Interface\");\n\t\tJRadioButton rbGUI = new JRadioButton();\n\t\trbGUI.setSelected(sett.isGUI());\n\t\trbGUI.addItemListener(new ItemListener() {\n\n\t\t\t@Override\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tif(e.getStateChange() == ItemEvent.SELECTED){\n\t\t\t\t\tsett.setGUI(true);\n\t\t\t\t} else if(e.getStateChange() == ItemEvent.DESELECTED){\n\t\t\t\t\tsett.setGUI(false);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t});\n\t\t\n\t\tJLabel lblFile = new JLabel(\"Working file\");\n\t\tfinal JTextField tfFile = new JTextField(sett.getWorkingFile());\n\t\t\t\t\n\t\tsettings.add(lblDB);\n\t\tsettings.add(rbDB);\n\t\tsettings.add(lblGUI);\n\t\tsettings.add(rbGUI);\n\t\tsettings.add(lblFile);\n\t\tsettings.add(tfFile);\n\t\t\n\t\tJButton btnSave = new JButton(\"Save settings\");\n\t\tbtnSave.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tif(!saved) {\n\t\t \t\tint option = JOptionPane.showOptionDialog(frame,\n\t\t \t\t\t\t\"Updating the settings will reset the application\\nThere are unsaved changes\\nDo you want to save them now?\",\n\t\t \t\t\t\t\"Unsaved changes\",JOptionPane.YES_NO_CANCEL_OPTION,\n\t\t \t\t\t\tJOptionPane.WARNING_MESSAGE, null, null, 0);\n\t\t \t\tswitch(option) {\n\t\t \t\tcase 0:\n\t\t \t\t\ttoggleSaved(portfolio.save(WORKING_FILE));\n\t\t \t\tdefault:\n\t\t \t\t\tbreak; \t \t\t\n\t\t \t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsett.setWorkingFile(tfFile.getText());\n\t\t\t\t\n\t\t\t\tsett.save();\n\t\t\t\tconfig = new Settings(sett);\n\t\t\t\tsettingsDialog.dispose();\n\t\t\t\t\n\t\t\t\tif(!sett.isGUI()){\n\t\t\t\t\tframe.dispose();\n\t\t\t\t\texit = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!sett.isUpdateDB()){\n\t\t\t\t\tportfolio.init(config.getWorkingFile());\n\t\t\t\t\tframe.setTitle(\"JProject v.\"+VERSION);\n\t\t\t\t\tbtnRestore.setEnabled(true);\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tportfolio.initDB();\n\t\t\t\t\tframe.setTitle(\"JProject v.\"+VERSION+\" ** Linked to Database **\");\n\t\t\t\t\tbtnRestore.setEnabled(false);\n\t\t\t\t}\n\t\t\t\t\topTable.setModel((TableModel) new ProjectTableModel(portfolio.getOngoingProjects()));\n\t\t\t\t\tfpTable.setModel((TableModel) new ProjectTableModel(portfolio.getFinishedProjects()));\n\t\t\t\t\tsel.init(portfolio);\n\t\t\t\t\tupdateCounters();\n\t\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tsettingsDialog.add(settings, BorderLayout.CENTER);\n\t\tsettingsDialog.add(btnSave, BorderLayout.PAGE_END);\n\t\t\n\t\tsettingsDialog.pack();\n\t\tsettingsDialog.setVisible(true);\t\n\t}", "private void setupDebugger(){\n this.debuggerFrame = new JFrame();\n this.debuggerFrame.setSize(550, 275);\n this.debuggerFrame.add(PIDpanel);\n \n this.setInitialPIDValues(this.initPidValues);\n }", "@FXML\n private void updateGUI(){\n\n spriteImage.setImage(new Image(Main.gang.getCarSpriteURL()));\n\n // updating labels\n distanceLabel.setText(\"Travelled: \"+ Main.gang.getDistance() +\"Mi\");\n conditionsLabel.setText(\"Health Cond: \"+ Main.gang.getHealthConditions());\n daysLabel.setText(\"Days: \"+ Main.gang.getDays());\n\n if (Main.gang.isMoving()) {\n setOutBtn.setText(\"Speedup\");\n statusLabel.setText(\"Status: Moving\");\n } else {\n setOutBtn.setText(\"Set out\");\n statusLabel.setText(\"Status: Resting\");\n }\n }", "private void change() {\n\t\tsetChanged();\n\t\t//NotifyObservers calls on the update-method in the GUI\n\t\tnotifyObservers();\n\t}", "public void run() {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n\n createAndShowGUI();\n }", "private void simulatorChanged()\r\n\t{\r\n\t\tString simulator = acSimulator.getComponentText();\r\n\t\tboolean bValid = ( simulator.length() > 0 );\r\n\t\ttabbedPane.setEnabled(bValid);\r\n\t\tfscNetfile.setEnabled(bValid);\r\n\t\tfscOppFile.setEnabled( bValid && fscOppFile.hasFilter() );\r\n\t}", "protected void setCurrentState(State newState) {\n\n if (currentState == newState) {\n return;\n }\n\n currentState = checkNotNull(newState);\n\n display.setNewButtonEnabled(currentState.isNewButtonEnabled());\n display.setOpenButtonEnabled(currentState.isOpenButtonEnabled());\n display.setSaveButtonEnabled(currentState.isSaveButtonEnabled());\n display.setCopyButtonEnabled(currentState.isCopyButtonEnabled());\n display.setVersionsButtonEnabled(currentState.isVersionsButtonEnabled());\n display.setDeleteButtonEnabled(currentState.isDeleteButtonEnabled());\n display.setShareButtonEnabled(currentState.isShareButtonEnabled());\n display.setUndoButtonEnabled(currentState.isUndoButtonEnabled());\n display.setRedoButtonEnabled(currentState.isRedoButtonEnabled());\n display.setPrintButtonEnabled(currentState.isPrintButtonEnabled());\n display.setSimulateButtonEnabled(currentState.isSimulateButtonEnabled());\n display.setSimulateButtonDown(currentState.isSimulateButtonDown());\n\n display.setSchematicPanelEditable(currentState.isSchematicPanelEditable());\n\n display.clearPrintSettingsList();\n if (currentState.getPrintSettingsList() != null) {\n for (DownloadFormat item : currentState.getPrintSettingsList()) {\n display.addToPrintSettingsList(item.getExtension(), item);\n }\n }\n\n display.hideDialogs();\n if (currentState.isFileChooserVisible()) {\n display.clearFileList();\n if (currentState.getFileChooserList() != null) {\n for (Map.Entry<VersionMetadata, Optional<Image>> item : currentState.getFileChooserList().entrySet()) {\n display.addToFileList(item.getKey(), item.getValue().orNull());\n }\n }\n display.showFileChooserPanel();\n } else if (currentState.isVersionChooserVisible()) {\n display.clearVersionList();\n if (currentState.getVersionChooserList() != null) {\n for (VersionMetadata item : currentState.getVersionChooserList()) {\n display.addToVersionList(item);\n }\n }\n display.showVersionChooserPanel();\n } else if (currentState.isShareChooserVisible()) {\n display.showShareChooserPanel();\n display.setShareChooserFileVisibility(currentState.getShareChooserFileVisibility(),\n currentState.getShareChooserIsSimulate());\n }\n\n if (currentState.isDialogBackPaneVisible()) {\n display.showDialogBackPane();\n }\n\n if (currentState.doHidePanels()) {\n display.hidePanels();\n }\n if (currentState.isDevicePanelVisible()) {\n display.showDevicePanel();\n } else if (currentState.isGraphPanelVisible()) {\n display.showGraphPanel();\n }\n\n if (currentState.getURLState() != null) {\n currentState.getURLState().fire();\n }\n\n currentState.enter();\n }", "public void statusChanged() {\n\t\tif(!net.getArray().isEmpty()) {\n\t\t\tigraj.setEnabled(true);\n\t\t}else\n\t\t\tigraj.setEnabled(false);\n\t\t\n\t\tupdateKvota();\n\t\tupdateDobitak();\n\t}", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "public void run() {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n createAndShowGUI();\n }", "public void updateUI() {\n\t\tgetLoaderManager().restartLoader(0, null, this);\n\t}", "void updateControls();", "private void initGUI() {\n statusLabel = new JLabel();\n add(statusLabel);\n updateStatus();\n }", "public void ver() {\n\t\tthis.setVisible(true);\n\t}", "private void updateUI() {\n if (mAccount != null) {\n signInButton.setEnabled(false);\n signOutButton.setEnabled(true);\n callGraphApiInteractiveButton.setEnabled(true);\n callGraphApiSilentButton.setEnabled(true);\n currentUserTextView.setText(mAccount.getUsername());\n } else {\n signInButton.setEnabled(true);\n signOutButton.setEnabled(false);\n callGraphApiInteractiveButton.setEnabled(false);\n callGraphApiSilentButton.setEnabled(false);\n currentUserTextView.setText(\"None\");\n }\n\n deviceModeTextView.setText(mSingleAccountApp.isSharedDevice() ? \"Shared\" : \"Non-shared\");\n }", "public void update() {\n\n\t\tdisplay();\n\t}", "public void updateUI() {\n if (ui != null) {\n removeKeymap(ui.getClass().getName());\n }\n setUI(UIManager.getUI(this));\n }", "protected void _updateWidgets()\n\t{\n\t\t// Show the title\n\t\tString title = _spItem.getTitleAttr() ;\n\t\tif( title != null )\n\t\t\t_obsTitle.setText( title ) ;\n\t\telse\n\t\t\t_obsTitle.setText( \"\" ) ;\n\n\t\tString state = _avTab.get( \"state\" ) ;\n\t\tif( state == null )\n\t\t\t_obsState.setText( \"Not in Active Database\" ) ;\n\t\telse\n\t\t\t_obsState.setText( state ) ;\n\n\t\tignoreActions = true ; // MFO\n\n\t\tSpObs obs = ( SpObs )_spItem ;\n\t\t\n\t\t// Set the priority\n\t\tint pri = obs.getPriority() ;\n\t\t_w.jComboBox1.setSelectedIndex( pri - 1 ) ;\n\n\t\t// Set whether or not this is a standard\n\t\t_w.standard.setSelected( obs.getIsStandard() ) ;\n\n\t\t// Added for OMP (MFO, 7 August 2001)\n\t\t_w.optional.setValue( obs.isOptional() ) ;\n\n\t\tint numberRemaining = obs.getNumberRemaining();\n\t\t_w.setRemainingCount(numberRemaining);\n\n\t\t_w.unSuspendCB.addActionListener( this ) ;\n\n\t\tignoreActions = false ;\n\n\t\t_w.estimatedTime.setText( OracUtilities.secsToHHMMSS( obs.getElapsedTime() , 1 ) ) ;\n\n\t\t_updateMsbDisplay() ;\n\t}", "public void refreshGUIConfiguration() {\n\t\tcbxFEP.setSelectedItem(Initializer.getFEPname());\n\t\ttxtPort.setText(String.valueOf(Initializer.getPortNumber()));\n\t\t\n\t\tfor(Map.Entry<String, String> value : Initializer.getConfigurationTracker().getFepPropertiesMap().entrySet()) {\n\t\t\tif(value.getKey().equals(\"valueOfBitfield76\")) {\n\t\t\t\tSystem.out.println(value.getValue());\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().sendResponseVariableName).equalsIgnoreCase(\"No\")) {\n\t\t\trdbtnDontSendResponse.setSelected(true);\n\t\t} else {\n\t\t\trdbtnSendResponse.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().authorizationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnAuthorizationApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().authorizationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnAuthorizationDecline.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().authorizationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().partialApprovalValue)) {\n\t\t\trdbtnAuthorizationPartiallyapprove.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialSalesResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnFinancialSalesApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialSalesResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnFinancialSalesDecline.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialSalesResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().partialApprovalValue)) {\n\t\t\trdbtnFinancialSalesPartiallyapprove.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialForceDraftResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnFinancialForceDraftApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialForceDraftResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnFinancialForceDraftDecline.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().reconciliationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnReconciliationApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().reconciliationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnReconciliationDecline.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().reversalResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnReversalApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().reversalResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnReversalDecline.setSelected(true);\n\t\t}\n\n\t\ttxtDeclineCode\n\t\t\t\t.setText(Initializer.getConfigurationTracker().getFepPropertiesMap().get(\"ValueOfBitfield39Decline\"));\n\t\ttxtApprovalAmount.setText(Initializer.getConfigurationTracker().getFepPropertiesMap().get(\"valueOfBitfield4\"));\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap().get(\"isHalfApprovalRequired\")\n\t\t\t\t.equalsIgnoreCase(\"true\")) {\n\t\t\tchckbxApproveForHalf.setSelected(true);\n\t\t\ttxtApprovalAmount.setEnabled(false);\n\t\t} else {\n\t\t\tchckbxApproveForHalf.setSelected(false);\n\t\t\ttxtApprovalAmount.setEnabled(true);\n\t\t}\n\t\t\n\t\tlogger.debug(\"GUI configuration updated based on the FEP properties configured\");\n\t}", "protected void updatePanelContent() {\n updating = true;\n jTextFieldName.setText(bulb.getName());\n jTextFieldName.setToolTipText(bulb.getType());\n jSlider1.setValue(bulb.getIntensity());\n jToggleButton1.setSelected(bulb.isOn());\n if (bulb.getColor() != null) {\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n switch(bulb.getColor()) {\n case TradfriConstants.COLOR_NORMAL: jRadioNormal.setSelected(true); break;\n case TradfriConstants.COLOR_WARM: jRadioWarm.setSelected(true); break;\n case TradfriConstants.COLOR_COLD: jRadioCold.setSelected(true); break;\n }\n }\n else {\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n }\n \n \n if (bulb.isOnline()) {\n jToggleButton1.setEnabled(true);\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n jSlider1.setEnabled(true);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [online]\");\n }\n else {\n jToggleButton1.setEnabled(false);\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n jSlider1.setEnabled(false);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [offline]\");\n }\n \n updating = false;\n }", "public void updateVisuals ()\n\t{\n\t\tbrainPanel.repaint();\n\t}", "private void updateGui(PshData pshData) {\n\n // Storm Type\n PshStormType stormType = pshData.getStormType();\n if (stormType != null) {\n typeCombo.setText(stormType.getDesc());\n\n // Storm number for tropical depression.\n if (stormType == PshStormType.TROPICAL_DEPRESSION) {\n depressionCheckbox.setEnabled(true);\n int stormNumber = pshData.getStormNumber();\n if (stormNumber > 0) {\n depressionCheckbox.setSelection(true);\n depressionNumberCombo.setText(\"\" + stormNumber);\n } else {\n depressionCheckbox.setSelection(false);\n depressionNumberCombo.setText(\"1\");\n }\n }\n }\n\n // Message Type - always start up with \"ROU\".\n pshData.setStatus(IssueType.ROUTINE);\n messageTypeCombo.select(0);\n\n // Route - always start up with \"ALL\".\n pshData.setRoute(AFOS_ROUTING_CODE[0]);\n routeCombo.select(0);\n\n }", "private void showProposalDevelopment(){\r\n try{\r\n \r\n ProposalBaseWindow propFrame = null;\r\n if ( (propFrame = (ProposalBaseWindow)mdiForm.getFrame(\r\n CoeusGuiConstants.PROPOSAL_BASE_FRAME_TITLE))!= null ) {\r\n if( propFrame.isIcon() ){\r\n propFrame.setIcon(false);\r\n }\r\n propFrame.setSelected(true);\r\n return;\r\n }\r\n propFrame = new ProposalBaseWindow(mdiForm );\r\n propFrame.setVisible( true );\r\n }catch(Exception exception){\r\n CoeusOptionPane.showInfoDialog(exception.getMessage());\r\n }\r\n }", "private void setCurrentState(StateEnum state)\n {\n m_CurrentState = state;\n m_DoneInit = false;\n switch(m_CurrentState)\n {\n case QB:\n m_A1Label.setText( \"PS\");\n m_A2Label.setText( \"PC\");\n m_A3Label.setText( \"ACC\");\n m_A4Label.setText( \"APB\");\n m_Sim1Label.setText( \"Sim Run\");\n m_Sim2Label.setText( \"Sim Pass\");\n m_Sim3Label.setText( \"Sim Pocket\");\n m_Sim4Label.setText( \"\");\n m_Sim1UpDown.setEnabled( true);\n m_Sim2UpDown.setEnabled( true);\n m_Sim3UpDown.setEnabled( true);\n m_Sim4UpDown.setEnabled( false);\n \n m_Sim1UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim2UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim3UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim4UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_PS_BC_PI_KABox.setEnabled( true);\n m_PC_REC_QU_KABox.setEnabled( true);\n m_ACCBox.setEnabled( true);\n m_APBBox.setEnabled( true);\n break;\n case SKILL:\n m_A1Label.setText( \"BC\");\n m_A2Label.setText( \"REC\");\n m_A3Label.setText( \"\");\n m_A4Label.setText( \"\");\n m_Sim1Label.setText( \"Sim Rush\");\n m_Sim2Label.setText( \"Sim Catch\");\n m_Sim3Label.setText( \"<HTML> Sim Punt<br>return</HTML>\");\n m_Sim4Label.setText( \"<HTML> Sim Kick<br>return</HTML>\");\n m_Sim1UpDown.setEnabled( true);\n m_Sim2UpDown.setEnabled( true);\n m_Sim3UpDown.setEnabled( true);\n m_Sim4UpDown.setEnabled( true);\n m_Sim1UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim2UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim3UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim4UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_PS_BC_PI_KABox.setEnabled( true);\n m_PC_REC_QU_KABox.setEnabled( true);\n m_ACCBox.setEnabled( false);\n m_APBBox.setEnabled( false);\n break;\n case OLINE:\n m_A1Label.setText( \"\");\n m_A2Label.setText( \"\");\n m_A3Label.setText( \"\");\n m_A4Label.setText( \"\");\n m_Sim1Label.setText( \"\");\n m_Sim2Label.setText( \"\");\n m_Sim3Label.setText( \"\");\n m_Sim4Label.setText( \"\");\n m_Sim1UpDown.setEnabled( false);\n m_Sim2UpDown.setEnabled( false);\n m_Sim3UpDown.setEnabled( false);\n m_Sim4UpDown.setEnabled( false);\n m_PS_BC_PI_KABox.setEnabled( false);\n m_PC_REC_QU_KABox.setEnabled( false);\n m_ACCBox.setEnabled( false);\n m_APBBox.setEnabled( false);\n break;\n case DEFENSE:\n m_A1Label.setText( \"PI\");\n m_A2Label.setText( \"QU\");\n m_A3Label.setText( \"\");\n m_A4Label.setText( \"\");\n m_Sim1Label.setText( \"<HTML> Sim Pass<br>rush </HTML>\");\n m_Sim2Label.setText( \"Sim Coverage\");\n m_Sim3Label.setText( \"\");\n m_Sim4Label.setText( \"\");\n m_Sim1UpDown.setEnabled( true);\n m_Sim2UpDown.setEnabled( true);\n m_Sim3UpDown.setEnabled( false);\n m_Sim4UpDown.setEnabled( false);\n m_Sim1UpDown.setModel(new SpinnerNumberModel(0, 0, 255, 1));\n m_Sim2UpDown.setModel(new SpinnerNumberModel(0, 0, 255, 1));\n m_Sim3UpDown.setModel(new SpinnerNumberModel(0, 0, 255, 1));\n m_Sim4UpDown.setModel(new SpinnerNumberModel(0, 0, 255, 1));\n m_PS_BC_PI_KABox.setEnabled( true);\n m_PC_REC_QU_KABox.setEnabled( true);\n m_ACCBox.setEnabled( false);\n m_APBBox.setEnabled( false);\n break;\n case KICKER:\n m_A1Label.setText( \"KA\");\n m_A2Label.setText( \"AKB\");\n m_A3Label.setText( \"\");\n m_A4Label.setText( \"\");\n m_Sim1Label.setText( \"Sim KA\");\n m_Sim2Label.setText( \"\");\n m_Sim3Label.setText( \"\");\n m_Sim4Label.setText( \"\");\n m_Sim1UpDown.setEnabled( true);\n m_Sim2UpDown.setEnabled( false);\n m_Sim3UpDown.setEnabled( false);\n m_Sim4UpDown.setEnabled( false);\n m_Sim1UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim2UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim3UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim4UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_PS_BC_PI_KABox.setEnabled( true);\n m_PC_REC_QU_KABox.setEnabled( true);\n m_ACCBox.setEnabled( false);\n m_APBBox.setEnabled( false);\n break;\n }\n m_DoneInit = true;\n }", "public void run() {\n\t\t\t\tUIManager.put(\"swing.boldMetal\", Boolean.FALSE);\r\n\t\t\t\tcreateAndShowGUI();\r\n\t\t\t}", "void updateState() {\n String[] players = client.getPlayers();\n System.out.println(Arrays.toString(players));\n\n if(oldPlayerNum != players.length){\n oldPlayerNum = players.length;\n updateComboBox();\n }\n\n playersListModel.clear();\n\n for (int i = 0; i < players.length; i++) {\n playersListModel.add(i, players[i]);\n }\n\n // SECOND check if player holding the ball / update GUI accordingly\n String[] playerBall = client.whoIsBall();\n boolean serverSideBall = Integer.parseInt(playerBall[1]) == client.getId();\n\n if (client.hasBall != serverSideBall) { // If the server says something different\n client.hasBall = serverSideBall;\n ballState(serverSideBall, playerBall[0]);\n }\n // THIRD if you are holding the ball update gui so that ball is throwable\n\n }", "protected abstract void updateTabState();", "@Override\n\t\tpublic void flagChanged(Object changedValue) {\n\t\t\tSwingUtilities.invokeLater(new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// Check what the status is now.\n\t\t\t\t\tObject server = serverDefinition.getServerFlag().getFlag();\n\t\t\t\t\tif (server == null) {\n\t\t\t\t\t\tshowPanel(CONNECTING_PANEL);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshowPanel(CONNECTED_PANEL);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t}", "private static void initAndShowGUI() {\n }", "@Override\n public void run() {\n boolean pvp_net;\n //Start with negative state:\n pvp_net_changed(false);\n \n Window win = null;\n\n while(!isInterrupted()||true) {\n //Check whether window is running\n if(win==null) {\n win = CacheByTitle.initalInst.getWindow(ConstData.window_title_part);\n //if(win==null)\n // Logger.getLogger(this.getClass().getName()).log(Level.INFO, \"Window from name failed...\");\n }\n else if(!win.isValid()) {\n win = null;\n //Logger.getLogger(this.getClass().getName()).log(Level.INFO, \"Window is invalid...\");\n }\n else if(\n main.ToolRunning() && \n main.settings.getBoolean(Setnames.PREVENT_CLIENT_MINIMIZE.name, (Boolean)Setnames.PREVENT_CLIENT_MINIMIZE.default_val) &&\n win.isMinimized()) {\n win.restoreNoActivate();\n }\n pvp_net = win!=null;\n //On an change, update GUI\n if(pvp_net!=pvp_net_running) {\n pvp_net_changed(pvp_net);\n }\n \n /*thread_running = main.ToolRunning();\n if(thread_running!=automation_thread_running)\n thread_changed(thread_running);*/\n\n try {\n sleep(900L);\n //Wait some more if paused\n waitPause();\n }\n catch(InterruptedException e) {\n break; \n }\n } \n }", "public void showStatus(){\n\t\tjlMoves.setText(\"\"+moves);\n\t\tjlCorrectMoves.setText(\"\"+correctMoves);\n\t\tjlWrongMoves.setText(\"\"+wrongMoves);\n\t\tjlOpenMoves.setText(\"\"+openMoves);\n\t\tjlNumberGames.setText(\"\"+numberGames);\n\t}", "public void buildGui() {\n\t}", "public void designerStateModified(DesignerEvent e);", "public void updateGamePanel() {\n\t\tthis.removeAll();\n\t\t\n\t\tButton2 buttonTip = new Button2(\"DICA\", 75, 100, 100, 100);\n\t\tbuttonTip.addActionListener(e -> Controller.game.showTip());\n\t\tthis.add(buttonTip);\n\t\t\n\t\tButton2 menu = new Button2(\"Menu\", 200, 100, 100, 100);\n\t\tmenu.addActionListener(e -> this.frame.setVisible(\"menu\"));\n\t\tthis.add(menu);\n\t\t\n\t\tthis.drawButtons();\n\t\t\n\t\t//Adding labels\n\t\tthis.add(frame.getWordShow());\n\t\tthis.add(frame.getLifeShow());\n\t\t\n\t\tthis.frame.add(this);//Adding the gameJPanel to the frame\n\t}", "private void changeFrame() {\n\t\t\n\t\tselected.setVisible(!selected.isVisible());\n\t}", "@Override\n public void update() {\n jTextField1.setText(mCalculator.getDisplay());\n }", "public void refreshUI(){\n\n // disable/endable certain UI elements depending on mode\n this.setModeUI();\n\n if (this.inManualMode == false){ this.automaticModeChecks(); }\n\n /**\n * @bug When selected a train from a TCDispatchedTrainsFrame, a NullPointerException is thrown.\n *\n */\n if (this.isUtilityFailure()){ this.vitalsButton.setForeground(Color.red); } // change to red\n else if (this.isUtilityFailure() == false){this.vitalsButton.setForeground(new Color(0,0,0));}\n\n // checks so that the doors can't open doors if moving..\n if (this.canOpenDoors()){ this.enableOpeningDoors(); }\n\n else{ // shut the doors if moving\n this.disableOpeningDoors();\n if (this.selectedTrain.getLeftDoor() != -1){ this.selectedTrain.setLeftDoor(0); }\n if (this.selectedTrain.getRightDoor() != -1){ this.selectedTrain.setRightDoor(0); }\n }\n\n // set utility stuff based on train information\n this.refreshAC();\n this.refreshHeat();\n this.refreshLights();\n this.refreshLeftDoors();\n this.refreshRightDoors();\n }", "public void updateAnalogWindow() {\r\n\t\tif (this.analogTabItem != null && !this.analogTabItem.isDisposed()) {\r\n\t\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\t\tthis.analogTabItem.update(true);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tDataExplorer.this.analogTabItem.update(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}", "public void updateUi() {\n\t\t// // update the car color to reflect premium status or lack thereof\n\t\t// ((ImageView)findViewById(R.id.free_or_premium)).setImageResource(mIsPremium\n\t\t// ? R.drawable.premium : R.drawable.free);\n\t\t//\n\t\t// // \"Upgrade\" button is only visible if the user is not premium\n\t\t// findViewById(R.id.upgrade_button).setVisibility(mIsPremium ?\n\t\t// View.GONE : View.VISIBLE);\n\t\t//\n\t\t// // \"Get infinite gas\" button is only visible if the user is not\n\t\t// subscribed yet\n\t\t// findViewById(R.id.infinite_gas_button).setVisibility(mSubscribedToInfiniteGas\n\t\t// ?\n\t\t// View.GONE : View.VISIBLE);\n\t\t//\n\t\t// // update gas gauge to reflect tank status\n\t\t// if (mSubscribedToInfiniteGas) {\n\t\t// ((ImageView)findViewById(R.id.gas_gauge)).setImageResource(R.drawable.gas_inf);\n\t\t// }\n\t\t// else {\n\t\t// int index = mTank >= TANK_RES_IDS.length ? TANK_RES_IDS.length - 1 :\n\t\t// mTank;\n\t\t// ((ImageView)findViewById(R.id.gas_gauge)).setImageResource(TANK_RES_IDS[index]);\n\t\t// }\n\t}", "public void UpdateView(){\n\t\tStageArray[CurrentStage].Update();\r\n\t\t//updateUI will activate the Draw function\r\n\t\tStageArray[CurrentStage].updateUI();\r\n\t\t//this completely refreshes totalGUI and removes and mouse listener it had\r\n\t\tif(CardMain.frame.getContentPane()!=StageArray[CurrentStage]){\r\n\t\t\tCardMain.frame.setContentPane(StageArray[CurrentStage]);\r\n\t\t}\r\n\t}", "public void update() {\n\t\tif (!uiDone)\n\t\t\tinitializeUI();\n\t\t\n Vehicle vehicle = (Vehicle) unit;\n\n // Update driver button if necessary.\n boolean driverChange = false;\n if (driverCache == null) {\n if (vehicle.getOperator() != null) driverChange = true;\n }\n else if (!driverCache.equals(vehicle.getOperator())) driverChange = true;\n if (driverChange) {\n driverCache = vehicle.getOperator();\n if (driverCache == null) {\n driverButton.setVisible(false);\n }\n else {\n driverButton.setVisible(true);\n driverButton.setText(driverCache.getOperatorName());\n }\n }\n\n // Update status label\n if (!vehicle.sameStatusTypes(statusCache, vehicle.getStatusTypes())) {\n statusCache = vehicle.getStatusTypes();\n statusLabel.setText(vehicle.printStatusTypes());\n }\n\n // Update beacon label\n if (beaconCache != vehicle.isBeaconOn()) {\n \tbeaconCache = vehicle.isBeaconOn();\n \tif (beaconCache) beaconLabel.setText(\"On\");\n \telse beaconLabel.setText(\"Off\");\n }\n\n // Update speed label\n if (speedCache != vehicle.getSpeed()) {\n speedCache = vehicle.getSpeed();\n speedLabel.setText(\"\" + formatter.format(speedCache) + \" km/h\");\n }\n\n // Update elevation label if ground vehicle.\n if (vehicle instanceof GroundVehicle) {\n GroundVehicle gVehicle = (GroundVehicle) vehicle;\n double currentElevation = gVehicle.getElevation();\n if (elevationCache != currentElevation) {\n elevationCache = currentElevation;\n elevationLabel.setText(formatter.format(elevationCache) + \" km\");\n }\n }\n\n Mission mission = missionManager.getMissionForVehicle(vehicle);\n \n boolean hasDestination = false;\n \t\t\n if ((mission != null) && (mission instanceof VehicleMission)\n && ((VehicleMission) mission).getTravelStatus().equals(TravelMission.TRAVEL_TO_NAVPOINT)) {\n \tNavPoint destinationPoint = ((VehicleMission) mission).getNextNavpoint();\n \t\n \thasDestination = true;\n \t\n \tif (destinationPoint.isSettlementAtNavpoint()) {\n \t\t// If destination is settlement, update destination button.\n \t\tif (destinationSettlementCache != destinationPoint.getSettlement()) {\n \t\t\tdestinationSettlementCache = destinationPoint.getSettlement();\n \t\t\tdestinationButton.setText(destinationSettlementCache.getName());\n \t\t\taddDestinationButton();\n \t\t\tdestinationTextCache = \"\";\n \t\t}\n \t}\n \telse {\n// \t\tif (destinationTextCache != \"\") {\n \t\t\t// If destination is coordinates, update destination text label.\n \t\t\tdestinationTextCache = Conversion.capitalize(destinationPoint.getDescription());//\"A Navpoint\";\n \t\t\tdestinationTextLabel.setText(destinationTextCache);\n \t\t\taddDestinationTextLabel();\n destinationSettlementCache = null;\n// \t\t}\n \t}\n }\n \n if (!hasDestination) {\n \t// If destination is none, update destination text label.\n \tif (destinationTextCache != \"\") {\n \t\tdestinationTextCache = \"\";\n \t\tdestinationTextLabel.setText(destinationTextCache);\n \t\taddDestinationTextLabel();\n \t\tdestinationSettlementCache = null;\n \t}\n }\n \n\n // Update latitude and longitude panels if necessary.\n if ((mission != null) && (mission instanceof VehicleMission)\n && ((VehicleMission) mission).getTravelStatus().equals(TravelMission.TRAVEL_TO_NAVPOINT)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n \tif (destinationLocationCache == null)\n \t\tdestinationLocationCache = new Coordinates(vehicleMission.getNextNavpoint().getLocation());\n \telse \n \t\tdestinationLocationCache.setCoords(vehicleMission.getNextNavpoint().getLocation());\n destinationLatitudeLabel.setText(\"\" +\n destinationLocationCache.getFormattedLatitudeString());\n destinationLongitudeLabel.setText(\"\" +\n destinationLocationCache.getFormattedLongitudeString());\n }\n else {\n \tif (destinationLocationCache != null) {\n \t\tdestinationLocationCache = null;\n destinationLatitudeLabel.setText(\"\");\n destinationLongitudeLabel.setText(\"\");\n \t}\n }\n\n // Update distance to destination if necessary.\n if ((mission != null) && (mission instanceof VehicleMission)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n \ttry {\n \t\tif (distanceCache != vehicleMission.getCurrentLegRemainingDistance()) {\n \t\t\tdistanceCache = vehicleMission.getCurrentLegRemainingDistance();\n \t\t\tdistanceLabel.setText(\"\" + formatter.format(distanceCache) + \" km\");\n \t\t}\n \t}\n \tcatch (Exception e) {\n \t\tlogger.log(Level.SEVERE,\"Error getting current leg remaining distance.\");\n \t\t\te.printStackTrace(System.err);\n \t}\n }\n else {\n \tdistanceCache = 0D;\n \tdistanceLabel.setText(\"\");\n }\n\n // Update ETA if necessary\n if ((mission != null) && (mission instanceof VehicleMission)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n if (vehicleMission.getLegETA() != null) {\n if (!etaCache.equals(vehicleMission.getLegETA().toString())) {\n etaCache = vehicleMission.getLegETA().toString();\n etaLabel.setText(\"\" + etaCache);\n }\n }\n }\n else {\n \tetaCache = \"\";\n \tetaLabel.setText(\"\");\n }\n\n // Update direction display\n directionDisplay.update();\n\n // Update terrain display\n terrainDisplay.update();\n }", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "public updateFrame() {\n initComponents();\n }", "public void display() {\r\n\t\tsetVisible(true);\r\n\t}", "public void setActiveCircuit(CircuitPanel circuit) {\r\n if(circuitwindows.contains(circuit.getParentFrame())){\r\n // Set application's title\r\n setTitle(\"Logic Circuit Workbench - \" + circuit.getParentFrame().getTitle());\r\n \r\n // Make the circuit active in the Desktop Window Pane\r\n this.circuitPanel = circuit;\r\n try { circuit.getParentFrame().setSelected(true); } \r\n catch (PropertyVetoException ex) { \r\n ErrorHandler.newError(\"Editor Error\",\r\n \"Cannot select circuit \" +\r\n circuit.getParentFrame().getTitle() + \".\", ex); \r\n }\r\n\r\n // Set the appropriate state for all command history buttons\r\n UndoButton.setEnabled(circuitPanel.getCommandHistory().canUndo());\r\n RedoButton.setEnabled(circuitPanel.getCommandHistory().canRedo());\r\n Undo.setEnabled(circuitPanel.getCommandHistory().canUndo());\r\n Redo.setEnabled(circuitPanel.getCommandHistory().canRedo());\r\n \r\n clipboard.setHasSelection(circuitPanel.hasActiveSelection());\r\n \r\n // Set the appropriate state for all simulation buttons\r\n if(circuitPanel.getSimulatorState().equals(SimulatorState.STOPPED)){\r\n StartButton.setEnabled(true);\r\n StartButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/media-playback-start.png\")));\r\n Run.setEnabled(true);\r\n StopButton.setEnabled(false);\r\n Stop.setEnabled(false);\r\n StepForwardButton.setEnabled(false);\r\n StepForward.setEnabled(false); \r\n } else if(circuitPanel.getSimulatorState().equals(SimulatorState.PLAYING)){\r\n StartButton.setEnabled(true);\r\n StartButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/media-playback-pause.png\")));\r\n Run.setEnabled(true);\r\n StopButton.setEnabled(true);\r\n Stop.setEnabled(true);\r\n StepForwardButton.setEnabled(false);\r\n StepForward.setEnabled(false); \r\n } else if(circuitPanel.getSimulatorState().equals(SimulatorState.PAUSED)){\r\n StartButton.setEnabled(true);\r\n StartButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/ui/images/buttons/toolbar/media-playback-start.png\")));\r\n Run.setEnabled(true);\r\n StopButton.setEnabled(true);\r\n Stop.setEnabled(true);\r\n StepForwardButton.setEnabled(true);\r\n StepForward.setEnabled(true); \r\n }\r\n \r\n // Update Simulator speed slider\r\n SimulatorSpeed.setValue(circuitPanel.getSimulator().getSimulatorSpeed());\r\n \r\n // Is logger window open?\r\n RecordButton.setSelected(getActiveCircuit().getLoggerWindow().isShowing());\r\n Record.setSelected(getActiveCircuit().getLoggerWindow().isShowing());\r\n } else {\r\n ErrorHandler.newError(\"Editor Error\",\r\n \"Error whilst setting an active circuit. \\n \" +\r\n \"Please close and reopen all open circuits.\");\r\n } \r\n }", "public void update( )\n {\n FormPortletHome.getInstance( ).update( this );\n }", "public void updateStatusIndicators() {\n // this runs on the UI thread, to avoid conflicting UI updates\n final class statusUpdater implements Runnable {\n @Override\n public void run() {\n boolean phoneCommBusy;\n boolean myConnectedToPhone;\n synchronized(statusLock) {\n phoneCommBusy = waitingForProjectLoad || sendingToPhone;\n myConnectedToPhone = connectedToPhone;\n }\n // comm indicator\n if (phoneCommBusy) { // communicating with phone\n commIndicator.setState(PhoneCommIndicator.IndicatorState.COMMUNICATING);\n } else {\n if (myConnectedToPhone) { // not communicating with phone and repl app is running\n commIndicator.setState(PhoneCommIndicator.IndicatorState.CONNECTED);\n } else { // not communicating and repl app not running\n commIndicator.setState(PhoneCommIndicator.IndicatorState.DISCONNECTED);\n }\n }\n // connect menu enabled/disabled\n // Note: The device selector menu is created with the initial text\n // \"Loading a Project\". This changes to \"Connect to Device\" when the\n // menu is first activated.\n if (!phoneCommBusy\n && WorkspaceControllerHolder.get().haveProject()) {\n deviceSelector.setEnabled(true);\n } else {\n deviceSelector.setEnabled(false);\n }\n // connected device\n if (myConnectedToPhone) {\n deviceSelector.setCurrentDevice(psReplController.getSelectedDevice());\n } else {\n deviceSelector.setCurrentDevice(null);\n }\n }\n }\n if (commIndicator == null) {\n // only expect this to be true during testing\n return;\n }\n if (SwingUtilities.isEventDispatchThread()) {\n new statusUpdater().run();\n } else {\n try {\n SwingUtilities.invokeAndWait(new statusUpdater());\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public void update() {\n if ((mLikesDialog != null) && (mLikesDialog.isVisible())) {\n return;\n }\n\n if ((mCommentariesDialog != null) && (mCommentariesDialog.isVisible())) {\n return;\n }\n\n if (!getUserVisibleHint()) {\n return;\n }\n\n updateUI();\n }", "@Override\n\tprotected void UpdateUI() {\n\t\tDisplayFuelData(AverageFuelRate, LatestFuelConsumed);\n\t\t\n\t\tif(bCursurIndex == false && ParentActivity.ScreenIndex == Home.SCREEN_STATE_MENU_MONITORING_FUELHISTORY_GENERALRECORD)\n\t\t\tCursurDisplay(CursurIndex);\n\t}", "public void forceUpdateUI() {\n\t\tupdateUI();\n\t}", "private ISInspectorGui(ISInspectorController controller){\n this.controller = controller;\n initComponents();\n autoUpdateISToggle.setSelected(autoupdate);\n }", "public void show(){\n developmentGroup.setVisible(true);\n }", "public void update (AnActionEvent e)\n {\n Presentation presentation = e.getPresentation ();\n boolean selectable = false;\n Project project = DataKeys.PROJECT.getData (e.getDataContext ());\n UMLDiagramsPanel diagrams = ProjectUtils.get (project, UMLDiagramsPanel.class);\n if (diagrams != null)\n {\n UMLDiagram umlDiagram = diagrams.getCurrentDiagram ();\n selectable = umlDiagram != null;\n }\n presentation.setEnabled (selectable);\n }", "public void update (AnActionEvent e)\n {\n Presentation presentation = e.getPresentation ();\n boolean selectable = false;\n Project project = DataKeys.PROJECT.getData (e.getDataContext ());\n UMLDiagramsPanel diagrams = ProjectUtils.get (project, UMLDiagramsPanel.class);\n if (diagrams != null)\n {\n UMLDiagram umlDiagram = diagrams.getCurrentDiagram ();\n selectable = umlDiagram != null;\n }\n presentation.setEnabled (selectable);\n }", "public void display() {\n\t\tthis.setVisible(true);\n\t}", "public void refresh() {\r\n\t\tneeds.setText(needs());\r\n\t\tproduction.setText(production());\r\n\t\tjobs.setText(jobs());\r\n\t\tmarketPrices.setText(marketPrices());\r\n\t\tmarketSellAmounts.setText(marketSellAmounts());\r\n\t\tmarketBuyAmounts.setText(marketBuyAmounts());\r\n\t\tcompanies.setText(companies());\r\n\t\tmoney.setText(money());\r\n\t\ttileProduction.setText(tileProduction());\r\n\t\tcapital.setText(capital());\r\n\t\thappiness.setText(happiness());\r\n\t\tland.setText(land());\r\n\t\t//ArrayList of Agents sorted from lowest to highest in money is retrieved from Tile\r\n\t\tagents=tile.getAgentsByMoney();\r\n\t\tgui3.refresh();\r\n\t\tsliderPerson.setText(\"\"+agents.get(slider.getValue()).getMoney());\r\n\t\ttick.setText(tick());\r\n\t\tthis.pack();\r\n\t}", "public void show() {\n\t\tif (ENABLED) {\n\t\t\tframe.setVisible(true);\n\t\t}\n\t}", "private void setUpGUI()\n\t{\n\t\tgetContentPane().setLayout(new BorderLayout());\n\n\t\t//center panel (project and developer dropdown lists, and state of\n\t\t//server label)\n\t\tJPanel centerPanel = new JPanel();\n\t\tcenterPanel.setLayout(new GridLayout(3, 2));\n\n\t\tcenterPanel.add(new JLabel(\"Choose a project\"));\n\t\tprojectsComboBox = new JComboBox<String>(selectADBString);\n\t\tcenterPanel.add(projectsComboBox);\n\n\t\tcenterPanel.add(new JLabel(\"Choose a developer group\"));\n\t\tdevNamesComboBox = new JComboBox<String>(selectADBString);\n\t\tcenterPanel.add(devNamesComboBox);\n\n\t\tstateOfServerLabel = new JLabel(\"The server is NOT running\");\n\t\tcenterPanel.add(stateOfServerLabel);\n\n\t\tgetContentPane().add(centerPanel, BorderLayout.CENTER);\n\n\t\t//south panel (start the server)\n\t\tJPanel southPanel = new JPanel();\n\t\tsouthPanel.setLayout(new FlowLayout());\n\n\t\tstartStopServerButton = new JButton(START_SERVER_BUTTON_TEXT);\n\t\tstartStopServerButton.addActionListener(this);\n\n\t\topenPlaybackInBrowserCheckbox = new JCheckBox(\"Open the playback in the browser?\");\n\n\t\tsouthPanel.add(startStopServerButton);\n\t\tsouthPanel.add(openPlaybackInBrowserCheckbox);\n\n\t\tgetContentPane().add(southPanel, BorderLayout.SOUTH);\n\n\t\t//create the north panel by looking for the last used db file\n\t\tJPanel northPanel = createNorthPanel();\n\n\t\tgetContentPane().add(northPanel, BorderLayout.NORTH);\n\n\t\t//window controls\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetSize(800, 250);\n\t\tsetVisible(true);\n\t}", "protected void updateButtonStates()\n\t{\n\t\tboolean isLastStep = isLastStep(currentStep);\n\t\tboolean isFirstStep = isFirstStep(currentStep);\n\t\t// Check whether current step data is valid or not\n\t\tboolean isValid = currentStep.onAdvance();\n\t\tthis.getCancelButton().setVisible(!isLastStep);\n\t\tthis.getCancelButton().setEnabled(!isLastStep);\n\t\t\n\t\tthis.getBackButton().setVisible(!isLastStep);\n\t\tthis.getBackButton().setEnabled(!isFirstStep && !isLastStep);\n\n\t\tthis.getNextButton().setVisible(!isLastStep);\n\t\tthis.getNextButton().setEnabled(!isLastStep && isValid);\n\n\t\tthis.getFinishButton().setEnabled(isLastStep);\n\t\tthis.getFinishButton().setVisible(isLastStep);\n\t}", "public void updateState() {\n\t\tfloat uptime = .05f;\t\t\t// Amount of Time the up animation is performed\n\t\tfloat downtime = .35f;\t\t\t// Amount of Time the down animation is performed\n\t\tColor colorUp = Color.YELLOW;\t// Color for when a value is increased\n\t\tColor colorDown = Color.RED;\t// Color for when a value is decreased\n\t\tColor color2 = Color.WHITE;\t\t// Color to return to (Default Color. Its White btw)\n\t\t\n\t\t// Check to see if the Time has changed and we are not initializing the label\n\t\tif(!time.getText().toString().equals(Integer.toString(screen.getState().getHour()) + \":00\") && !level.getText().toString().equals(\"\")) {\n\t\t\t// Set the time label and add the animation\n\t\t\ttime.setText(Integer.toString(screen.getState().getHour()) + \":00\");\n\t\t\ttime.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t} else if(time.getText().toString().equals(\"\")) {\n\t\t\t// First time setting the label, dont add the animation\n\t\t\ttime.setText(Integer.toString(screen.getState().getHour()) + \":00\");\n\t\t}\n\t\t\n\t\t// Check to see if the Level has changed and we are not initializing the label\n\t\tif(!level.getText().toString().equals(screen.getState().getTitle()) && !level.getText().toString().equals(\"\")) {\n\t\t\tlevel.setText(\"Level: \" + screen.getState().getTitle());\n\t\t\tlevel.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t} else if(level.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the level label\n\t\t\tlevel.setText(\"Level: \" + screen.getState().getTitle());\n\t\t}\n\t\t\n\t\t// Check to see if the XP has changed and we are not initializing the label\n\t\tif(!xp.getText().toString().equals(\"XP: \" + Integer.toString(screen.getState().getXp())) && !xp.getText().toString().equals(\"\")) {\n\t\t\txp.setText(\"XP: \" + Integer.toString(screen.getState().getXp()));\n\t\t\txp.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t} else if(xp.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the XP label\n\t\t\txp.setText(\"XP: \" + Integer.toString(screen.getState().getXp()));\n\t\t}\n\t\t\n\t\t// Check to see if the Money has changed and we are not initializing the label\n\t\tif(!money.getText().toString().equals(\"$\" + Double.toString(screen.getState().getMoney()) + \"0\") && !money.getText().toString().equals(\"\")) {\n\t\t\t\n\t\t\t// Check to see if the player's money went up. This is a mess but it works\n\t\t\t// Makes the change animation Yellow or Green depending on the change in money\n\t\t\tif(Double.parseDouble(money.getText().substring(1).toString()) <= screen.getState().getMoney())\n\t\t\t\tmoney.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t\telse\n\t\t\t\tmoney.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorDown)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t\t\n\t\t\t// Set the label to the new money\n\t\t\tmoney.setText(\"$\" + Double.toString(screen.getState().getMoney()) + \"0\");\n\t\t\t\n\t\t} else if(money.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the Money Label\n\t\t\tmoney.setText(\"$\" + Double.toString(screen.getState().getMoney()) + \"0\");\n\t\t}\n\t\t\n\t\t// Check to see if the Energy has changed and we are not initializing the label\n\t\tif(!energy.getText().toString().equals(\"E: \" + Integer.toString(screen.getState().getEnergy()) + \"/100\") && !energy.getText().toString().equals(\"\")) {\n\t\t\t\n\t\t\t// Changes the animation to Yellow or Red depending on the change in the energy value\n\t\t\tif(Integer.parseInt(energy.getText().substring(3).split(\"/\")[0].toString()) < screen.getState().getEnergy())\n\t\t\t\tenergy.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t\telse\n\t\t\t\tenergy.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorDown)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t\t\n\t\t\t// Set the energy label\n\t\t\tenergy.setText(\"E: \" + Integer.toString(screen.getState().getEnergy()) + \"/100\");\n\t\t} else if(energy.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the energy label if it isnt set\n\t\t\tenergy.setText(\"E: \" + Integer.toString(screen.getState().getEnergy()) + \"/100\");\n\t\t}\n\t\t\n\t\t// Get the current date.\n\t\tint[] curDate = screen.getState().getDate();\n\t\t\t\n\t\t// Check to see if the Date has changed and we are not initializing the label\n\t\tif(!date.getText().toString().equals(\"\" + curDate[2] + \"/\" + curDate[1] + \"/\" + curDate[0]) && !date.getText().toString().equals(\"\")) {\n\t\t\t// Set the date label and add the change animation\n\t\t\tdate.setText(\"\" + curDate[2] + \"/\" + curDate[1] + \"/\" + curDate[0]);\n\t\t\tdate.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t} else if(date.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the date label\n\t\t\tdate.setText(\"\" + curDate[2] + \"/\" + curDate[1] + \"/\" + curDate[0]);\n\t\t}\n\t\t\n\t\t// Set the log text\n\t\tlogLabel.setText(screen.getState().getLog());\n\t\t\n\t\t// Update the stats\n\t\tState state = screen.getState();\n\t\tstatsLabel.setText(\"XP: \" + state.getXp() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Level: \" + state.getLevel() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Title: \" + state.getTitle() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Popularity: \" + state.getPopularity() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Year \" + state.getDate()[0] + \" Month \" + state.getDate()[1] + \" Day \" + state.getDate()[2] + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Hour: \" + state.getHour() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Energy: \" + state.getEnergy() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Current Funds: \" + state.getMoney() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Money Earned: \" + state.getEarned_money() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Money Spent: \" + state.getSpent_money());\n\t}", "private void settings() {\n mainTitle = makeLabel(\"Settings\", true);\n add(mainTitle);\n add(content);\n add(diffSlider);\n add(colourChooser);\n add(mainB);//button to main menu\n diffSlider.requestFocus();\n }", "private void settings() {\n\t\tthis.setVisible(true);\n\t\tthis.setSize(800,200);\n\t}", "public void testOpenJavaProgramLaunchConfigurationDialog2() {\n // warm run..depends on testOpenJavaProgramLaunchConfigurationDialog1 for cold start\n ILaunchConfiguration config = getLaunchConfiguration(\"Breakpoints\");\n IStructuredSelection selection = new StructuredSelection(config);\n openLCD(selection, fgIdentifier);\n }", "@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tupdateUI();\n\t\t\t\t\t\t}", "private void updateStateUiAfterSelection() {\n stageManager.updateStateUi();\n eventBus.publish(EventTopic.DEFAULT, EventType.SELECTED_OBJECT_CHANGED);\n eventManager.fireEvent(EngineEventType.SELECTED_OBJECT_CHANGED);\n }", "public void updateVisible(){\n if (serviceManager.isCustomerQueMode() == true && serviceManager.isManagerMode() == false) {\n this.setVisible(true);\n } else {\n this.setVisible(false);\n }\n// System.out.println(serviceManager.isCustomerQueMode());\n }", "public void update(){\n\t\tif (!VisualizerMain.selectedRun.equals(\"\")){\n\t\t\tupdateEpochNum();\n\t\t\tupdateParticles();\n\t\t\tthis.repaint();\n\t\t}\n\t\t\n\t}", "public void updateGUI(Connection m_dbConn)\n\t{\n\t\t// Reset content pane before building it\n\t\tgetContentPane().removeAll();\n\t\tsetLayout(new BorderLayout());\n\n\t\t// Get primary keys and build the drop down box\n\t\tcurCHID = queryDatabaseForPrimaryKeys(m_dbConn);\n\t\t\n\t\ttableName = new JLabel(\"RELATES TO\", SwingConstants.CENTER);\n\n\t\tdropBox = new JComboBox<String>(curCHID);\n\t\t\n\t\tselectButton = new JButton(\"Select\");\n\t\tselectButton.addActionListener(this);\n\n\t\tnorthPanel = new JPanel(new GridLayout(2,1));\n\t\tnorthPanel.add(tableName);\n\t\tnorthPanel.add(selectButton);\n\t\t//Instructions on how to use the GUI\n\t\tnorthPanel.add(new JLabel(\"Use the drop down menu to select an entry.\"));\n\t\tnorthPanel.add(new JLabel(\"Once an entry is selected, press the Select button\"));\n\t\tnorthPanel.add(new JLabel(\"to pull the information related to that entry.\"));\n\t\tnorthPanel.add(new JLabel(\"You may then select the related data to this entry from\"));\n\t\tnorthPanel.add(new JLabel(\"the second drop down menu. Similarly to selecting the\"));\n\t\tnorthPanel.add(new JLabel(\"first entry, press the Select button to pull the complete\"));\n\t\tnorthPanel.add(new JLabel(\"information from this entry. At this point you may then\"));\n\t\tnorthPanel.add(new JLabel(\"delete or update the info displayed. If either drop down\"));\n\t\tnorthPanel.add(new JLabel(\"has (new entry) displayed, you may insert the input\"));\n\t\tnorthPanel.add(new JLabel(\"data into the database as a new entry.\"));\n\t\t\n\t\tadd(\"North\",northPanel);\n\t\t\t\t\n\t\tdropBox_next = new JComboBox<String>(crIDs);\n\t\t\n\t\twestPanel = new JPanel(new GridLayout(2,2));\n\t\twestPanel.add(new JLabel(\"Current Character Name\"));\n\t\twestPanel.add(dropBox);\n\t\twestPanel.add(new JLabel(\"Related Creature ID\"));\n\t\twestPanel.add(dropBox_next);\n\t\t\n\t\tadd(\"West\",westPanel);\n\n\t\teastPanel = new JPanel(new GridLayout(2,4));\n\t\tif(curPK!=null)\n\t\t{\n\t\t\thate = false;\n\t\t\tlike = false;\n\t\t\t\n\t\t\tif(!(curPK.equals(\"(new entry)\"))&&!(crID.equals(\"(new entry)\")))\n\t\t\t{\n\t\t\t\tResultSet rs = null;\n\t\t\t\tString selectStmt1 = \"SELECT Ch_Hates FROM RELATE_W_CH WHERE Ch_Name =\\\"\" +curPK+ \"\\\" AND Cr_ID = \\\"\" + crID+\"\\\"\";\n\t\t\t\tString selectStmt2 = \"SELECT Ch_Likes FROM RELATE_W_CH WHERE Ch_Name =\\\"\" +curPK+ \"\\\" AND Cr_ID = \\\"\" + crID+\"\\\"\";\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Retrieve the count of primary keys in the table\n\t\t\t\t\tStatement stmt = m_dbConn.createStatement();\n\t\t\t\t\t\n\t\t\t\t\trs = stmt.executeQuery(selectStmt1);\n\t\t\t\t\trs.next();\n\t\t\t\t\thate = rs.getBoolean(\"Ch_Hates\");\n\t\t\t\t\trs = stmt.executeQuery(selectStmt2);\n\t\t\t\t\trs.next();\n\t\t\t\t\tlike = rs.getBoolean(\"Ch_Likes\");\n\t\t\t\t} catch (SQLException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\teastPanel.add(new JLabel(\"Current Creature ID\"));\n\t\t\t\n\t\t\tif(!(curPK.equals(\"(new entry)\")))\n\t\t\t\tcurCHTF = new JTextField(curPK);\n\t\t\telse\n\t\t\t\tcurCHTF = new JTextField(\"\");\n\t\t\t\n\t\t\teastPanel.add(curCHTF);\n\t\t\t\n\t\t\teastPanel.add(new JLabel(\"Current hates Related\"));\n\t\t\t\n\t\t\tcrHates = new JRadioButton();\n\t\n\t\t\tcrHates.setSelected(hate);\n\t\t\t\n\t\t\teastPanel.add(crHates);\n\t\t\t\n\t\t\teastPanel.add(new JLabel(\"Related Creature ID\"));\n\t\t\t\n\t\t\tif(!(crID.equals(\"(new entry)\")))\n\t\t\t\trelatedCrTF = new JTextField(crID);\n\t\t\telse\n\t\t\t\trelatedCrTF = new JTextField(\"\");\n\t\t\n\t\t\teastPanel.add(relatedCrTF);\n\t\t\t\n\t\t\teastPanel.add(new JLabel(\"Current likes Related\"));\n\t\t\t\n\t\t\tcrLikes = new JRadioButton();\n\t\t\t\n\t\t\tcrLikes.setSelected(like);\n\t\t\t\n\t\t\teastPanel.add(crLikes);\n\t\t}\n\t\tadd(\"East\", eastPanel);\n\t\t\n\t\t\n\t\t// Add the delete, update, and insert buttons to the bottom\n\t\tJPanel southPanel = new JPanel(new GridLayout(1, 3));\n\t\tsouthButtons = new JButton[3];\n\t\tsouthButtons[0] = new JButton(\"Delete\");\n\t\tsouthButtons[1] = new JButton(\"Update\");\n\t\tsouthButtons[2] = new JButton(\"Insert\");\n\t\tfor (int i = 0; i < southButtons.length; i++)\n\t\t{\n\t\t\tsouthButtons[i].addActionListener(this);\n\t\t\tsouthPanel.add(southButtons[i]);\n\t\t}\n\t\t\n\t\tif (curPK != null && crID != null && crID.equals(\"(new entry)\"))\n\t\t{\n\t\t\t\n\t\t\t// Only the insert button can be clicked if the user\n\t\t\t// wants to add a new entry to the table\n\t\t\tsouthButtons[0].setEnabled(false);\n\t\t\tsouthButtons[1].setEnabled(false);\n\t\t\tsouthButtons[2].setEnabled(true);\n\t\t} else if (curPK != null && crID != null)\n\t\t{\n\t\t\t// Only the delete and update buttons can be clicked\n\t\t\t// if the user wants to view a row of entry from the table\n\t\t\tsouthButtons[0].setEnabled(true);\n\t\t\tsouthButtons[1].setEnabled(true);\n\t\t\tsouthButtons[2].setEnabled(false);\n\t\t} else\n\t\t{\n\t\t\t// When selecting a primary key from the drop box,\n\t\t\t// all three buttons (delete, update, insert) are unavailable.\n\t\t\tsouthButtons[0].setEnabled(false);\n\t\t\tsouthButtons[1].setEnabled(false);\n\t\t\tsouthButtons[2].setEnabled(false);\n\t\t}\n\t\tadd(\"South\", southPanel);\n\t\t\n\t\tpack();\n\t\tsetDefaultCloseOperation(HIDE_ON_CLOSE);\n\t\tsetVisible(true);\n\t\tgetContentPane().revalidate();\n\t\tgetContentPane().repaint();\n\t}", "public void showWindow() {\n\t\tupdate();\n\t\tsetVisible(true);\n\t}" ]
[ "0.70180744", "0.6903343", "0.68910134", "0.6648204", "0.6518828", "0.62837934", "0.61666065", "0.61576515", "0.61266744", "0.6124783", "0.6099545", "0.6085751", "0.60603", "0.60155296", "0.5969654", "0.5948715", "0.59392256", "0.591637", "0.59031767", "0.58927774", "0.5880313", "0.5879288", "0.5874953", "0.5872665", "0.5845926", "0.5820246", "0.5780638", "0.577265", "0.57416576", "0.57322073", "0.5701007", "0.570003", "0.5693158", "0.5653471", "0.56491643", "0.5639698", "0.56381655", "0.56381655", "0.56381655", "0.5633349", "0.5618942", "0.56179047", "0.5614645", "0.56114626", "0.56066996", "0.56049836", "0.56009907", "0.55975634", "0.5594219", "0.55914515", "0.558439", "0.55747324", "0.5572285", "0.5554952", "0.5544218", "0.55385834", "0.5537821", "0.5528018", "0.55274415", "0.5527376", "0.552645", "0.55259216", "0.55228615", "0.5517669", "0.5517554", "0.55140865", "0.55133754", "0.5501382", "0.54960716", "0.5493571", "0.54751986", "0.546947", "0.546947", "0.54650164", "0.5448412", "0.544367", "0.54406697", "0.5440451", "0.54282075", "0.54265916", "0.54227746", "0.54202724", "0.5417469", "0.5400515", "0.5400515", "0.53956443", "0.5394064", "0.537832", "0.5373192", "0.53721225", "0.5365974", "0.53658605", "0.5365701", "0.53595555", "0.5358552", "0.5358436", "0.5356957", "0.5350835", "0.53485125", "0.5347538" ]
0.7363359
0
Adds a listener that is notified about events in the memory synchronizer.
public void addListener(final IMemoryViewerSynchronizerListener listener) { m_listeners.addListener(listener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void addListener(IIpcEventListener listener) {\n\t\tlisteners.add(listener);\n\t}", "@Override\n public void attach(IObserver observer) {\n listeners.add(observer);\n }", "public void addListener(EventListener listener);", "public void addListener(\n IListener listener\n )\n {listeners.add(listener);}", "public void addListener(IMXEventListener listener) {\n if (isAlive() && (null != listener)) {\n synchronized (mMxEventDispatcher) {\n mMxEventDispatcher.addListener(listener);\n }\n\n if (null != mInitialSyncToToken) {\n listener.onInitialSyncComplete(mInitialSyncToToken);\n }\n }\n }", "public void addListener(Listener listener) {\n m_listeners.add(listener);\n }", "public void addInvalidationListener(Runnable listener)\n {\n myInvalidationChangeSupport.addListener(listener);\n }", "@Override\n\tpublic void registListener(IListener listener) throws RemoteException {\n\t\tremoteCallbackList.register(listener);\n\t}", "static //@Override\n\tpublic void addListener(final Listener listener) {\n\t\tif (null == stListeners) {\n\t\t\tstListeners = new LinkedList<>();\n\t\t}\n\t\tstListeners.add(listener);\n\t}", "public void addChangeListener(ChangeListener listener) { _changeListeners.add(listener); }", "public void addListener(@NotNull ReceiverListener listener) {\n myListeners.add(listener);\n }", "public void addListener(ModifiedEventListener listener) {\n\t\tlisteners.add(listener);\n\t}", "@Override\n public void addListener(DisplayEventListener listener) {\n listenerList.add(DisplayEventListener.class, listener);\n }", "abstract public void addListener(Listener listener);", "public synchronized void addListener(PeerMessageListener ml)\n\t{\n\t\t_ml = ml;\n\t\tdequeueMessages();\n\t}", "public void addChangeListener(ChangeListener listener)\r\n {\r\n listeners.add(listener);\r\n }", "public void addChangeListener(ChangeListener<BufferedImage> listener) {\n observer.add(listener);\n }", "@Override\r\n public void register(L listener) {\r\n if (weakHandler) {\r\n registerWeak(listener);\r\n return;\r\n }\r\n synchronized (listeners) {\r\n if (!contains(listener)) listeners.put(listener, \"\");\r\n }\r\n }", "private void createMBeanNotificationListener(ObjectName mBeanName, NotificationListener listener) {\n log.debug(\"Adding notification listener for JMXClient \" + url.getURLPath());\n try {\n mbsc.addNotificationListener(mBeanName, listener, null, null);\n } catch (InstanceNotFoundException | IOException e) {\n log.error(\"Unable to add notification listener\", e);\n }\n }", "private static void registerEventListener() {\r\n\r\n log.info(\"Registering event listener for Listeners\"); //$NON-NLS-1$\r\n\r\n try {\r\n ObservationManager observationManager = ContentRepository\r\n .getHierarchyManager(ContentRepository.CONFIG)\r\n .getWorkspace()\r\n .getObservationManager();\r\n\r\n observationManager.addEventListener(new EventListener() {\r\n\r\n public void onEvent(EventIterator iterator) {\r\n // reload everything\r\n reload();\r\n }\r\n }, Event.NODE_ADDED\r\n | Event.NODE_REMOVED\r\n | Event.PROPERTY_ADDED\r\n | Event.PROPERTY_CHANGED\r\n | Event.PROPERTY_REMOVED, \"/\" + CONFIG_PAGE + \"/\" + \"IPConfig\", true, null, null, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n }\r\n catch (RepositoryException e) {\r\n log.error(\"Unable to add event listeners for Listeners\", e); //$NON-NLS-1$\r\n }\r\n }", "default void addListener(Runnable listener) {\n\t\tthis.getItemListeners().add(listener);\n\t}", "public abstract void registerListeners();", "public void registerListener(IMountServiceListener listener) throws RemoteException {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n _data.writeInterfaceToken(DESCRIPTOR);\n _data.writeStrongBinder((listener != null ? listener.asBinder() : null));\n mRemote.transact(Stub.TRANSACTION_registerListener, _data, _reply, 0);\n _reply.readException();\n } finally {\n _reply.recycle();\n _data.recycle();\n }\n }", "public void addListener(MoocListener listener) {\n\n\t\ttry {\n\t\t\t logger.info(\"add listener in MoocChannel is called and its \"+handler);\n\t\t\thandler.addListener(listener);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"failed to add listener\", e);\n\t\t}\n\t}", "@Override\n\tpublic void addListener() {\n\t\t\n\t}", "void registerListeners();", "@Override\n void attach(Observer observer) {\n observers.add(observer);\n }", "@Override\r\n public void registerWeak(L listener) {\r\n synchronized (listeners) {\r\n weak.put(listener, \"\");\r\n }\r\n }", "public void addListener( DatabaseUpdaterListener listener ) {\n\t\tsynchronized( listeners_ ) {\n\t\t\tif( ! listeners_.contains(listener) ) { \n\t\t\t\tlisteners_.add(listener);\n\t\t\t}\n\t\t}\n\t}", "void addListener(PromiseListener promiseListener);", "public void addListener(CommListener listener) {\n\t\tcomm.addListener(listener);\n\t}", "public synchronized void addJsimListener (JsimListener t)\n {\n jsimListeners.add (t);\n \n }", "public void addOnDataChangedListener(OnDataChangedListener listener) {\n dataChangedListeners.add(listener);\n }", "public void addChangeListener(ChangeListener listener) {\n if (listener == null) {\n return;\n }\n if (LOG.isLoggable(Level.FINE) && listeners.contains(listener)) {\n LOG.log(Level.FINE, \"diagnostics for #167491\", new IllegalStateException(\"Added \" + listener + \" multiply\"));\n }\n listeners.add(listener);\n }", "public interface ManagerListener extends EventListener {\r\n\t\r\n\t/**\r\n\t * Method to notify that a manager has joined the application.\r\n\t *\r\n\t * @param e the event\r\n\t */\r\n\tpublic void managerAdded(ManagerEvent e);\r\n\t\r\n\t/**\r\n\t * Method to notify that a manager's active model has been modified\r\n\t * to reflect a new design task.\r\n\t *\r\n\t * @param e the event\r\n\t */\r\n\tpublic void managerModelModified(ManagerEvent e);\r\n\t\r\n\t/**\r\n\t * Method to notify that a manager's output has been modified to \r\n\t * reflect a new set of inputs from designers.\r\n\t *\r\n\t * @param e the event\r\n\t */\r\n\tpublic void managerOutputModified(ManagerEvent e);\r\n\t\r\n\t/**\r\n\t * Method to notify that a manger has left the application.\r\n\t *\r\n\t * @param e the event\r\n\t */\r\n\tpublic void managerRemoved(ManagerEvent e);\r\n}", "public void addChangeListener (ChangeListener listener)\n {\n listenerList.add(ChangeListener.class, listener);\n }", "public void addConnectedCallback(OctaveReference listener) {\n\t\tlistenerConnected.add(listener);\n\t}", "public void addChangeListener(ChangeListener l) {\n }", "public void addChangeListener(ChangeListener l) {\n }", "@Override\r\n public void addStreamEventListener(IStreamEventListener eventListener) {\r\n listener = eventListener;\r\n }", "@Override\n\tpublic void addMessageReceivedListener(MessageReceivedListener messageReceivedListener) {\n\n\t}", "public void addKernelEventListener( KernelEventListener listener )\n {\n m_state.addKernelEventListener( listener );\n }", "public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {\n if (listeners == null) {\n listeners = new java.util.Vector();\n }\n listeners.addElement(listener);\n }", "@Override\n public void registerConnectorListener(RemoteConnectorListener listener) {\n connectorListeners.add(listener);\n }", "@Override\n\tpublic void addObserver(ObserverListener ob) {\n\t\tvector.add(ob);\n\t}", "public void addListener(GrillEventListener listener);", "@Override\n public void addObserver(IObserver observer) {\n observersList.add(observer);\n }", "public void attach(ChangeListener c){\n listeners.add(c);\n }", "public void addNotificationListener(ObjectName name,\r\n NotificationListener listener,\r\n NotificationFilter filter,\r\n Object handback) throws InstanceNotFoundException, IOException {\r\n if (logger.isLoggable(BasicLevel.DEBUG))\r\n logger.log(BasicLevel.DEBUG,\r\n \"MBSConnectionDelegate.addNotificationListener(\" + name + \", ..)\");\r\n\r\n NotificationListenerDesc desc = new NotificationListenerDesc(name, listener, filter, handback);\r\n List<NotificationListenerDesc> list = hashTableNotificationListener.get(name);\r\n if (list == null) {\r\n // Send the request to the JMX connector server then insert the\r\n // NotificationListener descriptor in the map.\r\n list = new Vector();\r\n desc.key = (Long) poolRequestors.request(new AddNotificationListener(name, qnotid));\r\n System.out.println(\"addNotificationListener: name=\" + name + \", key=\" + desc.key);\r\n list.add(desc);\r\n \r\n hashTableNotificationListener.put(name, list);\r\n } else {\r\n // The subscription is already active, just add the NotificationListener\r\n // descriptor in the map.\r\n desc.key = list.get(0).key;\r\n System.out.println(\"addNotificationListener: name=\" + name + \", key=\" + desc.key);\r\n list.add(list.size(), desc);\r\n }\r\n }", "public void attachListener(IProcessStatusListener p_listener)\n {\n m_localInstance.attachListener(p_listener);\n }", "public void bind(ChangeListener listener) {\n mChangeObserver.add(listener);\n }", "public final void addChangeListener(ChangeListener l) {\n\t\tsynchronized (listeners) {\n\t\t\tlisteners.add(l);\n\t\t}\n\t}", "public void register(IMessageListener listener) {\r\n registry.register(listener);\r\n }", "void addChangeListener(ChangeListener listener);", "void subscribeToEvents(Listener listener);", "public void addListener(IEpzillaEventListner listener)\n\t\t\tthrows RemoteException;", "public void addListener(SerialConnectionReadyListener listener) {\n listeners.add(listener);\n }", "public void addEventListener(EventListener listener){\n listenerList.add(EventListener.class, listener);\n }", "public void addChangeListener(ChangeListener l) {\r\n listenerList.add(ChangeListener.class, l);\r\n }", "public void addChangeListener(ChangeListener l) {\r\n listenerList.add(ChangeListener.class, l);\r\n }", "public void addChangeListener(ChangeListener listener) {\n\t\tchangeListeners.add(listener);\n\t}", "void addRefreshListener(RefreshListener listener) throws RemoteException;", "public void attach(Observer observer) {\n\t\tsubscribers.add(observer);\n\t}", "void subscribeReceiveListener(IDataReceiveListener listener);", "public synchronized void addEventListener(IEventListener listener){\r\n\t\twhile (isBlocked) {\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t\tif (!listeners.contains(listener))\r\n\t\t\tlisteners.add(listener);\r\n\t}", "protected void registerListener() {\r\n\t\t// do nothing\r\n\t}", "public void addInternalListener(InternalListener listener) {\r\n getManager().addInternalListener(listener);\r\n }", "public static void setListener(QuadConsumer listener) {\n\t\t\n\t\tnotificationListener = listener;\n\t\t\n\t}", "public void addNotificationListener(NotificationListener listener) {\n\t\tnotificationListeners.add(listener);\n\t}", "@Override\n public void addListener(StreamListener listener) {\n streamListeners.add(listener);\n }", "public void registerListener(PPGListener listener){\n listeners.add(listener);\n }", "@Override\n public void addObserver(Observer observer) {\n observers.add(observer);\n }", "public void addListener(Listener l) {\n\t\tmListenerSet.add(l);\n\t}", "public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener listener) {\r\n\tgetPropertyChange().addPropertyChangeListener(listener);\r\n}", "public void addNewDeviceDetectedEventListener(NewDeviceDetectedEventListener listener) {\r\n\tlistenerList.add(NewDeviceDetectedEventListener.class, listener);\r\n }", "public abstract void addListener(RegistryChangeListener listener);", "public void addReadyListener(ComponentSystemEventListener listener) {\n listeners.add(listener);\n }", "public synchronized void addEventListener(InputListener listener) {\n\t\tlisteners.add(listener);\n\t}", "@Override\n public void registerObserver(Observer o){\n this.observers.add(o);\n }", "void addListener(IEventChannelListener<K, V> listener);", "protected final void addListener(DialogModuleChangeListener listener) {\n listeners.add(listener);\n }", "public void registerListener(IMountServiceListener listener) throws RemoteException;", "public ReplicationEventListener() {\n // connect to both the process and storage cluster\n this.hzClient = HazelcastClientFactory.getStorageClient();\n // get references to the system metadata map and events queue\n this.systemMetadata = this.hzClient.getMap(systemMetadataMap);\n // listen for changes on system metadata\n this.systemMetadata.addEntryListener(this, true);\n log.info(\"Added a listener to the \" + this.systemMetadata.getName() + \" map.\");\n this.replicationTaskRepository = ReplicationFactory.getReplicationTaskRepository();\n // start replication manager\n ReplicationFactory.getReplicationManager();\n }", "void addEventRegistrationCallback(EventRegistrationCallback eventRegistrationCallback);", "public void addNotificationListener(ObjectName name,\r\n ObjectName listener,\r\n NotificationFilter filter,\r\n Object handback) throws InstanceNotFoundException, IOException {\r\n if (logger.isLoggable(BasicLevel.DEBUG))\r\n logger.log(BasicLevel.DEBUG,\r\n \"MBSConnectionDelegate.addNotificationListener(\" + name + \", ..)\");\r\n\r\n throw new IOException(\"Not yet implemented\");\r\n \r\n// NotificationListenerDesc desc = new NotificationListenerDesc(name, null, filter, handback);\r\n// List<NotificationListenerDesc> list = hashTableNotificationListener.get(name);\r\n// if (list == null) {\r\n// // Send the request to the JMX connector server then insert the\r\n// // NotificationListener descriptor in the map.\r\n// list = new Vector();\r\n// desc.key = (Long) poolRequestors.request(new AddNotificationListener(name, qnotid));\r\n// list.add(desc);\r\n// \r\n// hashTableNotificationListener.put(name, list);\r\n// } else {\r\n// // The subscription is already active, just add the NotificationListener\r\n// // descriptor in the map.\r\n// desc.key = list.get(0).key;\r\n// list.add(list.size(), desc);\r\n// }\r\n }", "public void addObjectChangeListener(ObjectChangeListener listener)\n\t{\n\t\tif (listenerList == null)\tlistenerList = new java.util.HashSet<ObjectChangeListener>(1,1);\n\t\tlistenerList.add(listener);\n\t}", "public void addObjectChangeListener(ObjectChangeListener listener)\n\t{\n\t\tif (listenerList == null)\tlistenerList = new java.util.HashSet<ObjectChangeListener>(1,1);\n\t\tlistenerList.add(listener);\n\t}", "public void addDestructionListener(DestructionListener listener) {\n\t\tif (listeners == null)\n\t\t\tlisteners = new LinkedList<DestructionListener>();\n\t\tlisteners.add(listener);\n\t}", "void addChangeListener( RegistryListener listener );", "public void addListener(TransferListener listener) {\n listeners.add(listener);\n }", "public void addListener(PrimitiveId primitiveId, SessionListener sessionListener) {\n Set<SessionListener> sessionListeners = listeners.computeIfAbsent(primitiveId, k -> new CopyOnWriteArraySet<>());\n sessionListeners.add(sessionListener);\n }", "public void addObserver(IObserver observer)\n {\n observers.add(observer);\n }", "public Ice.AsyncResult begin_addObserver(ServiceObserverPrx observer, Callback_ServiceManager_addObserver __cb);", "void addPropertyChangedObserver(PropertyChangeObserver observer);", "@Override\n public void registerObserver(Observer o) {\n list.add(o);\n \n }", "public void registerObserver(Observer observer);", "public void addPropertyChangeListener(PropertyChangeListener listener) {\n \tmPropertyChangeSupport.addPropertyChangeListener(listener);\n }", "void setListener(Listener listener);", "public void addNameChangeListener(NameChangeListener listener) {\n listeners.add(listener);\n }", "public void addListener(ZipListener listener) {\n synchronized (listeners) {\n listeners.add(new WeakReference<ZipListener>(listener));\n }\n }" ]
[ "0.6604124", "0.6584455", "0.6480991", "0.6339974", "0.6316543", "0.62772775", "0.6238053", "0.61371815", "0.61209863", "0.61200666", "0.61038893", "0.60706866", "0.60624284", "0.6051027", "0.6047217", "0.6032923", "0.60299367", "0.60216874", "0.602114", "0.60146934", "0.6012385", "0.6006039", "0.600216", "0.597274", "0.596382", "0.59617406", "0.5942106", "0.5934012", "0.58966017", "0.58851206", "0.5871822", "0.5869794", "0.5866915", "0.5863644", "0.58509076", "0.5841722", "0.5831804", "0.58279294", "0.58279294", "0.5823385", "0.5821532", "0.5809088", "0.5808823", "0.58053285", "0.579736", "0.5792461", "0.5789575", "0.5784554", "0.57754135", "0.576674", "0.57564086", "0.57515997", "0.57481134", "0.5743989", "0.5742069", "0.57401824", "0.57382923", "0.573763", "0.5731048", "0.5731048", "0.57271683", "0.5724826", "0.57183105", "0.5715355", "0.5715141", "0.5714888", "0.57103825", "0.57089126", "0.57072425", "0.5706736", "0.5686661", "0.5681176", "0.56790304", "0.56778395", "0.5674876", "0.56730026", "0.5672184", "0.5659612", "0.56538314", "0.5653739", "0.5653247", "0.56526196", "0.56509554", "0.5650598", "0.565026", "0.56428003", "0.56428003", "0.5631661", "0.5630687", "0.56286085", "0.5625794", "0.5624319", "0.5622672", "0.56210464", "0.5611255", "0.5604375", "0.560346", "0.5598268", "0.5595934", "0.55945206" ]
0.77282727
0
Removes a listener from the memory viewer synchronizer.
public void removeListener(final IMemoryViewerSynchronizerListener listener) { m_listeners.removeListener(listener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void removeListener() {\n this.mListener = null;\n }", "public void removeListener(T listener);", "@Override\n public void removeListener(DisplayEventListener listener) {\n listenerList.remove(DisplayEventListener.class, listener);\n }", "public void removeListener(GrillEventListener listener);", "public void unregisterListener() {\n\t\tthis.listener = null;\n\t}", "public void removeInvalidationListener(Runnable listener)\n {\n myInvalidationChangeSupport.removeListener(listener);\n }", "public void removeDisconnectedCallback(OctaveReference listener) {\n\t\tlistenerDisconnected.remove(listener);\n\t}", "default void removeListener(Runnable listener) {\n\t\tthis.getItemListeners().remove(listener);\n\t}", "public void removeListener(LineListener listener) {\n\t\tplayer.removeListeners(listener);\n\t}", "@Override\r\n public void unregister(L listener) {\r\n synchronized (listeners) {\r\n listeners.remove(listener);\r\n weak.remove(listener);\r\n }\r\n }", "public synchronized void removeListener(IIpcEventListener listener) {\n\t\tlisteners.remove(listener);\n\t}", "void removeListener(GraphListener listener);", "public synchronized void removeEventListener(InputListener listener) {\n\t\tlisteners.remove(listener);\n\t}", "void removeListener(IEventChannelListener<K, V> listener);", "public void detachListener()\n {\n m_localInstance.detachListener();\n }", "public void removeConnectedCallback(OctaveReference listener) {\n\t\tlistenerConnected.remove(listener);\n\t}", "void removeListener(RosZeroconfListener listener);", "@Override\n public void removeListener(StreamListener listener) {\n streamListeners.remove(listener);\n }", "void removeListener(BotListener l);", "public void removeListener(IMXEventListener listener) {\n if (isAlive() && (null != listener)) {\n synchronized (mMxEventDispatcher) {\n mMxEventDispatcher.removeListener(listener);\n }\n }\n }", "@Override\n\tpublic void unregistListener(IListener listener) throws RemoteException {\n\t\tremoteCallbackList.unregister(listener);\n\t}", "public void removeNPTListener(NPTListener l) {}", "public void removeChangeListener(ChangeListener<BufferedImage> listener) {\n observer.remove(listener);\n }", "public void removeListener(TransferListener listener) {\n listeners.remove(listener);\n }", "public void removeListener(StatisticsListener listener)\r\n\t{\r\n\t\tlisteners.remove(listener);\r\n\t}", "void removeListener( AvailabilityListener listener );", "@Override\r\n\tpublic synchronized void unregisterListener(EventListener<T> listener) {\n\t\tlisteners.removeElement(listener);\r\n\t}", "void removeListener(\n ReaderSettingsListenerType l);", "public void removeEnumerateCallback(OctaveReference listener) {\n\t\tlistenerEnumerate.remove(listener);\n\t}", "public void removeListener(ICdtVariableChangeListener listener){\n\t\tfListeners.remove(listener);\n\t}", "public void unregisterListener(PPGListener listener){\n listeners.remove(listener);\n }", "public void remove(Object listener) {\n if (!type.isInstance(listener)) {\n return;\n }\n if (listener.equals(logger.getDelegate())) {\n logger = noOpLogger;\n }\n handlers.remove(listener);\n }", "public void removeListener(IEpzillaEventListner listener)\n\t\t\tthrows RemoteException;", "public void removeVectorListener(final VectorDisplayListener aListener) {\r\n\t\tvectorListeners.remove(aListener);\r\n\t}", "public void removeChangeListener(ChangeListener listener) { _changeListeners.remove(listener); }", "public void removeListener(ValueChangedListener listener) {\n\t\t_listenerManager.removeListener(listener);\n\t}", "private void unregisterListener() {\n mSensorManager.unregisterListener(this);\n }", "public void removeTuioListener(TuioListener listener)\n\t{\n\t\tlistenerList.removeElement(listener);\t\n\t}", "public void removeListener(INotifyChangedListener notifyChangedListener)\n {\n changeNotifier.removeListener(notifyChangedListener);\n }", "public void removeAnalysisServerListener(AnalysisServerListener listener);", "public void removeListener(Listener l) {\n\t\tmListenerSet.remove(l);\n\t}", "public void removeViewportListener(ViewportListener l) {\n viewportListeners.removeElement(l);\n }", "public void unregisterListeners(){\n listeners.clear();\n }", "void removeVideoListener(CallPeer peer, VideoListener listener);", "private void removeEventListener(IEventListener<T> listener) {\n\t\t\tevent.removeEventListener(listener);\n\t\t}", "public void removeListener(RepaintRequestListener listener) {\n }", "void removeListener(RiakFutureListener<V,T> listener);", "public void removeListener(DCCSessionListener listener) {\n while(this.chatListeners.remove(listener)) {\n // just keep removing the listener until we no longer have any more of that type left\n }\n }", "private void unregisterListener() {\n\t\tif (!mHasStarted || mSensorManager == null) {\n\t\t\treturn;\n\t\t}\n\t\tmHasStarted = false;\n\t\tmSensorManager.unregisterListener(mAccListener);\n\t}", "public synchronized void removeJsimListener (JsimListener t)\n {\n jsimListeners.remove (t);\n\n }", "@Override\n public void removeListener(InvalidationListener listener) {\n }", "public void removeListener(ILabelProviderListener listener) {\n \t\t\r\n \t}", "void unsubscribe(LogListener listener);", "public void removeOnDataChangedListener(OnDataChangedListener listener) {\n dataChangedListeners.remove(listener);\n }", "@Override\r\n\tpublic void removeListener(INotifyChangedListener notifyChangedListener) {\r\n\t\tchangeNotifier.removeListener(notifyChangedListener);\r\n\t}", "void removeListener(ChangeListener<? super T> listener);", "public void removeFactListener(GenericFactListener<Fact> listener);", "public void removeListener(ILabelProviderListener listener) {\n\t}", "public void removeUpdateListener(StoreUpdateListener listener);", "public void removeInternalListener(InternalListener listener) {\r\n getManager().removeInternalListener(listener);\r\n }", "public void removeEventListener(EventListener listener){\n try {\n listenerList.remove(EventListener.class, listener);\n } catch (Exception e) {\n System.out.println(\"[analizadorClient.removeEventListener]\" + e.getMessage());\n }\n \n \n }", "@Override\n public void removeListener(ResourceListener listener) {\n }", "@Override\n\tpublic void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}", "@Override\n\tpublic void removeListener(INotifyChangedListener notifyChangedListener) {\n\t\tchangeNotifier.removeListener(notifyChangedListener);\n\t}", "void removeListener( ConfigurationListener listener );", "public void unregister(IMessageListener listener) {\r\n registry.unregister(listener);\r\n }", "public void removeKernelEventListener( KernelEventListener listener )\n {\n m_state.removeKernelEventListener( listener );\n }", "public void removeMessageListener(MessageListener listener)\n {\n messageListeners.remove(listener);\n }", "void removeListener(MapDelegateEventListener<K, V> listener);", "public void removeAmplitudeListener(IDualAmplitudeListener listener)\r\n {\r\n amplitudeListeners.remove(listener);\r\n }", "public void removeListener(ILabelProviderListener listener) {\n\t\t\t\r\n\t\t}", "public void removeRatioListener(IRatioListener listener)\r\n {\r\n ratioListeners.remove(listener);\r\n }", "public void removeListener(LogListener listener) {\n\t\tthis.eventListeners.remove(listener);\n\t}", "public void removeNavigatorListener(NavigatorListener listener) {\n\t\tlisteners.remove(listener);\n\t}", "public void removeAnswerListener(AnswerListener anw){\n\t\tlisteners.remove(anw);\n\t}", "private void removeListener(final @NonNull Consumer<E> listener) {\n eventListeners.remove(listener);\n\n if (eventListeners.isEmpty()) {\n HandlerList.unregisterAll(this);\n LISTENERS_GROUPS.remove(configuration);\n }\n }", "public void removeDeviceListener(DeviceDriverListener device);", "public void removeViewReconnectedListener(ViewReconnectedListener l) {\n this.viewReconnectedListeners.remove(l);\n }", "void removeDataCollectionListener(DataCollectionListener l);", "@Override\n public void onDetach() {\n super.onDetach();\n listener = null;\n }", "@Override\n public void onDetach() {\n super.onDetach();\n listener = null;\n }", "@Override\n public void onDetach() {\n super.onDetach();\n listener = null;\n }", "public void removeListener(@NotNull ValueListener<V> listener) {\n\t\tlistener.listenerDetached();\n\t\tvalueListeners.remove(listener);\n\t}", "public void unregister(ListenerRegistration listener) {\n if (handlerSlots.get(listener.getOrder()).contains(listener)) {\n dirty();\n handlerSlots.get(listener.getOrder()).remove(listener);\n }\n }", "public void removeListener(final IModuleListener listener) {\n m_listeners.removeListener(listener);\n }", "@Override\n\tpublic void removeGraphChangeListener(GraphChangeListener<N, ET> listener)\n\t{\n\t\tgcs.removeGraphChangeListener(listener);\n\t}", "public synchronized void removeEventListener(IEventListener listener){\r\n\t\twhile (isBlocked) {\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t\tlisteners.remove(listener);\r\n\t}", "void removeStateListener(MessengerStateListener listener);", "public void removeSelectionChangedListener(\n ISelectionChangedListener listener) {\n viewer.removeSelectionChangedListener(listener);\n }", "public void removeListener(CachePolicyListener listener) {\n listeners.removeElement(listener);\n }", "@Override\n\tpublic void delObserver(ObserverListener ob) {\n\t\tvector.remove(ob);\n\t}", "public void removeListeners() {\n if ( listeners != null ) {\n listeners.clear();\n }\n }", "public void removeListDataListener(ListDataListener l) {}", "public boolean removeListener(Listener listener) {\r\n\t\treturn LeapJNI.Controller_removeListener(this.swigCPtr, this, Listener.getCPtr(listener), listener);\r\n\t}", "public void removeNewDeviceDetectedEventListener(NewDeviceDetectedEventListener listener) {\r\n\tlistenerList.remove(NewDeviceDetectedEventListener.class, listener);\r\n }", "public static void removeGenomeChangedListener(Listener<GenomeChangedEvent> l) {\n genomeController.removeListener(l);\n }", "public ConnectionListener remove(String listenerID);", "public void removeDataDirectorListener(DataDirectorListener l) \n {\n if (l != null)\n {\n m_dataDirectorListeners.removeElement(l);\n }\n }", "public void removeConversationListener(ConversationListener<? super E> listener);", "@Override\n\tpublic void removeToolListener(ToolListener listener) {\n\t\t//do nothing\n\t}" ]
[ "0.8016262", "0.7695855", "0.7588861", "0.755065", "0.7540229", "0.7442447", "0.73628044", "0.73241025", "0.7322344", "0.7318868", "0.7318373", "0.7272956", "0.7245561", "0.72044396", "0.71732527", "0.717142", "0.71697736", "0.7161627", "0.7151682", "0.7145423", "0.7133809", "0.7106105", "0.7089407", "0.70692885", "0.70559216", "0.70552874", "0.7049458", "0.69844294", "0.696713", "0.69623184", "0.696231", "0.69528335", "0.69527197", "0.69492346", "0.6937039", "0.6931365", "0.69188", "0.6916837", "0.6912133", "0.6895827", "0.68930525", "0.689114", "0.68872297", "0.6855844", "0.6852621", "0.6851333", "0.68424773", "0.68344116", "0.68265986", "0.6819966", "0.68160903", "0.68157846", "0.6814082", "0.6805327", "0.67959124", "0.67919904", "0.67850524", "0.67745864", "0.67716175", "0.6761238", "0.67608464", "0.6752967", "0.6748765", "0.6748765", "0.67220336", "0.672042", "0.6715719", "0.6713659", "0.67033666", "0.6701619", "0.6691895", "0.66884476", "0.6688354", "0.66800517", "0.667886", "0.66677547", "0.66645485", "0.6664519", "0.6662477", "0.66581476", "0.66581476", "0.66581476", "0.6657304", "0.66568774", "0.66490483", "0.6645508", "0.6637546", "0.66367054", "0.663088", "0.6625947", "0.6618324", "0.66074586", "0.660185", "0.65938056", "0.65916306", "0.6590656", "0.6588021", "0.65815413", "0.65812975", "0.65800935" ]
0.8691159
0
Internal to package code. External code should ignore.
PlfsDirNativeGeneric.PlfsDir getNative() { assert this.dir != null; return this.dir; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "private SourcecodePackage() {}", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "private NaturePackage() {}", "public final void mo51373a() {\n }", "private VarietyPackage() {}", "private SolutionsPackage() {}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n public boolean isPackaged() {\n return false;\n }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "private PluginsInternal() {}", "@Override\n protected void prot() {\n }", "protected Doodler() {\n\t}", "private Dex2JarProxy() {\r\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "private MApi() {}", "public CharSequence getPackageName() {\n/* 1403 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private GraphFileManager() {\n\t}", "@Override\n public void perish() {\n \n }", "public final void mo91715d() {\n }", "private Util() { }", "private ReportGenerationUtil() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private ResourcePackage() {}", "private void kk12() {\n\n\t}", "protected void onFirstUse() {}", "private NativeSupport() {\n\t}", "private SparkseeUtils()\n {\n /*\n * Intentionally left empty.\n */\n }", "private NettyHttpUtil() {\n\t\t// do nothing.\n\t}", "private PackageValidator() {}", "public void setPackageName(CharSequence packageName) {\n/* 1418 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private Platform() {\n\t\t\n\t}", "private Utils() {\n\t}", "private Utils() {\n\t}", "JPackage _package();", "@Override\n\tpublic void namespace() {\n\t\t\n\t}", "private JacobUtils() {}", "protected abstract String getPackageName();", "private NamespaceHelper() {}", "private Unescaper() {\n\n\t}", "private PluginAPI() {\r\n\t\tsuper();\r\n\t}", "private ProcessorUtils() { }", "protected void additionalProcessing() {\n\t}", "private boolean isInternal(String name) {\n return name.startsWith(\"java.\")\n || name.startsWith(\"javax.\")\n || name.startsWith(\"com.sun.\")\n || name.startsWith(\"javax.\")\n || name.startsWith(\"oracle.\");\n }", "public void smell() {\n\t\t\n\t}", "private DungeonBotsMain() {\n\t\t// Does nothing.\n\t}", "public void method_4270() {}", "private Aliyun() {\n\t\tsuper();\n\t}", "@Override\n protected void init() {\n }", "private CanonizeSource() {}", "private CheckingTools() {\r\n super();\r\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public abstract void mo56925d();", "private FileUtil() {\n \t\tsuper();\n \t}", "private void m50366E() {\n }", "protected void setupLocal() {}", "public void use()\n\t{\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private DrillCalciteWrapperUtility() {\n }", "private UtilsCache() {\n\t\tsuper();\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public abstract void mo70713b();", "private XIncluder() {}", "@Override\n public void func_104112_b() {\n \n }", "private ArraySetHelper() {\n\t\t// nothing\n\t}", "protected void initialize() {}", "protected void initialize() {}", "private FlyWithWings(){\n\t\t\n\t}", "private CompressionTools() {}", "private XhtmlUtils()\n\t{\n\t}", "private SystemInfo() {\r\n // forbid object construction \r\n }", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "private OMUtil() { }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public static void initPackage() {\n\t\t(new Branch()).getCache();\n\t\t(new Change()).getCache();\n\t\t(new Client()).getCache();\n\t\t(new DirEntry()).getCache();\n\t\t(new FileEntry()).getCache();\n\t\t(new Job()).getCache();\n\t\t(new Label()).getCache();\n\t\t(new User()).getCache();\n\t\tProperties props = System.getProperties();\n\t}", "private final void i() {\n }", "private StickFactory() {\n\t}", "private WAPIHelper() { }", "private IOUtilities() {\n }", "private Util() {\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "private void init() {\n\n\t}", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "protected void init() {\n // to override and use this method\n }", "public void m23075a() {\n }", "protected void h() {}", "public abstract void mo27386d();", "@Override\n\tpublic void comer() {\n\t\t\n\t}" ]
[ "0.64090997", "0.63174766", "0.61641955", "0.60549337", "0.5994965", "0.59840465", "0.5972244", "0.59692013", "0.5921819", "0.5915373", "0.5915373", "0.591035", "0.5871021", "0.5868906", "0.58305997", "0.58210903", "0.58144474", "0.5809713", "0.57985604", "0.5790906", "0.57789814", "0.5774813", "0.576942", "0.5769398", "0.5753464", "0.5746888", "0.5734914", "0.57171917", "0.5699804", "0.56988835", "0.568458", "0.5673366", "0.566435", "0.5660972", "0.5660972", "0.5660972", "0.5660972", "0.56589574", "0.56589574", "0.5656447", "0.5640736", "0.5640736", "0.56379384", "0.56296736", "0.5622409", "0.55957144", "0.55909634", "0.5585891", "0.55850756", "0.55738467", "0.5572928", "0.55621123", "0.5548003", "0.5544771", "0.5539893", "0.5538859", "0.5535165", "0.55298966", "0.5529465", "0.55143666", "0.55143666", "0.55143666", "0.55143666", "0.55143666", "0.55143666", "0.55136245", "0.55101466", "0.5503448", "0.5500955", "0.5498674", "0.54962504", "0.54787403", "0.5478501", "0.5473841", "0.5471327", "0.5470356", "0.546846", "0.5466718", "0.54595566", "0.54595566", "0.5449534", "0.54472756", "0.5437805", "0.54348636", "0.54317033", "0.5428989", "0.5421582", "0.5419084", "0.54098016", "0.5397133", "0.5396678", "0.5394399", "0.538957", "0.53818566", "0.5378982", "0.53776056", "0.53741044", "0.5370971", "0.53701544", "0.5369892", "0.5369614" ]
0.0
-1
TODO: place custom component creation code here
private void createUIComponents() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Component createComponent();", "Component createComponent();", "@Override\n public void initComponent() {\n }", "@Override\n public void initComponent() {\n }", "Component getComponent() {\n/* 224 */ return this.component;\n/* */ }", "@Override\r\n public void initComponent() {\n }", "private void createUIComponents() {\n }", "private void createdComponent() {\r\n\r\n\t\tloadImage();\r\n\t\tresizeImage();\r\n\t\ttry {\r\n\t\t\tif (customFont == null) {\r\n\t\t\t\tcustomFont = FontLoader.getInstance().getXenipa();\r\n\t\t\t\tif (customFont == null) {\r\n\t\t\t\t\tcustomFont = new FontLoader().importFont();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (FontFormatException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (InstantiationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IllegalAccessException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (UnsupportedLookAndFeelException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tthis.init();\r\n\t\tthis.createpanel1();\r\n\t\tthis.createpanel2();\r\n\t\tthis.createpanel3();\r\n\t\tthis.createpanel4();\r\n\t\tthis.revalidate();\r\n\t}", "ComponentType createComponentType();", "private void initcomponent() {\n\r\n\t}", "public abstract void setupComponent();", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "DsmlComponent createDsmlComponent();", "@Override\npublic void childComponentsAdditionStarted() {\n\t\n}", "private void createComponents(String label) {\n itsCombo = createComboBox();\n JScrollPane scroll = new JScrollPane(itsCombo);\n scroll.setPreferredSize(new Dimension(WIDTH, HEIGHT));\n\n LabeledComponent c = new LabeledComponent(\"Symbol\", itsCombo);\n itsComp = c;\n }", "public Component() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\npublic void setUIComponent(VirtualComponent c) {\n\t\n}", "private Component createComponent(XmlNode node, String id) {\n\n Component comp = null;\n String tag = node.getTag();\n\n if (tag.equals(TAG_PANEL)) {\n comp = layoutContainer(new JPanel(), node, node.getChildren());\n } else if (tag.equals(TAG_BORDER)) {\n comp = layoutBorder(node, node.getChildren());\n } else if (tag.equals(TAG_TEXTINPUT)) {\n int cols = node.getAttribute(ATTR_COLS, -1);\n int rows = node.getAttribute(ATTR_ROWS, -1);\n String value = node.getAttribute(ATTR_VALUE, \"\");\n\n JTextComponent textComp;\n if (rows > 1) {\n if (cols < 0) {\n cols = 30;\n }\n textComp = new JTextArea(value, rows, cols);\n } else {\n if (cols == -1) {\n textComp = new JTextField(value);\n } else {\n textComp = new JTextField(value, cols);\n }\n ((JTextField) textComp).addActionListener(this);\n }\n comp = textComp;\n String action = node.getAttribute(ATTR_ACTION, (String) null);\n if (action != null) {\n componentToAction.put(textComp, action);\n }\n } else if (tag.equals(TAG_MENUITEM) || tag.equals(TAG_CBMENUITEM)) {\n String actionTemplate = null;\n JMenuItem mi;\n String label = node.getAttribute(ATTR_LABEL, \"\");\n String action = node.getAttribute(ATTR_ACTION);\n String value = node.getAttribute(ATTR_VALUE);\n String key = node.getAttribute(ATTR_KEY);\n if ((action == null) && (actionTemplate != null)\n && (value != null)) {\n action = GuiUtils.replace(actionTemplate, \"%value%\", value);\n }\n if ((key != null) && !key.startsWith(\"group:\")) {\n label = label + \" \" + key;\n }\n\n if (node.getTag().equals(TAG_CBMENUITEM)) {\n boolean initValue = node.getAttribute(ATTR_VALUE, true);\n JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(label,\n initValue);\n String group = node.getAttribute(ATTR_GROUP, (String) null);\n addToGroup(group, cbmi);\n mi = cbmi;\n if (action != null) {\n Hashtable actions = new Hashtable();\n actions.put(ATTR_ACTION, action);\n actions.put(ATTR_VALUE, new Boolean(initValue));\n componentToAction.put(cbmi, actions);\n cbmi.addItemListener(this);\n if ((group == null) || initValue) {\n itemStateChanged(new ItemEvent(cbmi, 0, cbmi,\n ItemEvent.ITEM_STATE_CHANGED));\n }\n }\n\n if (key != null) {\n if (key.startsWith(\"group:\")) {\n if (group != null) {\n key = key.substring(6);\n keyToComponent.put(key.toLowerCase(), group);\n }\n } else {\n keyToComponent.put(key.toLowerCase(), mi);\n }\n }\n } else {\n mi = new JMenuItem(label);\n if (action != null) {\n mi.setActionCommand(action);\n mi.addActionListener(this);\n if (key != null) {\n keyToComponent.put(key.toLowerCase(), mi);\n }\n }\n }\n if (id != null) {\n idToMenuItem.put(id, mi);\n }\n comp = mi;\n } else if (tag.equals(TAG_MENU)) {\n Vector children = node.getChildren();\n JMenu menu = new JMenu(node.getAttribute(ATTR_LABEL, \"\"));\n comp = menu;\n for (int i = 0; i < children.size(); i++) {\n XmlNode childElement = (XmlNode) children.get(i);\n if (childElement.getTag().equals(TAG_SEPARATOR)) {\n menu.addSeparator();\n\n continue;\n }\n Component childComponent = xmlToUi(childElement);\n if (childComponent == null) {\n continue;\n }\n menu.add(childComponent);\n }\n } else if (tag.equals(TAG_MENUBAR)) {\n Vector children = node.getChildren();\n JMenuBar menuBar = new JMenuBar();\n comp = menuBar;\n for (int i = 0; i < children.size(); i++) {\n XmlNode childElement = (XmlNode) children.get(i);\n Component childComponent = xmlToUi(childElement);\n if (childComponent == null) {\n continue;\n }\n menuBar.add(childComponent);\n }\n } else if (tag.equals(TAG_SPLITPANE)) {\n Vector xmlChildren = node.getChildren();\n if (xmlChildren.size() != 2) {\n throw new IllegalArgumentException(\n \"splitpane tag needs to have 2 children \" + node);\n }\n XmlNode leftNode = getReffedNode((XmlNode) xmlChildren.get(0));\n XmlNode rightNode = getReffedNode((XmlNode) xmlChildren.get(1));\n Component leftComponent = xmlToUi(leftNode);\n Component rightComponent = xmlToUi(rightNode);\n boolean continuous = node.getAttribute(ATTR_CONTINUOUS, true);\n int orientation = findValue(node.getAttribute(ATTR_ORIENTATION,\n (String) null), SPLITPANE_NAMES,\n SPLITPANE_VALUES);\n\n JSplitPane split = new JSplitPane(orientation, continuous,\n leftComponent, rightComponent);\n int divider = node.getAttribute(ATTR_DIVIDER, -1);\n if (divider != -1) {\n split.setDividerLocation(divider);\n }\n split.setOneTouchExpandable(\n node.getAttribute(ATTR_ONETOUCHEXPANDABLE, true));\n double resizeweight = node.getAttribute(ATTR_RESIZEWEIGHT, -1.0);\n if (resizeweight != -1.0) {\n split.setResizeWeight(resizeweight);\n }\n comp = split;\n } else if (tag.equals(TAG_LABEL)) {\n String label = node.getAttribute(ATTR_LABEL, \"\");\n comp = new JLabel(label, getAlign(node));\n } else if (tag.equals(TAG_IMAGE)) {\n comp = makeImageButton(node, null, null);\n } else if (tag.equals(TAG_SHAPEPANEL)) {\n comp = new ShapePanel(this, node);\n } else if (tag.equals(TAG_BUTTON)) {\n JButton b = new JButton(node.getAttribute(ATTR_LABEL, \"\"));\n b.setActionCommand(node.getAttribute(ATTR_ACTION, \"No action\"));\n b.addActionListener(this);\n comp = b;\n } else if (tag.equals(TAG_CHOICE)) {\n Choice b = new java.awt.Choice();\n String action = node.getAttribute(ATTR_ACTION,\n (String) null);\n int selected = node.getAttribute(ATTR_SELECTED, 0);\n Hashtable actions = new Hashtable();\n for (int i = 0; i < node.size(); i++) {\n XmlNode child = getReffedNode(node.get(i));\n if ( !child.getTag().equals(TAG_ITEM)) {\n throw new IllegalArgumentException(\"Bad choice item:\"\n + child);\n }\n b.add(child.getAttribute(ATTR_LABEL, \"\"));\n String value = child.getAttribute(ATTR_VALUE, (String) null);\n if (value != null) {\n actions.put(ATTR_VALUE + i, value);\n }\n String subAction = child.getAttribute(ATTR_ACTION,\n (String) null);\n if (subAction != null) {\n actions.put(ATTR_ACTION + i, subAction);\n }\n }\n comp = b;\n if (action != null) {\n actions.put(ATTR_ACTION, action);\n componentToAction.put(b, actions);\n b.select(selected);\n b.addItemListener(this);\n itemStateChanged(new ItemEvent(b, 0, b,\n ItemEvent.ITEM_STATE_CHANGED));\n }\n } else if (tag.equals(TAG_CHECKBOX)) {\n JCheckBox b = new JCheckBox(node.getAttribute(ATTR_LABEL, \"\"),\n node.getAttribute(ATTR_VALUE, false));\n String action = node.getAttribute(ATTR_ACTION, (String) null);\n comp = b;\n if (action != null) {\n componentToAction.put(comp, action);\n b.addItemListener(this);\n itemStateChanged(new ItemEvent(b, 0, b,\n ItemEvent.ITEM_STATE_CHANGED));\n }\n } else {\n comp = new JLabel(\"Unknown tag:\" + tag);\n System.err.println(\"Unknown tag:\" + node);\n }\n\n return comp;\n\n }", "public interface DomainBuilderComponent extends PropertyChangeListener {\n\t/**\n\t * get name of the component\n\t * @return\n\t */\n\tpublic String getName();\n\t\n\t/**\n\t * get icon for the component\n\t * @return\n\t */\n\tpublic Icon getIcon();\n\t\n\t\n\t/**\n\t * get component\n\t * @return\n\t */\n\tpublic Component getComponent();\n\t\n\t\n\t/**\n\t * get menu bar\n\t * @return\n\t */\n\tpublic JMenuBar getMenuBar();\n\t\n\t\n\t/**\n\t * load whatever resources one needs to get this piece working \n\t */\n\tpublic void load();\n\t\n\t/**\n\t * dispose of this component\n\t */\n\tpublic void dispose();\n}", "protected void createComponents() {\n sampleText = new JTextField(20);\n displayArea = new JLabel(\"\");\n displayArea.setPreferredSize(new Dimension(200, 75));\n displayArea.setMinimumSize(new Dimension(200, 75));\n }", "@Override\npublic void add(VirtualContainer parent, VirtualComponent comp, int pos) {\n\t\n}", "@Override\n public abstract String getComponentType();", "@Override\n\tpublic void setComponentLabel(String label) {\n\t\t\n\t}", "ViewComponent createViewComponent();", "@SuppressWarnings(\"unchecked\")\n private void create() {\n components.clear();\n\n if (content != null) {\n content.clearChildren();\n }\n else {\n content = new Container();\n content.setInsets(INSETS);\n }\n\n GuiComponent guiComponent = (GuiComponent) getReflectedItem().getValue();\n\n // let the user choose which type of backgroundComponent they want.\n Label label = content.addChild(new Label(\"Type\"), 0, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n Container backgroundTypeContainer = content.addChild(new Container(), 0, 1);\n\n ColorRGBA oldColor = BackgroundUtils.getBackgroundColor(guiComponent);\n\n Button colorOnlyBgButton = backgroundTypeContainer.addChild(new Button(\"Color Only\"), 0, 0);\n colorOnlyBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof QuadBackgroundComponent)) {\n setValue(new QuadBackgroundComponent(oldColor));\n create();\n }\n });\n\n Button colorAndImageBgButton = backgroundTypeContainer.addChild(new Button(\"Color and Image\"), 0, 1);\n colorAndImageBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof TbtQuadBackgroundComponent)) {\n setValue(BackgroundComponents.gradient(oldColor));\n create();\n }\n });\n\n if (guiComponent instanceof QuadBackgroundComponent) {\n\n try {\n\n Method getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n // margin\n getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 2, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 2, 1);\n components.add(marginComponent);\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n else if (guiComponent instanceof TbtQuadBackgroundComponent) {\n\n TbtQuadBackgroundComponent backgroundComponent = (TbtQuadBackgroundComponent) guiComponent;\n\n try {\n Method getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n label = content.addChild(new Label(\"Image\"), 2, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n Button browseImageButton = content.addChild(new Button(\"Select Background Image...\"), 2, 1);\n browseImageButton.setTextVAlignment(VAlignment.Center);\n browseImageButton.addClickCommands(source -> {\n\n JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n jfc.setDialogTitle(\"Select a Background Image...\");\n jfc.setMultiSelectionEnabled(false);\n jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n jfc.setAcceptAllFileFilterUsed(false);\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n jfc.addChoosableFileFilter(filter);\n int returnValue = jfc.showOpenDialog(null);\n\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n\n File file = jfc.getSelectedFile();\n\n\n try {\n\n byte[] imageData = Files.readAllBytes(file.toPath());\n byte[] stringData = Base64.getEncoder().encode(imageData);\n\n String imageString = new String(stringData);\n\n // PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n // panelBackground.setBase64Image(imageString);\n\n Texture texture = new TextureUtils().fromBase64(imageString);\n\n backgroundComponent.setTexture(texture);\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n });\n\n // margin\n getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 3, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 3, 1);\n components.add(marginComponent);\n\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n\n//\n// this.content = new RollupPanel(\"\", contentContainer, null);\n// this.content.setOpen(false);\n//\n// // background Image\n// Container bgImageContainer = contentContainer.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X, FillMode.Last, FillMode.Last)), 0, 0);\n// Label bgImageLabel = bgImageContainer.addChild(new Label(\"Background Image\"), 0, 0);\n// bgImageLabel.setTextVAlignment(VAlignment.Center);\n// bgImageLabel.setInsets(new Insets3f(0.0F, 2.0F, 0.0F, 5.0F));\n// Button browseImageButton = bgImageContainer.addChild(new Button(\"Browse...\"), 0, 1);\n// Button removeImageButton = bgImageContainer.addChild(new Button(\"Remove\"), 0, 2);\n// bgImageContainer.addChild(new Container(), 0, 3);\n//\n// browseImageButton.addClickCommands(source -> {\n//\n// JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n// jfc.setDialogTitle(\"Select a Background Image...\");\n// jfc.setMultiSelectionEnabled(false);\n// jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n// jfc.setAcceptAllFileFilterUsed(false);\n// FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n// jfc.addChoosableFileFilter(filter);\n// int returnValue = jfc.showOpenDialog(null);\n//\n// if (returnValue == JFileChooser.APPROVE_OPTION) {\n//\n// File file = jfc.getSelectedFile();\n//\n// try {\n// byte[] imageData = Files.readAllBytes(file.toPath());\n// byte[] stringData = Base64.getEncoder().encode(imageData);\n//\n// String imageString = new String(stringData);\n//\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(imageString);\n//\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// }\n//\n// });\n//\n// removeImageButton.addClickCommands(source -> {\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(\"\");\n// });\n//\n//\n// try {\n//\n// // color\n// Method get = PanelBackground.class.getMethod(\"getColor\");\n// Method set = PanelBackground.class.getMethod(\"setColor\", ColorRGBA.class);\n//\n// ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(getReflectedProperty().getValue(), get, set);\n// bgColorComponent.setPropertyName(\"Color\");\n// contentContainer.addChild(bgColorComponent.getPanel());\n// components.add(bgColorComponent);\n//\n// // insetTop\n// get = PanelBackground.class.getMethod(\"getInsetTop\");\n// set = PanelBackground.class.getMethod(\"setInsetTop\", int.class);\n//\n// IntComponent insetTopComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetTopComponent.setPropertyName(\"Inset Top\");\n// contentContainer.addChild(insetTopComponent.getPanel());\n// components.add(insetTopComponent);\n//\n// // insetLeft\n// get = PanelBackground.class.getMethod(\"getInsetLeft\");\n// set = PanelBackground.class.getMethod(\"setInsetLeft\", int.class);\n//\n// IntComponent insetLeftComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetLeftComponent.setPropertyName(\"Inset Left\");\n// contentContainer.addChild(insetLeftComponent.getPanel());\n// components.add(insetLeftComponent);\n//\n// // insetBottom\n// get = PanelBackground.class.getMethod(\"getInsetBottom\");\n// set = PanelBackground.class.getMethod(\"setInsetBottom\", int.class);\n//\n// IntComponent insetBottomComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetBottomComponent.setPropertyName(\"Inset Bottom\");\n// contentContainer.addChild(insetBottomComponent.getPanel());\n// components.add(insetBottomComponent);\n//\n// // insetRight\n// get = PanelBackground.class.getMethod(\"getInsetRight\");\n// set = PanelBackground.class.getMethod(\"setInsetRight\", int.class);\n//\n// IntComponent insetRightComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetRightComponent.setPropertyName(\"Inset Right\");\n// contentContainer.addChild(insetRightComponent.getPanel());\n// components.add(insetRightComponent);\n//\n// // zOffset\n// get = PanelBackground.class.getMethod(\"getzOffset\");\n// set = PanelBackground.class.getMethod(\"setzOffset\", float.class);\n//\n// FloatComponent zOffsetComponent = new FloatComponent(getReflectedProperty().getValue(), get, set);\n// zOffsetComponent.setPropertyName(\"Z-Offset\");\n// contentContainer.addChild(zOffsetComponent.getPanel());\n// components.add(zOffsetComponent);\n//\n// } catch (NoSuchMethodException e) {\n// e.printStackTrace();\n// }\n\n\n }", "@Override\n public void componentOpened() {\n super.componentOpened();\n\n }", "private JComponent createComponent(ViewModel<?> model)\r\n {\r\n JComponent comp = ControllerFactory.createComponent(model, null);\r\n if (comp instanceof JCheckBox)\r\n {\r\n ((JCheckBox)comp).setText(null);\r\n }\r\n return comp;\r\n }", "private void createUIComponents() {\n editor = createEditor(project, document);\n splitter = new JBSplitter(0.4f);\n ((JBSplitter) splitter).setFirstComponent(editor.getComponent());\n// ((JBSplitter) splitter).setSecondComponent();\n }", "@Override\r\n public void addLayoutComponent(String s, Component component) {\r\n\r\n }", "@Override\n public JComponent getComponent () {\n return this;\n }", "@Override\npublic void add(VirtualComponent comp, int pos) {\n\t\n}", "protected abstract ActivityComponent setupComponent();", "public abstract Component getComponentByName(String name);", "private void createUIComponents() {\n valueTextField = new JTextField();\n FixedService f = new FixedService();\n valueTextField.setText(\"£ \" + f.getPrice(\"Fixed\"));\n valueTextField.setBorder(new EmptyBorder(0, 0, 0, 0));\n }", "private void createUIComponents() {\n bt1 = new JButton(\"Hola\");\n }", "private void initComponentsCustom() {\n SGuiUtils.setWindowBounds(this, 480, 300);\n\n moTextUnitSymbol.setTextSettings(jlUnitSymbol.getText(), 15, 1);\n moTextUnitName.setTextSettings(jlName.getText(), 150, 1);\n moTextShortName.setTextSettings(SGuiUtils.getLabelName(jlAnalysisShortName.getText()), 10, 1);\n moTextName.setTextSettings(SGuiUtils.getLabelName(jlName.getText()), 100, 1);\n moKeyAnalysisType.setKeySettings(miClient, SGuiUtils.getLabelName(jlAnalysisType), true);\n\n moFields.addField(moTextUnitSymbol);\n moFields.addField(moTextUnitName);\n \n moFields.addField(moTextShortName);\n moFields.addField(moTextName);\n \n moFields.addField(moKeyAnalysisType);\n\n moFields.setFormButton(jbSave);\n }", "private void createUIComponents() {\n this.selectorApplication = new AzureArtifactComboBox(project, true);\n this.selectorApplication.refreshItems();\n }", "String constructComponentName() {\n return base + nameCounter++;\n }", "protected abstract Component addContent();", "private void createComponentBox() {\r\n\t\tthis.componentBox = new Vector<String>();\r\n\t\tthis.componentBox.add(\"Sword\");\r\n\t\tthis.componentBox.add(\"Two-handed Sword\");\r\n\t\tthis.componentBox.add(\"Staff\");\r\n\t\tthis.componentBox.add(\"Axe\");\r\n\t\tthis.componentBox.add(\"Hammer\");\r\n\t\tthis.componentBox.add(\"Bow\");\r\n\t\tthis.componentBox.add(\"Crossbow\");\r\n\t\tthis.componentBox.add(\"Wand\");\r\n\t\tthis.componentBox.add(\"Spear\");\r\n\t\tthis.componentBox.add(\"Bottle\");\r\n\t}", "@Override\n\tprotected void createCompButtons() {\n\t\tbuildCompButtons();\n\t}", "private JComponent initComponent(Class compClass, String label) {\r\n\t\tJComponent comp = null;\r\n\t\tif (compClass == JLabel.class) {\r\n\t\t\tcomp = new JLabel(label);\t\t\t\r\n\t\t}\r\n\t\telse if (compClass == JTextField.class) {\r\n\t\t\tcomp = new JTextField();\t\t\t\r\n\t\t}\r\n\t\telse if (compClass == JComboBox.class) {\r\n\t\t\tcomp = new JComboBox();\r\n\t\t\t((JComboBox) comp).addActionListener(this);\r\n\t\t}\r\n\t\telse if (compClass == JButton.class) {\r\n\t\t\tcomp = new JButton(label);\r\n\t\t\t((JButton) comp).addActionListener(this);\r\n\t\t}\r\n\t\telse if (compClass == JRadioButton.class) {\r\n\t\t\tcomp = new JRadioButton(label);\r\n\t\t\t((JRadioButton) comp).addActionListener(this);\r\n\t\t}\r\n\t\telse if (compClass == JMenuItem.class) {\r\n\t\t\tcomp = new JMenuItem(label);\r\n\t\t\t((JMenuItem) comp).addActionListener(this);\r\n\t\t}\r\n\t\telse if (compClass == JCheckBox.class) {\r\n\t\t\tcomp = new JCheckBox(label);\r\n\t\t\t((JCheckBox) comp).addActionListener(this);\r\n\t\t}\r\n\t\tcomp.setFont(tahoma);\r\n\t\treturn comp;\r\n\t}", "private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}", "protected void onComponentRendered()\n\t{\n\t}", "@Override\n\tpublic Component getComponent() {\n\t\treturn toolbox;\n\t}", "public interface ConfigurableComponentProvider extends ComponentProvider {\n\n}", "ISModifyComponent createISModifyComponent();", "public Component() {\n\t\tlocation = new Point(0, 0);\n\t\tsize = new Dimension(100, 80);\n\t\tproperties = new LinkedHashMap<>();\n\t\tsubJobContainer= new LinkedHashMap<>();\n\t\tleftPortCount = 0;\n\t\trightPortCount = 0;\n\t\tbottomPortCount = 0;\n\t\tinputLinksHash = new Hashtable<String, ArrayList<Link>>();\n\n\t\tinputLinks = new ArrayList<Link>();\n\t\toutputLinksHash = new Hashtable<String, ArrayList<Link>>();\n\t\toutputLinks = new ArrayList<Link>();\n\t\tinputportTerminals = new ArrayList<String>();\n\t\toutputPortTerminals = new ArrayList<String>();\n\t\twatcherTerminals = new HashMap();\n\t\tnewInstance = true;\n\t\tvalidityStatus = ValidityStatus.WARN.name();\n\t\tcomponentName = DynamicClassProcessor.INSTANCE.getClazzName(this\n\t\t\t\t.getClass());\n\n\t\tcomponentLabel = new ComponentLabel(componentName);\n\t\tcomponentLabelMargin = 16;\n\n\t\tprefix = XMLConfigUtil.INSTANCE.getComponent(componentName)\n\t\t\t\t.getDefaultNamePrefix();\n\t\t\n\t\tdefaultPrefix=XMLConfigUtil.INSTANCE.getComponent(componentName)\n\t\t\t\t.getDefaultNamePrefix();\n\t\tinitPortSettings();\n\t\ttoolTipErrorMessages = new LinkedHashMap<>();\n\t\tstatus = ComponentExecutionStatus.BLANK;\n\t}", "public ConverterComponent() {\n\t}", "ViewComponentPart createViewComponentPart();", "public interface PIComponent {\n\t\n\t\n\t/**\n\t * returns the current height of the component.\n\t * @return the components height\n\t */\n\tpublic float getHeight();\n\t\n\t\n\t/**\n\t * returns the current width of the component.\n\t * @return the components width\n\t */\n\tpublic float getWidth();\n\t\n\t\n\t/**\n\t * Resizes the component so that it has width width and height height. \n\t * @param width the new width of the component\n \t * @param height the new height of the component\n\t */\n\tpublic void setSize(float width, float height);\n\t\n\t\n\t/**\n\t * Returns the current x coordinate of the components origin.\n\t * @return the current x coordinate of the components origin\n\t */\n\tpublic float getX();\n\t\n\t\n\t/**\n\t * Returns the current y coordinate of the components origin.\n\t * @return the current y coordinate of the components origin\n\t */\n\tpublic float getY();\n\t\n\t\n\t/**\n\t * sets the location of the component\n\t * @param x the x value\n\t * @param y the y value\n\t */\n\tpublic void setLocation(float x, float y);\n\t\n\n\t/**\n\t * checks if the components contains x and y for the sake of e.g. mouse processing. \n\t * @param x the x coordinate of the point\n\t * @param y the y coordinate of the point\n\t * @return true if the component contains x and y\n\t */\n\tpublic boolean contains(float x, float y);\n\t\n\t\n\t/**\n\t * returns the component's unique id.\n\t * @return the component's unique id. \n\t */\n\tpublic UUID getComponentId();\n\t\n\t\n\t/**\n\t * to draw the component onto the canvas\n\t */\n\tpublic void draw();\n\n}", "public ExampleComponent(Component parent) {\n super(parent);\n }", "void addComponents();", "void addComponent(Component component);", "private void initComponents() {\n rootLayout = new Grid();\n rootLayout.setWidth(new Extent(100, Extent.PERCENT));\n rootLayout.setSize(2);\n add(rootLayout);\n Empsn_Label= new nextapp.echo2.app.Label();\n Empsn_Label.setText(\"N_TIME_BEAR.EMPSN\");\n rootLayout.add(Empsn_Label);\n \n Empsn_DscField = new dsc.echo2app.component.DscField();\n Empsn_DscField.setId(\"Empsn_DscField\");\n Empsn_DscField.setWidth(new Extent(4, Extent.CM));\n rootLayout.add(Empsn_DscField);\n \n\t}", "@Override\npublic void childComponentsAdded(boolean hasProperties) {\n\t\n}", "@Override\n public Component getComponent() {\n if (component == null) {\n component = new PubMLSTVisualPanel2();\n }\n component.setPreferredSize(new java.awt.Dimension(480,340));\n return component;\n }", "@Override\n\tpublic Component getComponent() {\n\t\treturn this;\n\t}", "public void add(Component c){}", "Builder setComponent(String component);", "public void addComponent(String name, Component newComp);", "public interface Datum {\n\n Component createComponent(ComponentContext c);\n}", "public GuiComponent(String componentName) {\n\t\tsuper(componentName);\n\t}", "private void createComponents() {\r\n // create a title\r\n indexTitle = new JLabel(\"Indexing\");\r\n indexTitle.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\r\n\r\n dirUrl = new JTextField();\r\n dirUrl.setColumns(70);\r\n dirUrl.setEditable(false);\r\n\r\n openDir = new JButton(\"Open Dir\");\r\n fileChooser = new JFileChooser();\r\n\r\n startIndexing = new JButton(\"Start\");\r\n startIndexing.setPreferredSize(new Dimension(95, 22));\r\n\r\n indexProgress = new JProgressBar();\r\n //progressBar.setStringPainted(true);\r\n // progressBar.setString(\"Indexing State..\");\r\n\r\n addExistingCheck = new JCheckBox();\r\n }", "public void addComponent(Component c);", "@Override\n public Component getUiComponent() {\n return this;\n }", "ComponentsType createComponentsType();", "ComponentBuilder named(String label);", "public ComponentsFactory() {\n\t\tsuper();\n\t}", "protected Component generateComp(String compName) {\n\t\treturn null;\n\t}", "private void createUIComponents() {\n table = new ShareTraderTable();\n }", "@Override\r\n\tpublic void componentActivated(AbstractComponent arg0) {\n\r\n\t}", "public void manageComponent() {\n menu = new JMenuBar();\n mainbox = new JScrollPane();\n toolbox = new JPanel();\n paintBox = new JPanel();\n optionbox = new JPanel();\n statusbar = new JPanel();\n paintModule = new PaintModule();\n\n // component setting\n createToolBox(toolbox);\n createMenu(menu);\n createOptionBox(optionbox);\n createStatusBar(statusbar);\n this.setLayout(new BorderLayout());\n\n // add component to container\n paintBox.add(paintModule);\n mainbox.setViewportView(paintBox);\n\n\n this.add(menu, BorderLayout.NORTH);\n this.add(mainbox, BorderLayout.CENTER);\n this.add(toolbox, BorderLayout.WEST);\n this.add(optionbox, BorderLayout.EAST);\n this.add(statusbar, BorderLayout.SOUTH);\n\n }", "@Override\r\n\t\t\tpublic void componentAdded(ContainerEvent arg0){}", "String getComponentName();", "String getComponentName();", "private void createComponents() {\n\n add(createSetDataPanel(), BorderLayout.NORTH);\n add(createResourcesListAndButtonsPanel(), BorderLayout.CENTER);\n }" ]
[ "0.748043", "0.748043", "0.710925", "0.710925", "0.70801723", "0.70445067", "0.69780385", "0.6929074", "0.69076335", "0.6886755", "0.67288405", "0.65718913", "0.65718913", "0.65703416", "0.65284145", "0.65241957", "0.6444727", "0.643084", "0.643084", "0.643084", "0.643084", "0.63960147", "0.6384356", "0.63791186", "0.63755465", "0.63584095", "0.6355117", "0.6350047", "0.63453037", "0.6342518", "0.6338044", "0.63329166", "0.632944", "0.6305833", "0.6300628", "0.6298501", "0.6290578", "0.6284852", "0.62778133", "0.6261838", "0.6259183", "0.62277776", "0.6226062", "0.6224614", "0.6218576", "0.62125236", "0.6197752", "0.6191626", "0.6160474", "0.6154159", "0.6135396", "0.6133078", "0.61322415", "0.61233544", "0.611821", "0.6104217", "0.610001", "0.6092981", "0.6086858", "0.6080753", "0.60695434", "0.6068635", "0.6048626", "0.6042294", "0.6040294", "0.60402536", "0.60389113", "0.60387844", "0.6035159", "0.6034891", "0.60347074", "0.6032865", "0.60247046", "0.6014248", "0.60073996", "0.6006098", "0.5998663", "0.5990762", "0.5983335", "0.59783345", "0.5970002", "0.5970002", "0.5945725" ]
0.69689584
24
Get the data item for this position
@Override public View getView(int position, View convertView, ViewGroup parent) { String dataModel = getItem(position); // Check if an existing view is being reused, otherwise inflate the view ViewHolder viewHolder; // view lookup cache stored in tag final View result; if (convertView == null) { viewHolder = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.listviewcontent, parent, false); viewHolder.txtLabel = (TextView) convertView.findViewById(R.id.label); result=convertView; convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); result=convertView; } viewHolder.txtLabel.setText(dataModel); 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
/ Here startAction needs to be overrided to allow for the uuid argument to be passed from one instance to another and to remove the alreadyPending limitation. Here we need to be able to call multiple instances of this at the same time
public void startAction(String s_) { this.startAction(incomingConnection, incomingMsg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void action(UUID uuid);", "private void execStartAction(String action){\n\n if (action.length() == 0) { return; }\n\n if (startTask != null ){\n startTask.interrupt();\n startTask = null;\n }\n\n RunningTask rt = new RunningTask(this,action.split(\" \"),true);\n startTask = new Thread(rt);\n startTask.start();\n }", "@Override\n\tpublic void onActionStart(int action) {\n\t\t\n\t}", "public void resetTimeLimitAction();", "public abstract void userActionStarts(long ms);", "@Override\n public void action(String name, boolean start) {\n if (name.equalsIgnoreCase(REGISTRATION))\n setRegistrationOver(!start);\n else if (name.equalsIgnoreCase(BATTLEFIELD))\n setBattlefieldChatActive(start);\n else\n super.action(name, start);\n }", "private void addPendingAction(Set<String> paramSet, PermissionsResultAction paramPermissionsResultAction) {\n }", "@Test\n public void testStartTaskReservedByPotentialOwner() throws HTException {\n\n Task t = createTask_OnePotentialOwner();\n org.junit.Assert.assertEquals(\"user1\", t.getActualOwner().getName());\n org.junit.Assert.assertEquals(Status.RESERVED, t.getStatus());\n \n this.services.startTask(t.getId(), \"user1\");\n org.junit.Assert.assertEquals(Status.IN_PROGRESS, t.getStatus());\n }", "@Override\r\n\tpublic void uniqueOnStartInteraction() {\n\t\tif (Main.clientPlayer.getNumWood() < cost) {\r\n\t\t\tMain.clientPlayer.stopInteraction();\r\n\t\t}\r\n\r\n\t}", "public ScheduledActionAction() {\n\n }", "public CreateIndividualPreAction() {\n }", "@Override\n\tpublic void startRequest(int taskId) {\n\n\t}", "private void removePendingAction(PermissionsResultAction paramPermissionsResultAction) {\n }", "public void startExecuting() {\n this.taskOwner.setAttackTarget(this.target);\n super.startExecuting();\n }", "private void notifyTaskStarted(int action) {\n Intent intent = new Intent(LocalAction.ACTION_BACKUP_SERVICE_STARTED);\n intent.putExtra(ACTION, action);\n intent.putExtra(CALLER_ID, mCallerId);\n mBroadcastManager.sendBroadcast(intent);\n // update the notification if required\n if (mNotificationBuilder != null) {\n mNotificationBuilder.setContentTitle(getNotificationContentTitle(action, false));\n startForeground(NotificationContract.NOTIFICATION_ID_BACKUP_PROGRESS, mNotificationBuilder.build());\n }\n }", "public void createAction() {\n }", "public void doActionBefore(DefaultInstanceActionCmd actionModel) {\n }", "void startToPerformAsLeader();", "public MemberAction() {\n\t\tsuper();\n\t}", "public static void startActionBaz(Context context, String param1, String param2) {\n Intent intent = new Intent(context, TimerService.class);\n intent.setAction(ACTION_REMOVE_ALARM);\n intent.putExtra(EXTRA_PARAM1, param1);\n intent.putExtra(EXTRA_PARAM2, param2);\n context.startService(intent);\n }", "@Override\n public MemberContext startInstance(MemberContext memberContext, byte[] payload) {\n\n this.setDynamicPayload(payload);\n String group = getIaasProvider().getIaas().getGroupName(memberContext, payload);\n\n try {\n ComputeService computeService = getIaasProvider().getComputeService();\n Template template = getIaasProvider().getTemplate();\n\n if (template == null) {\n String msg = \"Could not start an instance, jclouds template is null for iaas provider [type]: \" +\n getIaasProvider().getType();\n log.error(msg);\n throw new InvalidIaasProviderException(msg);\n }\n\n if (log.isDebugEnabled()) {\n log.debug(\"Cloud controller is delegating request to start an instance for \"\n + memberContext + \" to jclouds\");\n }\n // create and start a node\n Set<? extends NodeMetadata> nodeMetadataSet = computeService.createNodesInGroup(group, 1, template);\n NodeMetadata nodeMetadata = nodeMetadataSet.iterator().next();\n if (log.isDebugEnabled()) {\n log.debug(\"Cloud controller received a response for the request to start \"\n + memberContext + \" from Jclouds layer.\");\n }\n\n if (nodeMetadata == null) {\n String msg = \"Null response received for instance start-up request to Jclouds.\\n\"\n + memberContext.toString();\n log.error(msg);\n throw new IllegalStateException(msg);\n }\n memberContext.setInstanceId(nodeMetadata.getId());\n memberContext.setInstanceMetadata(createInstanceMetadata(nodeMetadata));\n } catch (Exception e) {\n String msg = \"Failed to start an instance. \" + memberContext.toString() + \" Cause: \" + e.getMessage();\n log.error(msg, e);\n throw new IllegalStateException(msg, e);\n }\n return memberContext;\n }", "public final void start() {\n if (!player.isSkillAction()) {\n player.setSkillAction(true);\n World.submit(new SkillActionTask(this));\n }\n }", "@Override\n\tpublic void requestStopInstance() {\n\t\tif (!isStarted.get() && !enableRequested.get()) {\n\t\t\tLOGGER.error(\"requestStopInstance: Instance not started - ignoring request\");\n\t\t\treturn;\n\t\t}\n\t\tenableRequested.set(false);\n\t\tstopRequested.set(true);\n\t\tsynchronized (lockPeerChange) {\n\t\t\tlockPeerChange.notifyAll();\n\t\t}\n\t}", "ForwardMinAction createForwardMinAction();", "private ScalingAction handleFirstRun(final InstanceInfo instances) throws ScalerException\n {\n final ScalingAction action;\n if (instances.getTotalInstances() < minInstances) {\n action = new ScalingAction(ScalingOperation.SCALE_UP, minInstances - instances.getTotalInstances());\n } else if (instances.getTotalInstances() > maxInstances) {\n action = new ScalingAction(ScalingOperation.SCALE_DOWN, instances.getTotalInstances() - maxInstances);\n } else {\n action = ScalingAction.NO_ACTION;\n }\n return action;\n }", "Start createStart();", "private void checkAction() {\n if (action == Consts.CREATE_ACTION) {\n createAction();\n } else {\n updateAction(getArguments().getString(\"taskId\"));\n }\n }", "Map<String, Object> forceStartTaskInstance(User loginUser, int queueId);", "public GetMarkerSetMembershipAction() {\n }", "StopAction createStopAction();", "private static void spawnInstance(){\n\t\tString instanceType = null;\n\t\tString imageId = null; \n\t\tint numInstances = 0;\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Name of key to use?\");\n\t\tkeyname = in.next();\n\t\t\n\t\tSystem.out.println(\"Instance type? (use d for default: t2.micro)\");\n\t\tinstanceType = in.next();\n\t\t\n\t\tif(instanceType.equals(\"d\")){\n\t\t\tinstanceType = INSTANCE_TYPE;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Image id? (use d for default: ami-b5a7ea85, Amazon Linux AMI)\");\n\t\timageId = in.next();\n\t\t\n\t\tif(imageId.equals(\"d\")){\n\t\t\timageId = IMAGE_ID; \n\t\t}\n\t\t\n\t\tSystem.out.println(\"Number of instances?\");\n\t\tnumInstances = in.nextInt();\n\n\t\tin.close();\n\t\n\t\tRunInstancesRequest req = new RunInstancesRequest();\n\t\t\n\t String group = GROUP;\n\t \n\t req.withImageId(imageId)\n\t .withInstanceType(instanceType)\n\t .withMinCount(numInstances)\n\t .withMaxCount(numInstances)\n\t .withKeyName(keyname)\n\t .withSecurityGroups(group);\n\t \n\t RunInstancesResult reqRes = ec2.runInstances(req);\n\t Reservation res = reqRes.getReservation();\n\t System.out.println(\"Reservation number is \" + res.getReservationId());\n\t try {\n \t\tSystem.out.println(\"Just a moment while the instance is spun up...\");\n\t\t\tTimeUnit.SECONDS.sleep(10);\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.out.println(\"Instantiation failed!\");\n\t\t}\n \t\tString ip = listLiveInstances();\n \t\tSystem.out.println(\"\");\n \t\tSystem.out.println(\"Connect with 'ssh -i \" + keyname + \".pem ec2-user@\" + ip +\"'\");\n \t\tSystem.out.println(\"If connection fails, run with -l option and check status.\");\n \t\tSystem.exit(0);\n\t}", "public void startExecuting() {}", "@Override\n public void start(int totalTasks) {\n }", "public abstract void systemActionStarts(long ms);", "public void willStartOne() {\n startOne();\n }", "public BattleWeaponsSegmentAction() {\n }", "@Override\n\tpublic void onRequestStart(String reqId) {\n\t\t\n\t}", "public abstract void performRestartActivity(IBinder token, boolean start);", "@Override\n protected void triggerFirstIteration() throws IllegalActionException {\n }", "public void setAction(RateLimiterAction action) {\n this.action = action;\n }", "@Test(expected = HTIllegalAccessException.class)\n public void testStartTaskReservedByNotActualOwner() throws HTException {\n\n Task t = createTask_OnePotentialOwner();\n //org.junit.Assert.assertEquals(\"user1\", t.getActualOwner().getName());\n org.junit.Assume.assumeTrue(\"user1\".equals(t.getActualOwner().getName()));\n //org.junit.Assert.assertEquals(Status.RESERVED, t.getStatus());\n org.junit.Assume.assumeTrue(Status.RESERVED.equals(t.getStatus()));\n \n this.services.startTask(t.getId(), \"user2\");\n }", "@Override\n public void specificAction(PlayerService playerService) {\n }", "protected abstract void doStart();", "private void handleStart(Intent intent) {\n if (intent != null && intent.hasExtra(COMMAND_EXTRA)) {\n Bundle extras = intent.getExtras();\n int command = extras.getInt(COMMAND_EXTRA, COMMAND_UNKNOWN);\n try {\n long alarmId = currentAlarmId(); // get the current alarm\n switch (command) {\n case COMMAND_DISMISS_ALARM:\n Log.d(TAG, \"action button: dismiss is clicked\");\n acknowledgeCurrentNotification(0);\n break;\n case COMMAND_SNOOZE_ALARM:\n Log.d(TAG, \"action button: snooze is clicked\");\n int snoozeMinutes = db.readAlarmSettings(alarmId).getSnoozeMinutes(); // get snooze minutes time from the database\n acknowledgeCurrentNotification(snoozeMinutes);\n break;\n }\n\n // finish the notification activity because it may be already exists. Send a local broadcast that will be received by the activity\n LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(NotificationService.this);\n localBroadcastManager.sendBroadcast(new Intent(\"com.kiss.alarm.action.close\"));\n\n // To refresh the alarm's \"next time\" if the main activity was already opened\n if(ActivityAlarmClock.isActive){\n Intent i =new Intent(NotificationService.this, ActivityAlarmClock.class);\n i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n }\n\n } catch (NoAlarmsException e) {\n e.printStackTrace();\n }\n\n\n return; // Don't start the alarm sound, return because this intent is started by a user clicked on dismiss or snooze action button\n }\n\n // startService called from alarm receiver with an alarm id url. onStartCommand is not starting by an action button\n if (intent != null && intent.getData() != null) {\n long alarmId = AlarmUtil.alarmUriToId(intent.getData());\n try {\n WakeLock.assertHeld(alarmId);\n } catch (WakeLock.WakeLockException e) {\n if (AppSettings.isDebugMode(NotificationService.this)) {\n throw new IllegalStateException(e.getMessage());\n }\n }\n // We starts the notification activity by the notification now, so that the system Ui can choose to show\n // heads up notification instead of the activity if the user is busy using the device right now\n /*Intent notifyActivity = new Intent(NotificationService.this, ActivityAlarmNotification.class);\n notifyActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(notifyActivity);*/\n\n boolean firstAlarm = firingAlarms.size() == 0;\n if (!firingAlarms.contains(alarmId)) {\n firingAlarms.add(alarmId);\n }\n\n if (firstAlarm) {\n soundAlarm(alarmId);\n }\n }\n }", "private void createAction() {\n setupPrioritySpinner();\n mPriority.setSelection(getActivity().getSharedPreferences(TASK_PREFS, Context.MODE_PRIVATE).getInt(PRIORITY_PREF, 0));\n }", "private static void runManagerInstance() {\n\t\tFilter tagFilter = new Filter(\"tag:Type\", Arrays.asList(\"Manager\"));\n Filter stateFilter = new Filter(\"instance-state-name\", Arrays.asList(\"stopped\", \"pending\", \"running\"));\n \n DescribeInstancesResult response = ec2.describeInstances((new DescribeInstancesRequest())\n \t\t.withFilters(tagFilter, stateFilter));\n\n List<Reservation> managerInstances = response.getReservations();\n Instance managerInstance;\n if (!managerInstances.isEmpty()) { // Manager already exists. \n managerInstance = getManagerInstance(managerInstances);\n managerInstanceId = managerInstance.getInstanceId();\n InstanceState managerState = getInstanceState(managerInstance);\n if (managerState != InstanceState.Running) {\n \tStartInstancesRequest startRequest = new StartInstancesRequest().withInstanceIds(managerInstanceId);\n ec2.startInstances(startRequest);\n }\n }\n else { // Manager doesn't exist.\n RunInstancesRequest runManagerRequest = new RunInstancesRequest(\"ami-b66ed3de\", 1, 1);\n runManagerRequest.setInstanceType(InstanceType.T2Micro.toString());\n runManagerRequest.setUserData(fileToBase64String(\"C:\\\\Users\\\\Haymi\\\\Documents\\\\BGU\\\\DSP\\\\bootstart.sh\"));\n managerInstance = ec2.runInstances(runManagerRequest).getReservation().getInstances().get(0);\n managerInstanceId = managerInstance.getInstanceId();\n CreateTagsRequest createTagsRequest = new CreateTagsRequest()\n \t\t.withResources(managerInstanceId)\n .withTags(new Tag(\"Type\", \"Manager\"));\n ec2.createTags(createTagsRequest);\n }\n waitForInstanceState(managerInstance, InstanceState.Running, 1905);\n\n System.out.println(\"Manager is running.\");\n\t\t\n\t}", "protected PMBaseAction() {\r\n super();\r\n }", "private SleeperTask()\r\n\t{\r\n\t\ttimer = new Timer();\r\n\t\tprovider = null;\r\n\t\taction = \"\";\r\n\t\tverbose = false;\r\n\t\tsetRepeat(5);\r\n\t}", "public static void startActionFoo(Context context, String param1, String param2) {\n Intent intent = new Intent(context, TimerService.class);\n intent.setAction(ACTION_SHOW_ALARM);\n intent.putExtra(EXTRA_PARAM1, param1);\n intent.putExtra(EXTRA_PARAM2, param2);\n context.startService(intent);\n }", "SyncStart createSyncStart();", "public HSRCreateDraftRequestProcessorAction() {\n\t\tlogger.warn(\"***** This constructor is for Test Cases only *****\");\n\t\t\n\t}", "@Override\n public abstract void startCompetition();", "public void startExecuting() {\n this.attackTime = 20;\n ShulkerEntity.this.updateArmorModifier(100);\n }", "@Override\n\tprotected void BeforeActivating(IEntity sender, boolean starting) {\n\t\t\n\t}", "public void start()\n {\n if (task != -1) {\n return;\n }\n\n task = Bukkit.getScheduler().scheduleSyncRepeatingTask(library.getPlugin(), this, 5, 1);\n }", "public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}", "public abstract void started();", "@Override\n\tpublic void start() throws ServiceException\n\t{\n\t\t\n\t}", "@RequiresLock(\"SeaLock\")\r\n protected void dependentInvalidAction() {\r\n // by default do nothing\r\n }", "public static void startActionUpdatePlantWidgets(Context context) {\n Intent intent = new Intent(context, IngredientsService.class);\n context.startService(intent);\n }", "@Override\r\n\tpublic void runInstincts() throws GameActionException {\n\t\t\r\n\t}", "public void onRunActionRunnerAvailabilityChange(boolean isRunning);", "public abstract void interactionStarts(long ms);", "@ServiceMethod(returns = ReturnType.SINGLE)\n private PollerFlux<PollResult<Void>, Void> beginStartAsync(\n String resourceGroupName, String vmScaleSetName, String instanceId, Context context) {\n context = this.client.mergeContext(context);\n Mono<Response<Flux<ByteBuffer>>> mono =\n startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context);\n return this\n .client\n .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);\n }", "protected void start() {\n }", "private NodeRestartRequest() {\n\t\t}", "public static void startActionFoo(Context context, String param1, String param2) {\n Intent intent = new Intent(context, AlarmIntentService.class);\n intent.setAction(ACTION_FOO);\n intent.putExtra(EXTRA_PARAM1, param1);\n intent.putExtra(EXTRA_PARAM2, param2);\n context.startService(intent);\n }", "public static void startActionBaz(Context context, String param1, String param2) {\n Intent intent = new Intent(context, AlarmIntentService.class);\n intent.setAction(ACTION_BAZ);\n intent.putExtra(EXTRA_PARAM1, param1);\n intent.putExtra(EXTRA_PARAM2, param2);\n context.startService(intent);\n }", "public static void startActionONCE(Context context) {\n try {\n Intent intent = new Intent(context, DataReceiveService.class);\n intent.setAction(ACTION_ONCE);\n context.startService(intent);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void startSpawning()\n {\n MAUtils.setSpawnFlags(plugin, world, 1, allowMonsters, allowAnimals);\n \n // Start the spawnThread.\n spawnThread = new MASpawnThread(plugin, this);\n spawnTaskId = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, spawnThread, waveDelay, (!waveClear) ? waveInterval : 60);\n }", "void turnOn() throws ActorServiceCallException;", "public static void startActionBaz(Context context, String param1, String param2) {\n Intent intent = new Intent(context, GcmIntentService.class);\n intent.setAction(ACTION_BAZ);\n intent.putExtra(EXTRA_PARAM1, param1);\n intent.putExtra(EXTRA_PARAM2, param2);\n context.startService(intent);\n }", "private NotifySuspendedCommandControllerPowerState() {\n\n\t}", "CdapSuspendScheduleStep createCdapSuspendScheduleStep();", "void willStartTurn() throws RemoteException;", "void start() throws DependencyException, InvalidStateException, ProvisionedThroughputException;", "private PendingIntent getPendingSelfIntent(Context context, String action) {\n Intent intent = new Intent(context, getClass());\n intent.setAction(action);\n return PendingIntent.getBroadcast(context, 0, intent, 0);\n }", "public static void startActionFoo(Context context, String param1, String param2) {\n Intent intent = new Intent(context, GcmIntentService.class);\n intent.setAction(ACTION_FOO);\n intent.putExtra(EXTRA_PARAM1, param1);\n intent.putExtra(EXTRA_PARAM2, param2);\n context.startService(intent);\n }", "public void start(int p) {\n\t\t_start.setEnabled(true);\n\t\tupdateToPlace(p);\n\t}", "public void startExecuting() {\n this.peekTime = 20 * (1 + ShulkerEntity.this.rand.nextInt(3));\n ShulkerEntity.this.updateArmorModifier(30);\n }", "private DrawDestinyToPowerOnlyEffect(Action action, String playerId) {\n super(action);\n _playerId = playerId;\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n\n MyApplication application = (MyApplication) this.getApplication();\n if( application.isCurrentTaskExist() && application.getCurrentTaskRecord().isExecuting()) {\n return START_REDELIVER_INTENT;\n }\n\n application.setCurrentTaskRecord(TaskRecord.getNextTaskRecord());\n\n if( application.isCurrentTaskExist() ){\n prepare( application.getCurrentTaskRecord() );\n }\n return START_REDELIVER_INTENT;\n }", "@Override\n public void start() { }", "@Override\n public void start() {}", "@Override\r\n\t\tpublic void setLimitBreachMarkOnAction(int i) {\n\t\t\t\r\n\t\t}", "GameState requestActionTile();", "@Override\r\n\tpublic void processWorkload() {\n this.spawnUser(periods.get(0).getPeriodStartTimePoint());\t\r\n\t}", "@Test\n public void testStartTaskReadyByPotentialOwner() throws HTException {\n\n Task t = createTask_TwoPotentialOwners();\n this.services.startTask(t.getId(), \"user1\");\n \n org.junit.Assert.assertEquals(\"user1\", t.getActualOwner().getName());\n org.junit.Assert.assertEquals(Status.IN_PROGRESS, t.getStatus());\n }", "public abstract void doAdminStartVm(int userId, String uuid);", "public void setTimeLimitAction(java.lang.String timeLimitAction);", "PrefixRegistrationSessionEventStart startRequest(PrefixRegistrationRequest request,\n String actor,\n String additionalInformation) throws PrefixRegistrationRequestManagementServiceException;", "void queueShrunk();", "public void doInitialAction(){}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tstartService(streamService);\n\t\t\t\tstartButton.setEnabled(false);\n\t\t\t}", "public static void startActionBaz(Context context, String param1, String param2) {\n Intent intent = new Intent(context, ServerIntentService.class);\n intent.setAction(ACTION_BAZ);\n intent.putExtra(EXTRA_PARAM1, param1);\n intent.putExtra(EXTRA_PARAM2, param2);\n context.startService(intent);\n }", "public static void startActionBaz(Context context, String param1, String param2){\n\tIntent intent = new Intent(context, MyIntentService.class);\n\tintent.setAction(ACTION_BAZ);\n\tintent.putExtra(EXTRA_PARAM1, param1);\n\tintent.putExtra(EXTRA_PARAM2, param2);\n\tcontext.startService(intent);\n }", "@Override\n public void start() {\n }", "public void startProcessingRequest(MailboxSession session) {\n // Do nothing \n }", "private static PendingIntent m92439a(Context context, int i, long j, String str, String str2, String str3) {\n Intent startIntent = IntentOperation.getStartIntent(context, SnetWatchdogChimeraIntentService.class, str3);\n startIntent.putExtra(\"snet.watchdog.intent.extra.GMS_CORE_VERSION\", i);\n startIntent.putExtra(\"snet.watchdog.intent.extra.TIMEOUT\", j);\n startIntent.putExtra(\"snet.watchdog.intent.extra.SESSION_UUID\", str);\n startIntent.putExtra(\"snet.watchdog.intent.extra.DEVICE_UUID\", str2);\n return PendingIntent.getService(context, 0, startIntent, 0);\n }", "public static void startActionCancelOne(Context context) {\n Intent intent = new Intent(context, UploadService.class);\n intent.setAction(ACTION_CANCEL_ALL_UPLOAD);\n context.startService(intent);\n }" ]
[ "0.58047456", "0.57830673", "0.56776243", "0.5401034", "0.54006016", "0.5364999", "0.5332097", "0.52911633", "0.52471596", "0.52413297", "0.5232007", "0.5230774", "0.52069545", "0.51999265", "0.51931214", "0.51714194", "0.51348937", "0.5123264", "0.509739", "0.5095373", "0.5090758", "0.5070182", "0.50684285", "0.5055743", "0.50385886", "0.5026406", "0.50235355", "0.502306", "0.50127566", "0.49925858", "0.49880353", "0.49651912", "0.49541298", "0.49473652", "0.49398786", "0.49373117", "0.49252295", "0.49230957", "0.49170977", "0.48930603", "0.48869607", "0.48830292", "0.48741466", "0.4859609", "0.4856807", "0.48544207", "0.48376065", "0.483583", "0.48337772", "0.48334944", "0.48307946", "0.4826447", "0.4822276", "0.48193163", "0.48182738", "0.48181334", "0.48065227", "0.48050398", "0.47971398", "0.47956368", "0.47903028", "0.4783511", "0.4783187", "0.4772896", "0.476247", "0.47615662", "0.4758341", "0.4754868", "0.47461954", "0.4738316", "0.47317052", "0.47248125", "0.47238314", "0.4723496", "0.47204897", "0.4719715", "0.47194675", "0.47175813", "0.4711399", "0.4710756", "0.47098598", "0.47078255", "0.47077733", "0.4707053", "0.47005188", "0.4700385", "0.469822", "0.46957228", "0.46922505", "0.46898508", "0.4689754", "0.46886227", "0.46874797", "0.4687113", "0.46837103", "0.46827123", "0.46823126", "0.46811718", "0.46796656", "0.4674721" ]
0.47072592
83
/ We also have to override the responseReceived package, because this action has to finish only if the correct uuid has been received
public void responseReceived(Connection conn, Object msg) { this.endConnection = conn; this.endMsg = msg; if (((UpdateForcedPlayerPositionOk) endMsg).uuid.equals(uuid)) { detachFromParent(); server().setUpdatePos(uuid, true); System.out.println("Response received for " + this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void receiveResponse(String invocationId, HttpResponse response);", "public abstract void onReceiveResponse(ExchangeContext context);", "void responseReceived(byte[] response);", "public abstract void action(UUID uuid);", "@Override\n public void onResponse(String response, int id) {\n processData(response);\n\n }", "public String receiveResponse()\n\t{\n\t\t\n\t}", "@Override\n public void onReceivedResponse(WebSocketResponseMessage responseMessage) {\n System.err.println(\"[JVDBG] Got response with status \" + responseMessage.getStatus()+\n \" and requestId = \"+responseMessage.getRequestId());\n long id = responseMessage.getRequestId();\n if (pending.containsKey(id)) {\n Consumer f = pending.get(id);\n f.accept(responseMessage);\n pending.remove(id);\n }\n System.err.println(\"Message = \" + responseMessage);\n if (responseMessage.getBody().isPresent()) {\n System.err.println(\"[JVDBG] Got response body: \" + new String(responseMessage.getBody().get()));\n }\n }", "void onResponse(String response, int requestId);", "void receiveResponse(V response);", "abstract protected void onReceivedSequence(String sequence);", "@Override\n public void onResponse(String response) {\n System.out.print(\"respuesta Server\"+response);\n responseRequest(sync_id);\n /*if (sync_id != 0) {\n responseRequest(sync_id);\n } else {\n background_response = \"ID Sync null\";\n restartRequest(background_response);\n }*/\n }", "@Override\n public void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation) {\n }", "@Override\n public void receivedReply(final RequestTargetReply reply) {\n }", "@Override\n public void onResponse(String response) {\n System.out.println(\"Recieved Response: \" + response);\n }", "@Override\n public void onResponse(Response response) throws IOException {\n }", "@Override\r\n\tpublic void readResult(IDCardItem arg0) {\n\t\tmHandler.obtainMessage(200, arg0).sendToTarget();\r\n\t}", "@Override\n\tpublic void processResponse(Response response)\n\t{\n\t\t\n\t}", "@Override\n\tpublic void processResponse(ResponseEvent responseEvent) {\n\t\tResponse response = responseEvent.getResponse();\n\t\ttry {\n\t\t\t// Display the response message in the text area.\n\t\t\t//printMessage(\"\\nReceived response: \" + response.toString());\n\n\t\t\tClientTransaction tid = responseEvent.getClientTransaction();\n\t\t\tCSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);\n\t\t\tif (response.getStatusCode() == Response.OK) {\n\t\t\t\tif (cseq.getMethod().equals(Request.REGISTER)) {\n\t\t\t\t\tSystem.out.println(\"regist ACK OK\");\n\t\t\t\t\t//onInvite();\n\t\t\t\t} else if (cseq.getMethod().equals(Request.INVITE)) {\n\t\t\t\t\tDialog dialog = inviteTid.getDialog();\n\t\t\t\t\tRequest ackRequest = dialog.createAck(cseq.getSeqNumber());\n\t\t\t\t\tdialog.sendAck(ackRequest);\n\t\t\t\t\tSystem.out.println(\"Sending ACK\");\n\t\t\t\t} else if (cseq.getMethod().equals(Request.MESSAGE)) {\n\t\t\t\t\tSystem.out.println(\"Send OK !\");\n\t\t\t\t} else if (cseq.getMethod().equals(Request.CANCEL)) {\n\t\t\t\t\tSystem.out.println(\"Sending BYE -- cancel went in too late !!\");\n\t\t\t\t}\n\t\t\t} else if (response.getStatusCode() == Response.PROXY_AUTHENTICATION_REQUIRED\n\t\t\t\t\t|| response.getStatusCode() == Response.UNAUTHORIZED) {\n\t\t\t\tauthenticationHelper = ((SipStackExt) sipStack)\n\t\t\t\t\t\t.getAuthenticationHelper(new AccountManagerImpl(),\n\t\t\t\t\t\t\t\theaderFactory);\n\t\t\t\tinviteTid = authenticationHelper.handleChallenge(response, tid,\n\t\t\t\t\t\tsipProvider, 5);\n\t\t\t\tinviteTid.getRequest().addHeader(\n\t\t\t\t\t\theaderFactory.createExpiresHeader(3600));\n\t\t\t\tinviteTid.getRequest().setMethod(Request.REGISTER);\n\t\t\t\tinviteTid.sendRequest();\n\t\t\t\tinvco++;\n\t\t\t\tprintMessage(\"[processResponse] Request sent:\\n\" + inviteTid.getRequest().toString() + \"\\n\\n\");\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "@Override\n\t\t\t\t\tpublic void onResponse(String response) {\n\n\t\t\t\t\t}", "public void responseReceived(int i, String str, long j, String str2) {\n super.responseReceived(i, str, j, str2);\n JumioAnalytics.add(MobileEvents.networkRequest(JumioAnalytics.getSessionId(), getClass().getName(), i, str, j));\n }", "public void afterReceivingeGainChatResponse(ChatResponse response);", "@Override\n\tpublic void onRuning(TAResponse response) {\n\n\t}", "@Override\n public void onResponse(String response) {\n }", "@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\tpublic void handleResponse() {\n\t\t\n\t}", "@Override\n public void onResponse(String response) {\n }", "@Override\n\tpublic void onResourceDelivered(ResourceResponse arg0) {\n\t\t\n\t}", "ISerializer invoke(String responseReceiverId);", "void responseReady(String response);", "public void onResponse(Response response) throws Exception;", "@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}", "void onReceive( String response );", "@Override\n public void onResponse(String response) {\n }", "@Override\n public void receivedReply(final SelectProcessReply reply) {\n }", "@Override\n public void onResponse(String response) {\n }", "@Override\n public void onResponse(String response) {\n }", "@Override\n public void onResponse(String response) {\n }", "@Override\n public void onResponse(String response)\n {\n\n }", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "@Override\n public void onResponse(String response) {\n String[] info = response.split(\",\");\n //now we know how many invoices do we need to create the same number of buttons\n listener.onInvoiceRetriveSuccess(info);\n }", "@Override\n\t\t\tprotected void deliverResponse(String response) {\n\n\t\t\t}", "private void handleResponse(Message msg, String listenerId)\n {\n String requestId = popString(Message.REQUESTID_TAG, msg);\n String type = popString(Message.TYPE_TAG, msg);\n \n NamedResource res = null;\n\n if (type.equals(NamedResource.PEER))\n {\n res = (Peer) new Peer();\n }\n\n //FIXME conversion of advertisment to resource object is done in each\n // of the resource\n // thus while converting to resource object we create an Id from the\n // byte array in the message recd\n // and while storing to cache, I store it hashed on the String version\n // of the ID..thus need to convert\n //ID again to String. My other option is to store the resource hashed\n // on ID object but then for every\n //comparison in the cache , i need to convert the ID to string as the\n // ID in the message is in a string\n // Its a trade off between when to do the conversion. Can be modified\n // later:)\n\n else if (type.equals(NamedResource.GROUP))\n {\n res = (PeerGroup) new PeerGroup();\n } else if (type.equals(NamedResource.PIPE))\n {\n res = (Pipe) new Pipe();\n }\n \n boolean available = false;\n \n if (res != null)\n {\n res.RevAdvertisment(msg.getElements());\n \n // resolved adv is its own peer, don't handle\n if (res.getID().equals(peer.getID()))\n {\n LOG.debug(\"got its own peer advertisement\");\n return;\n }\n available = cache.addResource(res);\n res.touch();\n }\n\n LOG.debug(\"found resource: \"+res.getName());\n \n if (!available)\n {\n\t for(Enumeration en = queries.elements(); en.hasMoreElements();)\n\t {\n\t Query query = (Query)en.nextElement();\n\t \n\t if (res.matches(query.groupId, query.type, query.attr,query.value))\n\t query.listener.handleSearchResponse(res);\n\t }\n }\n// Listener listener = getListener(listenerId);\n// if (listener != null){\n// listener.handleSearchResponse(res);\n// }\n \n }", "@Override\n\t\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\t\tSystem.out.println(arg0);\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\tpublic void receiveRequest() {\n\n\t}", "@Override\n\tpublic void sendResponse() {\n\t\t\n\t}", "@Override\n public void onResponse(String response) {\n String[] IDs = response.split(\",\");\n //now we know how many invoices do we need to create the same number of buttons\n listener.onInvoicesRetrievalSuccess(IDs);\n }", "@Override\n public void onResponse(String response) {\n String[] IDs = response.split(\",\");\n //now we know how many invoices do we need to create the same number of buttons\n listener.onInvoicesRetrievalSuccess(IDs);\n }", "public Object handleCommandResponse(Object response) throws RayoProtocolException;", "@Override\n\tpublic void sendResponse() {\n\n\t}", "@Override\n public void onCompleted() {\n responseObserver.onCompleted();\n }", "public abstract String getResponseID();", "protected abstract void askResponse();", "void responseSequenceNumber() {\r\n\t\t\r\n\t}", "public void onEventResponded(int eventID, int qid, String qtype, String responseString);", "@Override\n\t\t\t\t\tpublic void onResponse(String s) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void selectResponse(String response , Player player);", "abstract UUID getRequestId();", "public void onRequestResponse(Response response) { }", "@Override\n public void onOffportRequestCompleted(int requestId) {\n\n }", "void onResponseTaskCompleted(Request request, Response response, OHException ohex, Object data);", "@Override\n protected void deliverResponse(T response) {\n listener.onSuccessResponse(response);\n }", "void received() throws ImsException;", "private void __getReply() throws IOException\n {\n __getReply(true); // tagged response\n }", "public void onRequestFinished(int requestId, int resultCode, Bundle payload);", "@Override\n\tpublic void complete(ReceiveResponseBean receiveResponseBean) {\n\n\t}", "public void receiveResultIdAmbito(\r\n es.mitc.redes.urbanismoenred.serviciosweb.v1_86.UrbrWSServiceStub.IdAmbitoResponseE result\r\n ) {\r\n }", "public void setResponsedByUserUuid(String responsedByUserUuid);", "public void handleResponse(byte[] result, Command originalCommand);", "@Override\n\t\tpublic void onComplete(String response, Object state) {\n\t\t\tLog.d(\"arvi\", \"arvi1111\");\n\t\t}", "@Override\n\t\t\t\t\t\t public void run() {\n\t\t\t\t\t\t\t getResponse();\n\t\t\t\t\t\t }", "@Override\n public void onResponse(String response) {\n loadSentMessages();\n }", "protected void handleSuccessMessage(Response response) {\n\t\tonRequestResponse(response);\n\t}", "@Override\n public void onResponse(String response) {\n Log.i(\"Checking\", response + \" \");\n if(new ServerReply(response).getStatus())\n {\n Toast.makeText(context,new ServerReply(response).getReason(),Toast.LENGTH_LONG).show();\n }\n\n }", "@Override\n\tpublic void receivedNegotiation(int arg0, int arg1) {\n\t\t\n\t}", "public void callCompleted(InetAddress clientId, int xid, RpcResponse response) {\n ClientRequest req = new ClientRequest(clientId, xid);\n CacheEntry e;\n synchronized(map) {\n e = map.get(req);\n }\n e.response = response;\n }", "@Override\n protected void deliverResponse(JSONObject response) {\n listener.onResponse(response);\n System.out.println(\"response \"+response);\n }", "@Override\r\n\t\tpublic void onComplete(String response, Object state) {\n\t\t\t\r\n\t\t}", "private void receivedMessage(ChannelHandlerContext channelHandlerContext, ByteBuf response) {\n String message = new String(getByteArray(response));\n if (message.contains(\"Heartbeat\")) {\n logger.info(\"Received Heartbeat message\");\n channelHandlerContext.fireUserEventTriggered(response);\n } else {\n clientChannelHandlerObserver.processResponse(getByteArray(response));\n }\n }", "@Override\r\n\t\t\t\t\tpublic void onResponse(String arg0) {\n\t\t\t\t\t\tlistonResponse(arg0);\r\n\t\t\t\t\t\trefreshView.onRefreshComplete();\r\n\t\t\t\t\t}", "@Override\n public void onResponse(String response) {\n String[] info = response.split(\",\");\n //now we know how many invoices do we need to create the same number of buttons\n System.out.println(info);\n listener.onInvoiceRetrievalSuccess(info);\n }", "@Override\n public void receivedReply(final SelectFileReply reply) {\n }", "public void readResponse()\n\t{\n\t\tDataObject rec = null;\n\t\tsynchronized(receive)\n\t\t{\n\t\t\trec = receive.get();\n\t\t}\n\t\tAssertArgument.assertNotNull(rec, \"Received packet\");\n\t\tpublishResponse(rec);\n\t}", "@Override\n public void onResponse(String response) {\n Log.i(\"TAG\", \"---\" + response);\n if (action.equals(\"login\")) {\n if (response.contains(\"login_ok\")) {\n Log.i(\"TAG\", response + \"login_ok\" + application.password);\n handler.sendMessage(handler\n .obtainMessage(LOGIN_OK));\n } else if (response.contains(\"Password is error\")) {\n handler.sendMessage(handler\n .obtainMessage(PASSWORD_ERROR));\n } else {\n handler.sendMessage(handler\n .obtainMessage(LOGIN_FAILED));\n }\n } else {\n handler.sendMessage(handler\n .obtainMessage(LOGOUT_OK));\n }\n\n }", "public RequestResponseBehaviour(BoatCoordinator myAgent, MessageTemplate mt) {\n super(myAgent, mt);\n showMessage(\"Waiting REQUESTs from authorized agents\");\n this.receiver = receiver;\n }", "@Implementation\n protected boolean sendResponse(\n BluetoothDevice device, int requestId, int status, int offset, byte[] value) {\n this.responses.add(value);\n return this.bluetoothGattServerReflector.sendResponse(device, requestId, status, offset, value);\n }", "@Override\n public void processResult(HttpResponseMessage response) {\n }", "@Override\n public void onResponse(JSONObject response) {\n processResponse(response);\n }", "public void startResponse()\n\t\t\t{\n\t\t\t\tsend(\"<response>\", false);\n\t\t\t}", "@Override\n public void onResponse(String response) {\n finalData(response);\n }", "@Override\n public void onResponse(final Transaction transaction, final String requestId, final PoyntError poyntError) throws RemoteException {\n transaction.setAction(TransactionAction.VOID);\n\n final ElavonTransactionRequest request = convergeMapper.getTransactionVoidRequest(\n transaction.getFundingSource(),\n transaction.getProcessorResponse().getRetrievalRefNum());\n convergeService.update(request, new ConvergeCallback<ElavonTransactionResponse>() {\n @Override\n public void onResponse(final ElavonTransactionResponse elavonResponse) {\n Log.d(TAG, elavonResponse != null ? elavonResponse.toString() : \"n/a\");\n if (elavonResponse.isSuccess()) {\n Log.i(TAG, \"voidTransaction: \" + transaction.getId() + \" SUCCESS\");\n if (listener != null) {\n convergeMapper.mapTransactionResponse(elavonResponse, transaction);\n try {\n // update the transactionId w/ new void txn Id and set parent\n transaction.setParentId(transaction.getId());\n transaction.setId(UUID.randomUUID());\n listener.onResponse(transaction, requestId, null);\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }\n } else {\n Log.e(TAG, \"voidTransaction: \" + transaction.getId() + \" FAILED\");\n if (listener != null) {\n try {\n // TODO need better error mapping\n PoyntError error = new PoyntError(PoyntError.CODE_API_ERROR);\n listener.onResponse(transaction, requestId, error);\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }\n }\n }\n\n @Override\n public void onFailure(final Throwable t) {\n t.printStackTrace();\n Log.e(TAG, \"voidTransaction: \" + transaction.getId() + \" FAILED\");\n if (listener != null) {\n // TODO need better error mapping\n final PoyntError error = new PoyntError(PoyntError.CHECK_CARD_FAILURE);\n error.setThrowable(t);\n try {\n listener.onResponse(transaction, requestId, error);\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }\n }\n });\n }", "@Override\r\n\tpublic void onReceive(Object arg0) throws Exception {\n\t\t\r\n\t}", "@Override\n public void onResponseRecieved(String reply) {\n\n if(!reply.equals(\"error\")) {\n Context context = getApplicationContext();\n CharSequence text = reply;\n int duration = Toast.LENGTH_LONG;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n EditText serverReply = (EditText) findViewById(R.id.editTextServerReply);\n serverReply.setText((CharSequence) serverReply, EditText.BufferType.NORMAL);\n\n //Deserializing response and pulling session data out\n Response r = new Gson().fromJson(reply, Response.class);\n\n account.sessionID = r.result.session_id;\n\n AccountMan.AccountMan a = new AccountMan.AccountMan();\n a.AddAccount(account);\n }\n\n }", "@Override\n\tpublic void replyOperationCompleted() { ; }", "@Override\r\n\tpublic void receiveResult(Stanza stanza, Object payload) {\n\t\t\r\n\t}", "@Override\n\t\tpublic void asyncRequestSuccess(long id, Object response)\n\t\t\t\tthrows ConnectorException {\n\t\t\t\n\t\t}", "@Override\n public void onResponse(String response) {\n Utils.logApiResponseTime(calendar, tag + \" \" + url);\n mHandleSuccessResponse(tag, response);\n\n }", "@Override\n\tprotected Object handleUserinfoEndpointRequest(String requestId) {\n\t\tif(!receivedRefreshRequest) {\n\t\t\t//we don't want the test to be marked as completed if the client sends a userinfo\n\t\t\t//request before sending a refresh request\n\t\t\t//this is not the userinfo request we are looking for\n\t\t\treceivedUserinfoRequest = false;\n\t\t}\n\t\treturn super.handleUserinfoEndpointRequest(requestId);\n\t}", "@Override\n public long getUUID() {\n return endpointHandler.getUUID();\n }", "@Override\n\tpublic void onResponse( Object cookie, ResponseJSO response, int msgLevel, String msg )\n\t{\n\t\tPendingRequestInfo info = (PendingRequestInfo) cookie;\n\n\t\t// Store answer in cache\n\t\tif( info.fStoreResultInCache )\n\t\t\tcache.put( info.requestKey, response );\n\n\t\t// give the result to all the subscribees\n\t\tfor( RequestCallInfo call : info.subscriptions )\n\t\t\tcall.setResult( msgLevel, msg, null, response );\n\n\t\t// forget this request\n\t\tpendingRequests.remove( info );\n\n\t\t// calls back the clients\n\t\tcheckAnswersToGive();\n\t}" ]
[ "0.66537", "0.65351427", "0.6408824", "0.6316407", "0.6298074", "0.6274689", "0.6228698", "0.6171877", "0.61152333", "0.6104544", "0.60509145", "0.60431427", "0.6027321", "0.5975671", "0.59630877", "0.5956907", "0.59375155", "0.59347135", "0.59129417", "0.5902392", "0.5855573", "0.5839381", "0.5834172", "0.58309466", "0.58235514", "0.5820015", "0.58196586", "0.58174723", "0.57932717", "0.5790431", "0.57838285", "0.57705224", "0.57661146", "0.5765973", "0.5760245", "0.5760245", "0.5760245", "0.57332337", "0.57131183", "0.57131183", "0.5681285", "0.5672971", "0.5657397", "0.56486094", "0.5639501", "0.56378657", "0.5602622", "0.5602622", "0.5593644", "0.5581666", "0.55756116", "0.5573623", "0.55693173", "0.5561155", "0.55586153", "0.55440307", "0.5542682", "0.55426425", "0.5528122", "0.5526566", "0.55213445", "0.55208385", "0.5499052", "0.54880255", "0.548587", "0.54847604", "0.5484535", "0.5482948", "0.54800546", "0.5478719", "0.5469953", "0.5469731", "0.546179", "0.545534", "0.5446129", "0.5444334", "0.5442085", "0.5437454", "0.54371387", "0.54293126", "0.5414534", "0.5414444", "0.5413767", "0.5411145", "0.5403656", "0.5400429", "0.5387258", "0.5384212", "0.538207", "0.5380189", "0.53780687", "0.537799", "0.5367667", "0.53671575", "0.5359688", "0.5357693", "0.53484", "0.53465194", "0.5341125", "0.5339994" ]
0.56290674
46
Refund is created using the payment id and amount details.
@Test public void create() throws RazorpayException{ JSONObject request = new JSONObject("{" + "\"amount\":\"100\"," + "\"speed\":\"normal\"," + "\"notes\":{\"notes_key_1\":\"BeammeupScotty.\"," + "\"notes_key_2\":\"Engage\"}," + "\"receipt\":\"ReceiptNo.31\"}"); String mockedResponseJson = "{\n" + " \"id\": "+REFUND_ID+",\n" + " \"entity\": \"refund\",\n" + " \"amount\": 500100,\n" + " \"receipt\": \"Receipt No. 31\",\n" + " \"currency\": \"INR\",\n" + " \"payment_id\": \"pay_FCXKPFtYfPXJPy\",\n" + " \"notes\": [],\n" + " \"acquirer_data\": {\n" + " \"arn\": null\n" + " },\n" + " \"created_at\": 1597078866,\n" + " \"batch_id\": null,\n" + " \"status\": \"processed\",\n" + " \"speed_processed\": \"normal\"\n" + "}"; try { mockResponseFromExternalClient(mockedResponseJson); mockResponseHTTPCodeFromExternalClient(200); Refund fetch = refundClient.create(request); assertNotNull(fetch); assertEquals(REFUND_ID,fetch.get("id")); assertEquals("refund",fetch.get("entity")); assertEquals(500100,(int)fetch.get("amount")); assertEquals("INR",fetch.get("currency")); String createRequest = getHost(Constants.REFUNDS); verifySentRequest(true, request.toString(), createRequest); } catch (IOException e) { assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FeeRefund create(Map<String, Object> params) throws StripeException {\n return create(params, (RequestOptions) null);\n }", "public FeeRefund create(Map<String, Object> params, RequestOptions options)\n throws StripeException {\n return ApiResource.request(ApiResource.RequestMethod.POST, String.format(\"%s%s\",\n Stripe.getApiBase(), this.getUrl()), params, FeeRefund.class, options);\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "public void setRefundId(int value) {\n this.refundId = value;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@PostMapping(\"/payments\")\n public ResponseEntity<Payment> createPayment(@Valid @RequestBody Payment payment) throws URISyntaxException {\n log.debug(\"REST request to save Payment : {}\", payment);\n if (payment.getId() != null) {\n throw new BadRequestAlertException(\"A new payment cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n Payment result = paymentRepository.save(payment);\n return ResponseEntity.created(new URI(\"/api/payments/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "public com.vodafone.global.er.decoupling.binding.request.RefundCreditRequest createRefundCreditRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundCreditRequestImpl();\n }", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "public FeeRefund retrieve(String id) throws StripeException {\n return retrieve(id, (RequestOptions) null);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "int insert(TRefundOrder record);", "public String getRefundId() {\n return refundId;\n }", "public int getRefundId() {\n return refundId;\n }", "@RequestMapping(value = \"/customer_refund/create\", method = RequestMethod.POST,\n produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> createCustomerRefund(\n @RequestBody(required = true) COrderRefundTable customerRefund) {\n try {\n int affectedRow = refundRepositoryImpl.createCustomerRefund(customerRefund);\n\n if (affectedRow == 0) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Customer refund not created\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Customer refund successfully registered\\\"}\",\n HttpStatus.OK);\n }\n } catch (DataIntegrityViolationException di) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Invalid input, lack of data\\\"}\",\n HttpStatus.BAD_REQUEST);\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public com.vodafone.global.er.decoupling.binding.request.RefundDiscountRequest createRefundDiscountRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundDiscountRequestImpl();\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "@Override\r\n\tpublic void makePayment(Payment p, int amount) {\n\t\t\r\n\t}", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public com.vodafone.global.er.decoupling.binding.request.RefundMonetaryRequest createRefundMonetaryRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundMonetaryRequestImpl();\n }", "boolean createInvoice(int id, String title, LocalDate effecitvedate, float amount) throws PreconditionException, PostconditionException, ThirdPartyServiceException;", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public FeeRefund retrieve(String id, RequestOptions options) throws StripeException {\n return retrieve(id, null, options);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "public com.vodafone.global.er.decoupling.binding.request.RefundCreditRequestType createRefundCreditRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundCreditRequestTypeImpl();\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "int updateByPrimaryKey(TRefundOrder record);", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "public com.vodafone.global.er.decoupling.binding.request.RefundAttributesType createRefundAttributesType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundAttributesTypeImpl();\n }", "public com.vodafone.global.er.decoupling.binding.request.RefundDiscountRequestType createRefundDiscountRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundDiscountRequestTypeImpl();\n }", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //scmybank1@huianrong.com\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "CancelPaymentResponse cancelPayment(Integer paymentId) throws ResourceNotFoundException, BadInputException;", "@RequestMapping(value = \"/organizer_refund/create\", method = RequestMethod.POST,\n produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> createOrganizerRefund(\n @RequestBody(required = true) OOrderRefundTable organizerRefundTable) {\n try {\n int affectedRow = refundRepositoryImpl.createOrganizerRefund(organizerRefundTable);\n\n if (affectedRow == 0) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not created\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully registered\\\"}\",\n HttpStatus.OK);\n }\n } catch (DataIntegrityViolationException di) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Invalid input, lack of data\\\"}\",\n HttpStatus.BAD_REQUEST);\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public com.vodafone.global.er.decoupling.binding.request.RefundMonetaryRequestType createRefundMonetaryRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundMonetaryRequestTypeImpl();\n }", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public Integer getRefund() {\n return refund;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public FeeRefund retrieve(String id, Map<String, Object> params, RequestOptions options)\n throws StripeException {\n String url = String.format(\"%s%s/%s\", Stripe.getApiBase(), this.getUrl(), id);\n return ApiResource.request(ApiResource.RequestMethod.GET, url, params, FeeRefund.class,\n options);\n }", "@PostMapping(\"/payments\")\n\tpublic Payment addPayment(@RequestBody Payment thePayment) {\n\t\t\n\t\tthePayment.setId(0);\n\t\t\n\t\tpaymentService.save(thePayment);\n\t\t\n\t\treturn thePayment;\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "public String getRefundReason() {\n return refundReason;\n }", "@DeleteMapping(\"/payment/{id}\")\n\tpublic ResponseEntity<Payment> cancelPayment(@PathVariable(\"id\") int paymentId) {\n\t\tlogger.info(\"Cancel Payment\");\n\t\tif (payService.cancelPayment(paymentId) == null) {\n\t\t\tthrow new PaymentNotFoundException(\"Payment not found with id: \" + paymentId);\n\t\t}\n\t\treturn ResponseEntity.ok().body(payService.cancelPayment(paymentId));\n\t}", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "@DeleteMapping(\"/payments/{id}\")\n public ResponseEntity<Void> deletePayment(@PathVariable Long id) {\n log.debug(\"REST request to delete Payment : {}\", id);\n paymentRepository.deleteById(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "int insertSelective(TRefundOrder record);", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setPaymentId( Integer paymentId ) {\n this.paymentId = paymentId ;\n }", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "@PostMapping(\"/invoices/{invoice_number}/paytransactions\")\r\n public PayTransaction createPayTransaction(@PathVariable long invoice_number, @Valid @RequestBody PayTransaction payTransaction) {\r\n return invoiceRepository.findById(invoice_number).map(invoice -> {\r\n payTransaction.setInvoice(invoice);\r\n // Manually invoice number needs to be set. Otherwise it will be empty.\r\n payTransaction.setInvoice_number(invoice.getInvoice_number());\r\n return payTransactionRepository.save(payTransaction);\r\n }).orElseThrow(() -> new ResourceNotFoundException(\"Invoice ID \" + invoice_number + \" not found\"));\r\n }", "public com.vodafone.global.er.decoupling.binding.request.CustcareFullRefundCreditRequest createCustcareFullRefundCreditRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CustcareFullRefundCreditRequestImpl();\n }", "int deleteByPrimaryKey(String refundorderid);", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "public int updatePayment2(int requestId, int amount);", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public ModelPayment(double payment) {\n this.payment = payment;\n }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public Invoice createInvoice(Order order);", "public Payment(double amountPaid, int method, Timestamp date, int cardDetailsID, int invoiceID){\n this.recordID = recordID;\n this.amountPaid = amountPaid;\n this.method = method;\n this.date = date;\n this.cardDetailsID = cardDetailsID;\n this.invoiceID = invoiceID;\n }", "@RequestMapping(\"/create-transaction-void\")\n public String createTransactionVoid(Model model,\n @RequestParam(value = \"transaction_id\", required = false) final String transactionId) {\n if (StringUtils.isNotBlank(transactionId)) {\n TransactionVoid transactionVoid = new TransactionVoid.Builder(ReturnReason.FRAUD, transactionId).build();\n TransactionVoid createdTransactionVoid = alternativePaymentClient.create(transactionVoid,\n TransactionVoid.getApiEndpoint(transactionId), TransactionVoid.class);\n\n model.addAttribute(\"transactionVoid\", createdTransactionVoid);\n }\n return \"void/create-transaction-void\";\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "@RequestMapping(value = \"bankRemittanceList\", method = RequestMethod.POST)\n\tpublic String createBankRemittance(@Valid @ModelAttribute BankRemittanceForm bankRemittanceForm, RedirectAttributes ra) {\n\n\t\tbankRemittanceService.createBankRemittance(DateUtils.format(bankRemittanceForm.getDateCharge(), DateUtils.FORMAT_DATE),\n\t\t\t\tDateUtils.format(bankRemittanceForm.getMonthCharge(), DateUtils.FORMAT_MONTH_YEAR));\n\t\tMessageHelper.addSuccessAttribute(ra, \"bankRemittance.successCreate\", bankRemittanceForm.getDateCharge());\n\t\treturn REDIRECT_BANKREMITTANCE;\n\t}", "public FeeRefundCollection list(Map<String, Object> params) throws StripeException {\n return list(params, null);\n }", "void paymentOrder(long orderId);", "public CreditReversal create(CreditReversalCreateParams params) throws StripeException {\n return create(params, (RequestOptions) null);\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "public IBankTransfert payment();", "public Payment(User to, User from, double cashAmount, String paymentName) {\n this.cashAmount = cashAmount;\n this.to = to;\n this.from = from;\n this.paymentName = paymentName;\n paymentID = rand.nextInt(max - min + 1) + min;\n }", "void create(Discount discount) throws ServiceException;", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "boolean postReimbursementToDataBase(int amount, String description, int author, int statusId, int typeId);", "public void addindbpayment(){\n \n \n double tot = calculateTotal();\n Payment pms = new Payment(0,getLoggedcustid(),tot);\n \n System.out.println(\"NI Payment \"+getLoggedcustid()+\" \"+pms.getPaymentid()+\" \"+pms.getTotalprice());\n session = NewHibernateUtil.getSessionFactory().openSession();\n session.beginTransaction();\n session.save(pms);\n try \n {\n session.getTransaction().commit();\n session.close();\n } catch(HibernateException e) {\n session.getTransaction().rollback();\n session.close();\n }\n clear();\n setBookcart(null);\n test.clear();\n itemdb.clear();\n \n \n try{\n FacesContext.getCurrentInstance().getExternalContext().redirect(\"/BookStorePelikSangat/faces/index.xhtml\");\n } \n catch (IOException e) {}\n \n\t}", "public long createPayment(double amount, long orderId) throws ApiException {\n @SuppressWarnings(\"Convert2MethodRef\")\n MutationQuery query = Operations.mutation(mutation -> mutation\n .createPayment(amount, orderId, res -> res\n .code()\n .message()\n .success()\n .payment(payment -> payment\n .id())));\n\n CreatePaymentResponse createPaymentResponse = mutate(query).getCreatePayment();\n if (!createPaymentResponse.getSuccess()) {\n throw new ApiException(\"Failed to create payment: \" + createPaymentResponse.getMessage() + \" (code=\" + createPaymentResponse.getCode() + \")\");\n }\n\n return createPaymentResponse.getPayment().getId();\n }", "Purchase create(Purchase purchase) throws SQLException, DAOException;", "CancelPaymentResponse getCancelPaymentById(Integer paymentId) throws ResourceNotFoundException;", "String makePayment(String userName, String teamName, Payment payment) throws RemoteException, InterruptedException;", "public int makePayment(Map<String, Object> makePaymentArgs) {\n\n\t\tOffer offer = (Offer) makePaymentArgs.get(\"offer\"); // verification logic\n\t\t//log.debug(\"make payment service - \" + offer);\n\t\tint installments = offer.getInstallments();\n\t\tif (installments <= 0) {\n\t\t\tlog.info(\"Sorry, payments can't be made on this offer!\");\n\t\t\toffer.setStatus(new Status(2, \"completed\"));\n\t\t\tofferDao.update(offer);\n\t\t\treturn 0;\n\t\t}\n\n\t\t// create a payment\n\t\tPayment payment = new Payment();\n\t\tpayment.setUser((User) makePaymentArgs.get(\"user\"));\n\t\tpayment.setOffer(offer);\n\n\t\tDouble amount = ((Double) makePaymentArgs.get(\"amount\") / installments);\n\t\tpayment.setAmount(amount);\n\t\tpayment = paymentDao.create(payment);\n\n\t\tif (payment.getPayment_id() != null) {\n\t\t\t//log.debug(\"Make Payment - Payment Id: \" + payment);\n\n\t\t\t// update number of installments left\n\t\t\tint oldInstallments = offer.getInstallments();\n\t\t\toffer.setInstallments(oldInstallments - 1);\n\t\t\tif (oldInstallments - 1 == 0) {\n\t\t\t\tStatus complete = new Status();\n\t\t\t\tcomplete.setStatus_id(2);\n\t\t\t\tcomplete.setStatus_name(\"completed\");\n\t\t\t\toffer.setStatus(complete);\n\t\t\t}\n\n\t\t\tDouble oldBalance = offer.getBalance();\n\t\t\toffer.setBalance(oldBalance - amount);\n\t\t\tofferDao.update(offer);\n\t\t\treturn payment.getPayment_id();\n\t\t} else {\n\t\t\tlog.info(\"Payment Unsuccessful\");\n\t\t\treturn 0;\n\t\t}\n\t}", "@PostMapping(\"/payment\")\n\tpublic ResponseEntity<Payment> addPayment(@Valid @RequestBody Payment payment) {\n\t\tlogger.info(\"Adding new Payment\");\n\t\tpayService.addPayment(payment);\n\t\treturn ResponseEntity.ok(payment);\n\t}", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "@Transactional\n public String transferMoney(Integer destCardId, double amount, HttpServletRequest r) {\n Card toCard = cardService.getCard(destCardId);\n double currentAmount = currentCard.getAmount();\n JSONObject json = new JSONObject();\n if (currentAmount < amount) {\n try {\n json.put(\"sucess\", false);\n json.put(\"result\", \"Недостаточно средств.\");\n } catch (JSONException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n\n } else {\n currentCard.setAmount(currentAmount - amount);\n double newAmount = converter.convert(currentCard.getCurrency(), toCard.getCurrency(), amount);\n toCard.setAmount(toCard.getAmount() + newAmount);\n Invoice invoice = currentCard.createInvoice();\n invoice.setToCard(destCardId);\n invoice.setAmount(newAmount);\n String date = new SimpleDateFormat(\"dd.MM.yyyy-hh.mm-a\").format(GregorianCalendar.getInstance().getTime());\n invoice.setDate(date);\n invoice.setCurrency(toCard.getCurrency());\n invoiceService.addInvoice(invoice);\n try {\n json.put(\"sucess\", true);\n json.put(\"result\", \"Успешно.\");\n } catch (JSONException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }\n cardService.update(currentCard);\n r.getSession().setAttribute(\"Card\", currentCard);\n cardService.update(toCard);\n return json.toString();\n }" ]
[ "0.67485976", "0.64840716", "0.64594907", "0.6238347", "0.6125729", "0.6059347", "0.60248953", "0.58475405", "0.57802075", "0.5732882", "0.569515", "0.567121", "0.5665027", "0.5662124", "0.56130135", "0.5590688", "0.55866563", "0.554725", "0.55263215", "0.5496998", "0.5483516", "0.54733694", "0.5439263", "0.5416095", "0.53850776", "0.5355728", "0.53542477", "0.5343146", "0.53040963", "0.5303664", "0.5267607", "0.5261682", "0.52602065", "0.5253464", "0.5211668", "0.52084136", "0.51962894", "0.5190182", "0.5181797", "0.5170019", "0.5169039", "0.51447076", "0.5112304", "0.5105476", "0.5085567", "0.50764084", "0.5075446", "0.5060966", "0.50491035", "0.504629", "0.5043346", "0.50412226", "0.4990892", "0.4989734", "0.4966579", "0.4965693", "0.49497947", "0.49493375", "0.49385288", "0.4932721", "0.49130893", "0.49028167", "0.48895955", "0.4882345", "0.48568055", "0.48472852", "0.48449573", "0.48273885", "0.48219538", "0.4819915", "0.48183915", "0.48128387", "0.4809144", "0.48033145", "0.48024756", "0.47853607", "0.47810256", "0.47780338", "0.47713327", "0.4770021", "0.4745704", "0.4740801", "0.47382262", "0.4734623", "0.473375", "0.47281587", "0.4726641", "0.47247502", "0.4709985", "0.47092295", "0.46902084", "0.46708182", "0.46689066", "0.46637386", "0.46590194", "0.4654385", "0.46521804", "0.46497285", "0.46438017", "0.464241" ]
0.52684253
30
Retrieve all refund details using refund id.
@Test public void fetch() throws RazorpayException{ String mockedResponseJson = "{\n" + " \"id\": "+REFUND_ID+",\n" + " \"entity\": \"refund\",\n" + " \"amount\": 300100,\n" + " \"currency\": \"INR\",\n" + " \"payment_id\": \"pay_FIKOnlyii5QGNx\",\n" + " \"notes\": {\n" + " \"comment\": \"Comment for refund\"\n" + " },\n" + " \"receipt\": null,\n" + " \"acquirer_data\": {\n" + " \"arn\": \"10000000000000\"\n" + " },\n" + " \"created_at\": 1597078124,\n" + " \"batch_id\": null,\n" + " \"status\": \"processed\",\n" + " \"speed_processed\": \"normal\",\n" + " \"speed_requested\": \"optimum\"\n" + "}"; try { mockResponseFromExternalClient(mockedResponseJson); mockResponseHTTPCodeFromExternalClient(200); Refund fetch = refundClient.fetch(REFUND_ID); assertNotNull(fetch); assertEquals(REFUND_ID,fetch.get("id")); String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID)); verifySentRequest(false, null, fetchRequest); } catch (IOException e) { assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getRefundId() {\n return refundId;\n }", "public FeeRefund retrieve(String id) throws StripeException {\n return retrieve(id, (RequestOptions) null);\n }", "public int getRefundId() {\n return refundId;\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public FeeRefund retrieve(String id, RequestOptions options) throws StripeException {\n return retrieve(id, null, options);\n }", "@RequestMapping(value = \"/organizer_refund/search/{organizer_refund_id}\",\n method = RequestMethod.GET, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> getOrganizerRefundByRefundID(\n @PathVariable int organizer_refund_id) {\n\n try {\n List<OOrderRefundTable> organizerRefundList =\n refundRepositoryImpl.getOrganizerRefundByRefundID(organizer_refund_id);\n\n if (organizerRefundList == null || organizerRefundList.isEmpty()) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"No refund found\\\"}\", HttpStatus.OK);\n } else {\n return new ResponseEntity<>(new Gson().toJson(\n (refundRepositoryImpl.getOrganizerRefundByRefundID(organizer_refund_id))),\n HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public FeeRefund retrieve(String id, Map<String, Object> params, RequestOptions options)\n throws StripeException {\n String url = String.format(\"%s%s/%s\", Stripe.getApiBase(), this.getUrl(), id);\n return ApiResource.request(ApiResource.RequestMethod.GET, url, params, FeeRefund.class,\n options);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "public Integer getRefund() {\n return refund;\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGoodsList(Integer id) {\n\t\tList<WxOrderDetail> returnList = null;\n\t\tList<WxOrderDetail> detailList = orderMapper.queryOrderRefundGoodsList(id);\n\t\tif(detailList != null && detailList.size() > 0) {\n\t\t\treturnList = new ArrayList<WxOrderDetail>();\n\t\t\tfor(int i=0;i<detailList.size();i++) {\n\t\t\t\tif(detailList.get(i).getGoodsNum() > 0) {\n\t\t\t\t\tdetailList.get(i).setNum(0);\n\t\t\t\t\treturnList.add(detailList.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn returnList;\n\t}", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "TRefundOrder selectByPrimaryKey(String refundorderid);", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public FeeRefundCollection list(Map<String, Object> params) throws StripeException {\n return list(params, null);\n }", "public String getRefundReason() {\n return refundReason;\n }", "public void getBonuri(int id) {\n\t\tList<BonFiscal> bonuriClient = bonFiscalOperations.getAllBonuriFromClient(id);\n\t\tbonFiscalOperations.printListOfBonuri(bonuriClient);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "@Override\n\tpublic List<PageData> getRefundlist(Page page) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\n\t\t\t\t\"SummaryStatMapper.getRefundlistPage\", page);\n\t}", "public Integer getRefundState() {\n return refundState;\n }", "@Transactional(value = Transactional.TxType.MANDATORY)\n public Rubric getRubricById(Long id) {\n return getRubricFromLinker(rubricLinkerRepository.findById(new RubricLinker.Pk(new Project(id))).orElse(null));\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "List<Reimbursement> getReimbursementsByUser(int id);", "public Integer getRefundMoney() {\n return refundMoney;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "public FeeRefundCollection list(Map<String, Object> params, RequestOptions options)\n throws StripeException {\n String url = String.format(\"%s%s\", Stripe.getApiBase(), this.getUrl());\n return ApiResource.requestCollection(url, params, FeeRefundCollection.class, options);\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@RequestMapping(value = \"/organizer_refund/search/organizer_order_id/{oorder_id}\",\n method = RequestMethod.GET, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> getOrganizerRefundByOorder(@PathVariable int oorder_id) {\n\n try {\n List<OOrderRefundTable> organizerRefundList =\n refundRepositoryImpl.getOrganizerRefundByOorderID(oorder_id);\n\n if (organizerRefundList == null || organizerRefundList.isEmpty()) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"No refund found\\\"}\", HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n new Gson().toJson(\n (refundRepositoryImpl.getOrganizerRefundByOorderID(oorder_id))),\n HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "public List<Reimbursement> getReimsByStatusId(int status_id) {\n\t\t\n\t\tlog.info(\"USER RETRIEVED ALL REIMBURSEMENTS WITH STATUS \" + status_id);\n\t\treturn rDao.getReimsByStatusId(status_id);\n\t\t\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic List<BpFundIntent> getOriFund(String bidId) {\n\t\treturn dao.getOriFund(bidId);\n\t}", "@Override\n @Transactional(readOnly = true)\n public Fund findOne(Long id) {\n log.debug(\"Request to get Fund : {}\", id);\n Fund fund = fundRepository.findOneWithEagerRelationships(id);\n return fund;\n }", "@Override\r\n\tpublic Fault getFaultById(int faultId) {\r\n\t\tString sql = \"SELECT * FROM \" + Constants.FAULT_TABLE_NAME + \" WHERE \" + Constants.FAULT_TABLE_ID_COLUMN + \"=\" + faultId;\r\n\t\treturn jdbcTemplate.query(sql, new ResultSetExtractor<Fault>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic Fault extractData(ResultSet rs) throws SQLException, DataAccessException {\r\n\t\t\t\tif (rs.next()) {\r\n\t\t\t\t\tFault fault = new Fault();\r\n\t\t\t\t\t\r\n\t\t\t\t\tfault.setIdFault(rs.getInt(Constants.FAULT_TABLE_ID_COLUMN));\r\n\t\t fault.setDateTime(rs.getDate(Constants.FAULT_TABLE_DATE_TIME_COLUMN));\r\n\t\t fault.setProductId(rs.getString(Constants.FAULT_TABLE_PRODUCT_ID_COLUMN));\r\n\t\t fault.setProductSerialNumber(rs.getString(Constants.FAULT_TABLE_SERIAL_NUMBER_COLUMN));\r\n\t\t fault.setClientName(rs.getString(Constants.FAULT_TABLE_CLIENT_NAME_COLUMN));\r\n\t\t fault.setClientStreet(rs.getString(Constants.FAULT_TABLE_CLIENT_STREET_COLUMN));\r\n\t\t fault.setClientPostalCode(rs.getString(Constants.FAULT_TABLE_CLIENT_POSTAL_CODE));\r\n\t\t fault.setClientPlace(rs.getString(Constants.FAULT_TABLE_CLIENT_PLACE_COLUMN));\r\n\t\t fault.setClientPhoneOne(rs.getString(Constants.FAULT_TABLE_CLIENT_PHONE_ONE_COLUMN));\r\n\t\t fault.setClientPhoneTwo(rs.getString(Constants.FAULT_TABLE_CLIENT_PHONE_TWO_COLUMN));\r\n\t\t fault.setClientEmail(rs.getString(Constants.FAULT_TABLE_CLIENT_EMAIL_COLUMN));\r\n\t\t fault.setFaultDescription(rs.getString(Constants.FAULT_TABLE_FAULT_DESCRIPTION_COLUMN));\r\n\t\t fault.setFaultNote(rs.getString(Constants.FAULT_TABLE_FAULT_NOTE_COLUMN));\r\n\t\t fault.setFaultIssuedTo(rs.getString(Constants.FAULT_TABLE_FAULT_ISSUED_TO_COLUMN));\r\n\t\t fault.setFaultIssuedBy(rs.getString(Constants.FAULT_TABLE_FAULT_ISSUED_BY_COLUMN));\r\n\t\t fault.setFaultType(rs.getString(Constants.FAULT_TABLE_FAULT_TYPE_COLUMN));\r\n\t\t fault.setFaultPriority(rs.getString(Constants.FAULT_TABLE_FAULT_PRIORITY_COLUMN));\r\n\t\t fault.setFaultLat(rs.getDouble(Constants.FAULT_TABLE_FAULT_FAULT_LAT));\r\n\t\t fault.setFaultLng(rs.getDouble(Constants.FAULT_TABLE_FAULT_FAULT_LNG));\r\n\t\t\t\t\t\r\n\t\t \r\n\t\t\t\t\treturn fault;\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t}", "int deleteByPrimaryKey(String refundorderid);", "@Transactional(value = Transactional.TxType.MANDATORY)\n public Rubric getRubricAndLock(Long id) {\n return getRubricFromLinker(rubricLinkerRepository.findRubricLinkerById(new RubricLinker.Pk(new Project(id))).orElse(null));\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public Receipt getReceipt(Long id) {\n\t\tReceipt receipt = receiptRepository.findOne(id);\n\t\tHibernate.initialize(receipt.getOrder());\n\t\treturn receipt;\n\t}", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public Invoice getInvoiceById(@PathVariable int id) {\n return DatabaseInvoicePostgre.getInvoiceById(id);\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@Override\n\tpublic Recipe getRecipe(int id) {\n\t\tRestTemplate restTemplate = new RestTemplate();\n\t\t\n\t\tResponseEntity<Recipe> rateResponse =\n\t\t restTemplate.exchange(BASE_URL + RECIPE_URL + id, HttpMethod.GET, \n\t\t \t\tnull, new ParameterizedTypeReference<Recipe>() {\n\t\t });\n\t\tRecipe recipe = rateResponse.getBody();\n\t\tlogger.debug(\"RECIPE Info :\" + recipe);\n\t\treturn recipe;\n\t}", "Reimbursement getReimbursementByID(int id);", "@Override\n public RiceptDto getRicept(int id) {\n Optional<Ricept> ricept = riceptRepository.findById(id);\n if (!ricept.isPresent()) {\n log.error(\"Ricept not found by id. Class RiceptServiceImpl, method getRicept\");\n throw new NotFoundException(\"Ricept not found by id\");\n }\n log.info(\"Get ingredient by id. Class RiceptServiceImpl, method getRicept\");\n return RiceptDto.of(ricept.get());\n }", "@Override\n\tpublic int deleteFromLicenseOrderRefundByPrimaryKey(Integer id) {\n\t\treturn licenseOrderRefundMapper.deleteByPrimaryKey(id);\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "@Override\r\n\tpublic Repair queryRepairById(int id) {\n\t\treturn repairDao.queryRepairById(id);\r\n\t}", "public List<Reminder> getAllBy(Integer idu);", "public T getReultById(int id){\n return result_now.get(id);\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "public void getDetail(int id) {\n\t\t\n\t}", "@Override\n\tpublic ArrayList<Risposta> getRisposte(int id) {\n\t\tDB db = getDB();\n\t\tArrayList<Risposta> risposte = new ArrayList<Risposta>();\n\t\tMap<Long, Risposta> list = db.getTreeMap(\"risposte\");\n\t\tfor(Map.Entry<Long, Risposta> risposta : list.entrySet())\n\t\t\tif(risposta.getValue() instanceof Risposta) {\n\t\t\t\tif(risposta.getValue().getDomandaID() == id)\n\t\t\t\t\trisposte.add((Risposta)risposta.getValue());\n\t\t\t}\n\t\treturn risposte;\n\t}", "public Trasllat getById(Long id) throws InfrastructureException {\r\n\t\tTrasllat trasllat;\r\n\t\ttry {\r\n\t\t\tlogger.debug(\"getById ini\");\r\n\t\t\ttrasllat = (Trasllat)getHibernateTemplate().load(Trasllat.class, id);\t\t\t\r\n\t\t} catch (HibernateException ex) {\r\n\t\t\tlogger.error(\"getById failed\", ex);\r\n\t\t\tthrow new InfrastructureException(ex);\r\n\t\t}\r\n\t\tlogger.debug(\"getById fin\");\r\n\t\treturn trasllat;\r\n\t}", "public UnidadReceptora getUnidadReceptora(int idUnidadReceptora);", "List<Receipt> getAllReceipts() throws DbException;", "@Override\n public ReporteAccidente getById(int id) {\n return repr.findOne(id);\n }", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public ReCaseReportReg getReCaseReportReg(final String id);", "@Override\n\tpublic WxOrderRefund selectOrderTransByRefundNo(String refundNo) {\n\t\treturn orderMapper.selectOrderTransByRefundNo(refundNo);\n\t}", "public List<Receipt> getAll() {\n\t\treturn receiptRepository.findAll();\n\t}", "public Invoice findById(long id);", "@GET\r\n @Path(\"{id: \\\\d+}\")\r\n public MarcaDetailDTO getMarca(@PathParam(\"id\") long id) throws WebApplicationException {\r\n MarcaEntity marcaEntity = marcaLogic.getMarca(id);\r\n if (marcaEntity == null) {\r\n throw new WebApplicationException(\"El recurso /marcas/\" + id + \" no existe.\", 404);\r\n }\r\n MarcaDetailDTO detailDTO = new MarcaDetailDTO(marcaEntity);\r\n return detailDTO;\r\n }", "Optional<TITransferDetails> findOne(UUID id);", "public SummonerSpells getSummonerSpellsFromID(int id) throws SQLException {\n\t\tString selectSummonerSpells =\n\t\t\t\t\"SELECT SummonerSpells.SummonerSpellId as SummonerSpellId, Name, Description, Range, \"\n\t\t\t\t+ \"CoolDown, SummonerLevel, ModeAvailable \"\n\t\t\t\t+ \"FROM SummonerSpells \"\n\t\t\t\t+ \"WHERE SummonerSpells.summonerSpellId=?;\";\n\n\t\t\tConnection connection = null;\n\t\t\tPreparedStatement selectStmt = null;\n\t\t\tResultSet results = null;\n\t\t\ttry {\n\t\t\t\tconnection = connectionManager.getConnection();\n\t\t\t\tselectStmt = connection.prepareStatement(selectSummonerSpells);\n\t\t\t\tselectStmt.setInt(1, id);\n\t\t\t\tresults = selectStmt.executeQuery();\n\t\t\t\tif(results.next()) {\n\t\t\t\t\treturn parseSummonerSpellsFromResult(results);\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tthrow e;\n\t\t\t} finally {\n\t\t\t\tif(connection != null) {\n\t\t\t\t\tconnection.close();\n\t\t\t\t}\n\t\t\t\tif(selectStmt != null) {\n\t\t\t\t\tselectStmt.close();\n\t\t\t\t}\n\t\t\t\tif(results != null) {\n\t\t\t\t\tresults.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t}", "@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 LitemallOrderRefund other = (LitemallOrderRefund) that;\n return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))\n && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))\n && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))\n && (this.getServiceSn() == null ? other.getServiceSn() == null : this.getServiceSn().equals(other.getServiceSn()))\n && (this.getOrderSn() == null ? other.getOrderSn() == null : this.getOrderSn().equals(other.getOrderSn()))\n && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))\n && (this.getOrderPrice() == null ? other.getOrderPrice() == null : this.getOrderPrice().equals(other.getOrderPrice()))\n && (this.getOrderStatus() == null ? other.getOrderStatus() == null : this.getOrderStatus().equals(other.getOrderStatus()))\n && (this.getOrderType() == null ? other.getOrderType() == null : this.getOrderType().equals(other.getOrderType()))\n && (this.getAuditStatus() == null ? other.getAuditStatus() == null : this.getAuditStatus().equals(other.getAuditStatus()))\n && (this.getConsignee() == null ? other.getConsignee() == null : this.getConsignee().equals(other.getConsignee()))\n && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))\n && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))\n && (this.getRefundReason() == null ? other.getRefundReason() == null : this.getRefundReason().equals(other.getRefundReason()))\n && (this.getProblemDescription() == null ? other.getProblemDescription() == null : this.getProblemDescription().equals(other.getProblemDescription()))\n && (this.getScreenshotUrl() == null ? other.getScreenshotUrl() == null : this.getScreenshotUrl().equals(other.getScreenshotUrl()))\n && (this.getRefundPrice() == null ? other.getRefundPrice() == null : this.getRefundPrice().equals(other.getRefundPrice()))\n && (this.getConfirmTime() == null ? other.getConfirmTime() == null : this.getConfirmTime().equals(other.getConfirmTime()))\n && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))\n && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))\n && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));\n }", "public Reimbursement searchReimburseById(Integer id){\n Reimbursement re = reimbursementRepo.getById(id);\n\n // check to make sure User object is not null\n if (re != null) {\n // check something like approve or pass\n\n return re;\n }\n return null;\n }", "public List<SaleDetail> getAllSaleDetailsBySaleInvoice(int id) {\n SaleInvoice saleInvoice = saleInvoiceRepository.findById(id).orElseThrow(NullPointerException::new);\n return saleDetailRepository.findSaleDetailsBySaleInvoice(saleInvoice);\n }", "public List<StokContract> getById(int id) {\n\t\treturn null;\n\t}", "@GetMapping(\"/{id}\")\n\tpublic Transaction getTransactionById(@PathVariable Long id) {\n\t\tTransaction transaction = null;\n\t\t\n\t\ttry {\n\t\t\ttransaction = transactionService.getTransactionById(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 transaction;\n\t}", "@Override\n public Revue getById(int id) {\n return null;\n }", "public List<Reimburse> getAllReimbursements();", "public Cursor getAll()\r\n {\r\n \treturn mDb.query(DB_TABLE_NAME, new String[] {\"_id\",\"fundId\", \"moneyPaid\", \"currentValue\", \"units\", \"simpleReturn\"}, null, null, null, null, null);\r\n }", "@Override\n public Dish get(int id, int restaurantId) {\n List<Dish> dishes = crudRepository.get(id, restaurantId);\n return DataAccessUtils.singleResult(dishes);\n }" ]
[ "0.73002964", "0.7103542", "0.70836043", "0.6904482", "0.68177176", "0.66581976", "0.6638831", "0.6594498", "0.6549849", "0.65124285", "0.6314341", "0.61661845", "0.6164372", "0.61581177", "0.61492354", "0.6124882", "0.6109658", "0.60858566", "0.6044676", "0.60203046", "0.6010099", "0.59094435", "0.59062326", "0.59061307", "0.5731279", "0.5694572", "0.55439615", "0.5527273", "0.5488438", "0.5464921", "0.5450485", "0.544016", "0.54339427", "0.54062074", "0.54009163", "0.53582984", "0.53442556", "0.53040224", "0.52872324", "0.5253927", "0.5240372", "0.5164328", "0.5126355", "0.5118094", "0.51118076", "0.5099534", "0.5094163", "0.5089371", "0.5034797", "0.50174713", "0.501668", "0.5001825", "0.49720418", "0.49681893", "0.49557766", "0.49554685", "0.49534243", "0.49322772", "0.49296734", "0.49215335", "0.49183246", "0.49082762", "0.49072504", "0.48794055", "0.48623767", "0.48522466", "0.48508146", "0.48496142", "0.48215756", "0.47830406", "0.4769073", "0.4761738", "0.47602203", "0.47579026", "0.4749215", "0.47447705", "0.4743718", "0.47429922", "0.4726757", "0.47197816", "0.4703867", "0.46975404", "0.46962875", "0.4693896", "0.46875003", "0.4670046", "0.46540883", "0.46498182", "0.46481612", "0.464395", "0.46331677", "0.46270448", "0.46167517", "0.45973682", "0.45932156", "0.45930982", "0.45908168", "0.45890826", "0.45827392", "0.45814204" ]
0.49915096
52
Details of all the refund can be retrieved.
@Test public void fetchAll() throws RazorpayException{ String mockedResponseJson = "{\n" + " \"entity\": \"collection\",\n" + " \"count\": 1,\n" + " \"items\": [\n" + " {\n" + " \"id\": \"rfnd_FFX6AnnIN3puqW\",\n" + " \"entity\": \"refund\",\n" + " \"amount\": 88800,\n" + " \"currency\": \"INR\",\n" + " \"payment_id\": \"pay_FFX5FdEYx8jPwA\",\n" + " \"notes\": {\n" + " \"comment\": \"Issuing an instant refund\"\n" + " },\n" + " \"receipt\": null,\n" + " \"acquirer_data\": {},\n" + " \"created_at\": 1594982363,\n" + " \"batch_id\": null,\n" + " \"status\": \"processed\",\n" + " \"speed_processed\": \"optimum\",\n" + " \"speed_requested\": \"optimum\"\n" + " }\n" + " ]\n" + "}"; try { mockResponseFromExternalClient(mockedResponseJson); mockResponseHTTPCodeFromExternalClient(200); List<Refund> fetch = refundClient.fetchAll(); assertNotNull(fetch); assertTrue(fetch.get(0).has("id")); assertTrue(fetch.get(0).has("entity")); assertTrue(fetch.get(0).has("amount")); assertTrue(fetch.get(0).has("currency")); assertTrue(fetch.get(0).has("payment_id")); String fetchRequest = getHost(Constants.REFUNDS); verifySentRequest(false, null, fetchRequest); } catch (IOException e) { assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Integer getRefund() {\n return refund;\n }", "public String getRefundId() {\n return refundId;\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "public int getRefundId() {\n return refundId;\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "public String getRefundReason() {\n return refundReason;\n }", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public Integer getRefundState() {\n return refundState;\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "public FeeRefundCollection list(Map<String, Object> params) throws StripeException {\n return list(params, null);\n }", "@Override\n\tpublic List<PageData> getRefundlist(Page page) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\n\t\t\t\t\"SummaryStatMapper.getRefundlistPage\", page);\n\t}", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "int getRefundToCount();", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "public FeeRefundCollection list(Map<String, Object> params, RequestOptions options)\n throws StripeException {\n String url = String.format(\"%s%s\", Stripe.getApiBase(), this.getUrl());\n return ApiResource.requestCollection(url, params, FeeRefundCollection.class, options);\n }", "public List<Reimburse> getAllReimbursements();", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "List<DenialReasonDto> showAll();", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "@Transient\n\tpublic boolean getRefundable(){\n\t\treturn this.mRefundable;\n\t}", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "List<Reimbursement> retrieveAllReimbursements();", "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public List<Reimbursement> getAllReimbursements(){\n return reimbursementRepo.getAll();\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "@Transient\n\tpublic boolean isRefundable(){\n\t\treturn this.mRefundable;\n\t}", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public List<Refueling> getPendingRefuelings() throws DataAccessException;", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public FeeRefund retrieve(String id, Map<String, Object> params, RequestOptions options)\n throws StripeException {\n String url = String.format(\"%s%s/%s\", Stripe.getApiBase(), this.getUrl(), id);\n return ApiResource.request(ApiResource.RequestMethod.GET, url, params, FeeRefund.class,\n options);\n }", "public java.util.List<com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult> getReaultList() {\n return reault_;\n }", "@GET\n public List<TrayectoDetail> darTrayectos() {\n \n List<TrayectoDetail> listaTrayecto = listEntity2DetailDTO(trayectoLogic.getTrayectos());\n LOGGER.log(Level.INFO, \"BookResource getBooks: output: {0}\", listaTrayecto);\n return listaTrayecto;\n }", "@RequestMapping(value = \"/organizer_refund/search/{organizer_refund_id}\",\n method = RequestMethod.GET, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> getOrganizerRefundByRefundID(\n @PathVariable int organizer_refund_id) {\n\n try {\n List<OOrderRefundTable> organizerRefundList =\n refundRepositoryImpl.getOrganizerRefundByRefundID(organizer_refund_id);\n\n if (organizerRefundList == null || organizerRefundList.isEmpty()) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"No refund found\\\"}\", HttpStatus.OK);\n } else {\n return new ResponseEntity<>(new Gson().toJson(\n (refundRepositoryImpl.getOrganizerRefundByRefundID(organizer_refund_id))),\n HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "public java.util.List<com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult> getReaultList() {\n if (reaultBuilder_ == null) {\n return java.util.Collections.unmodifiableList(reault_);\n } else {\n return reaultBuilder_.getMessageList();\n }\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public FeeRefund retrieve(String id) throws StripeException {\n return retrieve(id, (RequestOptions) null);\n }", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //scmybank1@huianrong.com\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Schema(example = \"PAID\", description = \"Status of the refund. Status Description: --- - PENDING > The refund has been scheduled and will be completed as soon as there is enough money in the account. If there is not enough money in the account on a particular day, the refund will be carried over to the next day, and completed when the amount is available. > The refund will remain in a scheduled state indefinitely, until the amount is available and the refund is executed. - PAID > The refund has been paid out. \")\n public StatusEnum getStatus() {\n return status;\n }", "public FeeRefund retrieve(String id, RequestOptions options) throws StripeException {\n return retrieve(id, null, options);\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "public com.huazhu.hvip.thirdparty.entity.axis.reservation.EntityResDetail[] getListDetail() {\n return listDetail;\n }", "public List<Reimbursement> getAllReims() {\n\t\t\n\t\tlog.info(\"USER RETRIEVED ALL REIMBURSEMENTS\");\n\t\treturn rDao.getAllReims();\n\t\t\n\t}", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "java.util.List<com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult> \n getReaultList();", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGoodsList(Integer id) {\n\t\tList<WxOrderDetail> returnList = null;\n\t\tList<WxOrderDetail> detailList = orderMapper.queryOrderRefundGoodsList(id);\n\t\tif(detailList != null && detailList.size() > 0) {\n\t\t\treturnList = new ArrayList<WxOrderDetail>();\n\t\t\tfor(int i=0;i<detailList.size();i++) {\n\t\t\t\tif(detailList.get(i).getGoodsNum() > 0) {\n\t\t\t\t\tdetailList.get(i).setNum(0);\n\t\t\t\t\treturnList.add(detailList.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn returnList;\n\t}", "@Override\n public List<ReporteAccidente> getAll() {\n return (List<ReporteAccidente>) repr.findAll();\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@Override\n public List<Revue> getAll() {\n return null;\n }", "List<Reimbursement> adminGetReimbursements();", "@Override\r\n public List<Contract> getAllResContracts() {\r\n try {\r\n List<Contract> l = new ArrayList();\r\n Query q = entityManager.createQuery(\"SELECT c FROM Contract c WHERE c.shop.shopType='Restaurant'\");\r\n return q.getResultList();\r\n } catch(Exception ex) {\r\n return null;\r\n }\r\n }", "public List<Receipt> getAll() {\n\t\treturn receiptRepository.findAll();\n\t}", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public List<Reimbursement> getAllReimbursements() throws AuthenticationException {\n Facade dataTier = new Facade();\n return dataTier.getReimbursements();\n }", "@Test\n public void retrieveAllLoanChargesTest() throws ApiException {\n Long loanId = null;\n List<GetSelfLoansLoanIdChargesResponse> response = api.retrieveAllLoanCharges(loanId);\n\n // TODO: test validations\n }", "@RequestMapping(value = \"/details\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Detail> getAllDetails() {\n log.debug(\"REST request to get all Details\");\n List<Detail> details = detailRepository.findAll();\n return details;\n }", "public String getDetails() {\r\n\t\treturn \"Loan Id: \" + loanId + \"\\n\\rStock Id: \" + stockId + \" \\n\\rDate of loan: \" + loanDate + \"\\n\\r Has the loan been returned?: \" + isReturned + \" \\n\\rFine owed: \" + loanFine.getFine();\r\n\t}", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Override\n\tpublic List<Recipe> getAllRecipe() {\n\t\tRestTemplate restTemplate = new RestTemplate();\n\t\t\n\t\tResponseEntity<List<Recipe>> rateResponse =\n\t\t restTemplate.exchange(BASE_URL + RECIPE_URL, HttpMethod.GET, \n\t\t \t\tnull, new ParameterizedTypeReference<List<Recipe>>() {\n\t\t });\n\t\tList<Recipe> recipeList = rateResponse.getBody();\n\t\tlogger.debug(\"RECIPE Info :\" + recipeList);\n\t\treturn recipeList;\n\t}", "public java.util.List<? extends com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResultOrBuilder> \n getReaultOrBuilderList() {\n return reault_;\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@SuppressWarnings(\"finally\")\n\t@Override\n\tpublic Response showRecepient() {\n\t\tBaseResponse<NotifyTemplate> br = new BaseResponse<NotifyTemplate>();\n\t\ttry\n\t\t{\n\t\tList<NotifyTemplate> recepientList;\n\t\tjdbcTemplate.setDataSource(dataSourceProvider.getDataSource(FiinfraConstants.BU_DEFAULT));\n\t\trecepientList=jdbcTemplate.query(FiinfraConstants.SP_GET_SYSTEM_RECEPIENT_CHANNEL,new Object[]{FiinfraConstants.NOTIFYTARGET_ID} ,new BeanPropertyRowMapper<NotifyTemplate>(NotifyTemplate.class));\n\t\tbr.setResponseListObject(recepientList); \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 java.util.List<Reference> reasonReference() {\n return getList(Reference.class, FhirPropertyNames.PROPERTY_REASON_REFERENCE);\n }", "public java.util.List<Reference> reasonReference() {\n return getList(Reference.class, FhirPropertyNames.PROPERTY_REASON_REFERENCE);\n }", "@GetMapping(\"/relacions\")\n @Timed\n public List<Relacion> getAllRelacions() {\n log.debug(\"REST request to get all Relacions\");\n return relacionRepository.findAll();\n }", "@Transactional(readOnly = true)\n public List<Details> findAll() {\n log.debug(\"Request to get all Details\");\n return detailsRepository.findAll();\n }", "public java.util.List<? extends com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResultOrBuilder> \n getReaultOrBuilderList() {\n if (reaultBuilder_ != null) {\n return reaultBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(reault_);\n }\n }", "List<OrdPaymentRefDTO> findAll();", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "public ReactorResult<org.ontoware.rdfreactor.schema.rdfs.Resource> getAllPaymentURL_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), PAYMENTURL, org.ontoware.rdfreactor.schema.rdfs.Resource.class);\r\n\t}", "public Cursor getAll()\r\n {\r\n \treturn mDb.query(DB_TABLE_NAME, new String[] {\"_id\",\"fundId\", \"moneyPaid\", \"currentValue\", \"units\", \"simpleReturn\"}, null, null, null, null, null);\r\n }", "List<Reimbursement> getReimbursementsByUser(int id);", "List<Receta> getAllWithUSer();", "@Override\n\tpublic List<FilghtDetails> getFlightDetails() {\n\t\treturn Repository.FLIGHT_DETAILS;\n\t}", "public ArrayList<RaiderFund> getRaiderFunds() {\n\t\tArrayList<RaiderFund> funds = new ArrayList<RaiderFund>();\n\t\t\n\t\tif (!auth.isLoggedIn() || !isLoggedIn())\n\t\t\treturn funds;\n\t\t\n\t\tString html = \"\";\n\t\ttry {\n\t\t\tHttpURLConnection conn = Utility.getGetConn(FUND_HOME);\n\t\t\tconn.setInstanceFollowRedirects(false);\n\t\t\tconn.setRequestProperty(\"Cookie\", Cookie.chain(aws, php, dummy));\n\t\t\thtml = Utility.read(conn);\n\t\t\t//System.out.println(html);\n\t\t\tint index = html.indexOf(\"getOverview\");\n\t\t\tString userID = html.substring(index);\n\t\t\tuserID = userID.substring(userID.indexOf(\"(\") + 2,\n\t\t\t\t\tuserID.indexOf(\")\") - 1);\n\t\t\tString token = \"formToken\\\"\";\n\t\t\tindex = html.indexOf(token);\n\t\t\tindex += token.length() + 1;\n\t\t\tString form = html.substring(index);\n\t\t\tform = form.substring(form.indexOf(\"\\\"\") + 1);\n\t\t\tform = form.substring(0, form.indexOf(\"\\\"\"));\n\n\t\t\tconn = Utility.getPostConn(FUND_OVERVIEW);\n\t\t\tString query = \"userId=\" + userID + \"&formToken=\" + form;\n\t\t\tconn.setRequestProperty(\"Content-Length\", query.length() + \"\");\n\t\t\tconn.setInstanceFollowRedirects(false);\n\t\t\tconn.setRequestProperty(\"Referer\",\n\t\t\t\t\t\"https://get.cbord.com/raidercard/full/funds_home.php\");\n\t\t\tconn.setRequestProperty(\"Cookie\", Cookie.chain(aws, php, dummy));\n\t\t\tDataOutputStream dos = new DataOutputStream(conn.getOutputStream());\n\t\t\tdos.writeBytes(query);\n\t\t\tdos.close();\n\n\t\t\thtml = \"<html><body>\";\n\t\t\thtml += Utility.read(conn);\n\t\t\thtml += \"</body></html>\";\n\t\t\tDocument doc = Jsoup.parse(html);\n\t\t\tfor (Element el : doc.select(\"tbody tr\")) {\n\t\t\t\tRaiderFund fund = new RaiderFund();\n\t\t\t\tfund.setAccountName(el.select(\".account_name\").text());\n\t\t\t\tfund.setAmount(el.select(\".balance\").text());\n\t\t\t\tfunds.add(fund);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tTTUAuth.logError(e, \"raiderfundget\", ErrorType.Fatal);\n\t\t} catch (Throwable t) {\n\t\t\tTTUAuth.logError(t, \"raiderfundgeneral\", ErrorType.Fatal, html);\n\t\t}\n\n\t\treturn funds;\n\t}", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "@Override\r\n\tpublic String getDetails() {\r\n\t\tString result = \"\";\r\n\t\tresult += \"Vehicle ID: \t\t\t\" + getID() + \"\\n\" + \"Year:\t\t\t\t\" + getYear() + \"\\n\"\r\n\t\t\t\t+ \"Make:\t\t\t\t\" + getMake() + \"\\n\" + \"Model:\t\t\t\t\" + getModel() + \"\\n\"\r\n\t\t\t\t+ \"Number of seats:\t\t\" + getNumOfSeats() + \"\\n\" + \"Status:\t\t\t\t\" + getStatus() + \"\\n\"\r\n\t\t\t\t+ \"RENTAL RECORD:\t\t\" + \"\\n\";\r\n\r\n\t\tList<RentalRecord> carRecorder = databaseHandle.getAllRecordsByVehicleID(ID);\r\n\t\tfor (int i = 0; i < carRecorder.size() && i < 10; i++) {\r\n\t\t\tif (i == 0 && status == Status.RENTED) {\r\n\r\n\t\t\t\tRentalRecord temp = carRecorder.get(carRecorder.size() - 1);\r\n\t\t\t\tresult += \"Record ID: \t\t\t \" + temp.getId() + \"\\n\" + \"Rent date:\t\t\t \" + temp.getRentDate()\r\n\t\t\t\t\t\t+ \"\\n\" + \"Estimated Return Date: \" + temp.getEstimatedReturnDate() + \"\\n\";\r\n\r\n\t\t\t} else {\r\n\t\t\t\tresult += \"------------------------------------\" + \"\\n\";\r\n\t\t\t\tRentalRecord temp = carRecorder.get(carRecorder.size() - 1 - i);\r\n\t\t\t\tresult += \"Record ID: \t\t\t \" + temp.getId() + \"\\n\" + \"Rent date:\t \t\t \" + temp.getRentDate()\r\n\t\t\t\t\t\t+ \"\\n\" + \"Estimated Return Date: \" + temp.getEstimatedReturnDate() + \"\\n\"\r\n\t\t\t\t\t\t+ \"Actual Return Date: \" + temp.getActualReturnDate() + \"\\n\" + \"Rental Fee: \t\t\t \"\r\n\t\t\t\t\t\t+ temp.getRentalFee() + \"\\n\" + \"Late Fee: \" + temp.getLateFee() + \"\\n\";\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tresult += \"====================================\" + \"\\n\";\r\n\t\treturn result;\r\n\t}", "public List<ReceitaDTO> listarReceitas() {\n return receitaOpenHelper.listar();\n }", "public List<Referee> findAllReferees(){\n\t\treturn refereeRepository.findAll();\n\t}", "@Override\r\n\tpublic List<ContractDetailTO> findAllContractDetailList() {\n\t\treturn contractApplicationService.findAllContractDetailList();\r\n\t}", "String getRemediationDetail();", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Refueling [OrderID=\" + OrderID + \", ownerID=\" + ownerID + \", CarNumber=\" + CarNumber + \", GasStation=\"\r\n\t\t\t\t+ GasStation + \", address=\" + address + \", GasType=\" + GasType + \", RateForLiter=\" + RateForLiter\r\n\t\t\t\t+ \", Qunatity=\" + Qunatity + \", Price=\" + Price + \", Date=\" + Date + \", pumpNumber=\" + pumpNumber\r\n\t\t\t\t+ \", service=\" + service + \", time=\" + time + \", saleID=\" + saleID + \"]\";\r\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\tString _infoReferencia = String.format(\"INFORMACIÓN DE REFERENCIA:\\n--------------------------------------\\n\"\r\n\t\t\t\t\t\t\t\t\t\t\t + \"Código de referencias: %s\\n\", this._codigoReferencia);\r\n\t\t\r\n\t\treturn _infoReferencia + super.toString();\r\n\t}" ]
[ "0.7008352", "0.6719393", "0.653554", "0.6491386", "0.64671963", "0.63691884", "0.63558275", "0.63360703", "0.6263256", "0.62335545", "0.6199441", "0.61914086", "0.61519116", "0.6146157", "0.6095398", "0.5961172", "0.5868471", "0.5854801", "0.5854343", "0.5846184", "0.57653403", "0.57616603", "0.57458586", "0.5741081", "0.5705064", "0.56751674", "0.5597157", "0.5592555", "0.55823725", "0.5534748", "0.55329263", "0.55216503", "0.551871", "0.54663426", "0.5438471", "0.54372215", "0.5424249", "0.54241955", "0.54230607", "0.5422813", "0.54033333", "0.53993535", "0.53956664", "0.5387141", "0.5359304", "0.53460485", "0.5345402", "0.533932", "0.53318715", "0.5327522", "0.53246814", "0.5312646", "0.5309653", "0.53034025", "0.5298006", "0.52900887", "0.5270689", "0.5267993", "0.52644545", "0.52598685", "0.5252485", "0.52511317", "0.52128583", "0.5183128", "0.5168643", "0.5162828", "0.51331955", "0.5118252", "0.5106458", "0.5093648", "0.5086607", "0.5068781", "0.5066318", "0.5065085", "0.50631654", "0.5054001", "0.5032149", "0.50280744", "0.50280744", "0.50261444", "0.5025926", "0.5014897", "0.50133586", "0.501213", "0.50050443", "0.4998801", "0.4995389", "0.49953058", "0.49930397", "0.49885708", "0.49796167", "0.49710494", "0.49704292", "0.49686867", "0.49611005", "0.49293765", "0.49132082", "0.49043205", "0.49040985", "0.48872948" ]
0.55143
33
Details of mutiple refunds for a payment can be retrieved.
@Test public void fetchMultipleRefund() throws RazorpayException{ String mockedResponseJson = "{\n" + " \"entity\": \"collection\",\n" + " \"count\": 1,\n" + " \"items\": [\n" + " {\n" + " \"id\": \"rfnd_FP8DDKxqJif6ca\",\n" + " \"entity\": \"refund\",\n" + " \"amount\": 300100,\n" + " \"currency\": \"INR\",\n" + " \"payment_id\": \"pay_FIKOnlyii5QGNx\",\n" + " \"notes\": {\n" + " \"comment\": \"Comment for refund\"\n" + " },\n" + " \"receipt\": null,\n" + " \"acquirer_data\": {\n" + " \"arn\": \"10000000000000\"\n" + " },\n" + " \"created_at\": 1597078124,\n" + " \"batch_id\": null,\n" + " \"status\": \"processed\",\n" + " \"speed_processed\": \"normal\",\n" + " \"speed_requested\": \"optimum\"\n" + " }\n" + " ]\n" + "}"; try { mockResponseFromExternalClient(mockedResponseJson); mockResponseHTTPCodeFromExternalClient(200); List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID); assertNotNull(fetch); assertTrue(fetch.get(0).has("id")); assertTrue(fetch.get(0).has("entity")); assertTrue(fetch.get(0).has("amount")); assertTrue(fetch.get(0).has("currency")); assertTrue(fetch.get(0).has("payment_id")); String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID)); verifySentRequest(false, null, fetchRequest); } catch (IOException e) { assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public FeeRefundCollection list(Map<String, Object> params) throws StripeException {\n return list(params, null);\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "public Integer getRefund() {\n return refund;\n }", "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "@Override\n\tpublic List<PageData> getRefundlist(Page page) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\n\t\t\t\t\"SummaryStatMapper.getRefundlistPage\", page);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "public String getRefundReason() {\n return refundReason;\n }", "public FeeRefundCollection list(Map<String, Object> params, RequestOptions options)\n throws StripeException {\n String url = String.format(\"%s%s\", Stripe.getApiBase(), this.getUrl());\n return ApiResource.requestCollection(url, params, FeeRefundCollection.class, options);\n }", "int getRefundToCount();", "public String getRefundId() {\n return refundId;\n }", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //scmybank1@huianrong.com\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "public int getRefundId() {\n return refundId;\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 LitemallOrderRefund other = (LitemallOrderRefund) that;\n return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))\n && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))\n && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))\n && (this.getServiceSn() == null ? other.getServiceSn() == null : this.getServiceSn().equals(other.getServiceSn()))\n && (this.getOrderSn() == null ? other.getOrderSn() == null : this.getOrderSn().equals(other.getOrderSn()))\n && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))\n && (this.getOrderPrice() == null ? other.getOrderPrice() == null : this.getOrderPrice().equals(other.getOrderPrice()))\n && (this.getOrderStatus() == null ? other.getOrderStatus() == null : this.getOrderStatus().equals(other.getOrderStatus()))\n && (this.getOrderType() == null ? other.getOrderType() == null : this.getOrderType().equals(other.getOrderType()))\n && (this.getAuditStatus() == null ? other.getAuditStatus() == null : this.getAuditStatus().equals(other.getAuditStatus()))\n && (this.getConsignee() == null ? other.getConsignee() == null : this.getConsignee().equals(other.getConsignee()))\n && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))\n && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))\n && (this.getRefundReason() == null ? other.getRefundReason() == null : this.getRefundReason().equals(other.getRefundReason()))\n && (this.getProblemDescription() == null ? other.getProblemDescription() == null : this.getProblemDescription().equals(other.getProblemDescription()))\n && (this.getScreenshotUrl() == null ? other.getScreenshotUrl() == null : this.getScreenshotUrl().equals(other.getScreenshotUrl()))\n && (this.getRefundPrice() == null ? other.getRefundPrice() == null : this.getRefundPrice().equals(other.getRefundPrice()))\n && (this.getConfirmTime() == null ? other.getConfirmTime() == null : this.getConfirmTime().equals(other.getConfirmTime()))\n && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))\n && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))\n && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "List<PaymentsIdResponse> getAllPaymentsId();", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "@Test\n public void fetchAll() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FFX6AnnIN3puqW\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 88800,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FFX5FdEYx8jPwA\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Issuing an instant refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {},\\n\" +\n \" \\\"created_at\\\": 1594982363,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"optimum\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchAll();\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(Constants.REFUNDS);\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "List<Reimbursement> retrieveAllReimbursements();", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public boolean getContainsRedeemablePayment() {\n Payment[] payments = getPaymentTransaction().getPaymentsArray();\n for (int index = 0; index < payments.length; index++) {\n if (payments[index] instanceof Redeemable && !(payments[index] instanceof HouseAccount)) {\n return true;\n }\n }\n return false;\n }", "public List<Reimburse> getAllReimbursements();", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "private TenderTypeEnum[] getEnabledRmRefundOptions(RPIResponseIfc rpiReturnResponse, TenderTypeEnum[] enabledTypes)\n {\n List<RPIItemResponse> itemResponses = rpiReturnResponse.getItemRefundResponse();\n int numberOfReturnItems = itemResponses.size();\n\n List<SelectedTenderType> selectedTenderTypes = new ArrayList<SelectedTenderType>();\n\n Iterator<RPIItemResponse> iter = itemResponses.iterator();\n while ( iter.hasNext() )\n {\n RPIItemResponse rpiItemResponse = iter.next();\n List<RPITenderType> returnTenderTypes = rpiItemResponse.getRefundTenderTypes();\n if ( returnTenderTypes==null || returnTenderTypes.size()==0 )\n {\n //RM returns maintain tenders\n for (int i=0; i<enabledTypes.length; i++)\n {\n SelectedTenderType selectedTenderType = getSelectedTenderType(selectedTenderTypes, enabledTypes[i]);\n if ( selectedTenderType == null )\n {\n selectedTenderType = new SelectedTenderType();\n selectedTenderType.setTenderType(enabledTypes[i]);\n selectedTenderType.setSelected(1); //the first return item select\n }\n else\n {\n selectedTenderType.setSelected(selectedTenderType.getSelected()+1);\n }\n selectedTenderTypes.add(selectedTenderType);\n }\n }\n else\n {\n //use the original transaction's tender types\n Iterator<RPITenderType> tenderTypeIter = returnTenderTypes.iterator();\n while ( tenderTypeIter.hasNext() )\n {\n RPITenderType rpiTenderType = tenderTypeIter.next();\n String tenderType = rpiTenderType.getType();\n TenderTypeEnum tenderTypeEnum = mapTOTenderTypeEnum(tenderType);\n SelectedTenderType selectedTenderType = getSelectedTenderType(selectedTenderTypes, tenderTypeEnum);\n if ( selectedTenderType == null )\n {\n //first time find the tender type as a refund tender\n selectedTenderType = new SelectedTenderType();\n selectedTenderType.setTenderType(tenderTypeEnum);\n selectedTenderType.setSelected(1);\n }\n else\n {\n //find one more time.\n selectedTenderType.setSelected(selectedTenderType.getSelected()+1);\n }\n selectedTenderTypes.add(selectedTenderType);\n }\n }\n }\n List<TenderTypeEnum> tenderList = new ArrayList<TenderTypeEnum>(6);\n Iterator<SelectedTenderType> selectedTenderIter = selectedTenderTypes.iterator();\n while ( selectedTenderIter.hasNext() )\n {\n SelectedTenderType selectedTenderType = selectedTenderIter.next();\n tenderList.add(selectedTenderType.getTenderType());\n }\n\n // convert list to array\n TenderTypeEnum[] tenderTypeArray = new TenderTypeEnum[tenderList.size()];\n tenderTypeArray = tenderList.toArray(tenderTypeArray);\n return tenderTypeArray;\n }", "List<OrdPaymentRefDTO> findAll();", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public FeeRefund retrieve(String id, Map<String, Object> params, RequestOptions options)\n throws StripeException {\n String url = String.format(\"%s%s/%s\", Stripe.getApiBase(), this.getUrl(), id);\n return ApiResource.request(ApiResource.RequestMethod.GET, url, params, FeeRefund.class,\n options);\n }", "public List<Reimbursement> getAllReimbursements() throws AuthenticationException {\n Facade dataTier = new Facade();\n return dataTier.getReimbursements();\n }", "public ReactorResult<org.ontoware.rdfreactor.schema.rdfs.Resource> getAllPaymentURL_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), PAYMENTURL, org.ontoware.rdfreactor.schema.rdfs.Resource.class);\r\n\t}", "public List<Map<String, Object>> getSubscriptionsDueForBilling();", "List<Reimbursement> getReimbursementsByUser(int id);", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "public ArrayList<RaiderFund> getRaiderFunds() {\n\t\tArrayList<RaiderFund> funds = new ArrayList<RaiderFund>();\n\t\t\n\t\tif (!auth.isLoggedIn() || !isLoggedIn())\n\t\t\treturn funds;\n\t\t\n\t\tString html = \"\";\n\t\ttry {\n\t\t\tHttpURLConnection conn = Utility.getGetConn(FUND_HOME);\n\t\t\tconn.setInstanceFollowRedirects(false);\n\t\t\tconn.setRequestProperty(\"Cookie\", Cookie.chain(aws, php, dummy));\n\t\t\thtml = Utility.read(conn);\n\t\t\t//System.out.println(html);\n\t\t\tint index = html.indexOf(\"getOverview\");\n\t\t\tString userID = html.substring(index);\n\t\t\tuserID = userID.substring(userID.indexOf(\"(\") + 2,\n\t\t\t\t\tuserID.indexOf(\")\") - 1);\n\t\t\tString token = \"formToken\\\"\";\n\t\t\tindex = html.indexOf(token);\n\t\t\tindex += token.length() + 1;\n\t\t\tString form = html.substring(index);\n\t\t\tform = form.substring(form.indexOf(\"\\\"\") + 1);\n\t\t\tform = form.substring(0, form.indexOf(\"\\\"\"));\n\n\t\t\tconn = Utility.getPostConn(FUND_OVERVIEW);\n\t\t\tString query = \"userId=\" + userID + \"&formToken=\" + form;\n\t\t\tconn.setRequestProperty(\"Content-Length\", query.length() + \"\");\n\t\t\tconn.setInstanceFollowRedirects(false);\n\t\t\tconn.setRequestProperty(\"Referer\",\n\t\t\t\t\t\"https://get.cbord.com/raidercard/full/funds_home.php\");\n\t\t\tconn.setRequestProperty(\"Cookie\", Cookie.chain(aws, php, dummy));\n\t\t\tDataOutputStream dos = new DataOutputStream(conn.getOutputStream());\n\t\t\tdos.writeBytes(query);\n\t\t\tdos.close();\n\n\t\t\thtml = \"<html><body>\";\n\t\t\thtml += Utility.read(conn);\n\t\t\thtml += \"</body></html>\";\n\t\t\tDocument doc = Jsoup.parse(html);\n\t\t\tfor (Element el : doc.select(\"tbody tr\")) {\n\t\t\t\tRaiderFund fund = new RaiderFund();\n\t\t\t\tfund.setAccountName(el.select(\".account_name\").text());\n\t\t\t\tfund.setAmount(el.select(\".balance\").text());\n\t\t\t\tfunds.add(fund);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tTTUAuth.logError(e, \"raiderfundget\", ErrorType.Fatal);\n\t\t} catch (Throwable t) {\n\t\t\tTTUAuth.logError(t, \"raiderfundgeneral\", ErrorType.Fatal, html);\n\t\t}\n\n\t\treturn funds;\n\t}", "public FeeRefund retrieve(String id) throws StripeException {\n return retrieve(id, (RequestOptions) null);\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "public List<Payment> getAllPayments() {\n\t\treturn null;\r\n\t}", "@ApiModelProperty(value = \"A list of all surcharges associated with the refund.\")\n public List<V1PaymentSurcharge> getRefundedSurcharges() {\n return refundedSurcharges;\n }", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "public List<Refueling> getPendingRefuelings() throws DataAccessException;", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "private static final void refundPasses()\r\n {\r\n\t Boolean invalidID = true;\r\n\t String attractionID;\r\n\t int numOfTourists;\r\n\t double refundCost = 0;\r\n\t \r\n System.out.println(\"Refund Passes Feature Selected!\");\r\n System.out.println(\"--------------------------------------\");\r\n \r\n System.out.print(\"Enter attraction ID: \");\r\n attractionID = sc.nextLine();\r\n \r\n // for loop to iterate through the array\r\n for(int i = 0; i < attractionCount; i++)\r\n {\r\n \t // check if attractionID is found, if yes - call refundPasses()\r\n \t if(attractionList[i].getAttractionID().equalsIgnoreCase(attractionID))\r\n \t {\r\n \t\t invalidID = false;\r\n \t\t System.out.print(\"Enter number of tourists: \");\r\n \t\t numOfTourists = sc.nextInt();\r\n \t\t sc.nextLine();\r\n \t\t \r\n \t\t refundCost = attractionList[i].refundPasses(numOfTourists);\r\n \t\t \r\n \t\t // if value returned from sellPasses() is not Double.NaN, success!\r\n \t\t if (Double.isNaN(refundCost) == false)\r\n \t\t {\r\n \t\t\t System.out.println(\"Passes successfully refunded.\");\r\n \t\t\t System.out.printf(\"%s%.2f\", \"Refund Cost: $\", refundCost);\r\n \t\t\t System.out.println();\r\n \t\t }\r\n \t\t // print error if value returned is Double.NaN\r\n \t\t else\r\n \t\t {\r\n \t\t\t System.out.println(\"Error! Request to refund passes was unsuccessful\");\r\n \t\t }\r\n \t\t break;\r\n \t }\r\n }\r\n // print error if attraction ID was not found in above for loop\r\n if (invalidID == true)\r\n\t {\r\n\t\t System.out.println(\"Error - attraction ID \" + attractionID + \" does not exist\");\r\n\t }\r\n \r\n }", "public List<Reimbursement> getAllReimbursements(){\n return reimbursementRepo.getAll();\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "PaymentTermsType getPaymentTerms();", "@GetMapping(\"/payments\")\n public List<Payment> getAllPayments() {\n log.debug(\"REST request to get all Payments\");\n return paymentRepository.findAll();\n }", "@Test\n public void retrieveAllLoanChargesTest() throws ApiException {\n Long loanId = null;\n List<GetSelfLoansLoanIdChargesResponse> response = api.retrieveAllLoanCharges(loanId);\n\n // TODO: test validations\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "public ListPaymentMethodRsType listPaymentMethod(ListPaymentMethodRqType listPaymentMethodRq) throws ReferenceDataFault;", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@Test\n public void shouldRetrieveACollectionOfPayments() throws Exception {\n for (int i = 0; i < 10; i++) {\n postTestPaymentAndGetResponse();\n }\n\n //when: the collection of payments is fetched:\n ResponseEntity response = restTemplate.exchange(paymentsUrl, HttpMethod.GET, null, new ParameterizedTypeReference<PagedResources<Payment>>() {\n });\n //then: there should be at least 10 payments in the collection ( remember there may be more there from a previous test ):\n Collection<Payment> payments = ((PagedResources) response.getBody()).getContent();\n assertTrue(payments.size() >= 10);\n //and: the response status code should be OK:\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "@Test\n public void holdTest() {\n\n PaymentDto paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String firstPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status AUTHORIZED\", PaymentStatus.AUTHORIZED, paymentDto.getStatus());\n\n\n //init and authorize second payment, but there is 700 cents of 1000 withhold - ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = initPayment(inAccountId, outAccountId, \"700\");\n\n final String secondPaymentId = paymentDto.getId();\n\n paymentDto = authorizePayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n\n //confirm first payment - OK\n\n paymentDto = confirmPayment(firstPaymentId, 200);\n\n assertEquals(\"Payment status CONFIRMED\", PaymentStatus.CONFIRMED, paymentDto.getStatus());\n\n\n //confirm second payment, which was filed on authorization - still got ERROR: WITHDRAW_NO_FUNDS\n\n paymentDto = confirmPayment(secondPaymentId, 200);\n\n assertEquals(\"Payment status ERROR\", PaymentStatus.ERROR, paymentDto.getStatus());\n\n assertEquals(\"Error reason WITHDRAW_NO_FUNDS\", new Integer(ErrorCode.WITHDRAW_NO_FUNDS.getCode()), paymentDto.getErrorReason());\n\n }", "@Transient\n\tpublic boolean isRefundable(){\n\t\treturn this.mRefundable;\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "public List<Reimbursement> getAllReims() {\n\t\t\n\t\tlog.info(\"USER RETRIEVED ALL REIMBURSEMENTS\");\n\t\treturn rDao.getAllReims();\n\t\t\n\t}", "@Test\n public void makeAndRetrievePbaPaymentsByProbateForSuccessLiberataValidation() {\n String accountNumber = testProps.existingAccountNumber;\n CreditAccountPaymentRequest accountPaymentRequest = PaymentFixture\n .aPbaPaymentRequestForProbateForSuccessLiberataValidation(\"215.00\", \"PROBATE\");\n accountPaymentRequest.setAccountNumber(accountNumber);\n PaymentDto paymentDto = paymentTestService.postPbaPayment(USER_TOKEN, SERVICE_TOKEN, accountPaymentRequest).then()\n .statusCode(CREATED.value()).body(\"status\", equalTo(\"Success\")).extract().as(PaymentDto.class);\n\n // Get pba payment by reference\n PaymentDto paymentsResponse =\n paymentTestService.getPbaPayment(USER_TOKEN, SERVICE_TOKEN, paymentDto.getReference()).then()\n .statusCode(OK.value()).extract().as(PaymentDto.class);\n\n assertThat(paymentsResponse.getAccountNumber()).isEqualTo(accountNumber);\n\n // Get pba payments by ccdCaseNumber\n PaymentsResponse liberataResponse = paymentTestService\n .getPbaPaymentsByCCDCaseNumber(SERVICE_TOKEN, accountPaymentRequest.getCcdCaseNumber()).then()\n .statusCode(OK.value()).extract().as(PaymentsResponse.class);\n assertThat(liberataResponse.getPayments().size()).isGreaterThanOrEqualTo(1);\n PaymentDto retrievedPaymentDto = liberataResponse.getPayments().stream()\n .filter(o -> o.getPaymentReference().equals(paymentDto.getReference())).findFirst().get();\n assertThat(retrievedPaymentDto.getAccountNumber()).isEqualTo(accountNumber);\n assertThat(retrievedPaymentDto.getFees().get(0).getApportionedPayment()).isEqualTo(\"215.00\");\n assertThat(retrievedPaymentDto.getFees().get(0).getCalculatedAmount()).isEqualTo(\"215.00\");\n assertThat(retrievedPaymentDto.getFees().get(0).getMemoLine())\n .isEqualTo(\"Personal Application for grant of Probate\");\n assertThat(retrievedPaymentDto.getFees().get(0).getNaturalAccountCode())\n .isEqualTo(\"4481102158\");\n assertThat(retrievedPaymentDto.getFees().get(0).getJurisdiction1()).isEqualTo(\"family\");\n assertThat(retrievedPaymentDto.getFees().get(0).getJurisdiction2())\n .isEqualTo(\"probate registry\");\n\n // delete payment record\n paymentTestService.deletePayment(USER_TOKEN, SERVICE_TOKEN, paymentDto.getReference()).then().statusCode(NO_CONTENT.value());\n\n }", "@Override\n\tpublic List<LoanRepaymentSchedule> generateRepaymentScheduleByMultipleDisbursement(LoanLineOfCredit loanLoc, Money sanctionAmount, List<LoanRepaymentSchedule> myltipleRepaymentScheduleList, Date businessDate, Date firstInstallmentDate , String loanType , Long borrowingLoc ) {\n\t\tlogger.info(\"Start : Generating default repayment schedule to loan repayment schedule table in generateRepaymentSchedule() method.\");\n\t\tPacsLoanApplication loanApplication = loanLoc.getPacsLoanApplication();\n\t\tMoney prevOutstandingAmount = Money.ZERO;\n\t\tString reducingFrequency = null;\n\t\tdouble reducingFreq = 0;\n\t\tint reducingFreqInt = 0;\n\t\tList<LoanRepaymentSchedule> repaymentScheduleList = new ArrayList<LoanRepaymentSchedule>();\n\t\tif (loanApplication != null && loanLoc != null) {\n\t\t\tDate sanctionDate = null;\n\t\t\t//Date firstDueDate = null;\n\t\t\tInteger numOfInstallments = null;\n\t\t\tif(myltipleRepaymentScheduleList.size() > 0) {\n\t\t\t\tsanctionDate = businessDate;\n\t\t\t\tlogger.info(\" sanctionDate : \" + sanctionDate);\n\t\t\t\t//firstDueDate = myltipleRepaymentScheduleList.get(0).getInstallmentDate();\n\t\t\t\t//logger.info(\" firstDueDate : \" + firstDueDate);\n\t\t\t\tnumOfInstallments = myltipleRepaymentScheduleList.size();\n\t\t\t\tlogger.info(\" numOfInstallments : \" + numOfInstallments);\n\t\t\t\tlogger.info(\" sanctionAmount : \" + sanctionAmount);\n\t\t\t\tInteger loanPeriod = loanApplication.getLoanPeriod();\n\t\t\t\tlogger.info(\" loanPeriod : \" + loanPeriod);\n\t\t\t\tInteger frequencyValue = loanApplication.getInstallmentFrequency().getValue();\n\t\t\t\tlogger.info(\" frequencyValue : \" + frequencyValue);\n\t\t\t\tProduct product = loanApplication.getProduct();\n\t\t\t\tInterestCategory interestCategory = loanApplication.getInterestCategory();\n\t\t\t\tif (product != null && interestCategory != null) {\n\t\t\t\t\tRepaymentSchedule repaymentSchedule = product.getRepaymentSchedule();\n\t\t\t\t\tlogger.info(\" repaymentSchedule : \" + repaymentSchedule.getValue());\n\t\t\t\t\tRepaymentType repaymentType = product.getRepaymentType();\n\t\t\t\t\tlogger.info(\" repaymentType : \" + repaymentType.getValue());\n\t\t\t\t\tMoney principalAmountSum = Money.ZERO;\n\t\t\t\t\tMoney principalAmount = calculatePrincipalAmount(sanctionAmount, numOfInstallments);\n\t\t\t\t\tMoney tempPrincipalAmount = Money.ZERO;\n\t\t\t\t\tlogger.info(\" principalAmount : \" + principalAmount);\n\t\t\t\t\tMoney interestAmount = Money.ZERO;\n\t\t\t\t\tMoney tempInterestAmount = Money.ZERO;\n\t\t\t\t\t\n\t\t\t\t\tInteger interestCategoryId = interestCategory.getId();\n\t\t\t\t\tif(\"B\".equalsIgnoreCase(loanType)){\n\t\t\t\t\tinterestCategoryId=\tKLSServiceFactory.getBorrowingProductService().getProductById(loanLoc.getProduct().getBorrowingProductId()).getInterestCategoryId();\n\t\t\t\t\t}else{\n\t\t\t\t\tinterestCategoryId =\tinterestCategory.getId();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tList<SlabwiseInterestRate> interestSlabs = getInterestSlabs(interestCategoryId, sanctionDate);\n\t\t\t\t\tBigDecimal interestRate = (getInterestRate(interestSlabs, sanctionAmount)).divide(BigDecimal.valueOf(100));\n\t\t\t\t\tlogger.info(\" interestRate per annum : \" + interestRate);\n\t\t\t\t\tdouble interestRatePerMonth = 0d;\n\t\t\t\t\tif(frequencyValue != null) {\n\t\t\t\t\t\tif(frequencyValue == 1) {\n\t\t\t\t\t\t\tinterestRatePerMonth = interestRate.doubleValue() / 12;\n\t\t\t\t\t\t} else if(frequencyValue == 3) {\n\t\t\t\t\t\t\tinterestRatePerMonth = interestRate.doubleValue() / 4;\n\t\t\t\t\t\t} else if(frequencyValue == 6) {\n\t\t\t\t\t\t\tinterestRatePerMonth = interestRate.doubleValue() / 2;\n\t\t\t\t\t\t} else if(frequencyValue == 12) {\n\t\t\t\t\t\t\tinterestRatePerMonth = interestRate.doubleValue() / 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlogger.info(\" interestRate per month : \" + interestRatePerMonth);\n\t\t\t\t\tMoney outstandingAmount = sanctionAmount;\n\t\t\t\t\tMoney tempOutstandingAmount = Money.ZERO;\n\t\t\t\t\t//Date installmentDate = firstDueDate;\n\t\t\t\t\tMoney installmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\tMoney tempInstallmentAmount = Money.ZERO;\n\t\t\t\t\tboolean isEquated = RepaymentSchedule.PRINCIPAL_AND_INTEREST.equals(repaymentSchedule)\n\t\t\t\t\t\t\t&& RepaymentType.EQUATED_INSTALLMENTS.equals(repaymentType);\n\t\t\t\t\tlogger.info(\" isEquated : \" + isEquated);\n\t\t\t\t\tboolean isNonEquated = RepaymentSchedule.PRINCIPAL_AND_INTEREST.equals(repaymentSchedule)\n\t\t\t\t\t\t\t&& RepaymentType.NON_EQUATED_INSTALLMENTS.equals(repaymentType);\n\t\t\t\t\tlogger.info(\" isNonEquated : \" + isNonEquated);\n\t\t\t\t\tif (isEquated) {\n\t\t\t\t\t\tinstallmentAmount = calculateInstallmentAmount(outstandingAmount, numOfInstallments, interestRatePerMonth);\n\t\t\t\t\t} else if (isNonEquated) {\n\t\t\t\t\t\treducingFrequency = PropertiesUtil.getRepaymentProperty(ServiceConstants.REDUCING_FREQUENCY);\n\t\t\t\t\t\treducingFreq = new Double(reducingFrequency).doubleValue();\n\t\t\t\t\t\treducingFreqInt = new Double(reducingFrequency).intValue();\n\t\t\t\t\t\tlogger.info(\" reducingFreq : \" + reducingFreq);\n\t\t\t\t\t\tlogger.info(\" interestRate : \" + interestRate);\n\t\t\t\t\t}\n\t\t\t\t\tlogger.info(\" installmentAmount : \" + installmentAmount);\n\t\t\t\t\tlogger.info(\" interestAmount : \" + interestAmount);\n\t\t\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\t\t\tfor (int i = 0; i < numOfInstallments; i++) {\n\t\t\t\t\t\tLoanRepaymentSchedule loanRepaymentSchedule = myltipleRepaymentScheduleList.get(i);\n\t\t\t\t\t\tif (isEquated) {\n\t\t\t\t\t\t\tinterestAmount = calculateInterestAmount(outstandingAmount, interestRatePerMonth);\n\t\t\t\t\t\t\tprincipalAmount = installmentAmount.subtract(interestAmount);\n\t\t\t\t\t\t\tlogger.info(\" principalAmount : \" + principalAmount);\n\t\t\t\t\t\t\tprevOutstandingAmount = outstandingAmount;\n\t\t\t\t\t\t\tlogger.info(\" prevOutstandingAmount : \" + prevOutstandingAmount);\n\t\t\t\t\t\t} else if (isNonEquated) {\n\t\t\t\t\t\t\tint j = i+1;\n\t\t\t\t\t\t\tif ((reducingFreqInt != 0 && (j % reducingFreqInt) == 1) || reducingFreqInt == 1) {\n\t\t\t\t\t\t\t\tlogger.info(\" interestRate per annum reducing frequency : \" + interestRate);\n\t\t\t\t\t\t\t\tinterestAmount = calculateInterestAmount(outstandingAmount, interestRate.doubleValue(), reducingFreq);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinstallmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\t\t\tlogger.info(\" installmentAmount reducing frequency : \" + installmentAmount);\n\t\t\t\t\t\t\tprevOutstandingAmount = outstandingAmount;\n\t\t\t\t\t\t\tlogger.info(\" prevOutstandingAmount : \" + prevOutstandingAmount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.info(\" interestAmount : \" + interestAmount);\n\t\t\t\t\t\ttempInterestAmount = loanRepaymentSchedule.getInterestAmount().add(interestAmount);\n\t\t\t\t\t\tloanRepaymentSchedule.setInterestAmount(tempInterestAmount);\n\t\t\t\t\t\ttempInterestAmount = Money.ZERO;\n\t\t\t\t\t\ttempInstallmentAmount = loanRepaymentSchedule.getInstallmentAmount().add(installmentAmount);\n\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentAmount(tempInstallmentAmount);\n\t\t\t\t\t\ttempInstallmentAmount = Money.ZERO;\n//\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentDate(installmentDate);\n\t\t\t\t\t\t//installmentDate = Date.valueOf(getInstallmentDate(calendar, installmentDate, frequencyValue));\n\t\t\t\t\t\t//logger.info(\" installmentDate : \" + installmentDate);\n\t\t\t\t\t\toutstandingAmount = outstandingAmount.subtract(principalAmount);\n\t\t\t\t\t\tlogger.info(\" outstandingAmount : \" + outstandingAmount);\n\t\t\t\t\t\ttempOutstandingAmount = loanRepaymentSchedule.getLoanOutstandingAmount().add(outstandingAmount);\n\t\t\t\t\t\tloanRepaymentSchedule.setLoanOutstandingAmount(tempOutstandingAmount);\n\t\t\t\t\t\ttempPrincipalAmount =loanRepaymentSchedule.getPrincipalAmount().add(principalAmount);\n\t\t\t\t\t\tloanRepaymentSchedule.setPrincipalAmount(tempPrincipalAmount);\n\t\t\t\t\t\ttempPrincipalAmount = Money.ZERO;\n\t\t\t\t\t\tif(loanRepaymentSchedule.getLoanRepaymentScheduleId() == null) {\n\t\t\t\t\t\t\tLoanRepaymentScheduleId id = new LoanRepaymentScheduleId();\n\t\t\t\t\t\t\tif(\"B\".equalsIgnoreCase(loanType)){\n\t\t\t\t\t\t\tid.setLineOfCreditId(borrowingLoc);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tid.setLineOfCreditId(loanLoc.getId());\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid.setInstallmentNumber(i);\n\t\t\t\t\t\t\tloanRepaymentSchedule.setLoanRepaymentScheduleId(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (RepaymentSchedule.PRINCIPAL.equals(repaymentSchedule)) {\n\t\t\t\t\t\t\tprincipalAmountSum = principalAmountSum.add(principalAmount);\n\t\t\t\t\t\t\tlogger.info(\" principalAmountSum : \" + principalAmountSum);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (i == numOfInstallments) {\n\t\t\t\t\t\t\tif (RepaymentSchedule.PRINCIPAL.equals(repaymentSchedule)) {\n\t\t\t\t\t\t\t\tMoney adjustment = sanctionAmount.subtract(principalAmountSum);\n\t\t\t\t\t\t\t\tlogger.info(\" adjustment : \" + adjustment.getAmount());\n\t\t\t\t\t\t\t\tif (!adjustment.isZero()) {\n\t\t\t\t\t\t\t\t\tloanRepaymentSchedule.setLoanOutstandingAmount(Money.ZERO);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprincipalAmount = principalAmount.add(adjustment);\n\t\t\t\t\t\t\t\tlogger.info(\" principalAmount after adjustment : \" + principalAmount);\n\t\t\t\t\t\t\t\tinstallmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\t\t\t\tlogger.info(\" installmentAmount after adjustment : \" + installmentAmount);\n\t\t\t\t\t\t\t\ttempInstallmentAmount = loanRepaymentSchedule.getInstallmentAmount().add(installmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentAmount(tempInstallmentAmount);\n\t\t\t\t\t\t\t} else if (isEquated) {\n\t\t\t\t\t\t\t\tprincipalAmount = prevOutstandingAmount;\n\t\t\t\t\t\t\t\tlogger.info(\" principalAmount for the last schedule : \" + principalAmount);\n\t\t\t\t\t\t\t\tinstallmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\t\t\t\tlogger.info(\" installmentAmount for the last schedule : \" + installmentAmount);\n\t\t\t\t\t\t\t\ttempInstallmentAmount = loanRepaymentSchedule.getInstallmentAmount().add(installmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentAmount(tempInstallmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setLoanOutstandingAmount(Money.ZERO);\n\t\t\t\t\t\t\t} else if (isNonEquated) {\n\t\t\t\t\t\t\t\tprincipalAmount = prevOutstandingAmount;\n\t\t\t\t\t\t\t\tlogger.info(\" principalAmount for the last schedule : \" + principalAmount);\n\t\t\t\t\t\t\t\tinstallmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\t\t\t\tlogger.info(\" installmentAmount for the last schedule : \" + installmentAmount);\n\t\t\t\t\t\t\t\ttempInstallmentAmount = loanRepaymentSchedule.getInstallmentAmount().add(installmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentAmount(tempInstallmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setLoanOutstandingAmount(Money.ZERO);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttempPrincipalAmount = loanRepaymentSchedule.getPrincipalAmount().add(principalAmount);\n\t\t\t\t\t\t\tloanRepaymentSchedule.setPrincipalAmount(tempPrincipalAmount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepaymentScheduleList.add(loanRepaymentSchedule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trepaymentScheduleList = generateRepaymentSchedule(loanLoc, sanctionAmount, businessDate, firstInstallmentDate , loanType , borrowingLoc);\n\t\t\t}\n\t\t}\n\t\tlogger.info(\"End : Generating default repayment schedule to loan repayment schedule table in generateRepaymentSchedule() method.\");\n\t\treturn repaymentScheduleList;\n\t}", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGoodsList(Integer id) {\n\t\tList<WxOrderDetail> returnList = null;\n\t\tList<WxOrderDetail> detailList = orderMapper.queryOrderRefundGoodsList(id);\n\t\tif(detailList != null && detailList.size() > 0) {\n\t\t\treturnList = new ArrayList<WxOrderDetail>();\n\t\t\tfor(int i=0;i<detailList.size();i++) {\n\t\t\t\tif(detailList.get(i).getGoodsNum() > 0) {\n\t\t\t\t\tdetailList.get(i).setNum(0);\n\t\t\t\t\treturnList.add(detailList.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn returnList;\n\t}", "private OtherChargesDTO[] getOtherCharges() {\n\t\tOtherChargesDTO[] others = null;\t\t\n\t\tif (lrcDTO != null) {\n\t\t\tif (gscDTO != null) {\n\t\t\t\t//Combine LRC GSC\n\t\t\t\tothers = combineLrcGsc(lrcDTO, gscDTO);\n\t\t\t} else {\n\t\t\t\tothers = lrcDTO;\n\t\t\t}\n\t\t} else if (gscDTO != null) {\n\t\t\tothers = gscDTO;\n\t\t}\t\t\n\t\tif(others == null){\n\t\t\t/*if(quotationDTO.getOtherCharges() != null){\n\t\t\tfor(int i = 0; i < quotationDTO.getOtherCharges().length; i++){\n\t\t\t\tSystem.out.println(\"Avail Staions==>\" + quotationDTO.getOtherCharges()[i].getStationCode());\n\t\t\t\tSystem.out.println(\"Avail LRC==>\" + quotationDTO.getOtherCharges()[i].getLrCharge());\n\t\t\t\tSystem.out.println(\"Avail GSC==>\" + quotationDTO.getOtherCharges()[i].getGsc());\n\t\t\t}}*/\n\t\t\treturn quotationDTO.getOtherCharges();\n\t\t}else{\n\t\t\tif(quotationDTO != null)\n\t\t\t\totherChargesDTO = quotationDTO.getOtherCharges();\n\t\t\tif(otherChargesDTO != null){\t\t\t\n\t\t\t\t//Update OtherChargesDTO with existing DTO\n\t\t\t\totherChargesDTO = updateOtherCharges(others, otherChargesDTO);\t\t\t\t\n\t\t\t\t/*for(int i = 0; i < otherChargesDTO.length; i++){\n\t\t\t\t\tSystem.out.println(\"Updated Staions==>\" + otherChargesDTO[i].getStationCode());\n\t\t\t\t\tSystem.out.println(\"Updated LRC==>\" + otherChargesDTO[i].getLrCharge());\n\t\t\t\t\tSystem.out.println(\"Updated GSC==>\" + otherChargesDTO[i].getGsc());\n\t\t\t\t}*/\n\t\t\treturn otherChargesDTO;\n\t\t\t}else{\n\t\t\t\tOtherChargesDTO[] othersAllStations = null;\n\t\t\t\ttry {\n\t\t\t\t\tothersAllStations = convertOthersAllStations(others);\n\t\t\t\t} catch (Exception e) {\t\t\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn othersAllStations;\n\t\t\t}\n\t\t}\t\t\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "@GetMapping(\"/payment\")\n\tpublic ResponseEntity<List<Payment>> viewAllPayments() {\n\t\tlogger.info(\"View all Payments\");\n\t\treturn ResponseEntity.ok().body(payService.viewAllPayments());\n\t}", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "public java.util.List<com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult> getReaultList() {\n return reault_;\n }", "public JSONObject combineInvoiceCNDNRefundForExemptDetails(JSONObject reqParams) throws ServiceException, JSONException {\n JSONObject retObject = new JSONObject();\n JSONArray dataArr = new JSONArray();\n JSONArray tempArr = new JSONArray();\n JSONObject jSONObject = getInvoiceForGSTR3BTaxable(reqParams);\n retObject.put(\"totalamount\", retObject.optDouble(\"totalamount\", 0) + jSONObject.optDouble(\"totalamount\", 0));\n retObject.put(\"count\", retObject.optInt(\"count\", 0) + jSONObject.optInt(\"count\", 0));\n tempArr = jSONObject.optJSONArray(\"data\");\n if (tempArr != null && tempArr.length() > 0) {\n dataArr = StringUtil.concatJSONArray(dataArr, tempArr);\n tempArr = new JSONArray();\n }\n jSONObject = getCNForGSTR3BTaxable(reqParams);\n retObject.put(\"totalamount\", retObject.optDouble(\"totalamount\", 0) + jSONObject.optDouble(\"totalamount\", 0));\n retObject.put(\"count\", retObject.optInt(\"count\", 0) + jSONObject.optInt(\"count\", 0));\n tempArr = jSONObject.optJSONArray(\"data\");\n if (tempArr != null && tempArr.length() > 0) {\n dataArr = StringUtil.concatJSONArray(dataArr, tempArr);\n tempArr = new JSONArray();\n }\n jSONObject = getDNAgainstSalesForGSTR3BTaxable(reqParams);\n retObject.put(\"totalamount\", retObject.optDouble(\"totalamount\", 0) + jSONObject.optDouble(\"totalamount\", 0));\n retObject.put(\"count\", retObject.optInt(\"count\", 0) + jSONObject.optInt(\"count\", 0));\n tempArr = jSONObject.optJSONArray(\"data\");\n if (tempArr != null && tempArr.length() > 0) {\n dataArr = StringUtil.concatJSONArray(dataArr, tempArr);\n tempArr = new JSONArray();\n }\n return retObject.put(\"data\", dataArr);\n }", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Payment> retrievePaymentDetails() throws ApplicationException {\n \tSession session = null;\n try {\n session = getSession();\n\t return session.createQuery(\"FROM PurchaseOrder\").list(); \n\t } catch (HibernateException e) {\n\t throw new ApplicationException(\"Some error occured while listing the details of all cart\",e); \n\t } finally {\n\t \t session.flush();\n\t }\n }", "java.util.List<com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult> \n getReaultList();", "public FeeRefund retrieve(String id, RequestOptions options) throws StripeException {\n return retrieve(id, null, options);\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "public java.util.List<com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult> getReaultList() {\n if (reaultBuilder_ == null) {\n return java.util.Collections.unmodifiableList(reault_);\n } else {\n return reaultBuilder_.getMessageList();\n }\n }", "public Collection<Payment> getPayments(CustomerItem customerItem);", "ResponseEntity<List<TOURates>> getTouRates();", "@RequestMapping(value = \"/organizer_refund/search/{organizer_refund_id}\",\n method = RequestMethod.GET, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> getOrganizerRefundByRefundID(\n @PathVariable int organizer_refund_id) {\n\n try {\n List<OOrderRefundTable> organizerRefundList =\n refundRepositoryImpl.getOrganizerRefundByRefundID(organizer_refund_id);\n\n if (organizerRefundList == null || organizerRefundList.isEmpty()) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"No refund found\\\"}\", HttpStatus.OK);\n } else {\n return new ResponseEntity<>(new Gson().toJson(\n (refundRepositoryImpl.getOrganizerRefundByRefundID(organizer_refund_id))),\n HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "public List<PaymentStatus> getAllPaymentStatuses() throws ContestManagementException {\n return null;\r\n }", "public List<PaymentStatus> getAllPaymentStatuses() throws ContestManagementException {\n return null;\r\n }" ]
[ "0.62290627", "0.61912614", "0.6019187", "0.58885556", "0.5796889", "0.5685429", "0.5683554", "0.56625694", "0.5610062", "0.5504482", "0.5476099", "0.54718316", "0.54443973", "0.54095286", "0.5390352", "0.5355345", "0.52877307", "0.52835613", "0.52487236", "0.5225021", "0.5219158", "0.52146214", "0.5210429", "0.52007467", "0.5193268", "0.5189026", "0.51743656", "0.5076864", "0.5075418", "0.5071454", "0.5063595", "0.5049491", "0.5048308", "0.50240153", "0.5001621", "0.49715632", "0.49253398", "0.49170604", "0.48993567", "0.48954067", "0.48796362", "0.48436284", "0.483859", "0.48283407", "0.48268038", "0.48089767", "0.4797726", "0.47960848", "0.47565144", "0.47295335", "0.47275957", "0.47260854", "0.4724661", "0.4711355", "0.4710501", "0.46998122", "0.4686376", "0.4680327", "0.4680131", "0.46661326", "0.4659903", "0.46512762", "0.4644415", "0.4635124", "0.46322632", "0.46225068", "0.46195066", "0.46012247", "0.4600155", "0.4599775", "0.45987958", "0.45941105", "0.4586639", "0.458458", "0.4578647", "0.45764378", "0.457511", "0.45638824", "0.45603058", "0.45528197", "0.4537884", "0.4532294", "0.45311555", "0.45277786", "0.45254663", "0.45130065", "0.45119283", "0.44989443", "0.44964126", "0.44939148", "0.44910204", "0.44909146", "0.4490524", "0.44879046", "0.4487659", "0.44773382", "0.44747674", "0.4467838", "0.44637218", "0.44637218" ]
0.5915062
3
Update an refund details using refund id with object of that properties
@Test public void edit() throws RazorpayException{ JSONObject request = new JSONObject("" + "{\"notes\":" + "{\"notes_key_1\":\"BeammeupScotty.\"," + "\"notes_key_2\":\"Engage\"}}"); String mockedResponseJson = "{\n" + " \"id\": "+REFUND_ID+",\n" + " \"entity\": \"refund\",\n" + " \"amount\": 300100,\n" + " \"currency\": \"INR\",\n" + " \"payment_id\": \"pay_FIKOnlyii5QGNx\",\n" + " \"notes\": {\n" + " \"notes_key_1\": \"Beam me up Scotty.\",\n" + " \"notes_key_2\": \"Engage\"\n" + " },\n" + " \"receipt\": null,\n" + " \"acquirer_data\": {\n" + " \"arn\": \"10000000000000\"\n" + " },\n" + " \"created_at\": 1597078124,\n" + " \"batch_id\": null,\n" + " \"status\": \"processed\",\n" + " \"speed_processed\": \"normal\",\n" + " \"speed_requested\": \"optimum\"\n" + "}"; try { mockResponseFromExternalClient(mockedResponseJson); mockResponseHTTPCodeFromExternalClient(200); Refund fetch = refundClient.edit(REFUND_ID, request); assertNotNull(fetch); assertEquals(REFUND_ID,fetch.get("id")); assertEquals("refund",fetch.get("entity")); assertEquals(300100,(int)fetch.get("amount")); assertEquals("INR",fetch.get("currency")); String editRequest = getHost(String.format(Constants.REFUND,REFUND_ID)); verifySentRequest(true, request.toString(), editRequest); } catch (IOException e) { assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "int updateByPrimaryKey(TRefundOrder record);", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public String getRefundId() {\n return refundId;\n }", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "public int getRefundId() {\n return refundId;\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@RequestMapping(value = \"/customer_refund/update\", method = RequestMethod.PUT,\n produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> updateCustomerRefund(\n @RequestBody(required = true) COrderRefundTable customerRefund) {\n try {\n int affectedRow = refundRepositoryImpl.updateCustomerRefund(customerRefund);\n\n if (affectedRow == 0) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not updated\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully updated\\\"}\", HttpStatus.OK);\n }\n } catch (DataIntegrityViolationException di) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Invalid input, lack of data\\\"}\",\n HttpStatus.BAD_REQUEST);\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "@RequestMapping(value = \"/organizer_refund/update\", method = RequestMethod.PUT,\n produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> updateOrganizerRefund(\n @RequestBody(required = true) OOrderRefundTable organizerRefundTable) {\n try {\n int affectedRow = refundRepositoryImpl.updateOrganizerRefund(organizerRefundTable);\n\n if (affectedRow == 0) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not updated\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully updated\\\"}\", HttpStatus.OK);\n }\n } catch (DataIntegrityViolationException di) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Invalid input, lack of data\\\"}\",\n HttpStatus.BAD_REQUEST);\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "public Integer getRefund() {\n return refund;\n }", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "TRefundOrder selectByPrimaryKey(String refundorderid);", "public FeeRefund retrieve(String id) throws StripeException {\n return retrieve(id, (RequestOptions) null);\n }", "public String update(Inventory inv, int id) {\n inventory.setId(id);\r\n inventory.setAlbum(inv.getAlbum());\r\n inventory.setArtist(inv.getArtist());\r\n inventory.setYear(inv.getYear());\r\n inventory.setState(inv.getState());\r\n inventory.setState_detailed(inv.getState_detailed());\r\n inventory.setUpc(inv.getUpc());\r\n inventory.setNotes(inv.getNotes());\r\n arc.setOk(\"\");\r\n urc.setOk(\"\");\r\n this.inform = \"\";\r\n return \"updateRecord\";\r\n }", "DenialReasonDto edit(int id, DenialReasonDto denialReason);", "@PUT\r\n @Path(\"{id: \\\\d+}\")\r\n public MarcaDTO updateMarca(@PathParam(\"id\") long id, MarcaDetailDTO marca) throws WebApplicationException {\r\n marca.setId(id);\r\n if (marcaLogic.getMarca(id) == null) {\r\n throw new WebApplicationException(\"El recurso /marcas/\" + id + \" no existe.\", 404);\r\n }\r\n MarcaDetailDTO detailDTO = new MarcaDetailDTO(marcaLogic.updateMarca(id, marca.toEntity()));\r\n return detailDTO;\r\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "public void update(PaymentSummary object)\n throws SQLException {\n List params = fromObjectToBean(object).toList();\n params.add(object.getId());\n this.execute(new ParametricStatement[] {\n new ParametricStatement(updateSql, params)\n });\n }", "void update(Serializable objectId);", "Optional<OrdPaymentRefDTO> partialUpdate(OrdPaymentRefDTO ordPaymentRefDTO);", "RocketDTO updateRocket(UpdateRocketDTO rocket);", "@Override\n\tpublic CarModel updateCar(String id, Integer amount) {\n\t\tfor(int i=0; i < archiveCar.size(); i++) {\n\t\t\tCarModel car = archiveCar.get(i);\n\t\t\tif(car.getId().equals(id)) {\n\t\t\t\tcar.setAmount(amount);\n\t\t\t\treturn car;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "@PutMapping(\"{id}\")\n public JoinEvent update(@PathVariable final Long id, @Valid @RequestBody final JoinEvent inscription)\n throws BadRequestException, NotFoundException {\n\n final JoinEvent entity = this.service.getOne(id);\n\n // Use ObjectMapper mapper = new ObjectMapper();\n return this.service.create(entity);\n }", "Transfer updateStatus(Long id, Payment.Status status);", "T edit(long id, T obj);", "int deleteByPrimaryKey(String refundorderid);", "boolean edit(InvoiceDTO invoiceDTO);", "@Override\n public void update(Object object, Object id) throws DAOException {\n\n }", "@PutMapping(\"/api/rents/{id}\")\r\n public ResponseEntity<?> updateRent(@PathVariable(name = \"id\") Long id, @RequestBody Rent rentUpdate) {\r\n return rentService.find(id).map(rent -> {\r\n rent.setClient(rentUpdate.getClient());\r\n rent.setCar(rentUpdate.getCar());\r\n rent.setRate(rentUpdate.getRate());\r\n rent.setStartDate(rentUpdate.getStartDate());\r\n rent.setEndDate(rentUpdate.getEndDate());\r\n rent.setFinalPrice(rentUpdate.getFinalPrice());\r\n rentService.update(rent);\r\n return new ResponseEntity<>(rent, HttpStatus.OK);\r\n }).orElseThrow(() -> new IllegalArgumentException());\r\n\r\n }", "public FeeRefund retrieve(String id, RequestOptions options) throws StripeException {\n return retrieve(id, null, options);\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 }", "public void testUpdateInvoiceAccuracy() throws Exception {\n Invoice invoice = new Invoice();\n\n invoice.setId(4);\n invoice.setCreationDate(new Date());\n invoice.setCreationUser(\"tc\");\n invoice.setModificationDate(new Date());\n invoice.setModificationUser(\"tc\");\n invoice.setCompanyId(5);\n invoice.setProjectId(8);\n invoice.setInvoiceNumber(\"invoiceNumber\");\n invoice.setPaid(true);\n invoice.setDueDate(new Date());\n invoice.setInvoiceDate(new Date());\n invoice.setPurchaseOrderNumber(\"purchaseOrderNumber\");\n invoice.setSalesTax(new BigDecimal(5));\n\n ExpenseEntry entry = new ExpenseEntry();\n entry.setAmount(new BigDecimal(5));\n ExpenseEntry[] expenseEntries = new ExpenseEntry[] {entry};\n invoice.setExpenseEntries(expenseEntries);\n\n PaymentTerm paymentTerm = new PaymentTerm();\n paymentTerm.setId(3);\n invoice.setPaymentTerm(paymentTerm);\n\n FixedBillingEntry fixedBillingEntry = new FixedBillingEntry();\n FixedBillingEntry[] fixedBillingEntries = new FixedBillingEntry[] {fixedBillingEntry};\n invoice.setFixedBillingEntries(fixedBillingEntries);\n\n InvoiceServiceDetail detail = new InvoiceServiceDetail();\n detail.setAmount(new BigDecimal(8));\n detail.setId(4);\n InvoiceServiceDetail[] serviceDetails = new InvoiceServiceDetail[] {detail};\n invoice.setServiceDetails(serviceDetails);\n\n InvoiceStatus invoiceStatus = new InvoiceStatus(4, \"description\", \"user\", \"user\", new Date(), new Date());\n invoice.setInvoiceStatus(invoiceStatus);\n\n invoiceSessionBean.updateInvoice(invoice, true);\n\n }", "int updateByPrimaryKey(SrmFundItem record);", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "@PUT\r\n @Path(\"{proveedorId: \\\\d+}\")\r\n public ProveedorDetailDTO actualizarProveedorID(@PathParam(\"proveedorId\") Long proveedorId, ProveedorDetailDTO proveedor) throws BusinessLogicException {\r\n proveedor.setId(proveedorId);\r\n if (proveedorLogic.getProveedor(proveedorId) == null) {\r\n throw new WebApplicationException(\"El recurso /proveedores/\" + proveedorId + \" no existe.\", 404);\r\n }\r\n ProveedorDetailDTO detailDTO = new ProveedorDetailDTO(proveedorLogic.updateProveedor(proveedorId, proveedor.toEntity()));\r\n return detailDTO;\r\n }", "@Transactional\n @Modifying\n @Query(\"UPDATE Day SET stripes = stripes + ?1 WHERE date = ?2 AND user_id = ?3\")\n void updateStripes(Integer amountOfStripes, LocalDate date, Integer id);", "public String getRefundReason() {\n return refundReason;\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "@Override\n public Vehicle updateVehicleDetails(Vehicle model, Integer id){\n VehicleDetails domain = throwIfNotFound(repo.findById(id));\n domain = validateAndPatchRequest(domain, model);\n domain = repo.saveAndFlush(domain);\n return mapper.map(domain, Vehicle.class);\n }", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "void editTariff(int idTariff, String title, String description, String price) throws ServiceException;", "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void updateSupplierDetail(Supplier obj) {\n\t\t\r\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "@PatchMapping(\"recipes/{id}\")\n public RecipeDto updateBook(@PathVariable(\"id\") Long id, @RequestBody RecipeDto toUpdate) {\n logger.info(\"updating book with id: [{}] with new attributes: [{}]\", id, toUpdate);\n return recipeService.updateRecipeWithAttributes(id, toUpdate);\n }", "int updateByPrimaryKey(BusinessRepayment record);", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public FeeRefund retrieve(String id, Map<String, Object> params, RequestOptions options)\n throws StripeException {\n String url = String.format(\"%s%s/%s\", Stripe.getApiBase(), this.getUrl(), id);\n return ApiResource.request(ApiResource.RequestMethod.GET, url, params, FeeRefund.class,\n options);\n }", "@Override\n\tpublic void update(Unidade obj) {\n\n\t}", "@RequestMapping(value = \"/organizer_refund/search/{organizer_refund_id}\",\n method = RequestMethod.GET, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> getOrganizerRefundByRefundID(\n @PathVariable int organizer_refund_id) {\n\n try {\n List<OOrderRefundTable> organizerRefundList =\n refundRepositoryImpl.getOrganizerRefundByRefundID(organizer_refund_id);\n\n if (organizerRefundList == null || organizerRefundList.isEmpty()) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"No refund found\\\"}\", HttpStatus.OK);\n } else {\n return new ResponseEntity<>(new Gson().toJson(\n (refundRepositoryImpl.getOrganizerRefundByRefundID(organizer_refund_id))),\n HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "int updateByPrimaryKey(PurchasePayment record);", "int update(Purchase purchase) throws SQLException, DAOException;", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\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}", "@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 }", "public CarroDTO update(Carro carro, Long id) {\n\t\tOptional<Carro> optional = repository.findById(id);\n\t\tif (optional.isPresent()) {\n\t\t\tCarro db = optional.get();\n\t\t\t// Copiar as propriedades\n\t\t\tdb.setNome(carro.getNome());\n\t\t\tdb.setTipo(carro.getTipo());\n\t\t\tSystem.out.println(\"Carro id \" + db.getId());\n\n\t\t\t// atualiza o carro\n\t\t\trepository.save(db);\n\n\t\t\treturn CarroDTO.create(db);\n\t\t} else {\n\t\t\treturn null;\n\n\t\t}\n\n\t}", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "void update(Discount discount) throws ServiceException;", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "void update(Reservierung reservierung, int id) throws ReservierungException;", "public void updateforwadentry(String amit, String id) {\n\t\tContentValues up=new ContentValues();\n\t \n\t up.put(Sales_Amt, amit);\n\t \n\t\tourDatabase.update(DATABASE_TABLE5, up, Sales_Id+\" = \"+id, null);\n\t\t\t\n\t\t\n\t}", "int updWayBillById(WayBill record) throws WayBillNotFoundException;", "int updRouteById(Route record) throws RouteNotFoundException;", "@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 }", "@Transactional\n public void update(RoutersEntity uRouters, String routers_id) throws NoSuchRoutersException {\n var routers = routersRepository.findById(routers_id).get();//2.0.0.M7\n if (routers == null) throw new NoSuchRoutersException();\n //update\n routers.setOfficeId(uRouters.getOfficeId());\n }", "void update(Seller obj);", "void update(Seller obj);", "int updateByPrimaryKey(FinancialManagement record);", "VendorNotificationResponseDTO update(String id, VendorNotificationRequestDTO VendorDataNotificationRequestDTO)throws Exception;", "@Override\r\n\tpublic void archiveFault(int faultId) {\r\n\t\tString sql = \"UPDATE \" + Constants.FAULT_TABLE_NAME + \" SET \" + Constants.FAULT_TABLE_FAULT_STATUS_COLUMN + \"=? WHERE \" + Constants.FAULT_TABLE_ID_COLUMN + \"=?\";\r\n jdbcTemplate.update(sql, Constants.FAULT_TABLE_DONE_STATUS, faultId);\r\n\t}", "int updateByPrimaryKey(MVoucherDTO record);", "@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> 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}", "public WriteResult updateObject(String id, String name) {\n\t\treturn null;\n\t}", "@Transactional(propagation = Propagation.REQUIRED)\n\tpublic ServiceResult update(final Object obj){\n\t\tServiceResult result = new ServiceResult();\n\n\t\ttry{\n\t\t\tdao.update(obj);\n\t\t\tlog.debug(\"Updating :\"+obj);\n\t\t\tresult.setResult(true);\n\t\t\tresult.setReturnObject(obj);\n\t\t} catch (Exception e){\n\t\t\tresult.setResult(false);\n\t\t\tresult.setMessage(\"Error:\"+e);\n\t\t\tlog.error(\"Error updating the object: \", e);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "int updateByPrimaryKey(ResourcePojo record);", "@Test\n public void updateInvoiceItems() {\n\n InvoiceViewModel invoiceVM = new InvoiceViewModel();\n invoiceVM.setInvoiceId(2);\n invoiceVM.setCustomerId(3);\n invoiceVM.setPurchaseDate(LocalDate.of(2019, 5, 10));\n\n InvoiceItem invoiceItem = new InvoiceItem();\n invoiceItem.setInvoiceId(1);\n invoiceItem.setInventoryId(5);\n invoiceItem.setQuantity(2);\n invoiceItem.setUnitPrice(new BigDecimal(\"29.99\"));\n\n List<InvoiceItem> itemList = new ArrayList<>();\n itemList.add(invoiceItem);\n\n invoiceVM.setInvoiceItems(itemList);\n\n invoiceService.updateInvoice(invoiceVM, invoiceVM.getInvoiceId());\n ArgumentCaptor<Invoice> postCaptor = ArgumentCaptor.forClass(Invoice.class);\n verify(invoiceDao).updateInvoice(postCaptor.capture());\n assertEquals(invoiceVM.getCustomerId(), postCaptor.getValue().getCustomerId());\n\n verify(invoiceItemDao).getInvoiceItemsByInvoiceId(postCaptor.getValue().getInvoiceId());\n\n }", "@Test\r\n void testUpdateMedicine() throws Exception{\r\n\r\n String URI = \"/medicine/update/{medicineId}\";\r\n Medicine medicine = new Medicine();\r\n\t\tmedicine.setMedicineId(134);\r\n\t\tmedicine.setMedicineName(\"crosin\");\r\n\t\tmedicine.setMedicineCost(200);\r\n\t\t\r\n\t\tString jsonInput = this.converttoJson(medicine);\r\n Mockito.when(medicineService.updateMedicineById(Mockito.any(),Mockito.anyString())).thenReturn(medicine);\r\n MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.put(URI ,105).accept(MediaType.APPLICATION_JSON).content(jsonInput).contentType(MediaType.APPLICATION_JSON)).andReturn();\r\n MockHttpServletResponse mockHttpServletResponse = mvcResult.getResponse();\r\n String jsonOutput = mockHttpServletResponse.getContentAsString();\r\n assertNotNull(jsonOutput);\r\n }", "Uni<BudgetMensuel> chargeBudgetMensuel(String idBudget) ;", "E update(ID id, E entity, RequestContext context);" ]
[ "0.7642522", "0.69422877", "0.6926489", "0.68726116", "0.67061836", "0.6476267", "0.64711696", "0.63407767", "0.61163884", "0.61022335", "0.59540015", "0.5941326", "0.5904181", "0.58553386", "0.57059467", "0.57040334", "0.56989926", "0.56545115", "0.56329864", "0.5630809", "0.5583257", "0.55664754", "0.5539825", "0.55187035", "0.54547435", "0.5419791", "0.5406669", "0.53604484", "0.53451127", "0.5333345", "0.5322776", "0.53123426", "0.53097844", "0.5304752", "0.53030014", "0.52845025", "0.527946", "0.5239642", "0.5222656", "0.52115166", "0.5210186", "0.52007085", "0.5188451", "0.51798147", "0.51741445", "0.51595575", "0.5139677", "0.5136338", "0.51265705", "0.51263213", "0.51204014", "0.51098484", "0.5103519", "0.5081909", "0.50812805", "0.50772566", "0.5072953", "0.5066641", "0.5063599", "0.5054112", "0.50420356", "0.50262237", "0.5021075", "0.5013493", "0.50126445", "0.5009162", "0.50056106", "0.50043374", "0.49892125", "0.4985404", "0.49837306", "0.49731636", "0.49685544", "0.4958926", "0.49519208", "0.49492574", "0.49479252", "0.49448076", "0.49423376", "0.49194205", "0.49193826", "0.49142703", "0.49080122", "0.4905055", "0.49043512", "0.4904143", "0.4904143", "0.49014008", "0.48953784", "0.4895208", "0.4891191", "0.48890737", "0.48862365", "0.48836184", "0.488242", "0.4880844", "0.48797858", "0.48793474", "0.48783487", "0.4873946" ]
0.56677485
17
TODO Autogenerated method stub
public static void main(String[] args) { Node a = new Node(10); Node b = new Node(-5); Node c = new Node(-10); Node d = new Node(5); Node e = new Node(25); Node f = new Node(36); a.left = b; b.left = c; b.right = d; a.right = e; e.right = f; boolean found1 = search(a,22); boolean found2 = search(a,5); System.out.println(found1); System.out.println(found2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
private static boolean search(Node root, int key) { if(root == null) { return false; } else { if(key == root.data) { return true; } else if(key < root.data ) { return search(root.left,key); } else if(key > root.data) { return search(root.right,key); } else { return false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\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\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\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.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1
Gap heuristic Numbers of pancakes which are not of adjacent size to the pancake below
private static int heuristic(int[] unsortedPancakes) { int h = 0; for (int i = 0; i < unsortedPancakes.length - 1; i++) { if (Math.abs(unsortedPancakes[i] - unsortedPancakes[i + 1]) > 1) { h++; } } return h; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int numOfPillars() {\n // there are one more coordinate line than blocks in each direction\n // since each block must be hinged on a coordinate line on each side\n return (ni+1) * (nj+1);\n }", "private static int arrayDpHopper(int[] array) {\n\t\tint[] jumps = new int[array.length];\n\t\tif(array[0]==0||array.length==0){\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\t\tjumps[0]=0;\n\t\tfor(int i=1;i<array.length;i++){\n\t\t\tjumps[i]=Integer.MAX_VALUE;\n\t\t\tfor(int j=0;j<i;j++){\n\t\t\t\tif(i<=j + array[j] && jumps[j]!=Integer.MAX_VALUE){\n\t\t\t\t\tjumps[i] = arrayHopper.getMin(jumps[i],jumps[j]+1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn jumps[array.length-1];\n\t}", "public int hamming() {\n int distance = 0;\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (_tiles[i][j] != _goal[i][j]) {\n distance++;\n }\n }\n }\n return distance;\n }", "public int getGapCount() {\n return this.openGaps;\n }", "public int trap_old(int[] height) {\n if(height.length <=2){\n return 0;\n }\n int result = 0;\n List<Integer> peaks = new ArrayList<>();\n for(int i=0; i<height.length; i++){\n //if(i+1==height.length && height[i-1]<height[i]){\n // peaks.add(i);\n if(i<height.length-1 && height[i]!=height[i+1]){\n peaks.add(i);\n }\n }\n List<Integer> remove = new ArrayList<>();\n //merge top\n for(int i=0; i<peaks.size(); i++){\n boolean left = false;\n boolean right = false;\n for(int j=0; j<i; j++){ //left\n if(height[peaks.get(j)]>height[peaks.get(i)]){\n left = true;\n }\n }\n for(int j=i+1; j<peaks.size(); j++){ //right\n if(height[peaks.get(j)]>height[peaks.get(i)]){\n right = true;\n }\n }\n if(left&&right){\n remove.add(peaks.get(i));\n }\n }\n System.out.println(Arrays.toString(remove.toArray()));\n peaks.removeAll(remove);\n System.out.println(\"=============\");\n System.out.println(Arrays.toString(peaks.toArray()));\n for(int i=0; i<peaks.size()-1; i++){\n Integer a = peaks.get(i);\n Integer b = peaks.get(i+1);\n int min = Math.min(height[a],height[b]);\n for(int j=a+1; j<b; j++){\n int df = min - height[j];\n if(df > 0 ){\n result += df;\n }\n }\n }\n return result;\n }", "public void addGap() {\n this.openGaps++;\n }", "void lowerNumberOfStonesOnBoard();", "public int hamming() {\n int ham = 0;\n for (int i = 0; i < this.tiles.length; i++) {\n int n = this.tiles[i];\n if (n != i+1 && n > 0) {\n ham++;\n }\n }\n return ham;\n }", "private static int getNoOfWays() {\n int[][] arr = new int[4][4];\n\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 4; j++) {\n if(i == 0 || j == 0) {\n arr[i][j] = 1;\n } else {\n arr[i][j] = arr[i][j - 1] + arr[i - 1][j];\n }\n }\n }\n return arr[3][3];\n }", "void lowerNumberOfStonesLeftToPlace();", "private boolean reachableGap(int a_xmin, int a_xmax, int pos)\n {\n boolean reachableGap = false;\n int destinationY = GEBT_MarioAgent.MARIO_Y;\n if(pos-1 > m_cellsRun)\n {\n destinationY = GEBT_MarioAgent.MARIO_Y + (pos - 1 - m_cellsRun);\n reachableGap = !isObstacle(GEBT_MarioAgent.MARIO_X-1, GEBT_MarioAgent.MARIO_X,GEBT_MarioAgent.MARIO_Y, destinationY);\n }\n else if(pos-1 < m_cellsRun)\n {\n destinationY = GEBT_MarioAgent.MARIO_Y + (pos - 1 - m_cellsRun);\n reachableGap = !isObstacle(GEBT_MarioAgent.MARIO_X-1, GEBT_MarioAgent.MARIO_X, destinationY, GEBT_MarioAgent.MARIO_Y);\n }\n else reachableGap = true;\n\n //2nd check, there must be space for me over the gap\n if(reachableGap)\n {\n boolean obsInTop = isObstacle(a_xmin, a_xmin, destinationY+1, destinationY+1); //Identify where the obstacle is.\n boolean obsInDown = isObstacle(a_xmax, a_xmax, destinationY+1, destinationY+1);\n int hMin = a_xmin, hMax = a_xmax;\n if(obsInTop && !obsInDown)\n {\n//hMin = a_xmax;//THIS IS BAD\n//hMax = a_xmax + 1;//THIS IS BAD\n\n hMin = a_xmin-2; //THIS IS GOOD\n hMax = a_xmax-2; //THIS IS GOOD\n }else if(obsInDown)\n {\n//hMin = a_xmin + 2;//THIS IS BAD\n//hMax = a_xmax + 2;//THIS IS BAD\n hMin = a_xmin-1;//THIS IS GOOD\n hMax = a_xmax-1;//THIS IS GOOD\n }\n\n boolean marioSmall = marioMode == 0;\n if(marioSmall) hMax = hMin;\n reachableGap = !isObstacle(hMin, hMax, destinationY+1, destinationY+1); //Check if there is space enough for Mario to jump.\n }\n\n return reachableGap;\n }", "static int findMissing(int arr[], int size)\n {\n \n //0 -10 1 3 -20\n int p1 = 0;\n int p2 = size-1;\n while (p1<p2) {\n if (arr[p1] > 0) {\n p1++;\n } else {\n int temp = arr[p2];\n arr[p2] = arr[p1];\n arr[p1] = temp;\n p2--;\n }\n }\n //1 3 0 -10 -20\n for (int i=0; i<=p1; i++) {\n int x = Math.abs(arr[i])-1;\n int y = arr[x];\n if (y>0 && y <= size) {\n arr[x] = y*-1;\n }\n }\n for (int i=0; i<size; i++) {\n if (arr[i] > 0) {\n return i+1;\n }\n }\n \n return p1+2;\n }", "int getMinimalPaletteDistance();", "public int getHgap()\n {\n return hgap;\n }", "private int calculateConsecutiveDuplicateMutationsThreshold(){\n \tint combinedSiteLength = region.getCombinedSitesLength();\n \tif(combinedSiteLength <= 10){\n \t\treturn 100; // around the order of magnitude of 1,000,000 if we assume each of the 10 positions could have any of the 4 nucleotides\n \t}else{\n \t\tint consecFactor = 400000 / (combinedSiteLength * combinedSiteLength * combinedSiteLength * iContext.strategy.nucleotides.length);\n \t\treturn Math.max(2, consecFactor);\n \t}\n }", "public int numberOfBoxesInPile()\n {\n if (aboveBox != null)\n {\n return 1 + aboveBox.numberOfBoxesInPile();\n }\n else\n {\n return 1;\n }\n }", "public float computeGap()\r\n {\n float bestOffer = -1f;\r\n float secondBest = -1f;\r\n if (_offres != null)\r\n {\r\n for (Offre current : _offres)\r\n {\r\n if (!current.isRejetee())\r\n {\r\n if (current.getMontant() > bestOffer)\r\n {\r\n secondBest = bestOffer;\r\n bestOffer = current.getMontant();\r\n }\r\n else if (current.getMontant() > secondBest)\r\n {\r\n secondBest = current.getMontant();\r\n }\r\n }\r\n }\r\n }\r\n if (bestOffer > 0)\r\n {\r\n if (secondBest > 0)\r\n {\r\n return bestOffer - secondBest;\r\n }\r\n else\r\n {\r\n return bestOffer - _montantVente;\r\n }\r\n }\r\n else\r\n {\r\n return -1;\r\n }\r\n }", "public void countAdjacentMines()\n {\n adjacentMines = 0;\n for (GameSquare square : getAdjacentSquares())\n {\n if (square.mine)\n {\n adjacentMines++;\n }\n }\n }", "double getGapScore();", "public int hamming() {\n int wrong = 0;\n for (int row = 0; row < N; ++row) {\n for (int col = 0; col < N; ++col) {\n int goalValue = N * row + col + 1;\n if (tiles[row][col] != 0 && tiles[row][col] != goalValue) {\n wrong++;\n }\n }\n }\n\n return wrong;\n }", "public int maximumGap(final List<Integer> a) {\n\t if(a.size()<2)\n\t return 0;\n\t int max=0, i=0;\n\t int[] ar=new int[a.size()];\n\t for(int num: a){\n\t ar[i++]=num;\n\t if(num>max)\n\t max=num;\n\t }\n\t for(i=1; max/i>0; i=i*10){\n\t countSort(ar, i);\n\t }\n\t for(i=0;i<a.size();i++)\n\t System.out.print(ar[i]+\" \");\n\t \n\t System.out.println();\n\t return 0;\n\t}", "static int minJumps(int[] arr){\n int n = arr.length;\n int[] dp = new int[n];\n for(int i = 0; i < n; i++) dp[i] = Integer.MAX_VALUE;\n dp[0] = 0;\n for(int i = 1; i < n; i++){\n //checking from 0 to index i that if there is a shorter path for \n //current position to reach from any of the previous indexes\n //also previous index should not be MAX_VALUE as this will show that\n //we were not able to reach this particular index\n for(int j = 0; j < i; j++){\n if(dp[j] != Integer.MAX_VALUE && arr[j] + j >= i){\n if(dp[j] + 1 < dp[i]){\n dp[i] = dp[j] + 1;\n }\n }\n }\n }\n \n if(dp[n - 1] != Integer.MAX_VALUE){\n return dp[n - 1];\n }\n \n return -1;\n }", "public int getNSteps() {\n //if (mCovered == null) {\n //return 0;\n //}\n return mCovered.length;\n }", "public static int nStairGeneralizeBottomUp(int stairs, int hops) {\r\n if(stairs < 0) {\r\n return -1;\r\n }\r\n int [] bottomUp = new int[stairs + 1];\r\n bottomUp[0] = 1;\r\n bottomUp[1] = 1;\r\n for(int i = 2; i <= stairs; i++) {\r\n for(int j = 1; j <= i && j <= hops; j++) {\r\n bottomUp[i] += bottomUp[i - j];\r\n }\r\n }\r\n return bottomUp[stairs];\r\n }", "public int hamming() {\n int numIncorrect = -1;\n int index = 1;\n\n for (int[] row : tiles) {\n for (int tile : row) {\n if (tile != index)\n numIncorrect++;\n index++;\n }\n }\n return numIncorrect;\n }", "public static int[] findLargestGap() {\n int[] gapIndex = new int[2];\n int lastMaxGap = 0, highestGapIndex = 0, lowestGapIndex = 0;\n\n for (int i = 0; i < movieTheater.length; i++) {\n if (movieTheater[i]) {\n lowestGapIndex = i + 1;\n highestGapIndex = 0;\n } else highestGapIndex += 1;\n\n if (highestGapIndex > lastMaxGap) {\n lastMaxGap = highestGapIndex;\n gapIndex[0] = lowestGapIndex;\n gapIndex[1] = i;\n }\n }\n\n return gapIndex;\n }", "public abstract int numOfSameTypeNeighbourToReproduce();", "public int getHgap()\n\t{\n\t\treturn hgap;\n\t}", "int getNextGap(int gap)\n {\n gap = (gap*10)/13;\n if (gap < 1)\n return 1;\n return gap;\n }", "public int getNearbyMines(int i, int j) {\n int numberOfMines = 0;\n\n if (i > 0) { //IF there is space above\n if (game[i-1][j].equals(mine)) { //checks top\n numberOfMines++;\n }\n if (j > 0) {\n if (game[i-1][j-1].equals(mine)) { //checks top left\n numberOfMines++;\n }\n }\n if (j < column-1) {\n if ((game[i-1][j+1].equals(mine))) { //checks top right\n numberOfMines++;\n }\n }\n }\n\n if (i < row-1) { //IF there is space below\n if (game[i+1][j].equals(mine)) { //checks bottom\n numberOfMines++;\n }\n if (j > 0) {\n if (game[i+1][j-1].equals(mine)) { //checks bottom left\n numberOfMines++;\n }\n }\n if (j < column-1) {\n if (game[i+1][j+1].equals(mine)) { //checks bottom right\n numberOfMines++;\n }\n }\n }\n\n if (j > 0) { //IF there is space to the left\n if (game[i][j-1].equals(mine)) { //checks left\n numberOfMines++;\n }\n }\n if (j < column-1) { //IF there is space to the right\n if (game[i][j+1].equals(mine)) {\n numberOfMines++; //checks right\n }\n }\n return numberOfMines;\n }", "private int numberOfIncorrectFollowUp(JigsawNode jNode) {\n\t\tint s = 0;\n\t\tint dimension = JigsawNode.getDimension();\n\t\tfor (int index = 1; index < dimension * dimension; index++) {\n\t\t\tif (jNode.getNodesState()[index] + 1 != jNode.getNodesState()[index + 1])\n\t\t\t\ts++;\n\t\t}\n\t\treturn s;\n\t}", "public final List<Integer> getHierarchyGaps() {\r\n\t\tList<Integer> gaps = new ArrayList<Integer>();\r\n\t\tgaps.add(0);\r\n\t\tHeaderItem root = header.getFirstRoot();\r\n\t\tif(root == null)\r\n\t\t\treturn gaps;\r\n\t\twhile(root.hasRootsInNextLevel()) {\r\n\t\t\troot = root.getFirstRootInNextLevel();\r\n\t\t\tgaps.add(header.getWidgetTop(root));\r\n\t\t}\r\n\t\treturn gaps;\r\n\t}", "public static int size_hop() {\n return (8 / 8);\n }", "@Test\n public void testSmallPillarNeighbors(){\n //test pillar at (0,0)\n pillar = smallPillarMap.get(Maze.position(0,0));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(2, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 0)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(0, 1)));\n\n //test pillar at (1,0)\n pillar = smallPillarMap.get(Maze.position(1,0));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(3, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(2, 0)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(0, 0)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 1)));\n\n //test pillar at (2,0)\n pillar = smallPillarMap.get(Maze.position(2,0));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(2, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(2, 1)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 0)));\n\n //test pillar at (0,1)\n pillar = smallPillarMap.get(Maze.position(0,1));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(3, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(0, 0)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 1)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(0, 2)));\n\n //test pillar at (1,1)\n pillar = smallPillarMap.get(Maze.position(1,1));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(4, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 2)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 0)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(2, 1)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(0, 1)));\n\n //test pillar at (2,1)\n pillar = smallPillarMap.get(Maze.position(2,1));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(3, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(2, 2)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 1)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(2, 0)));\n\n //test pillar at (0,2)\n pillar = smallPillarMap.get(Maze.position(0,2));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(2, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 2)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(0, 1)));\n\n //test pillar at (1,2)\n pillar = smallPillarMap.get(Maze.position(1,2));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(3, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(2, 2)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(0, 2)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 1)));\n\n //test pillar at (2,2)\n pillar = smallPillarMap.get(Maze.position(2,2));\n pillarNeighbors = pillar.getNeighbors();\n assertEquals(2, pillarNeighbors.size());\n assertTrue(pillarNeighbors.containsKey(new Pillar(1, 2)));\n assertTrue(pillarNeighbors.containsKey(new Pillar(2, 1)));\n }", "int removeObstacle(int numRows, int numColumns, List<List<Integer>> lot)\r\n {\r\n \tint m = 0;\r\n \tint n = 0;\r\n \tfor(List<Integer> rowList: lot) {\r\n \t\tfor(Integer num: rowList) {\r\n \t\t\tif(num == 9 ) {\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tn++;\r\n \t\t}\r\n \t\tm++;\r\n \t}\r\n \t// to store min cells required to be \r\n // covered to reach a particular cell \r\n int dp[][] = new int[numRows][numColumns]; \r\n \r\n // initially no cells can be reached \r\n for (int i = 0; i < numRows; i++) \r\n for (int j = 0; j < numColumns; j++) \r\n dp[i][j] = Integer.MAX_VALUE; \r\n \r\n // base case \r\n dp[0][0] = 1; \r\n \r\n for (int i = 0; i < lot.size(); i++) {\r\n \tList<Integer> columnList = lot.get(i);\r\n for (int j = 0; j < columnList.size(); j++) { \r\n \r\n // dp[i][j] != INT_MAX denotes that cell \r\n // (i, j) can be reached from cell (0, 0) \r\n // and the other half of the condition \r\n // finds the cell on the right that can \r\n // be reached from (i, j) \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (j + columnList.get(j)) < numColumns && (dp[i][j] + 1) \r\n < dp[i][j + columnList.get(j)]\r\n \t\t && columnList.get(j) != 0) \r\n dp[i][j + columnList.get(j)] = dp[i][j] + 1; \r\n \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (i + columnList.get(j)) < numRows && (dp[i][j] + 1) \r\n < dp[i + columnList.get(j)][j] && columnList.get(j) != 0) \r\n dp[i + columnList.get(j)][j] = dp[i][j] + 1; \r\n } \r\n } \r\n \r\n if (dp[m - 1][n - 1] != Integer.MAX_VALUE) \r\n return dp[m - 1][n - 1]; \r\n \r\n return -1; \r\n }", "private int threeInNeg(final GameStateModule game, int player) {\n int count = 0;\n if(game.getHeight() == 4){ //if height is 4, no iterations needed\n //counting bottom up\n for(int i = 0; i < 2; i++) { //since rows is always of width 5\n for(int j = 3; j > 2; j--) {\n if ((game.getAt(i, j) == player) && (game.getAt(i + 1, j - 1) == player) && (game.getAt(i + 2, j - 2) == player) && (game.getAt(i+3,j-3) == 0))\n count++;\n }\n }\n //counting top bottom\n for(int i = 4; i > 2; i--) {\n for(int j = 0; j < 1; j++) {\n if ((game.getAt(i, j) == player) && (game.getAt(i - 1, j + 1) == player) && (game.getAt(i - 2, j + 2) == player) && (game.getAt(i-3, j+3) == 0))\n count++;\n }\n }\n }\n else { //if height is 5, iterations needed\n for(int i = 0; i < 3; i++) {\n for (int j = 4; j > 1; j--) {\n if ((game.getAt(i, j) == player) && (game.getAt(i + 1, j - 1) == player) && (game.getAt(i + 2, j - 2) == player) && (game.getAt(i+3,j-3) == 0))\n count++;\n }\n }\n for(int i = 5; i > 2; i--) {\n for (int j = 0; j < 2; j++) {\n if ((game.getAt(i, j) == player) && (game.getAt(i - 1, j + 1) == player) && (game.getAt(i - 2, j + 2) == player) && (game.getAt(i-3, j+3) == 0))\n count++;\n }\n }\n }\n return count;\n }", "private void addSurrounding(int location) {\n int mineColumn = location % boardWidth;\n int mineRow = location / boardWidth;\n\n boolean leftEdge = true;\n boolean rightEdge = true;\n boolean topEdge = true;\n boolean bottomEdge = true;\n\n if (mineColumn > 0) {\n leftEdge = !leftEdge;\n surroundingMines[location - 1]++;\n }\n if (mineColumn < boardWidth - 1) {\n rightEdge = !rightEdge;\n surroundingMines[location + 1]++;\n }\n if (mineRow > 0) {\n topEdge = !topEdge;\n surroundingMines[location - boardWidth]++;\n }\n if (mineRow < boardHeight - 1) {\n bottomEdge = !bottomEdge;\n surroundingMines[location + boardWidth]++;\n }\n if (!leftEdge) {\n if (!topEdge) {\n surroundingMines[location - boardWidth - 1]++;\n }\n if (!bottomEdge) {\n surroundingMines[location + boardWidth - 1]++;\n }\n }\n if (!rightEdge) {\n if (!topEdge) {\n surroundingMines[location - boardWidth + 1]++;\n }\n if (!bottomEdge) {\n surroundingMines[location + boardWidth + 1]++;\n }\n }\n }", "int getSwaps();", "int getNumberOfStonesLeftToPlace();", "private static int calcPyramidSize(int length)\r\n\t{\r\n\t\tdouble n = (-1 + Math.sqrt(1 + 8 * length)) / 2;\r\n\t\treturn (int)n; //Smallest value.\r\n\t}", "public int getVgap() {\n/* */ return this.vgap;\n/* */ }", "public int getHgap() {\n/* */ return this.hgap;\n/* */ }", "static void countApplesAndOranges(int houseStartPoint, int houseEndPoint, int appleTreeLocation,\n\t\t\tint orangeTreeLocation, int[] applesDistanceFromTheTree, int[] orangesDistanceFromTheTree) {\n\t\tint applesInTheHouse = 0;\n\t\tint orangesInTheHouse = 0;\n\n\t\tfor (int i = 0; i < applesDistanceFromTheTree.length; i++) {\n\t\t\tint appleDistanceFromTheTree = applesDistanceFromTheTree[i];\n\t\t\tint appleAbsolutePosition = appleDistanceFromTheTree + appleTreeLocation;\n\n\t\t\tif (appleAbsolutePosition >= houseStartPoint && appleAbsolutePosition <= houseEndPoint) {\n\t\t\t\tapplesInTheHouse++;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < orangesDistanceFromTheTree.length; i++) {\n\t\t\tint orangeDistanceFromTheTree = orangesDistanceFromTheTree[i];\n\t\t\tint orangeAbsolutePosition = orangeDistanceFromTheTree + orangeTreeLocation;\n\n\t\t\tif (orangeAbsolutePosition >= houseStartPoint && orangeAbsolutePosition <= houseEndPoint) {\n\t\t\t\torangesInTheHouse++;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(applesInTheHouse);\n\t\tSystem.out.println(orangesInTheHouse);\n\t}", "public static void main(String[] args) {\n\t\tint[] A = { 2, 7, 3, 1, 1 };\r\n\t\tint n = 5;\r\n\t\tSystem.out.println(findMaxGap(A, n));\r\n\t}", "float getLgap();", "private int neighborBombCount(Tile t) {\r\n int tileRow = t.getRow();\r\n int tileCol = t.getCol();\r\n int bombCount = 0;\r\n for (int r = tileRow - 1; r <= tileRow + 1; r++) {\r\n for (int c = tileCol - 1; c <= tileCol + 1; c++) {\r\n if (r >= 0 && r < gridSize && c >= 0 && c < gridSize) { \r\n if (grid[r][c].isBomb()) {\r\n bombCount++;\r\n } \r\n }\r\n }\r\n }\r\n return bombCount; \r\n }", "public int infectNeighbours(Map map);", "public int distBonus(){\n Player currentplayer = state.getCurrentPlayer();\n Maze maze = state.getMaze();\n Cell[][] tabcells = maze.getCells();\n ArrayList<GameObject> listObjectsOnCurrentCell;\n GameObject objectOnCell;\n int distTmp;\n int dist= tabcells.length+tabcells[0].length;\n for(int i=0;i<tabcells.length;i++){\n for(int j=0;j<tabcells[0].length;j++){\n listObjectsOnCurrentCell = tabcells[i][j].getGameObjects();\n for(GameObject object: listObjectsOnCurrentCell){\n if(object instanceof Bonus || object instanceof BonusWall){\n distTmp = manhattan(object,currentplayer);\n if(distTmp<dist){\n dist = distTmp;\n }\n }\n }\n }\n }\n return dist;\n }", "public abstract int getSpotsNeeded();", "static int waysToGiveACheck(char[][] board) {\n\t\tint[] pawnPos = new int[2];\n\t\tint[] bkPos = new int[2];\n\t\tint[] wkPos = new int[2];\n\t\tint[] forthPos = new int[2];\n\t\tchar fourth = 'x';\n\t\tint answerCount = 0;\n\t\tint hashCount = 0;\n\t\tfor(int board_i = 0; board_i < 8; board_i++){\n\t\t\tfor(int board_j = 0; board_j < 8; board_j++){\n\t\t\t\tswitch(board[board_i][board_j]){\n\t\t\t\tcase 35:\n\t\t\t\t\thashCount++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 80:\n\t\t\t\t\t{pawnPos[0] = board_i;\n\t\t\t\t\tpawnPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tcase 107:\n\t\t\t\t\t{bkPos[0] = board_i;\n\t\t\t\t\tbkPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tcase 75:\n\t\t\t\t\t{wkPos[0] = board_i;\n\t\t\t\t\twkPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tdefault:\n\t\t\t\t\t{forthPos[0] = board_i;\n\t\t\t\t\tforthPos[1] = board_j;\n\t\t\t\t\tfourth = board[board_i][board_j];\n\t\t\t\t\tbreak;}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint xdistPk = Math.abs(pawnPos[0] - bkPos[0]);\n\t\tint ydistPk = Math.abs(pawnPos[1] - bkPos[1]);\n\n\t\tif(xdistPk == ydistPk)\n\t\t\tanswerCount = answerCount+2;\n\t\tif(xdistPk==0)\n\t\t\tanswerCount++;\n\t\tif(ydistPk ==0)\n\t\t\tanswerCount++;\n\t\tif((xdistPk == 2 && ydistPk==1) || (xdistPk == 1 && ydistPk==2) )\n\t\t\tanswerCount++;\n\n\t\treturn answerCount;\n\n\t}", "int sizeOfRoadsideArray();", "public int antalSager() {\n int antalSager = 0;\n for (int i = 0; i < sager.size(); i++) {\n for (int j = 0; j < sager.get(i).size(); j++) {\n antalSager += 1;\n }\n }\n return antalSager;\n }", "public void CountWhiteDisks(){\n int counter =0;\n for (int i=0; i<8; i++){\n for (int j=0; j<8; j++){\n if (gameboard[i][j]==W){\n counter++;\n }\n }\n }\n whitedisks = counter;\n }", "static int migratoryBirds(List<Integer> arr) {\n int count=1;\n int max=arr.get(0);\n HashMap<Integer,Integer> map=new HashMap<>();\n for(int i=0;i<arr.size();i++) {\n \tif(map.containsKey(arr.get(i))) {\n \t\tmap.replace(arr.get(i), map.get(arr.get(i))+1);\n \t}else {\n \t\tmap.put(arr.get(i), count);\n \t}\n }\n \n int ans=0;\n for(Integer i:map.keySet()) {\n \t int n=map.get(i);\n \t if(n>max) {\n \t\t max=n;\n \t\t \tans=i;\n\n \t }\n }\n /*int comp[]=new int[256];\n for(int i=0;i<arr.size();i++){\n comp[arr.get(i)]++;\n }\n for(int i=0;i<comp.length;i++){\n if(comp[i]>max)\n max=comp[i];\n }*/\n return ans;\n }", "private int countMaxAtropisomricBond(OEGraphMol in)\n { OEBondBaseIter bIt;\n Set<Integer> atropBondSet = new HashSet<Integer>();\n\n // find all bonds that could possbily be atropisomeric\n OEMatchBaseIter mIt = POSSIBLEAtropIsomer.Match(in);\n while( mIt.hasNext() )\n { OEMatchBase mb = mIt.next();\n\n bIt = mb.GetTargetBonds();\n atropBondSet.add(bIt.next().GetIdx());\n bIt.delete();\n }\n mIt.delete();\n\n return atropBondSet.size();\n }", "public int hamming() {\n int count = 0;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N && i+j < 2*N-2; j++) {\n if (blocks[i][j] != i*N + j + 1) {\n count++;\n }\n }\n }\n return count;\n }", "public int Delete_Min()\n {\n \tthis.array[0]=this.array[this.getSize()-1];\n \tthis.size--; \n \tthis.array[0].setPos(0);\n \tint numOfCompares = heapifyDown(this, 0);\n \treturn numOfCompares;\n }", "@Override\n void calculate() {\n parents = new HashMap<>();\n table = new double[seq1.length() + 1][seq2.length() + 1];\n int n = table[0].length;\n GapPenalty.Type penaltyType = gapPenalty.getType();\n switch (penaltyType) {\n case AFFINE:\n table[0][0] = 0.0;\n for (int i = 1; i < table.length; i++) {\n table[i][0] = (double) (-1) * gapPenalty.countAffine(i);\n parents.put((n * i), new ArrayList<>(List.of(n * (i - 1))));\n }\n for (int i = 1; i < n; i++) {\n table[0][i] = (double) (-1) * gapPenalty.countAffine(i);\n parents.put(i, new ArrayList<>(List.of(i - 1)));\n }\n countAffValue();\n break;\n case LINEAR:\n for (int i = 0; i < table.length; i++) {\n table[i][0] = (double) i * (-1) * gapPenalty.linearPart();\n if (i != 0) {\n parents.put(n * i, new ArrayList<>(List.of(n * (i - 1))));\n }\n }\n for (int i = 0; i < n; i++) {\n table[0][i] = (double) i * (-1) * gapPenalty.linearPart();\n if (i != 0) {\n parents.put(i, new ArrayList<>(List.of(i - 1)));\n }\n }\n countLinValue();\n break;\n case ERROR:\n throw new GapPenalty.GapPenaltyNumericalError(\"Gap penalty not initialized properly\");\n }\n }", "public int getVgap()\n {\n return vgap;\n }", "private LinkedStack<short []> getSwaps() {\n LinkedStack<short []> result = new LinkedStack<short []>();\n // scan 4 directions, add to result if not edge\n if (blank_r > 0) result.push(new short[] {(short) (blank_r - 1), blank_c}); // above\n if (blank_c < N - 1) result.push(new short[] {blank_r, (short) (blank_c + 1)}); // right\n if (blank_r < N - 1) result.push(new short[] {(short) (blank_r + 1), blank_c}); // below\n if (blank_c > 0) result.push(new short[] {blank_r, (short) (blank_c - 1)}); // left\n return result;\n }", "public int verificarCantidadGanadores() {\n\t\t if(ganador.size() == 1 && !ganador.contains(\"dealer\")) {\n\t\t\t return 20;\n\t\t }else if(ganador.size() == 2 && !ganador.contains(\"dealer\")) {\n\t\t\t return 10;\n\t\t }else if(ganador.size() == 3 && !ganador.contains(\"dealer\")){\n\t\t\t return 0;\n\t\t }else if(ganador.size() == 1 && ganador.contains(\"dealer\")) {\n\t\t\t return 30;\n\t\t }\n\t\t return 0;\n\t }", "public int seat() {\n int result = 0;\n Pair gap = pq.poll();\n // if left is -1,,, next pos will be 0 for sure\n if (gap.left == -1) {\n result = 0;\n // if right is N.... next pos will be N-1 for sure\n } else if (gap.right == N) {\n result = N - 1 ;\n } else {\n // else it has to be the middle value\n result = gap.left + (gap.right - gap.left ) / 2;\n }\n pq.add(new Pair(gap.left, result));\n pq.add(new Pair(result, gap.right)); \n seats.add(result);\n return result;\n }", "public int solution(int[] H) {\n Stack<Integer> stackOfHeights = new Stack<>();\n int numOfStones = 0;\n \n for(int currentHeight: H) {\n while( !stackOfHeights.isEmpty() && stackOfHeights.peek() > currentHeight) {\n stackOfHeights.pop();\n }\n \n if(!stackOfHeights.isEmpty()) {\n if(stackOfHeights.peek() == currentHeight) { continue; }\n else {\n numOfStones++;\n stackOfHeights.push(currentHeight);\n }\n } else {\n numOfStones++;\n stackOfHeights.push(currentHeight);\n }\n }\n \n return numOfStones;\n }", "private int getNumberOfBoxesOfAllShips() {\r\n int count = 30;\r\n return count;\r\n }", "static void minimumBribes(int[] q) {\nint count =0;\nboolean isprint = true;\nint first = 1;\nint second = 2;\nint third = 3;\n\n for(int i=0;i< q.length-1;i++){\n \n if (q[i] == first) {\n first = second;\n second = third;\n third++;\n }else if(q[i]== second){\n second = third;\n third++;\n count++;\n }else if(q[i]==third){\n third++;\n count++;\n count++;\n }else{\n isprint = false;\n }\n }\n\n // if((q[i-1]-q[i]) > 2){\n // System.out.println(\"Too chaotic\");\n // isprint = false;\n // break; \n // }else if((q[i-1]-q[i])==1){\n // count++;\n // }else if((q[i-1]-q[i])==2){\n // count+=2;\n // }\n \n //}\n if(isprint){\n System.out.println(count);\n }else{\n System.out.println(\"Too chaotic\");\n }\n }", "@Override\n public int getRemainingMines() {\n int numPlacedFlags = cells.stream()\n .mapToInt(b -> (int) b.stream().filter(c -> c.getFlagState() == 1).count()).sum();\n return numMines - numPlacedFlags;\n }", "@Override\n\t\tpublic double heuristic() {\n\t\t\tint sum = 0;\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tsum += Math.abs(xGoals[i] - state[i]);\n\t\t\t\tsum += Math.abs(yGoals[i] - state[k + i]);\n\t\t\t}\n\t\t\treturn sum;\n\t\t}", "public int hamming() {\n int c = 0;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n int x = tiles[i][j];\n if (x == 0) continue;\n if (x != i*n + j + 1) c++;\n }\n }\n return c;\n }", "public Point getGapCoordinates()\n {\n Point gap = new Point(50,50);\n return gap;\n }", "public int getSnakeStartLength();", "static int jumpingOnClouds(int[] arr) {\n int i = 0;\n int count = 0;\n while (i < arr.length - 2) {\n if (arr[i + 1] == 1) {\n count++;\n i += 2;\n } else if (arr[i + 2] == 1) {\n count++;\n i += 1;\n } else {\n count++;\n i += 2;\n }\n }\n //System.out.println(count);\n if (i<arr.length-1)\n count++;\n return count;\n\n\n }", "public int removeStones(int[][] stones) {\n DSet ds = new DSet(20000);\n for(int[] stone: stones){\n ds.union( stone[0], stone[1] + 10000);\n }\n Set<Integer> parents = new HashSet<>();\n for(int[] stone: stones){\n parents.add( ds.find(stone[0]));\n }\n return stones.length - parents.size();\n }", "public abstract int numOfFoodCellToReproduce();", "private int getGroupSize(double positiveProbability)\n {\n if (positiveProbability < eightIndividualsGroupMaxProbability)\n return 8;\n\n if (positiveProbability < fourIndividualsGroupMaxProbability)\n return 4;\n\n if (positiveProbability < twoIndividualsGroupMaxProbability)\n return 2;\n\n return 1;\n }", "public static int binaryGap_opt(int n) {\n int ans = 0;\n int last = -1;\n for (int i = 0; n != 0; i++) {\n if ((n & 0x01) == 1) {\n if (last >= 0) {\n ans = Math.max(ans, i - last);\n }\n last = i;\n }\n\n n = n >> 1;\n }\n\n return ans;\n }", "public static void method_3(){\n int totalhotdog = 400;\n int hotDogPerContainer = 8;\n int totalContainer =0;\n int temp = totalhotdog+hotDogPerContainer;\n\n while (temp>hotDogPerContainer){\n temp = temp - hotDogPerContainer;\n System.out.println(temp);\n totalContainer++;\n }\n System.out.println(\"\\n \\n\\n\\n\\n \"+totalContainer);\n }", "@Test\n public void testSegmentationGreedyness() {\n assertMetrics(\"match:0.3717\",\"a b c\",\"a x b x x x x x x x x b c\");\n assertMetrics(\"match:0.4981\",\"a b c\",\"a x z x x x x x x x x b c\");\n }", "public static int firstMissingPositiveSpace(int[] nums) {\n int n = nums.length;\n int map[] = new int[n];\n for(int i=0;i<n;i++){\n if(nums[i]>0 && nums[i] <= n){\n map[nums[i]-1] = nums[i];\n }\n }\n int i=0;\n for(;i<n;i++){\n if(i+1!=map[i])\n return i+1;\n }\n return i==n ? n+1 : 1;\n }", "private int countPossibleRoutes(){\n\tint totPossRoutes =0;\n\tfor(int i=0;i<ConditionTree.length;i++){\n\t\tif(ConditionTree[i][5].equals(\"Y\")){\n\t\t\ttotPossRoutes++;\n\t\t}\n\t}\n\t\n\treturn totPossRoutes;\n}", "private void findLargestNNIPointsIndexPair(float ratioInh, float ratioAct) {\n ArrayList<Point> pts0 = new ArrayList<Point>();\n ArrayList<Point> pts1 = new ArrayList<Point>();\n Dimension dim = layoutPanel.getLayoutSize();\n int height = dim.height;\n int width = dim.width;\n int size = height * width;\n int newNListSize;\n if (ratioInh > ratioAct) {\n newNListSize = (int) (size * ratioInh);\n pts0 = cnvIndexList2Points(layoutPanel.activeNList);\n pts1 = cnvIndexList2Points(layoutPanel.inhNList);\n } else {\n newNListSize = (int) (size * ratioAct);\n pts0 = cnvIndexList2Points(layoutPanel.inhNList);\n pts1 = cnvIndexList2Points(layoutPanel.activeNList);\n }\n double len = Math.sqrt((double) size / (double) newNListSize);\n\n ArrayList<Point> union = new ArrayList<Point>(pts0);\n union.addAll(pts1);\n double maxNNI = calcNearestNeighborIndex(union);\n ArrayList<Point> maxPts0 = pts0;\n ArrayList<Point> maxPts1 = pts1;\n for (int xShift = (int) Math.floor(-len / 2); xShift <= Math\n .ceil(len / 2); xShift++) {\n for (int yShift = (int) Math.floor(-len / 2); yShift <= Math\n .ceil(len / 2); yShift++) {\n if (xShift == 0 && yShift == 0) {\n continue;\n }\n int xShift0 = (int) Math.ceil((double) xShift / 2);\n int xShift1 = (int) Math.ceil((double) -xShift / 2);\n int yShift0 = (int) Math.ceil((double) yShift / 2);\n int yShift1 = (int) Math.ceil((double) -yShift / 2);\n // System.out.println(\"xShift = \" + xShift + \", xShift0 = \" +\n // xShift0 + \", xShift1 = \" + xShift1);\n ArrayList<Point> sftPts0 = getShiftedPoints(pts0, xShift0,\n yShift0);\n ArrayList<Point> sftPts1 = getShiftedPoints(pts1, xShift1,\n yShift1);\n union = new ArrayList<Point>(sftPts0);\n union.addAll(sftPts1);\n double nni = calcNearestNeighborIndex(union);\n if (nni > maxNNI) {\n maxNNI = nni;\n maxPts0 = sftPts0;\n maxPts1 = sftPts1;\n }\n }\n }\n\n if (ratioInh > ratioAct) {\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts1);\n } else {\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts1);\n }\n }", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "@Override\r\n\tpublic int getPegCount() {\r\n\t\tint shipSize = 3;\r\n\t\treturn shipSize;\r\n\t}", "public int ghostMoves(List<Integer> pacmanLocaytarget, List<Integer> ghostLocay){\n int numOfmoves = 0;\n //counts the steps to get to the target\n for(int i=ghostLocay.get(0);i>pacmanLocaytarget.get(0);i--){\n numOfmoves++;\n }\n for(int i=ghostLocay.get(1);i>pacmanLocaytarget.get(1);i--){\n numOfmoves++;\n }\n return numOfmoves;\n\n }", "public void Pairs()\r\n {\n int pairsize = 0;\r\n int ind1 = 0;\r\n for(int i = 0; i < 5; i++){\r\n// while(cards[i].getNumber() != pairnum){\r\n for(int j = i+1; j < 5; j++)\r\n {\r\n if(cards[i].getFace().equals(cards[j].getFace()))\r\n {\r\n ind1 = i;\r\n if(pairsize < 3){\r\n pairsize += 1;\r\n// paircounts += 1;\r\n }\r\n if(cards[i].compareTo(cards[ind1]) > 0){\r\n// Maxpair = cards[i].getNumber();\r\n index = i;\r\n }\r\n \r\n }\r\n }\r\n// }\r\n }\r\n if(pairsize == 1)\r\n Judge = 2;\r\n if(pairsize == 2)\r\n Judge = 3;\r\n if(pairsize == 3)\r\n Judge = 6;\r\n }", "protected static int countNeighbours(int i, int j, byte[][] currentGen){\n int count = 0;\n \n for(int x = i-1; x<i+2; x++){\n count+=checkBorders(x, j-1, currentGen);\n count+=checkBorders(x, j+1, currentGen);\n }\n count+=checkBorders(i-1, j, currentGen);\n count+=checkBorders(i+1, j, currentGen);\n\n return count;\n }", "private static void findBridges() {\n Map<Integer, Integer> lastSeen = new HashMap<>();\n for (int i = 0; i < columns.length; i++) {\n if (!lastSeen.containsKey(columns[i])) {\n lastSeen.put(columns[i], i);\n }\n }\n bridgesCount = 0;\n\n int lastBridgeIndex = 0;\n for (int i = 1; i < columns.length; i++) {\n\n //returns prev index of columns[i]\n int columnPrevIndex = lastSeen.get(columns[i]);\n //columnPrevIndex must be to the right from lastBridgeIndex to avoid crossing\n if (columnPrevIndex != i &&\n columnPrevIndex >= lastBridgeIndex) {\n lastBridgeIndex = i;\n bridgesCount++;\n connections[i] = true;\n connections[columnPrevIndex] = true;\n }\n //not optimized solution -> for every element we search to it's left side\n //from lastBridgeIndex to i and if we meet same element -> connect new bridge\n// for (int j = lastBridgeIndex; j < i; j++) {\n//\n// if (columns[j] == columns[i]) {\n// lastBridgeIndex = i;\n// connections[j] = true;\n// connections[i] = true;\n// bridgesCount++;\n// break;\n// }\n// }\n\n //update index of columns[i]\n lastSeen.put(columns[i], i);\n }\n }", "public int getHeuristic(){\n\t\tint count = 0;\n\t\tfor (int i = 0; i < getRows(); i++) {\n\t\t\tfor (int j = 0; j < getColumns(); j++) {\n\t\t\t\tif (cells[i][j].getSand() != getK()) \n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t} \n\t\treturn count;\n\t}", "static int minimumSwaps2(int[] arr) {\n Map<Integer, Integer> backward = new HashMap<>();\n Map<Integer, Integer> forward = new HashMap<>();\n for (int i = 0; i < arr.length; i++) {\n int move = i + 1 - arr[i];\n if (move > 0)\n forward.put(arr[i], move);\n else if (move < 0)\n backward.put(arr[i], move);\n }\n\n //count swap in pairs\n int pairs = 0;\n for (Integer bk : backward.keySet()) {\n for (Integer fk : forward.keySet()) {\n if (backward.get(bk) * (-1) == forward.get(fk)) {\n pairs = pairs + 1;\n continue;\n }\n }\n }\n //count swap others\n int swapCount = forward.size() + backward.size() - (2 * pairs);\n if (swapCount > 0) swapCount = swapCount - 1;\n\n System.out.println(String.format(\n \"forward(%d):%s\\nbackeward(%d):%s\\neach: %d, swap: %d\"\n , forward.size(), forward, backward.size(), backward,\n pairs, swapCount\n ));\n\n return swapCount + pairs;\n }", "public static int heuristic(PentagoBoardState boardState) {\n\t\tint value = 0;\n\t\t\n\t\tfor (int i = 0; i<size; i++) {\n\t\t\tfor (int j = 0; j<size; j++) {\n\t\t\t\tif (boardState.getPieceAt(i, j) == PentagoBoardState.Piece.BLACK) {\n\t\t\t\t\tvalue += 10;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}", "public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int manhattan() {\n int dist = 0;\n for(int x = 0; x < n; x++) {\n for(int y = 0; y < n; y++) {\n if(tiles[x][y] != goal[x][y] && tiles[x][y] != 0) {\n int target = tiles[x][y] -1;\n int dest_row = target/n;\n int dest_col = target%n;\n dist += Math.abs((x-dest_col)) + Math.abs(y-dest_row);\n }\n }\n }\n return dist;\n }", "public int countNeighbours() {\n\t\tint count = 0;\n\t\tif (this.hasNeighbour(0))\n\t\t\tcount++;\n\t\tif (this.hasNeighbour(1))\n\t\t\tcount++;\n\t\tif (this.hasNeighbour(2))\n\t\t\tcount++;\n\t\treturn count;\n\t}", "public int calculateMisplacedTiles(List<Integer> currentState, List<Integer> goalState) {\n\t\tint edgeCost = 0;\n\t\tfor (int index = 0; index < currentState.size(); index++) {\n\t\t\tif(currentState.get(index).equals(0)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!currentState.get(index).equals(goalState.get(index))) {\n\t\t\t\tedgeCost++;\n\t\t\t}\n\t\t}\n\t\treturn edgeCost;\n\t}", "private static int numWaysDP(int N, ArrayList<Integer> x) {\n /* Base Cases */\n if (N == 0) {\n return 1;\n }\n\n int count;\n int[] counts = new int[N + 1];\n counts[0] = 1;\n for (int i = 1; i <= N; i++) {\n count = 0;\n for (int num : x) {\n if (i - num >= 0) {\n count += counts[i - num];\n }\n }\n counts[i] = count;\n }\n\n return counts[N];\n }", "public int CalcDistance ( )\r\n\t{\r\n\t\tfor ( int i = 0; i<size; i++ )\r\n\t\t{\r\n\t\t\tfor ( int offR = 0; offR <= size/2; offR++ )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( int offR = size-1; offR >= size/2; offR-- )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\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 maze [currentRow] [currentCol].getDistanceToExit();\r\n\t}", "public static void countWays() {\n\t\t//ways to climb up 7 stories if 1 to 3 steps can be taken.\n\t\t//int ways = countWaysUtil(7, 3);\n\t\tint ways = countWaysUtilDp(7, 3);\n\t\tSystem.out.println(\"ways \"+ways);\n\t}", "protected int GetMaxSpacing() {\n return Card.HEIGHT/3;\n }", "protected int GetMaxSpacing() {\n return Card.HEIGHT/3;\n }", "protected int GetMaxSpacing() {\n return Card.HEIGHT/3;\n }", "@Override\n public int getNumNeighboringMines(int row, int col) {\n int count = 0, rowStart = Math.max(row - 1, 0), rowFinish = Math.min(row + 1, grid.length - 1), colStart = Math.max(col - 1, 0), colFinish = Math.min(col + 1, grid[0].length - 1);\n\n for (int curRow = rowStart; curRow <= rowFinish; curRow++) {\n for (int curCol = colStart; curCol <= colFinish; curCol++) {\n if (grid[curRow][curCol].getType() == Tile.MINE) count++;\n }\n }\n return count;\n }" ]
[ "0.63066506", "0.6005303", "0.595927", "0.59014904", "0.58589596", "0.5655578", "0.5653885", "0.56485844", "0.56290585", "0.5595989", "0.5577895", "0.551914", "0.55137396", "0.5505139", "0.5498751", "0.5488567", "0.54797465", "0.5475145", "0.54596066", "0.54436713", "0.54412323", "0.5440948", "0.54254544", "0.54236686", "0.5423436", "0.54145175", "0.5394501", "0.53861433", "0.53859925", "0.53844273", "0.5370228", "0.5360244", "0.53492385", "0.53490293", "0.53471375", "0.5343708", "0.5340195", "0.53375447", "0.53252673", "0.5284782", "0.52787715", "0.5274679", "0.5261008", "0.5237473", "0.52371746", "0.5207891", "0.5203985", "0.5202507", "0.519605", "0.51954454", "0.5188601", "0.5174239", "0.517188", "0.5168988", "0.5165999", "0.51528263", "0.51513165", "0.5148564", "0.5147955", "0.5146113", "0.5145882", "0.5135813", "0.51284224", "0.51278913", "0.512235", "0.51181304", "0.5117866", "0.51165795", "0.51113766", "0.5110838", "0.51092964", "0.51063734", "0.5099858", "0.5093787", "0.50924754", "0.50871086", "0.5082417", "0.5078003", "0.5074907", "0.5073546", "0.5072372", "0.5071367", "0.50711924", "0.50663155", "0.50660455", "0.5065031", "0.50625706", "0.5053866", "0.5042219", "0.504179", "0.5039203", "0.5033599", "0.503228", "0.50303227", "0.50285995", "0.502851", "0.50266653", "0.50266653", "0.50266653", "0.502571" ]
0.6968551
0
/ Create a class Game which allows a user to play "Guess The Number" game once. Game should have following methods: 1. Constructor to generate the random number 2. takeUSerInput() to take a user input of number 3. isCorrectNumber() to detect whether the number entered by the user is true 4. getters and setters for number of guesses Use properties such as noOGuesses(), etc to get this task done
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Welcome to the very generic game of...Guess the Number!\");\r\n\t\t\r\n\t\tScanner difficultyChoice = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Select parameters below. 1 = 1-15, 2 = 1-25, and 3 = 1-50\");\r\n\t\t\r\n\t\tString choice = difficultyChoice.nextLine();\r\n\t\t\r\n\t\tint selection = 0;\r\n\t\t\r\n\t\tdo {\r\n\t\t\tif(choice.equals(\"1\")){\r\n\t\t\t\tselection = 1;\r\n\r\n\t\t\t} else if(choice.equals(\"2\")) {\r\n\t\t\t\tselection = 2;\r\n\r\n\t\t\t} else if(choice.equals(\"3\")) {\r\n\t\t\t\tselection = 3;\r\n\t\t\t}\r\n\t\t\tif(selection == 0) {\r\n\t\t\t\tSystem.out.println(\"Invalid entry. Please try again. Remember* 1 for 1-25, 2 for 1-50, and 3 for 1-100\");\r\n\t\t\t\tchoice = difficultyChoice.nextLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t} while(selection ==0);\r\n\t\t\r\n\t\tRandom computerNumber = new Random();\r\n\r\n\t\tint randomNum = 0;\r\n\r\n\t\tif(selection == 1){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(15);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-15. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 2){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(25);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-25. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(selection == 3){\r\n\r\n\t\t\tfor(int counter=1; counter<=1; counter++) {\r\n\t\t\t\trandomNum = 1+computerNumber.nextInt(50);\r\n\t\t\t\tSystem.out.println(\"The computer has chosen a number 1-50. You have 3 guesses. If your third guess is incorrect, you lose.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint guessTotal = 0;\r\n\r\n\t\tRandom RandomNum = computerNumber; \r\n\r\n\t\tScanner playerGuess1 = new Scanner(System.in);\r\n\r\n\t\tSystem.out.println(\"Please enter your first guess on the line below: \");\r\n\r\n\t\tint guess1 = playerGuess1.nextInt();\r\n\r\n\t\tif(guess1 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your first try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\tif(guess1 != randomNum) {\r\n\t\t\tguessTotal = 1;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 2)\");\r\n\t\t\tif(guess1 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tif(guess1 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tScanner playerGuess2 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your second guess on the line below: \");\r\n\r\n\t\tint guess2 = playerGuess2.nextInt();\r\n\r\n\t\tif(guess2 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your second try!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tif(guess2 != randomNum) {\r\n\t\t\tguessTotal = 2;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 1)\");\r\n\t\t\tif(guess2 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess2 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tScanner playerGuess3 = new Scanner(System.in);\r\n\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\");\r\n\r\n\t\tSystem.out.println(\"Please enter your third guess on the line below: \");\r\n\r\n\t\tint guess3 = playerGuess3.nextInt();\r\n\r\n\t\tif(guess3 == randomNum) {\r\n\t\t\tSystem.out.println(\"Correct, you guessed the right number on your third try!\");\r\n\t\t}\r\n\r\n\t\tif(guess3 != randomNum) {\r\n\t\t\tguessTotal = 3;\r\n\t\t\tSystem.out.println(\"The number you guessed is incorrect (guesses remaining = 0) Game over!\");\r\n\t\t\t/*if(guess3 > randomNum) {\r\n\t\t\t\tSystem.out.println(\"The number you guessed was greater than the computer's number\");\r\n\t\t\t} else {\r\n\t\t\t\tif(guess3 < randomNum) {\r\n\t\t\t\t\tSystem.out.println(\"The number you guessed was less than the computer's number\");\r\n\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\");\r\n\t\t\tSystem.out.println(\"The correct number was \" + randomNum);\r\n\t\t}", "private static void playGame()\n {\n initializeGame();\n System.out.println(textColor(\"white\",\"I have thought of a number, can you guess it?\"));\n Scanner guess = new Scanner(in);\n while(isPlaying)\n {\n // Give play information on how many guesses they have left\n System.out.print(textColor(\"blue\", \"Guesses left: \"));\n System.out.println(textColor(\"blue\", Integer.toString(guessesLeft)));\n if(showDebugInfo)\n {\n System.out.println(textColor(\"white\", String.format(\" %d (%d)\",bestGuess,secretNumber)));\n }\n // Ask for user input / guess\n System.out.println(textColor(\"cyan\", \"Enter your guess: \"));\n playerGuess = guess.nextInt();\n if (playerGuess > maxSecret)\n {\n // Cap player guess to max possible value\n System.out.print(textColor(\"yellow\",\"Guess is higher than possible maximum.\\nGuess is set to: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(maxSecret)));\n }\n else if(playerGuess < minSecret)\n {\n // Cap player guess to min possible value\n System.out.print(textColor(\"yellow\",\"Guess is smaller than possible maximum.\\nGuess is set to: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(minSecret)));\n }\n if (playerGuess == secretNumber)\n {\n // Player won\n System.out.print(textColor(\"white\",\"Congratulations! you have found my number: \"));\n System.out.println(textColor(\"cyan\",Integer.toString(secretNumber)));\n exitGame();\n }\n else if (secretNumber < playerGuess)\n {\n // Secret number is smaller than Player's guess\n System.out.printf(\"My number is %s\\n\",textColor(\"red\",\"LOWER\"));\n\n if(playerGuess - secretNumber < bestGuess)\n {\n bestGuess = playerGuess - secretNumber;\n }\n }\n else if (secretNumber > playerGuess)\n {\n // Secret number is larger than Player's guess\n System.out.printf(\"My number is %s\\n\",textColor(\"yellow\",\"HIGHER\"));\n if (secretNumber - playerGuess < bestGuess)\n {\n bestGuess = secretNumber - playerGuess;\n }\n }\n if (isPlaying)\n {\n switch(guessesLeft)\n {\n case 1:\n if(dangerZone(bestGuess))\n {\n // Player got close to finding the Secret Number, but still failed\n System.out.println(textColor(\"white\",\"You almost got me! My number was \"));\n System.out.println(textColor(\"yellow\",Integer.toString(secretNumber)));\n isPlaying = false;\n\n }\n else\n {\n if (safeLineUsed)\n {\n // Player could not find solution even after bonus guesses awarded\n System.out.print(textColor(\"white\",\"Sorry, the number I thought was \"));\n System.out.println(textColor(\"yellow\",Integer.toString(secretNumber)));\n isPlaying = false;\n }\n else\n {\n // Bonus Guesses award is triggered\n System.out.print(textColor(\"white\",\"Don't give up, here is \"));\n System.out.print(textColor(\"cyan\",Integer.toString(extraGuesses)));\n System.out.println(textColor(\"white\",\" extra guesses\"));\n safeLineUsed = true;\n guessesLeft += extraGuesses-1;\n }\n }\n break;\n\n default:\n // Keep reducing Guesses Left number\n guessesLeft--;\n break;\n }\n\n }\n }\n\n }", "public Game() {\n\t\tRandom rand = new Random();\n\t\tfor (int i=0; i<6; i++) {\n\t\t\trandNum[i] = rand.nextInt(40) + 1;\n\t\t\t\n\t\t\t// check if randNum already exists in the array starting from 2nd input\n\t\t\tif(i > 0) { \n\t\t\t\tfor(int c=i-1; c>=0; c--) { //iterate comparison to all previous inputs\n\t\t\t\t\tif(randNum[i]==randNum[c]) { //compare existing input with previous input\n\t\t\t\t\t\ti--; // subtract one(1) from the input counter\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Hello! Welcome to the game!\");\n\t int attempts = 0; //1a\n\t int green = 0;\n\t int red = 0;\n\t\tScanner myObj = new Scanner(System.in);\n\t Answer answer = new Answer();\n\t Guess userGuess = new Guess();\n //answer.printAnswer(); (this was included for your convenience if you want to see what the answer is when you run the program)\n\t while ((attempts < 10) && (green != 3)){\n\t userGuess.printGuessList();\n\t String stringGuess = getUserInput(myObj); //1d\n\t userGuess.set(stringGuess);\n\t int[] guess = userGuess.getGuess();\n\t green = answer.numGreenBall(guess);\n\t System.out.print(\"Green Balls: \" + green);\n\t red = answer.numRedBall(guess);\n\t System.out.println(\" Red Balls: \" + red);\n\t System.out.println();\n\t userGuess.sortAllGuesses();\n\t attempts = userGuess.getNumOfGuess();\n\t }\n\t //10\n if (green == 3){\n\t System.out.println(\"You won!\");\n\t }\n\t if (attempts == 10){\n\t System.out.println(\"You lose! You couldn't guess the number in ten tries.\");\n\t }\n\t\tmyObj.close();\n\t }", "public KunyarukGame() {\n \t\tthis(321);\n \t\tlong seed = System.nanoTime();\n \t\tRandom ran = new Random(seed);\n \t\tthis.secret = ran.nextInt(this.upperBound)+1;\n \t\tsuper.setMessage(\"Can you guess a number between 1 and \"+this.upperBound+\" that I'm thinking of?\");\n }", "public static void main(String[] args) {\n //Calculate the optimal number of guesses\n int OPTIMALGUESSCNT = getlog(UPPERBOUND,10);\n\n //Begin game\n System.out.println(\"This is the High Low Game. You WILL have fun.\");\n\n //Print Name\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter your name or be annihilated: \");\n\n String name = validateInputStr();\n if (name.isEmpty()) {\n System.out.println(\"You didn't enter a name. You must be Nobody. Glad I'm not a cyclops, haha jk, unless...\\nHello Player 1.\");\n }\n System.out.printf(\"Hello %s\\n\", name);\n\n boolean playAgain = false;\n int total_guesses = 0;\n short num_games = 0;\n do { //setup each game\n int game_guesses = 0;\n int secretNum = getSecretNum(Integer.parseInt(\"BEEF\",16));\n int guess = -1;\n int prev_guess = -1;\n while (guess != secretNum) { //A single game seshion\n Scanner scanGuess = new Scanner(System.in);\n System.out.println(\"Guess a number between 0 and 100: \");\n guess = validateInput();\n ++game_guesses;\n if (guess > UPPERBOUND || guess <= 0) {\n System.out.println(\"Your guess wasn't even in the range given!\");\n }\n if (guess > secretNum) {\n if (prev_guess != -1 && guess >= prev_guess && prev_guess >= secretNum) {\n System.out.println(\"You incorrectly guessed even higher this time! Lower your angle of attack!\");\n }\n System.out.println(\"You guessed too high.\");\n prev_guess = guess;\n }\n else if (guess < secretNum) {\n if (prev_guess != -1 && guess <= prev_guess && prev_guess <= secretNum) {\n System.out.println(\"You incorrectly guessed even lower this time! Aim high airman!\");\n }\n System.out.println(\"You guessed too low.\");\n prev_guess = guess;\n }\n else {\n //The game has effectively ended -> List Win Possibilities\n selectWinOption(game_guesses, OPTIMALGUESSCNT);\n //Check whether to play again\n boolean goodInput = false;\n while (!goodInput) {\n System.out.println(\"Would you like to play again? Enter yes (y) or no (n): \");\n Scanner clearBuff = new Scanner(System.in);\n String raw_playAgain = \"\";\n raw_playAgain = validateInputStr();\n //check input (I didn't feel like using Patterns\n if (raw_playAgain.equalsIgnoreCase(\"yes\") || raw_playAgain.equalsIgnoreCase(\"y\")) {\n playAgain = true;\n goodInput = true;\n }\n else if (raw_playAgain.equalsIgnoreCase(\"no\") || raw_playAgain.equalsIgnoreCase(\"n\")) {\n playAgain = false;\n goodInput = true;\n }\n else {\n System.out.println(\"Enter valid input! Ahhhh.\");\n }\n } //end check play again input\n }\n }\n System.out.println(\"You had \" + game_guesses + \" guesses during this game.\\n\\n\");\n total_guesses += game_guesses;\n ++num_games;\n }while(playAgain);\n\n printEndDialogue(total_guesses, num_games, OPTIMALGUESSCNT);\n }", "public static void userGuess() {\n\t\tSystem.out.println(\"It's time for you to guess. \");\n\t\tSystem.out.print(\"The computer will pick 4 numbers, each from 1 to 6: (\");\n\n\t\t// prints out all color options\n\t\tprintColor();\n\t\tSystem.out.println(\"You will try to guess what that exact sequence is in 12 tries, good luck!\");\n\t\tSystem.out.println(\"If you want to give up, enter 'quit' or 'exit'\");\n\t\tSystem.out.println(\"If you need a hint, enter 'hint'\");\n\t\tSystem.out.println(\"If you want some statistics, enter 'stats'\");\n\n\t\t// have computer pick random sequence\n\t\tRandom random = new Random();\n\t\tfor (int i = 0; i < NUM_COLOR_ROUND; i++) {\n\t\t\tcomputerCode[i] = random.nextInt(colors.length) + 1;\n\t\t}\n\n\t\t// scanner to input user data\n\t\ttry (Scanner scanner = new Scanner(System.in)) {\n\t\t\t// allows the user to input 12 guesses\n\t\t\twhile (totalGuess < MAX_GUESS) {\n\t\t\t\t// if you haven't entered 12 guesses allow more\n\t\t\t\tSystem.out.print(\"Please enter 4 numbers, each from 1 to 6: (\");\n\t\t\t\tprintColor();\n\n\t\t\t\t// reads the line into an array\n\t\t\t\tint[] user_guesses = new int[NUM_COLOR_ROUND];\n\t\t\t\tint index = 0;\n\t\t\t\twhile (index < NUM_COLOR_ROUND) {\n\t\t\t\t\t// reads the entire user input into a line\n\t\t\t\t\tString guess = scanner.nextLine();\n\n\t\t\t\t\t// check if user wants hint\n\t\t\t\t\tif (Objects.equals(\"hint\", guess)) {\n\t\t\t\t\t\thint();\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants to quit\n\t\t\t\t\tif (Objects.equals(\"quit\", guess.toLowerCase()) || Objects.equals(\"exit\", guess.toLowerCase())) {\n\t\t\t\t\t\tSystem.out.println(\"You quit, better luck next time! \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants stats\n\t\t\t\t\tif (Objects.equals(\"stats\", guess.toLowerCase())) {\n\t\t\t\t\t\tdisplayStats();\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (char ch : guess.toCharArray()) {\n\t\t\t\t\t\tif (index == NUM_COLOR_ROUND) {\n\t\t\t\t\t\t\t// if more than 4 digits are used, only the first 4 are entered into array\n\t\t\t\t\t\t\tSystem.out.println(\"Warning: only the first four digits are taken as your guess.\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ch > '0' && ch < '7') {\n\t\t\t\t\t\t\tuser_guesses[index++] = ch - '0';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tint digitLeft = NUM_COLOR_ROUND - index;\n\t\t\t\t\tif (digitLeft > 0) {\n\t\t\t\t\t\t// if <4 digits are entered, then the program asks the user to enter the\n\t\t\t\t\t\t// remaining to make 4\n\t\t\t\t\t\tSystem.out.println(String.format(\"Please enter %d more digits (1 to 6 only)\", digitLeft));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// total number of guesses so far\n\t\t\t\ttotalGuess++;\n\n\t\t\t\t// prints out total number of guesses so far\n\t\t\t\tSystem.out.println(\"Total number of guesses: \" + totalGuess);\n\t\t\t\t// prints out your guess\n\t\t\t\tSystem.out.println(\"Your guess is: \" + Arrays.toString(user_guesses));\n\n\t\t\t\t// checks if user wins, if not, gives feedback on their guess\n\t\t\t\tint[] result = compareGuess(computerCode, user_guesses);\n\t\t\t\tint numRightPos = result[0];\n\t\t\t\tint numWrongPos = result[1];\n\t\t\t\tif (numRightPos == NUM_COLOR_ROUND) {\n\t\t\t\t\tSystem.out.println(\"You win!\");\n\t\t\t\t\tstoreStats(totalGuess, fileName);\n\t\t\t\t\tdisplayStats();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(String.format(\n\t\t\t\t\t\t\t\"Correct position and color (BLACK): %d; Wrong position but correct color (WHITE): %d\",\n\t\t\t\t\t\t\tnumRightPos, numWrongPos));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (totalGuess >= MAX_GUESS) {\n\t\t\t// if user has done 12 guesses, game is over\n\t\t\tSystem.out.println(\"You lose!\");\n\t\t\tSystem.out.println(\"Here is what computer generated: \" + Arrays.toString(computerCode));\n\t\t\tstoreStats(0, fileName);\n\t\t\tdisplayStats();\n\t\t}\n\t}", "public void checkGuess() {\n\t\tString guessText = txtInput.getText();\r\n\t\tString message = \"\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// check the guess for too high/too low\r\n\t\t\tint guess = Integer.parseInt(guessText);\r\n\t\t\t//too high\r\n\t\t\tif (guess > theNumber) {\r\n\t\t\t\tmessage = guess + \" was too high. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else if (guess < theNumber) {\r\n\t\t\t\tmessage = guess + \" was too low. Try again.\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnumberOfPlayerGuesses += 1;\r\n\t\t\t} else {\r\n\t\t\t\tmessage = guess + \" was right! You used \" + numberOfPlayerGuesses + \" guesses. Let's play again!\";\r\n\t\t\t\tlblDirections2Result.setText(message);\r\n\t\t\t\tnewGame();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tlblDirections2Result.setText(\"Enter a whole number between 1 and 100.\");\r\n\t\t}\r\n\t\t\r\n\t\ttxtInput.requestFocus();\r\n\t\ttxtInput.selectAll();\r\n\t\t\r\n\t\t\r\n\t}", "public static void startGame(Scanner console){\r\n // 1. generate new game ans the random number\r\n GuessFourDigits guess = new GuessFourDigits(4);\r\n \r\n System.out.println(\"Welcome to GuessDigits\"); \r\n System.out.println(\"-----------------------------------------\");\r\n System.out.println(\"guess the right sequence of digits in \"+guess.NUMBER_LENGTH+ \"digits number.\");\r\n System.out.println(\"with each try there will be tipp about result\");\r\n System.out.println(\"-----------------------------------------\");\r\n \r\n // declaring and initialization of loop flag\r\n boolean tipp = false;\r\n \r\n //counter of tries\r\n int counterTry = 0;\r\n \r\n do{\r\n // 2. asking User to guess\r\n System.out.println(\"Your guess: \");\r\n String usersNumber = UserInput.askUserToInsert(console);\r\n \r\n // 2a. check validity of inserted number\r\n if(!guess.validityCheckOfNumber(usersNumber)){\r\n System.out.println(\" inserted number is not valid+\\n\"\r\n + \" a 4 digit positive number, no digit repeated.\");\r\n continue;\r\n }\r\n \r\n // if inserted nummer valid, tipp counter goes up\r\n counterTry++;\r\n \r\n // 3. comparing numbers\r\n int[] comparingNum = guess.compareTheNumbers(usersNumber);\r\n \r\n // 4. giving tipps and congratulating user\r\n if(comparingNum[0] == guess.NUMBER_LENGTH){\r\n //user wins\r\n System.out.println(\"Congrats, you reach \"+usersNumber+\" in \"\r\n + counterTry+ \" tries.\\n\");\r\n tipp = true;\r\n }else{\r\n // tipp to user\r\n System.out.println(\"right number at right position: \"\r\n +comparingNum[0]+ \" right number at wrong position: \"\r\n + comparingNum[1]+ \"\\n\");\r\n }\r\n \r\n \r\n \r\n }while(!tipp);\r\n \r\n }", "public static void main(String[] args) {\n int randomValue = (int) (100 * Math.random() + 1);\n /*Inicializamos una variable de tipo entero con un valor de 5 que\n * representará los intentos que tiene el usuario para adivinar el número*/\n int lives = 5;\n\n /*Pedimos por consola que el usuario escriba un número (primer intento)*/\n Scanner input = new Scanner(System.in);\n System.out.println(\"You have \" + lives + \" lives. Good luck!\");\n System.out.println(\"Try to guess the number:\");\n int inputNumber = input.nextInt();\n\n /*A partir del segundo intento se irá pidiendo al usuario que añada un número cada vez que no acierte,\n * mostrando algunos mensajes sobre las vidas que le quedan y si el número añadido es más grande o más\n * pequeño que el número que debe adivinar*/\n while (lives > 0) {\n lives--;\n if (lives == 0) {\n System.out.println(\"You died.\");\n break;\n }\n if (inputNumber > randomValue) {\n System.out.println(inputNumber + \" Your number is too big:\");\n System.out.println(\"Remaining lives: \" + lives);\n System.out.println(\"Try to guess the number:\");\n inputNumber = input.nextInt();\n }\n if (inputNumber < randomValue) {\n System.out.println(inputNumber + \" Your number is too small:\");\n System.out.println(\"Remaining lives: \" + lives);\n System.out.println(\"Try to guess the number:\");\n inputNumber = input.nextInt();\n }\n if (inputNumber == randomValue) {\n System.out.println(\"Good job! You are right!\");\n System.out.println(\"You wrote \" + inputNumber + \" and the number is \" + randomValue);\n System.out.println(\"Remaining lives: \" + lives);\n break;\n }\n }\n }", "public static void main(String[] args) {\n\n\t\tScanner input = new Scanner(System.in);\n\n\t\t// Introduction and random number selection between 1-10\n\t\tSystem.out.println(\"Hey you!\" + \"\\n\\n\"\n\t\t\t\t+ \"Word on the street says you're a pretty good number guesser. I beg to differ, nobody has ever guessed my number correctly in the entire history of number guessing!\"\n\t\t\t\t+ \"\\n\\n\"\n\t\t\t\t+ \"See if you can guess my number hotshot! I'm thinking of a number between 1 and 10, and no mindreading, because thats cheating!\\n\");\n\t\tint secretNum = new Random().nextInt(11 + 1);\n\t\tSystem.out.println(secretNum);\n\t\t// MainGame functionality\n\t\ttry {\n\n\t\t\tint guess = input.nextInt();\n\t\t\tint count = 0;\n\t\t\twhile (guess < 1 || guess > 10) {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"Hey, that's not a number between 1 and 10. You can't count let alone guess my number! Try again, but for real this time...\");\n\t\t\t\tguess = input.nextInt();\n\t\t\t\tcount = 0;\n\t\t\t}\n\t\t\tif(guess == secretNum){\n\t\t\t\tSystem.out.println(\"So it is true what everybody says. You truly are the master number guesser. You have my respects sir, I am sorry I ever doubted you. Please take my money.\");\n\t\t\t\tSystem.exit(0); \n\t\t\t}\n\t\t\twhile (guess > 1 && guess < 10 && guess != secretNum) {\n\t\t\t\tcount++;\n\t\t\t\tif (count == 1) {\n\t\t\t\t\tSystem.out.println(\"That's your first guess? HAH!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 2) {\n\t\t\t\t\tSystem.out.println(\"Oh come on, are you even trying???\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 3) {\n\t\t\t\t\tSystem.out.println(\"Actually you're getting quite close... NOT!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 4) {\n\t\t\t\t\tSystem.out.println(\"My grandmother is a better guesser than you!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 5) {\n\t\t\t\t\tSystem.out.println(\"Okay, now this is getting embarressing.\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 6) {\n\t\t\t\t\tSystem.out.println(\"You are a fake! A sham!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 7) {\n\t\t\t\t\tSystem.out.println(\"This is pathetic. Forget I even asked!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 8) {\n\t\t\t\t\tSystem.out.println(\"Wow... Honestly i'm speechless.\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\t\t\t\tif (count == 9) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I didn't even think it was possible to guess this many times and STILL not get the answer. You should be ashamed. I am reporting you to the number guessing authorities and you are going pay for wasting my time. HORRENDOUS!\");\n\t\t\t\t\tguess = input.nextInt();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (InputMismatchException ex) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"You don't even know the difference between a number and a letter. Pathetic. You are no master number guesser.\");\n\t\t}\n\n\t}", "public String guessingNumber(int randomNumber,int userNumber) {\n if(userNumber <= 0 || userNumber > 50)\n {\n return \"Enter number between 1 to 50\";\n }\n if(userNumber>randomNumber) {\n return \"guessed number is more than the original number\";\n } else if (userNumber < randomNumber) {\n return \"guessed number is less than the original number\";\n } else {\n return \"guessed matches the original number\";\n }\n }", "public Main()\n {\n \n Random rand = new Random();\n int n = rand.nextInt(10);\n n+=1;\n \n Scanner sc = new Scanner(System.in);\n int i = 0;\n do {\n \n i = sc.nextInt();\n\n //System.out.println(i);\n if(i<n){\n System.out.println(\"too small\");\n if (previousNum!=i){\n count += 1;\n }\n }\n else if(i>n){\n System.out.println(\"too big\");\n if (previousNum!=i){\n count +=1;\n }\n }\n else {\n System.out.println(\"correct guess\");\n \n count +=1;\n \n }\n \n previousNum = i;\n }while (i!=n);\n System.out.println(\"it took you \"+count+\" guesses!\");\n \n }", "public void checkGuess() {\n\t\tString guessText = txtGuess.getText();\n\t\tString message = \"\";\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\t//check users guess too high/too low\n\t\t\tint guess = Integer.parseInt(guessText);\n\t\t\t\n\t\t\tif ( guess < 0 || guess > 100) {\n\t\t\t\tthrow new Exception(\"User entry out of range\");\n\t\t\t}//if\n\n\t\t\t//too high\n\t\t\tif(guess > theNumber){\n\t\t\t\tmessage = guess + \" is to high guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}//if\n\t\t\t//too low\n\t\t\telse if (guess < theNumber){\n\t\t\t\tmessage = guess + \" is to low guess again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t}else{//guessed correct\n\t\t\t\tmessage = guess + \" was right! You win! Let's play again!\";\n\t\t\t\tlblOutput.setText(message);\n\t\t\t\tnewGame();\n\t\t\t}//else\n\t\t}//try\n\t\tcatch(Exception e) {\n\t\t\tlblOutput.setText(\"Enter a whole number between 1-100\"); \n\t\t}//catch\n\t\tfinally {\n\t\t\t\n\t\t\ttxtGuess.requestFocus();\n\t\t\ttxtGuess.selectAll();\n\t\t\t\n\t\t}//finally\n\t}", "public int play(NumberGame game) {\n\t\tboolean correct = false ; \n\t\tint guess = 0 ;\n\t\tint min = 1 ;\n\t\tint max = game.getUpperBound() ;\n\t\tdo {\n\t\tSystem.out.print(\"Your answer? \");\n\t\tguess = min+((max-min)/2); \n\t\tcorrect = game.guess(guess);\n\t\tSystem.out.println(guess);\n\t\tif(game.getMessage().equals(\"The number is too small\")) {\n\t\t\tmin = guess+1 ; \n\t\t}else if(game.getMessage().equals(\"The number is too large\")) {\n\t\t\tmax = guess-1 ;\n\t\t}\n\n\t\tSystem.out.println( game.getMessage() );\n\t\t}while(!correct);\n\t\treturn guess ;\n\t}", "public GuessingGame(int upperBound) {\n\t\tthis.upperBound = upperBound;\n\t\tthis.secret = getRandomNumber(upperBound);\n\t\tthis.hint = \"I'm thinking of a number between 1 and \" + upperBound;\n\t}", "public static void main(String[] args){\n \n //\"Declaring\" local variables for use later in the method.\n String firstName, lastName;\n int goalNumber, userGuess, countGuesses, ranNum;\n int triangleHeight;\n Scanner keyboardReader = new Scanner(System.in);\n \n //Get the user's name.\n System.out.print(\"Enter your first and last name: \");\n firstName = keyboardReader.next();\n lastName = keyboardReader.next();\n \n //Display a marquee with a personalized greeting.\n drawBorder(40, '*');\n printWelcome(firstName, lastName);\n drawBorder(40, '*');\n \n //Explain the game.\n printGameIntro(firstName);\n \n //Set up the game.\n goalNumber = (int)(1 + 20 * Math.random());\n countGuesses = 1;\n \n //Get the first guess.\n drawBorder(40, '*');\n System.out.print(\"Enter guess #\" + countGuesses + \": \");\n userGuess = keyboardReader.nextInt();\n \n //Loop until the user correctly guesses.\n while(userGuess != goalNumber){\n \n //Give advice to the user.\n if(userGuess < goalNumber){\n System.out.println(\"Too low. Guess higher.\");\n }\n else{\n System.out.println(\"Too high. Guess lower.\");\n }\n \n countGuesses = countGuesses + 1;\n \n System.out.print(\"Enter guess #\" + countGuesses + \": \");\n userGuess = keyboardReader.nextInt();\n \n } //end of while loop.\n \n //User wins if it takes fewer than 5 guesses.\n if(countGuesses < 5){\n System.out.print(\"Congratulations \" + firstName + \", \");\n System.out.println(\"you got it in \" + countGuesses + \" tries.\");\n System.out.println(\"You are a good guesser.\");\n }\n else{\n System.out.print(\"OK \" + firstName + \", \");\n System.out.println(\"you got it, but took 5 or more tries.\");\n }\n \n //Some artwork:\n drawBorder(40, '*');\n System.out.println(\"And now, we bring you a triangle of money!\");\n ranNum = (int)(1 + 10 * Math.random());\n triangleHeight = ranNum;\n \n //Display the triangle:\n for(int rowCount = 1; rowCount <= triangleHeight; rowCount++){\n drawBorder(rowCount, '$');\n }\n \n }", "private static void playGame()\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tint userGuess = 0;\n\t\tint length = String.valueOf(userGuess).length();\n\t\tboolean play = true;\n\t\twhile (play)\n\t\t{\t\n\t\t\tint gameNumber = newNumber();\n\t\t\tString randomNumber = String.valueOf(gameNumber);\n\t\t\tSystem.out.println(\">>>MASTERMIND<<<\");\n\t\t\tSystem.out.println(\"Enter your guess of the 4 digit number!\");\n\t\t\tdo\n\t\t\t{\n\t\t\t\tuserGuess = in.nextInt();\n\t\t\t\tlength = String.valueOf(userGuess).length();\n\t\t\t\tif (length != 4)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Please enter a number with a length of 4 digits.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (length != 4);\n\t\t\tString userNumber = String.valueOf(userGuess);\n\t\t\tnumberTester(userNumber, randomNumber);\n\t\t\tSystem.out.printf(\"\\nCongratulations! You guessed the random number %d\\n\", gameNumber);\n\t\t\tSystem.out.println(\"Would you like to play again?\");\n\t\t\tSystem.out.println(\"1.) Yes\");\n\t\t\tSystem.out.println(\"2.) No\");\n\t\t\tif (in.nextInt() == 2)\n\t\t\t{\n\t\t\t\tplay = false;\n\t\t\t}\n\t\t}\n\t}", "private static void playGame(int maxGuessCount) {\n Random random = new Random();\n int randomNumber = random.nextInt(50) + 1;\n\n // track user guesses and set a limit\n int userGuess;\n int guessCount = 0;\n\n // INITIALIZE GAME\n\n // the number range is modified through param when calling method validateInput\n System.out.println(\"Please type a number between 1 and 50.\");\n\n while (guessCount < maxGuessCount) {\n guessCount++;\n // put param for lowest and highest number range\n userGuess = validateInput(1, 50);\n\n if (userGuess == randomNumber) {\n System.out.println(\"That's right, you won!\");\n break;\n }\n if (userGuess < randomNumber) {\n System.out.println(\"Nope, try something higher.\" + \"\\n\");\n continue;\n } else if (userGuess > randomNumber) {\n System.out.println(\"Nope, try something lower.\" + \"\\n\");\n continue;\n }\n }\n\n // decide if game should restart or not\n System.out.println(\"\\n\" + \"Would you like to start over?\" + \"\\n\" + \"1. Yes\" + \"\\n\" + \"2. No\");\n int playAgainOrNot = validateInput(1, 2);\n\n switch (playAgainOrNot) {\n case 1:\n playAgain = true;\n break;\n case 2:\n System.out.println(\"Ok, see you next time.\");\n playAgain = false;\n break;\n }\n\n }", "public static void main(String[] args){\n Scanner keyboard = new Scanner(System.in);\n //declare variables for the answer, user's guess, and number fo guesses\n int answer;\n int guess;\n int numOfGuess = 0;\n \n boolean done = false;\n answer = (int)(100*Math.random())+1;\n \n //print an introduction that tells the user how to play this game\n System.out.println(\"Hello user! I will generate a number between 1-100 inclusive and you will try to guess it! I will tell you if your answer is too low or too high after each incorrect guess!\");\n do \n {\n System.out.print(\"Please enter your guess:\");\n guess = keyboard.nextInt();\n if (guess > answer){\n System.out.println(\"Too high!\");\n }\n else if( guess < answer){\n System.out.println(\"Too low!\");\n }\n else{\n done = true;\n }\n numOfGuess += 1;\n } while (done == false);\n \n System.out.println(\"Congratulations! You're score is \" + numOfGuess);\n if (numOfGuess >= 20){\n System.out.println(\"Rating: You are terrible at this game!\");\n }\n else if (numOfGuess >= 10 && numOfGuess <=19){\n System.out.println(\"Rating: You need more practice!\");\n }\n else if (numOfGuess >= 5 && numOfGuess <= 9){\n System.out.println(\"Rating: Not too bad, But can you get it in fewer than 5 guesses?\");\n }\n else if (numOfGuess >= 2 && numOfGuess <= 4){\n System.out.println(\"Rating: AWESOME. You win a trip to Hawaii!\");\n }\n else{\n System.out.println(\"Rating: That was pure LUCK and you know it!\");\n }\n \n }", "public static void numberManiaGame(Scanner input, byte difficulty){\n Random rand=new Random();\n int numberLimit=0,operation,number1,number2,total=0,userNumber;\n boolean isTheNumber=false;\n System.out.println(\"How many numbers would you like to guess? Maximum amount of questions allowed in this version are 128\");\n byte amountOfQuestions=input.nextByte();\n switch (difficulty){\n case 1:\n numberLimit=1000;\n break;\n case 2: \n numberLimit=5000;\n break;\n case 3:\n numberLimit=10000;\n break;\n }\n System.out.println(\"Great, let's start our game.\");\n for(int i=0;i<amountOfQuestions;i++){\n operation=rand.nextInt(2)-0;\n switch(operation){\n case 0:\n number1=rand.nextInt((numberLimit/2));\n number2=rand.nextInt((numberLimit/2));\n total=(number1+number2);\n System.out.println(\"Which number + \" + number1 + \" gives you \" + total);\n userNumber=input.nextInt();\n do{ \n if (userNumber==number2){\n System.out.println(\"Congratulations, that is the number.\");\n isTheNumber=true;\n }else{\n System.out.println(\"That is not the number. Please write another number\");\n userNumber=input.nextInt();\n }\n }while (isTheNumber==false);\n isTheNumber=false;\n break;\n case 1:\n number1=rand.nextInt((numberLimit/2));\n number2=rand.nextInt((numberLimit/2));\n total=(number1-number2);\n System.out.println(\"Which number - \" + number1 + \" gives you \" + total);\n userNumber=input.nextInt();\n do{ \n if (userNumber==number2){\n System.out.println(\"Congratulations, that is the number.\");\n isTheNumber=true;\n }else{\n System.out.println(\"That is not the number. Please write another number\");\n userNumber=input.nextInt();\n }\n }while (isTheNumber==false);\n isTheNumber=false;\n break;\n }\n }\n\n System.out.println(\"Thanks for playing! Returning to main menu...\");\n \n }", "public static void main(String[] args) {\n Random rand = new Random();\r\n int answer = rand.nextInt(10) + 1;\r\n Scanner sc = new Scanner(System.in);\r\n System.out.println(\"John's Guessing Game\");\r\n System.out.println(\"Guess a number between 1 and 10\");\r\n\r\n while (true) {\r\n System.out.print(\"Enter a number: \");\r\n int guess = sc.nextInt();\r\n if (guess == answer) {\r\n break;\r\n } else if (guess >= answer) {\r\n System.out.println(\"The number is lower, try again...\");\r\n } else {\r\n System.out.println(\"The number is higher, try again...\");\r\n }\r\n }\r\n System.out.println(\"You got it!!!\");\r\n }", "private static int guessing() {\n\t\t\n\t\tSystem.out.println(\"Guess a number between 1 and 100, you have 5 trials: \");\n\t\t\n\t\tint trials = 5;\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\t//set a random number as the number to be guessed\n\t\tint num = (int)(100 * Math.random()) + 1;\n\t\tint points = 0;\n\t\t\n\t\t//use a flag to check if player guess the correct number or not\n\t\tboolean flag = false;\n\t\twhile ( trials > 0) {\n\t\t\tint guess = input.nextInt();\n\t\t\ttrials--;\n\t\t\tif ( guess == num ) {\n\t\t\t\tpoints = trials == 0? 20 : trials * 20;\n\t\t\t\t//System.out.println(\"You guess the number with\"+trials+\"trials left, congratulation! +\"+ (points = trials == 0? 20 : trials * 20)+\" points\");\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}else if ( guess < num ) {\n\t\t\t\tSystem.out.println(\"The guess is too small, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"The guess is too large, please try again, you have \"+trials+\" trials left.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif ( !flag ) System.out.println(\"Trials used up, + 0 points\");\n\t\treturn points;\n\t\t\n\t}", "public void startGame(){\n\tp1= new Player();\r\n\tp2= new Player();\r\n\tp3= new Player();\r\n\r\nint guessp1=0, guessp2=0, guessp3=0;\r\nboolean p1isRight = false, p2isRight=false, p3isRight = false;\r\n\r\nint targetNumber = (int) (Math.random() * 10);\r\n\r\nSystem.out.println(\"I'm thinking of a number between 0 and 9...\");\r\n\r\nwhile(true){\r\n\tSystem.out.println(\"Number to guess is \" +targetNumber);\r\n\tp1.guess();\r\n\tp2.guess();\r\n\tp3.guess();\r\n\tguessp1 = p1.number;\r\n\tguessp2 = p2.number;\r\n\tguessp3 = p3.number;\r\n\r\n\tif(guessp1 == targetNumber){\r\n\t\tp1isRight=true;\r\n\t}if(guessp2 == targetNumber){\r\n\t\tp2isRight=true;\r\n\t}if(guessp3 == targetNumber){\r\n\t\tp3isRight=true;\r\n\t}\r\n\r\n\tif(p1isRight||p2isRight||p3isRight){\r\n\t\tSystem.out.println(\"We have a Winner!\");\r\n\t\tSystem.out.println(\"Player one got it right? \" +p1isRight);\r\n\t\tSystem.out.println(\"Player two got it right? \" +p2isRight);\r\n\t\tSystem.out.println(\"Player three got it right? \" +p3isRight);\r\n\r\n\t\tbreak;\r\n\t}else{\r\n\t\tSystem.out.println(\"Players will have to try again.\");\r\n\t}\r\n}\r\n}", "private void tryGuess(int guess) {\n int guessAssert = guesser.assertGuess(guess);\n switch (guessAssert) {\n case 0:\n guesser.madeGuess();\n System.out.println(\"Too low. Guess again: \");\n break;\n case 1:\n guesser.madeGuess();\n System.out.println(\"Too high. Guess again: \");\n break;\n case 2:\n guesser.madeGuess();\n System.out.println(\"You got it in \"+guesser.getGuess()+\" guesses!\");\n break;\n default:\n guesser.madeGuess();\n System.out.println(\"Invalid numeric value has been entered.\");\n break;\n }\n\n }", "public static int game(Scanner console) {\r\n Random rand = new Random();\r\n int number = rand.nextInt(MAX) + 1;\r\n System.out.println(\"I'm thinking of a number between 1 and \" + MAX + \"...\");\r\n System.out.print(\"Your guess? \");\r\n int guess = console.nextInt();\r\n int numGuesses = 1; \r\n while (guess != number) {\r\n hints(number, guess);\r\n System.out.print(\"Your guess? \");\r\n guess = console.nextInt();\r\n numGuesses++;\r\n }\r\n if (numGuesses != 1) {\r\n System.out.println(\"You got it right in \" + numGuesses + \" guesses\");\r\n } else { // numGuesses == 1\r\n System.out.println(\"You got it right in \" + numGuesses + \" guess\");\r\n }\r\n return numGuesses;\r\n }", "public static void main(String[] args) {\n\t\tint computerNum = (int)(Math.random()*100) + 1; \r\n\t\t//Code generates a decimal -> multiple by 100 to make it a whole number ->\r\n\t\t//use int to convert to integer to cut off decimal\r\n\t\tint userGuess = -100;\r\n\t\tint guessCount = 0;\r\n\t\twhile (userGuess != computerNum && userGuess != -1) {\r\n\t\t\tString input = JOptionPane.showInputDialog(null, \"This is a number guessing game. \"\r\n\t\t\t\t\t+ \"\\nPlease guess a whole number between 1 and 100.\");\r\n\t\t\tuserGuess = Integer.parseInt(input);\r\n\t\t\t//JOptionPane.showMessageDialog(null, \"Your guess was \" + userGuess + \".\");\r\n\t\t\tif (userGuess == -1){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You have chosen to leave the program.\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse if (userGuess < 0 || userGuess > 100){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Your number is invalid.\"\r\n\t\t\t\t\t\t+ \" Please enter a number between 1 and 100.\");\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (userGuess > computerNum){\r\n\t\t\t\tif (userGuess - 10 <= computerNum) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess a little too high, \"\r\n\t\t\t\t\t\t\t+ \" but within 10 of the number! Guess a little lower.\");\r\n\t\t\t\t\t//guessCount ++; \r\n\t\t\t\t\t//return guessCount;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess was too high! \"\r\n\t\t\t\t\t\t\t+ \"Make a lower guess.\");\r\n\t\t\t\t\t//guessCount ++;\r\n\t\t\t\t}\r\n\t\t\t\tguessCount ++;\r\n\t\t\t}\r\n\t\t\telse if (userGuess < computerNum) {\r\n\t\t\t\tif (userGuess + 10 >= computerNum) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Your guess was a little too low, \"\r\n\t\t\t\t\t\t\t+ \"but within 10 of the number! Guess a little higher.\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showConfirmDialog(null, \"Your guess was too low!\"\r\n\t\t\t\t\t\t\t+ \" Make a higher guess.\");\t\r\n\t\t\t\t}\r\n\t\t\t\tguessCount ++;\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Yay! You guessed correctly!\");\r\n\t\t\t}\r\n\t\t\t//JOptionPane.showMessageDialog(null, \"# = \" + computerNum +\r\n\t\t\t\t\t//\"# of guesses = \" + guessCount);\r\n\t\t}\r\n\t\tJOptionPane.showMessageDialog(null, \"The random number was: \" + computerNum +\r\n\t\t\t\t\"\\nIt took you \" + guessCount + \" guesses.\");\r\n\r\n\t}", "public int getUserGuess(){\n int n;\n\n System.out.print(\"Guess a number between 1 and 100:\\t\"); // Prompts for input\n while (!scanner.hasNextInt()) { // Checks to see if input is an integer\n System.out.print(\"Enter a number please: \\t\");\n scanner.next();\n }\n\n n = scanner.nextInt();\n return n;\n }", "public int play(NumberGame game){\n\n System.out.println( game.toString() );\n System.out.println();\n int min = 1;\n int max = game.getUpperBound();\n int guess = min + (max - min)/2;\n while(true){\n if(game.guess(guess)){\n break;\n }else {\n\n if(game.getMessage().contains(\"small\")){\n min = guess + 1;\n }else {\n max = guess - 1;\n }\n\n guess = min + (max - min)/2;\n\n }\n\n }\n\n return guess;\n }", "public static void main(String[] args) {\n\r\n\t\tboolean gameOver = true;\r\n\r\n\t\t// Do-while loop controls the entire game -- if this loop cannot run, the game will not run.\r\n\t\tdo {\r\n\t\t\tint players = 999;\r\n\t\t\tboolean numberError = true;\r\n\t\t\tString answer = \"\";\r\n\t\t\tint number = 0;\r\n\r\n\r\n\t\t\tint[] randomNumbers = new int[players];\r\n\t\t\tint[] numberOfGuesses = new int[players];\r\n\t\t\tint[][] numberArray = new int[players][205];\r\n\r\n\r\n\t\t\tScanner keyboard = new Scanner(System.in);\r\n\t\t\tboolean playAgain = false;\r\n\t\t\tSystem.out.println(\"Welcome to the Multi-Player Random Number Game\\nHow many players do we have?\");\r\n\r\n\t\t\tdo {\r\n\t\t\t\tif (players <= 0) {\r\n\t\t\t\t\tSystem.out.println(\"Please select at least one player.\");\r\n\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Validates the number of players\r\n\t\t\t\ttry {\r\n\t\t\t\t\tplayers = parsePlayerInput();\r\n\r\n\t\t\t\t\tif (players > 0) {\r\n\t\t\t\t\t\tnumberError = false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Creates the game\r\n\t\t\t\t\t\tfor (int i = 0; i < players; i++) {\r\n\t\t\t\t\t\t\t randomNumbers[i] = RNG();\r\n\t\t\t\t\t\t\t// *Remove the two slashes to the left and everything within these stars to see random number values per player* System.out.println(randomNumbers[i]);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < players; i++) {\r\n\t\t\t\t\t\t\tnumberOfGuesses[i] = 0;\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\tcatch (Exception e) {\r\n\t\t\t\t\tSystem.out.println(\"Your input was not an integer; try again\");\r\n\t\t\t\t\tnumberError = true;\r\n\t\t\t\t}\r\n\t\t\t} while (numberError == true);\r\n\t\t\tSystem.out.println(\"Okay, let's get started\\n\\nEach player has been assigned a random number.\\nTo win, correctly guess your random number before the other players do the same.\\nThe numbers are between 1 and 10.\");\r\n\t\t\r\n\t\t\t//Game condition set by While loop\r\n\t\t\twhile (playersFinished(players, randomNumbers, numberOfGuesses, numberArray ) == false) {\r\n\r\n\t\t\t\tfor (int i = 0; i < players; i++) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tint guessedNumber = numberOfGuesses[i];\r\n\t\t\t\t\t\tif (guessedNumber == 0 || numberArray[i][guessedNumber - 1] != randomNumbers[i]) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"\\nPlease enter a number Player \" + (i + 1));\r\n\t\t\t\t\t\t\tnumber = parseUserInput();\r\n\t\t\t\t\t\t\tguessComparator(number, randomNumbers[i]);\r\n\t\t\t\t\t\t\tnumberArray[i][guessedNumber] = number;\r\n\t\t\t\t\t\t\tnumberOfGuesses[i] = guessedNumber + 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\tSystem.out.println(\"Your input was not an integer OR it was out of range; try again\");\r\n\t\t\t\t\t\ti = i - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tprintValues(players, numberOfGuesses, numberArray);\r\n\t\t\trankingGenerator(players, numberOfGuesses);\r\n\r\n\t\t\tSystem.out.println(\"\\nWould you like to play again?: yes? or no?\\ntype 1 for yes \\nor \\ntype 2 for no\");\r\n\t\t\tanswer = keyboard.next();\r\n\t\t\twhile (playAgain == false){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (Integer.parseInt(answer.trim()) == 1){\r\n\t\t\t\t\t\tSystem.out.print(\"\\n\\n\\n\");\r\n\t\t\t\t\t\tplayAgain = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (Integer.parseInt(answer.trim()) == 2) {\r\n\t\t\t\t\t\tgameOver = false;\r\n\t\t\t\t\t\tplayAgain = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Thanks for playing. Ciao!\"); \r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.print(\"\\nPlease input 1 or 2 to make a descision:\\n\");\r\n\t\t\t\t\t\tanswer = keyboard.next();\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e){\r\n\t\t\t\t\tSystem.out.print(\"Your input was not an integer\\nPlease input 1 or 2 to make a descision:\\n\");\r\n\t\t\t\t\tanswer = keyboard.next();\r\n\r\n\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\t//Game End\r\n\t\t} while (gameOver);\r\n\t}", "public static void main(String[] args) {\n\t\tint randNum,num;\n\t\tGuessGame player=new GuessGame();\n\t\twhile(true) {\n\t\t\t//生成随机数\n\t\t\trandNum=player.RandomNum();\t\n\t\t\tSystem.out.println(\"请输入你猜的数字(你只有3次机会)\");\n\t\t\tfor(int i=3;i>0;i--) {\n\t\t\t\tnum=player.inputNum();\n\t\t\t\tif(player.isTrue(randNum, num)) {\n\t\t\t\t\tSystem.out.println(\"你猜对了,你的得分是:\"+player.counter);\n\t\t\t\t\tbreak;\n\t\t\t\t}else {\n\t\t\t\t\tif(i-1!=0)\n\t\t\t\t\t\tSystem.out.println(\"你猜错了,你还有\"+(i-1)+\"次机会\");\n\t\t\t\t\t\t\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"你猜错了,已经没有机会了。\");\n\t\t\t\t\t\tSystem.out.println(\"最终得分:\"+player.counter);\n\t\t\t\t\t\tSystem.out.println(\"随机数为:\"+randNum);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"游戏结束,按“1”,重玩,按“0”退出\");\n\t\t\tif(player.inputNum()==0)\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\t\tplayer.counter=0;//重置分数为0\t\t\t\n\t\t}\t\t\n\t}", "public void checkUserGuess(int userGuess, int randomNumber) {\n guessesLeft();\n if (userGuess == randomNumber) {\n gameFragmentLayout.setVisibility(View.VISIBLE);\n savehighscore();\n level++;\n hideKeybord();\n\n CorrectGameFragment correctGameFragment = new CorrectGameFragment();\n FragmentManager fragmentManager = getSupportFragmentManager();\n correctGameFragment.getCorrectFragInfo(this, level, levelMaxRange, guessesLeft);\n fragmentManager.beginTransaction()\n .replace(R.id.game_fragment, correctGameFragment)\n .commit();\n }\n }", "public boolean guess(int number) {\n\t\tcountRound++;\n\t\tlastGuess = number;\n\t\t\n\t\tif(number == secret) {\n\t\t\tsetChanged();\n\t\t\tnotifyObservers(number);\n\t\t\tsetMessage(\"Wow! Correct!! I'm thinking of \"+secret+\".\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (number < secret && number >= 1) setMessage(\"Umm, \" + number + \" is too small.\");\n\t\telse if (number > secret && number <= this.upperBound) setMessage(\"Oh! \" + number + \" is too large.\");\n\t\telse setMessage(\"Oops! Please input a valid number!!\");\n\t\t\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t\treturn false;\n\t}", "public static void main(String [] args){\n int randomNumber = (int) (Math.random()*100);\r\n\r\n // creating a scanner object\r\n Scanner scanner = new Scanner(System.in);\r\n\r\n // instructions\r\n System.out.println(\"I will choose a Number randomly between 1 - 100\");\r\n System.out.println(\"Try to guess it.\");\r\n\r\n for(int i = 10; i > 0; i--){\r\n\r\n System.out.println(\"you Currently have \" + i + \" guess(es) left choose again:\");\r\n\r\n // taking user input\r\n int guess = scanner.nextInt();\r\n\r\n if (guess > randomNumber){\r\n System.out.println(\"It's smaller than: \" + guess + \" try again.\");\r\n }else if (guess < randomNumber){\r\n System.out.println(\"It's bigger than: \" + guess + \" try again.\");\r\n } else{\r\n System.out.println(\"You Win! \" + guess);\r\n break;\r\n }\r\n }\r\n }", "public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}", "public void initiateGame()\n {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"========================\");\n System.out.println(\"Olympic Game\\n\\tGame Selection >>>>>> Game Initiation\");\n System.out.println(\"========================\");\n System.out.println(\"How many athletes in this game? from 4 to 8\");\n boolean input = false;\n do\n {\n try // check the input\n {\n this.participantNum = scan.nextInt();\n if(this.participantNum >= 4 && this.participantNum <= 8) //check the number of participant between 4 and 8\n {\n input = true;\n }else\n {\n System.out.println(\"please enter a number from 4 to 8\");\n }\n }\n catch (InputMismatchException ime)\n {\n System.out.println(\"please enter a number\");\n }\n scan.nextLine(); //clean scan and avoid from infinite loop\n }while (!input); // jump do-while loop when input is true\n\n System.out.print(\"\\n\");\n System.out.println(\"Add Participants Randomly? Y/N \");\n this.matchType(); // match integer game type with String\n this.createGame(); // add new game in game array list\n this.addParticipant(); // add athletes in the new game\n\n }", "public static void main(String[] args) {\r\n Scanner scan = new Scanner(System.in);\r\n Random generator = new Random();\r\n final int cap = 100;\r\n String answer = \"Y\";\r\n do {\r\n int numToGuess;\r\n int guess = -1;\r\n int count = 0;\r\n answer = \"Y\";\r\n numToGuess = generator.nextInt(cap) + 1; \r\n System.out.print(\"Please guess the integer number between\"\r\n + \" 1 and 100.\\nIf you wish to quit, type, \\\"0.\\\" \");\r\n while (guess != 0) {\r\n guess = scan.nextInt();\r\n System.out.println(\"Your guess was...\" + guess);\r\n if (guess > cap || guess < 0) {\r\n throw new IllegalArgumentException(\"Input cannot be more \"\r\n + \"than 100 or less than 0. To quit the input must\"\r\n + \" be -1\");\r\n } else if (guess == 0) {\r\n System.out.println(\"Quitting game...\\n\");\r\n } else if (guess > numToGuess) {\r\n System.out.println(\"That number is too high.\");\r\n count++;\r\n } else if (guess < numToGuess) {\r\n System.out.println(\"That number is too low.\");\r\n count++;\r\n } else if (guess == numToGuess) {\r\n System.out.println(\"That was correct.\");\r\n guess = 0;\r\n count++;\r\n }\r\n \r\n }\r\n System.out.println(\"Number of guesses for this game: \" + count);\r\n System.out.println(\"Would you like to play again? \\n\\\"N\\\" for no,\"\r\n + \" or any other input to start a new game.\");\r\n answer = scan.next();\r\n } while (!answer.equals(\"N\"));\r\n System.out.println(\"Goodbye!\");\r\n }", "public Integer guess(Integer g)\n {\n if (chosenNum == g){\n return 0;\n } else if (chosenNum > g){\n return -1;\n } else if (chosenNum < g){\n return 1;\n }\n return chosenNum;\n }", "public static void main(String[] args) throws IOException\n\t{\n\t\tGame Set = new Game(); //Class That Handles the Game\n\t\tObject\t[][] bingoCard = Set.createCard(); //Original Unmarked Card\n\t\tObject\t[][] playingCard = bingoCard; //Marked Card for Each Game\n\t\tint [] bingoNumbers; //Numbers to be Called\n\t\t\n\t\t/*\n\t\t//int nog; //Number of Games\n\t\t\n\t\t//Get Number of Games\n\t\tSystem.out.println(\"How many games to play?\");\n\t\tnog = cin.nextInt();\n\t\tcin.close();\n\t\tbingoNumbers = new int [100*nog]; //Set Amount of Numbers to Call, Per Instructions in ReadMe\n\t\t//*/\n\t\t\n\t\t//Would Normally Not Do This. Would Make Only 50 Numbers at A Time Instead of 100,\n\t\t\t//but Description Asks for It\n\t\tbingoNumbers = new int [500]; //Set Amount of Numbers to Call, Per Instructions in ReadMe\n\t\tScanner numbers = new Scanner(new File(\"Numbers.txt\")); //File With Numbers\n\t\tint t = 0; //Traverse Array of Bingo Numbers\n\t\twhile(numbers.hasNext()) //Till No More Numbers\n\t\t{\n\t\t\tString tmp = numbers.next(); //Get Number\n\t\t\ttmp = tmp.substring(0, tmp.length()-1); //Remove Delimiter\n\t\t\tbingoNumbers[t++] = Integer.parseInt(tmp); //Convert to Integer\n\t\t}\n\t\tnumbers.close(); //Close Scanner, No Longer Needed\n\t\t\n\t\t/*\n\t\tHashSet<Integer> numbs = new HashSet<Integer>(); //HashSet to Keep Track of Already Used Numbers\n\t\t\n\t\t//Get Numbers, No DataSet Given With Numbers, So Picked At Random\n\t\tfor (int i=0; i<bingoNumbers.length;)\n\t\t{\t\n\t\t\tint random; //Number to Call\n\t\t\tdo\n\t\t\t\t{random = (int)(Math.random()*100+1);} //Pick Random Number From Allowed Range\n\t\t\twhile (numbs.contains(random)); //Make Sure for No Repeats\n\t\t\t\n\t\t\tbingoNumbers[i] = random; //Add Number to List of Numbers to Call\n\t\t\tnumbs.add(random); //Add to List of Already Chosen\n\t\t\t\n\t\t\tif (++i%100==0) //Reset List Every 100 Numbers\n\t\t\t\tnumbs = new HashSet<Integer>();\n\t\t}\n\t\t//*/\n\t\t\n\t\t//Play and Print Game(s)\n\t\t//for (int i=0; i<nog;)\n\t\tfor (int i=0; i<6;)\n\t\t{\n\t\t\tObject [] res; //Results of Game\n\t\t\tint start = i*100; //Start Location\n\t\t\tint end = (++i)*100-1; //End Location\n\t\t\tint [] bn = Arrays.copyOfRange(bingoNumbers, start, end); //Get 100 Numbers From the Set at A Time\n\t\t\tres = Set.play(bn, playingCard); //Play Game\n\t\t\tprintGame(playingCard, res, bn, i); //Print Result\n\t\t\tplayingCard = bingoCard; //Reset Card\n\t\t}\n\t}", "public interface IGuessingGamePlayer {\n int nextGuess() throws NumberFormatException;\n}", "public static void main(String[] args) {\n \tSystem.out.println(\"----- MASTERMIND -----\" + \"\\n\" + \"Guess the 4 digit number!\");\n \tScanner in = new Scanner(System.in);\n \tRandom num = new Random();\n \t//the while loop will continue as long as the keepPlaying boolean is set to true meaning that the user still wants to play\n \tboolean keepPlaying = true;\n \twhile (keepPlaying) {\n \t\t//Here the random number is being generated randomly from 0 to 9 and then multiplied accordingly to represent the thousandths place, hundredths, tenths, and single.\n \t\tint firstDigit = num.nextInt(10);\n \tint secondDigit = num.nextInt(10);\n \tint thirdDigit = num.nextInt(10);\n \tint fourthDigit = num.nextInt(10);\n \tint answer = (firstDigit * 1000) + (secondDigit * 100) + (thirdDigit * 10) + fourthDigit; // Building the answer which will be the number that the user is trying to guess\n \tint userGuess = 0; //This variable will hold the number that the user guesses\n \tint i = 0; //initializing variables to represent the number of guesses the user has had\n \twhile (answer != userGuess) { //This while look will continue as long as the user has not guessed the answer that matches the one that was generated\n \t\ti++;\n \t\tSystem.out.println(\"Guess \" + i + \": \"); //Printing out the amount of guesses the user has made\n \t\tuserGuess = in.nextInt(); //Scanning in the guess\n \t\tint firstGuessDigit = userGuess/1000; //First guess digit is divided by 1000 so reach the single digit in the thousandths place\n \t\tint secondGuessDigit = (userGuess- (firstGuessDigit * 1000)) /100; //Second guess digit is subtracted by the first digit *1000 to make sure it is only the hundredths place and then divided by 100 to get the single digit that is in the hundredths place\n \t\tint thirdGuessDigit = ((userGuess - (firstGuessDigit * 1000) - (secondGuessDigit * 100)) /10); //Third guess digit is reached by subtracted the thousandths and hundreths place to make sure it's only the tenths and then divided by 10 to get the single digit that is in the tenths place.\n \t\tint fourthGuessDigit = (userGuess) - (thirdGuessDigit * 10) - (secondGuessDigit *100) - (firstGuessDigit * 1000); //the fourth guess digit is reached by subtracting the thousandths, hundredths, and tenths place to get the final digit in the rightmost place.\n \t\tint correctDigits = 0; //initialize variable to represent how many digits the user has gotten correct\n \t\tif (firstDigit == firstGuessDigit) { //if the first digit of the randomly generated number matches the corresponding place in the user guess the number of correct digits increments up 1.\n \t\t\tcorrectDigits++;\n \t\t\t\n \t\t}\n \t\tif (secondDigit == secondGuessDigit) { //if the second digit of the randomly generated number matches the corresponding place in the user guess the number of correct digits increments up 1.\n \t\t\tcorrectDigits++;\n \t\t\t\n \t\t}\n \t\tif (thirdDigit == thirdGuessDigit) {//if the third digit of the randomly generated number matches the corresponding place in the user guess the number of correct digits increments up 1.\n \t\t\tcorrectDigits++;\n \t\t\t\n \t\t}\n \t\tif (fourthDigit == fourthGuessDigit) {//if the fourth digit of the randomly generated number matches the corresponding place in the user guess the number of correct digits increments up 1.\n \t\t\tcorrectDigits++;\n \t\t\t\n \t\t}\n \t\tSystem.out.println(\"You matched \" + correctDigits); //Prints out the amount of correct digits are in the guess\n \t\t\n \t}\n \t//Once the user gets the number right they are congratulated and told how many guesses it took.\n \tSystem.out.println(\"Congratulations! You guessed the right number in \" + i + \" guesses.\"); \n \t//Now they are asked if they want to play again and their input is scanned in\n \tSystem.out.println(\"Would you like to play again (yes/no)?\");\n \tin.nextLine();\n \t//if their input is not equal to yes then the keep playing variable is changed to false making the program end, if they do say yes then the loop will start over restarting everything.\n \tString restart = in.nextLine();\n \tif (!restart.equals(\"yes\")) {\n \t\tkeepPlaying = false;\n \t\n \t}\n \t}\n }", "public KunyarukGame(int upperbound) {\n\t\tthis.upperBound = upperbound;\n\t\tlong seed = System.nanoTime();\n\t\tRandom ran = new Random(seed);\n\t\tthis.secret = ran.nextInt(this.upperBound) + 1;\n\t\tsuper.setMessage(\"Can you guess a number between 1 and \"+this.upperBound+\" that I'm thinking of?\");\n\t}", "public EvilHangman(int numGuess){\n\t\tthis.guesses = numGuess;\n\t\tthis.dict = new EvilDictionary(\"dictionary.txt\");\n\t\tthis.usedLetters = new ArrayList<Character>();\n\t\tthis.showWords = false;\n\t}", "public void Enter() {\n\t\tEndTimer();\n\t\tif (Question >= 10) {\n\n\t\t\tSystem.out.println(\"This is Game\" + Score);\n\t\t\tIntent TheScore = new Intent(this, Score.class).putExtra(\"Score\",\n\t\t\t\t\tInteger.toString(Score));\n\t\t\tEndTimer();\n\t\t\tstartActivity(TheScore);\n\t\t\tfinish();\n\t\t} else {\n\n\t\t\tEditText editText22 = (EditText) findViewById(R.id.editText1);\n\t\t\tInteger Guess = 0;\n\t\t\ttry {\n\t\t\t\tGuess = Integer.parseInt(editText22.getText().toString());\n\t\t\t} catch (NumberFormatException nfe) {\n\t\t\t}\n\n\t\t\tTextView CorrectOrNot = (TextView) findViewById(R.id.textView1);\n\t\t\t/*\n\t\t\t * If the Hints is on it will allow the user to try each question 4\n\t\t\t * times. Below checks if the Hints is on or off.\n\t\t\t */\n\t\t\tif (Prefs.getHints(this)) {\n\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\tCorrect++;\n\t\t\t\t\t/*\n\t\t\t\t\t * The score is worked out by 100 divided by 10 take away\n\t\t\t\t\t * from how much time was left.\n\t\t\t\t\t */\n\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\tQuestion++;\n\t\t\t\t\treset();\n\t\t\t\t\t/*\n\t\t\t\t\t * Should the user enter the wrong answer it will allow them\n\t\t\t\t\t * to retry as well as tell them if the answer they entered\n\t\t\t\t\t * is greater or less then the actual answer.\n\t\t\t\t\t */\n\t\t\t\t} else if (Tries < 4) {\n\t\t\t\t\tif (Guess > Answer) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.MAGENTA);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Greater\");\n\t\t\t\t\t\tTries = Tries + 1;\n\t\t\t\t\t\tEndTimer();\n\t\t\t\t\t\tStartTimer();\n\n\t\t\t\t\t}\n\t\t\t\t\tif (Guess < Answer) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.MAGENTA);\n\t\t\t\t\t\tCorrectOrNot.setText(\"less\");\n\t\t\t\t\t\tTries = Tries + 1;\n\t\t\t\t\t\tEndTimer();\n\t\t\t\t\t\tStartTimer();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * Once the 4 tries is over, it will check if the last answer is\n\t\t\t\t * correct or not and act accordingly\n\t\t\t\t */\n\t\t\t\tif (Tries >= 4) {\n\t\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\t\tCorrect++;\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * The score is worked out by 100 divided by 10 take\n\t\t\t\t\t\t * away from how much time was left.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\t\tQuestion++;\n\t\t\t\t\t\treset();\n\t\t\t\t\t} else if (Answer != Guess) {\n\t\t\t\t\t\tQuestion++;\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.RED);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Incorrect\");\n\t\t\t\t\t\tTries = 0;\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\tCorrect++;\n\t\t\t\t\t/*\n\t\t\t\t\t * The score is worked out by 100 divided by 10 take away\n\t\t\t\t\t * from how much time was left.\n\t\t\t\t\t */\n\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\tSystem.out.println(Score);\n\t\t\t\t\tQuestion++;\n\t\t\t\t\tSystem.out.println(\"Correct \" + Correct);\n\t\t\t\t\treset();\n\t\t\t\t} else {\n\t\t\t\t\tQuestion++;\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.RED);\n\t\t\t\t\tCorrectOrNot.setText(\"Incorrect\");\n\t\t\t\t\treset();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "private static String getValidGuess(BagelGame game) {\n Scanner scan = new Scanner(System.in);\n boolean valid = false;\n String guess = \"\";\n String error;\n \n while (!valid) {\n System.out.print(\"Guess # \" + game.getGuessNum() + \" ? \");\n guess = scan.nextLine().trim();\n error = game.validateGuess(guess);\n if (error == \"\") {\n valid = true;\n } else {\n System.out.println(error);\n }\n }\n return guess;\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tRandom rand = new Random();\n\t\tint number = rand.nextInt(100), guesses = 0;\n\t\tSystem.out.print(\"Can you guess the number? (1-100)\");\n\t\tfor(int userGuess = 0 ; userGuess != number; guesses++) {\n\t\t\tSystem.out.print(\"Guess: \");\n\t\t\tuserGuess = scan.nextInt();\n\t\t\tif(userGuess < number) {\n\t\t\t\tSystem.out.println(\"Up\");\n\t\t\t} else if(userGuess > number) {\n\t\t\t\tSystem.out.println(\"Down\");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Congratulations! That is the number!\");\n\t\tSystem.out.println(\"It took you \" + guesses+1 + \" guesses!\");\n\t\tscan.close();\n\t\t\n}", "public static void main( String[] args) \r\n {\n Scanner scan; \r\n HangMan game; \r\n String userInput; \r\n String letter; \r\n int errorValue;\r\n boolean temp;\r\n \r\n //Initialize the variables (other variables will be given values as program proceeds) \r\n scan = new Scanner( System.in); \r\n temp = true; \r\n \r\n //Create the user-interface and play the game \r\n while( temp ) \r\n { \r\n game = new HangMan(); \r\n System.out.println( \"Welcome to Hang-man game\"); \r\n System.out.println( \"You have \" + 6 + \" tries\"); \r\n System.out.println( \"Enter any button except q to proceed, q to quit\"); \r\n userInput = scan.next(); \r\n \r\n //Outer loop for re-playing of the game\r\n if( !userInput.equals( \"q\")) \r\n { \r\n //Inner loop for the simulation of the game \r\n while( !game.isGameOver() && !game.hasLost()) \r\n { \r\n System.out.println( \"The word that you're looking for: \" + game.knownSoFar); \r\n System.out.println( \"Number of tries left : \" + (6 - game.numberOfIncorrectTries)); \r\n System.out.println( \"Letters in the english alphabet: \" + game.allLetters); \r\n System.out.println( \"Used letters: \" + game.usedLetters); \r\n System.out.println( \"Please enter a letter\");\r\n letter = scan.next(); \r\n errorValue = game.tryThis( letter.charAt(0) /* or just letter itself (depending on the implementation of the method)*/); \r\n \r\n if( errorValue == -1) // Invalid input \r\n {\r\n System.out.println( \"Please enter a valid letter\"); \r\n }\r\n else if( errorValue == -2) // Repeated letter \r\n {\r\n System.out.println( \"You entered this letter before, please enter a different letter\"); \r\n }\r\n else if( errorValue == 1) // Correct answer 1 repetition \r\n {\r\n System.out.println( \"The letter you entered is repeated 1 time\"); \r\n }\r\n else if( errorValue > 1) // Correct answer multiple representation\r\n {\r\n System.out.println( \"The letter you entered is repeated \" + errorValue + \" times\"); \r\n }\r\n else if( errorValue == 0) // Wrong answer \r\n {\r\n System.out.println( \"Unfortunately the letter you entered is not in the word\"); \r\n }\r\n else if( errorValue == -3) // Game Over \r\n {\r\n System.out.println( \"Game Over\"); \r\n }\r\n if( game.hasLost()) \r\n {\r\n System.out.println( \"Unfortunately, you lost\"); // Implementing a method showing the secret word would be nice \r\n }\r\n else if( game.isGameOver()) \r\n {\r\n System.out.println( \"You won, congratulations\"); \r\n }\r\n } \r\n } \r\n \r\n else \r\n { \r\n temp = false; \r\n System.out.println( \"Bye - bye, thanks for playing\"); \r\n } \r\n } \r\n }", "private static void initializeGame()\n {\n minSecret = 1;\n maxSecret = 100;\n secretNumber = newSecretNumber(minSecret,maxSecret);\n guessesLeft = 10;\n guessRange = 10;\n bestGuess = maxSecret + 1;\n extraGuesses = 5;\n isPlaying = true;\n safeLineUsed = false;\n showDebugInfo = false;\n\n }", "public static void main(String[] args) {\n Scanner myInt = new Scanner(System.in); // This line creates a scanner object\r\n System.out.print(\"Enter number between 1 and 5:\");\r\n \r\n int guess = myInt.nextInt(); // read user input\r\n if (guess >=1 && guess <=5){\r\n int result = guess%2; \r\n if (result == 0)\r\n {\r\n System.out.println(\"Lucky Guess\");\r\n }else{\r\n System.out.println(\"Better Luck Next Time\");\r\n } }else{\r\n System.out.print(\"Enter number between 1 and 5:\");\r\n guess = myInt.nextInt();\r\n } \r\n }", "public static void main(String[] args) {\n\n\t\tScanner keyboard = new Scanner(System.in); //creates keyboard for input\n\t\tRandom rand = new Random(); //generates random number between 1 and 20\n\t\tint num = rand.nextInt(20) + 1; //variable for generated number\n\t\tint playerGuess; //variable for player's guess\n\t\tboolean correct = false; //boolean expression used to end while loop once guess is correct\n\n\t\tSystem.out.println(\"I am thinking of a number between 1 and 20.\");\n\t\tSystem.out.println(\"The machine number is: \" + num); //Prints the machine guess for easy testing\n\n\t\tdo { \n\t\t System.out.println(\"\\nWhat is your guess: \");\n\t \ttry {\n\t \t playerGuess = keyboard.nextInt(); //initiates variable for guesses\n\t \t if (playerGuess > 20 || playerGuess < 1) { //if player's guess is out of range\n\t \t System.out.println(\"Please enter a number between 1 and 20.\");\n\t \t } else if (playerGuess < num) { //if player guess is too low\n\t \t System.out.println(\"Too low.\");\n\t } else if (playerGuess > num) { //if player guess is too high\n\t System.out.println(\"Too high.\");\n\t } else { //correct guess\n\t System.out.println(\"Congratulations! You are correct!\");\n\t keyboard.close(); //closes scanner\n\t correct = true; //exits while loop\n\t \t}\n\t \t} catch (InputMismatchException e) { //if player does not enter an integer\n\t \t System.out.println(\"Please enter an integer.\");\n\t \t keyboard.next(); //moves onto next keyboard input\n\t \t}\n\t\t} while (correct == false); //moves onto next iteration in while loop\n\t}", "public static String startGame() {\n Scanner scan = new Scanner(System.in);\n System.out.print(\"Enter your name:\");\n String playerName = scan.nextLine();\n if(playerName.isEmpty()) {\n playerName = \"Player 1\";\n System.out.println(\"Somehow you failed to type your own name in...\");\n System.out.print(\"I'll just call you Player 1 :)\\n\\n\");\n }\n System.out.print(\"WELCOME to the High/Low Game \" + playerName + \"!\\n\\n\");\n System.out.print(\"The objective of this game is to determine the randomly generated number between 0 & 100\\n\");\n System.out.println(\"When prompted for a guess, enter an integer and NOTHING else.\");\n System.out.println(\"Upon your guess, the game will return high if your guess was higher than the number,\");\n System.out.println(\"and low if your guess was lower than the number.\");\n System.out.println(\"The goal is to eventually figure out the exact number... shouldn't be too hard right?\");\n System.out.print(\".\\n.\\n.\\nGOOD LUCK!\\n\");\n return playerName;\n }", "public void playGame(){\n do{\n int userGuess = getUserGuess();\n user.getUserGuesses().add(userGuess); // adds guess to user's arraylist\n isWinner(userGuess, chosenNumber);\n }while(!wonGame);\n }", "public void makeGuess() {\n columnGuess = ((int) (Math.random() * 100000)) % 10;\n\n int number = ((int) (Math.random() * 100000)) % 10;\n rowGuess = (char) (number + 65);\n }", "public static void main(String[] args) {\n int secretNumber;\n secretNumber = (int) (Math.random () * 20 + 1);\n //System.out.print(\"For debugging purposes the secret number is: \" + secretNumber);\n \n Scanner keyboard = new Scanner (System.in);\n int guessedNumber;\n do {\n\t System.out.print(\"Please enter a random number: \" );\n\t \n\t guessedNumber = keyboard.nextInt();\n\t System.out.println(\"The Number you choose is : \" + guessedNumber);\n\t \n\t if (guessedNumber == secretNumber) {\n\t\t System.out.print(\"Aye You guessed the number correctly\");\n\t }\n\t else if (guessedNumber < secretNumber) {\n\t\t System.out.println(\"Sorry try again! Your number is too low!\");\n\t }\n\t else if (guessedNumber > secretNumber) {\n\t\t System.out.println(\"Try again bud your number was too high!\");\n\t }\n\t \n } while (guessedNumber != secretNumber);\n\t}", "abstract int nextTry(String guess);", "public static void runGame() {\n Scanner read = new Scanner(System.in);\n Random generator = new Random();\n \n //get username\n String userName = getUserName(read);\n\n //get number of rounds\n int rounds = getRounds(read, userName);\n \n //play the game!\n playGame(read, generator, userName, rounds);\n }", "private static void playGame() {\n CardDeck deck = new CardDeck();\n int dealer, player, hitOrStand = 1, score = 0;\n System.out.println(\"Goal: Beat the dealer without going over 21\");\n Scanner input = new Scanner(System.in);\n\n // Generate the dealer's card\n dealer = generateRandomNumber(16, 21); \n System.out.println(\"The Dealer scored: \" + dealer);\n System.out.println(\"\");\n \n\n // Keep playing while the player hasn't won or lost yet\n while (hitOrStand == 1 && score < 21 && score < dealer) {\n // Generate player's card\n player = generateRandomNumber(1, 10); \n System.out.println(\"Your card is worth \" + player);\n\n // Displays the picture of player's card\n String card = deck.drawCard(player);\n System.out.println(card);\n\n // Add player's card value to their score\n score = score + player;\n\n // Displays score and asks wether user wants to hit or stand\n if (score <= 21 && score < dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.print(\"Another card? Hit=1 stand=0: \");\n hitOrStand = input.nextInt();\n System.out.println(\"\");\n }\n }\n \n // Display player won\n if (score > dealer && score <= 21 ) {\n System.out.println(\"You win!\");\n System.out.println(\"Your score is \" + score);\n System.out.println(\"The dealer score was \" + dealer);\n System.out.println(\"You were closer to 21 by \" + (score - dealer));\n\n // Display when player ties with dealer\n } else if (score == dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You tied!\");\n\n // Display if player lost\n } else if (score > 21) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You lose!\");\n int over = score - 21;\n System.out.println(\"You were over 21 by \" + over);\n\n // Display if player lost\n } else {\n int difference;\n difference = dealer - score;\n System.out.println(\"Your score is \" + score);\n System.out.println(\"You lose!\");\n System.out.println(\"The dealer was closer to 21 than you by \" + difference);\n } \n }", "public interface Guessable {\n\n}", "public void wrongGuess()\r\n\t{\r\n\t\tSystem.out.println(\"Sorry, your guess is wrong\");\r\n\t\tif(userRanPan.getValue() == -1)\r\n\t\t\tnewGame.getUserHand().addDash(true,userRanPan);\r\n\t\telse\r\n\t\t\tnewGame.getUserHand().addPanel(userRanPan,true);\r\n\r\n\t\tif(userWon() == false)\r\n\t\t\tcompTurn(false);\r\n\t\telse if(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "public static void main( String [] args )\r\n {\n \r\n \r\n Scanner scan = new Scanner( System.in );\r\n \r\n System.out.println( \"Enter your first name here > \" );\r\n String firstName = scan.next();\r\n System.out.println( \"Hello \" + firstName + \", how are you doing today?\" );\r\n int firstNameLength = firstName.length();\r\n System.out.println( \"By the way, your name consists of \" + firstNameLength + \" letters.\" );\r\n\r\n \r\n //*****\r\n // 3. Print an empty line\r\n \r\n \r\n System.out.println();\r\n \r\n \r\n //*****\r\n // 4. a. Using previously created Scanner object prompt the user for the year (s)he was born.\r\n // b. Calculate and print the age the user will be this year.\r\n // c. Declare a constant for average life expectancy,\r\n // set its value to 78.74\r\n // d. Print a message that tells the user the percentage\r\n // of their expected life they've lived.\r\n // Use the DecimalFormat class to format the percentage\r\n DecimalFormat percentPattern = new DecimalFormat( \"#0.0%\" );\r\n \r\n System.out.println( \"I know this is a bit rude, but what year were you born? > \" );\r\n int year = scan.nextInt();\r\n final int CURRENT_YEAR = 2015;\r\n int age = CURRENT_YEAR - year;\r\n final double LIFE_EXPECTANCY = 78.74;\r\n double lifeExpectancy = age/LIFE_EXPECTANCY;\r\n System.out.println( \"Based on your birth year you are \" + age + \" years old.\"\r\n + \"\\n Also your life expectancy is \" + percentPattern.format( lifeExpectancy ) );\r\n \r\n \r\n //*****\r\n // 5. a. Create a Random object\r\n // and generate a random integer between 1 and 20 inclusive\r\n // b. Using previously created Scanner object prompt the user for a guess.\r\n // c. Print a message that tells the user the number\r\n // and how far from the number the guess was (hint: use Math.abs)\r\n Random random = new Random();\r\n \r\n int ranRoll = random.nextInt( 20 ) + 1;\r\n System.out.println( \"\\nLet's play a game, guess a number between 1 and 20 > \");\r\n int guess = scan.nextInt( );\r\n int far = Math.abs( ranRoll - guess );\r\n System.out.println( \"The number you guessed was: \" + guess + \", and you were \"\r\n + far + \" away from the random number.\" );\r\n }", "public static void main(String[] args) {\n GuessWhoGame g = new GuessWhoGame();\n System.out.println(play(g));\n// g.guess(\"bob\");\n// System.out.println(g.guess(\"bob\"));\n System.out.println(\"score =\" + g.score());\n }", "public MyNumberGuessGameGUI() {\n initComponents();\n min = JOptionPane.showInputDialog(\"Enter the low end of the range: \");\n max = JOptionPane.showInputDialog(\"Enter the high end of the range: \"); \n titleWithRange.setText(\"What number am I thinking of between \" + min + \" and \" + max);\n \n try{\n ((JTextFieldValidateable)guessSpace).setValidator(new NumericRangeValidator(min,max));\n }catch(NumberFormatException nfe){\n JOptionPane.showMessageDialog(rootPane, RANGE_ERR_MSG);\n }\n \n try{\n guesser = new MyNumberGuessProgram(min, max); \n }catch(NumberFormatException nfe) {\n JOptionPane.showMessageDialog(rootPane, RANGE_ERR_MSG);\n } \n }", "public abstract void nextGuessResult(ResultPegs resultPegs);", "public static void main(String[] args) {\r\n int grade = 0;\r\n \r\n initializeBoard();\r\n \r\n System.out.println(game);\r\n//getValueIn is a simple getter method the returns value at given array index \r\n if (game.getValueIn(1, 1) == 5)\r\n grade += 5;\r\n else\r\n System.out.println(\"getValueIn(r,c) test failed\");\r\n//confirms that to string was done correctly \r\n if (testToString()) \r\n grade += 5;\r\n else\r\n System.out.println(\"toString() test failed\");\r\n//testAddGuess1() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 3, 5);\r\n if (testAddGuess1()) \r\n grade += 5;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 1 failed\"); \r\n//testAddGuess2() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 2, 5);\r\n if (testAddGuess2()) \r\n grade += 5;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 2 failed\"); \r\n//testAddGuess3() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 4, 1);\r\n if (testAddGuess3()) \r\n grade += 10;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 3 failed\"); \r\n //tests reset(), by re-running the first toString test above, after running game.reset() \r\n game.reset();\r\n if (testToString())\r\n grade += 10;\r\n else\r\n System.out.println(\"reset() test failed\");\r\n//tests the game.getAllowedValues method by passing the game object method call and hence it's results\r\n//to the testGetAllowedValues(), which appears to only apply to one cell/array index at a time\r\n//so if I am correct this is saying what values can be used at coordinates 8, 8.\r\n//the answer that it uses to compare is a visual/manual analysis of expected results for cell 8, 8. \r\n if (testGetAllowedValues(game.getAllowedValues(8, 8)))\r\n grade += 10;\r\n else\r\n System.out.println(\"getAllowedValues() test failed\");\r\n \r\n System.out.printf(\"Your grade is %d/50.\\n\", grade);\r\n }", "public void checkUserGuess(String inputGuess){\n numGuesses++;\n // Set the result to You Miss,\n String result = \"You Miss!\";\n // Loop and check for occurence in any of the three dot coms.\n for(DotCom dotComToTest : dotComList){\n // Checking the user input versus each dotCom.\n String temp = dotComToTest.checkGuess(inputGuess);\n if(temp.equals(\"You Hit!\")){\n result = temp;\n break;\n }\n \n if(temp.equals(\"You Kill!\")){\n result = temp + \" DotCom Sunk : \" + dotComToTest.getName();\n dotComList.remove(dotComToTest);\n break;\n } \n }\n \n //Printing out the result\n System.out.println(result);\n \n }", "private synchronized String responseMessage(String playerInputNum) {\n if (playerInputNum.equals(answer)) {\n winOrLose = true;\n return \"Congratulation, the correct answer is \" + answer;\n } else if (attempt == 4) {\n attempt = 5;\n return \"Game over, the answer is \" + answer;\n } else if (playerInputNum.compareTo(answer) > 0)\n return \"The guess number \" + playerInputNum + \" is bigger than the generated number, \" + (4 - attempt) + \" chances left.\";\n else\n return \"The guess number \" + playerInputNum + \" is smaller than the generated number, \" + (4 - attempt) + \" chances left.\";\n }", "public void isWinner(int userGuess, int randomNumber){\n if(userGuess == randomNumber){\n wonGame = true;\n }else{\n NumberUtils.notEqualToRandomNumber(userGuess, randomNumber);\n wonGame = false;\n }\n }", "public boolean guess(int number) {\n\t\tcount++;\n\t\tif (number == secret) {\n\t\t\tsetHint(String.format(\"Correct. The secret is %d. You used %d guesses.\", this.secret, this.count));\n\t\t\treturn true;\n\n\t\t} else if (number < secret) {\n\t\t\tsetHint(\"Sorry,your guess is too small\");\n\t\t} else {\n\t\t\tsetHint(\"Sorry,your guess is too large\");\n\t\t}\n\t\treturn false;\n\n\t}", "public void userMessageInput() {\n //declaring and initializing new userScanner variable\n Scanner userScanner = new Scanner(System.in);\n //displayed message to the user with the updating replacedMovie variable\n System.out.println(\"You are guessing :\" + this.replacedMovie);\n //displaying message with total number of wrong trials (guessed letters) to the user ,\n // together with the wrong guessed letter/s.\n getAllWrongLetters(); // calls method to dispaly the whole list of wrong guessed letters.\n System.out.println(\"You have guessed \" + this.wrongLettersCount + \" wrong letter(s): \" + allWrongLetters);\n //displaying a message asking the user to enter a guessed letter\n System.out.println(\"Guess a Letter\");\n //storing the entered letter in userEnteredLetter variable\n this.setUserGuessedLetter(userScanner.next().charAt(0));\n\n //return userEnteredLetter; // returning userEnteredLetter variable\n\n }", "public void generateNumbers() {\n number1 = (int) (Math.random() * 10) + 1;\n number2 = (int) (Math.random() * 10) + 1;\n operator = (int) (Math.random() * 4) + 1;\n //50% chance whether the displayed answer will be right or wrong\n rightOrWrong = (int) (Math.random() * 2) + 1;\n //calculate the offset of displayed answer for a wrong equation (Error)\n error = (int) (Math.random() * 4) + 1;\n generateEquation();\n }", "public void playGuess(ActionEvent e) throws IOException {\n try {\n // Player and computer guesses\n int p = spinPVal.getValue();\n int total = game.play(p);\n int c = game.getComputerPlays();\n spinCVal.setValue(c);\n playerPlays = \"Player guesses \" + p + \". \";\n computerPlays = \"Computer guesses \" + c + \". \";\n getWinnerJBJ(total, p, c);\n myctr.setLabels();\n myctr.setMinMaxLabel();\n } catch(Exception n) {\n System.out.println(\"Game \\\"JellyBeanJar\\\" not initialized!\");\n }\n }", "public static void paintHangman() {\n if (count == 1) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"1 incorrect guess, 6 guesses left\");\n }\n if (count == 2) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"2 incorrect guesses, 5 guesses left\");\n }\n if (count == 3) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|\");\n System.out.println(\" | / |\");\n System.out.println(\" | / |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"3 incorrect guesses, 4 guesses left\");\n }\n if (count == 4) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"4 incorrect guesses, 3 guesses left\");\n }\n if (count == 5) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | /\");\n System.out.println(\" | /\");\n System.out.println(\" | _/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"5 incorrect guesses, 2 guesses left\");\n }\n if (count == 6) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < ' |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"6 incorrect guesses, only 1 guess left!\");\n }\n if (count == 7) {\n System.out.println(\"GAME OVER!\");\n System.out.println(\"7 incorrect guesses\");\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / X X \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | __ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"RIP \" + UserName.getUserName());\n System.out.println(\"GAME OVER! The word was \" + CategorySelector.word);\n }\n }", "public static int userTurn() {\n\t\t// Create the boolean variable goodNumber and set it equal to false.\n\t\tboolean goodNumber = false;\n\t\t// Set the turn variable equal to 0.\n\t\tturn = 0;\n\t\t// Make A while loop that runs while the goodNumber variable is equal to false.\n\t\twhile(goodNumber == false) {\n\t\t\t// Have the system ask the user to enter a number between 1 and 3.\n\t\t\tSystem.out.print(\"Enter a number between 1-3: \");\n\t\t\tScanner manualInput = new Scanner(System.in);\n\t\t\tturn = manualInput.nextInt();\n\t\t\t// Make an if statement that runs if the turn variable is equal to 1, 2, or 3.\n\t\t\tif(turn == 1 || turn == 2 || turn == 3) {\n\t\t\t\t// Set the goodNumber variable to true.\n\t\t\t\tgoodNumber = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Have the system tell the user that the number they choose is out of range and hey have to pick another number.\n\t\t\t\tSystem.out.println(\"Number out of range choose another number.\");\n\t\t\t}\n\t\t}\n\t\treturn turn;\n\t}", "void askForNumber(String spieler,String playerChoices) throws IOException;", "public interface Game {\n\n int NUMBER_OF_FRAMES = 10;\n int NUMBER_OF_PINS_PER_FRAME = 10;\n\n /**\n * Called each time the player rolls a ball. Ignores negative numbers\n * and anything greater than the initial number of pins per frame.\n *\n * @param pins the number of pins knocked down\n */\n void roll(int pins);\n\n /**\n * Called only at the very end of the game.\n *\n * @return The total score for each game.\n */\n int score();\n\n /**\n * @return true if this game is over.\n */\n boolean isGameOver();\n}", "public void setUpTheGame() throws UserCancelsException{\n played = true;\n ui.printToUser(\"Close the game at any time by inputting letters instead of numbers.\");\n currentOcean = new OceanImpl();\n currentOcean.placeAllShipsRandomly();\n \n currentScore = 0;\n playTheGame();\n if(currentScore<highestScore\n ||highestScore == 0){\n highestScore = currentScore;\n ui.printToUser(\"New High Score! : \" + highestScore);\n }\n }", "public void playGame() {\n // we read input from the user using a scanner\n Scanner userIn = new Scanner(System.in);\n\n while (true) {\n // read guess from user\n System.out.print(\"Enter guess from 1 to 100 (-1 to exit): \");\n int guess = userIn.nextInt();\n\n // user entered a guess - they don't want to abort\n if (guess != -1) {\n // send guess to server\n this.networkOut.printf(GUESS, guess);\n\n // check response\n\n // TODO: Step 2\n String response = networkIn.nextLine();\n if(response.equals(LOW)){\n System.out.println(LOW);\n } else if(response.equals(HIGH)){\n System.out.println(HIGH);\n } else{\n System.out.println(CORRECT);\n this.networkOut.println(GuessServer.ABORT);\n break;\n }\n\n } else {\n this.networkOut.println(GuessServer.ABORT);\n // if the user wants to quit early we break out of the loop\n break;\n }\n }\n System.out.println(this.networkIn.nextLine());\n }", "private void changeGame() {\n switch (input) {\n case \"1\":\n new Lotto().generate();\n break;\n case \"2\":\n new SmallLotto().generate();\n break;\n case \"3\":\n System.out.println(\"Good bye\");\n System.exit(0);\n break;\n default:\n startGame();\n }\n continueGame();\n }", "public void setGuess(Code guess) {\n this.guess = guess;\n }", "public static void numberManiaDifficulty(Scanner input){\n Random rand= new Random();\n byte difficulty=0;\n String userInput;\n boolean difficultyHasBeenChosen=false;\n System.out.println(\"Easy from number 1 to 1000. (1)\\nMedium from number 1 to 5000 (2)\\nHard from number 1 to 10000 (3)\");\n do{\n userInput=input.nextLine();\n switch(userInput){\n case \"1\":\n difficulty=1;\n difficultyHasBeenChosen=true;\n break;\n case \"2\":\n difficulty=2;\n difficultyHasBeenChosen=true;\n break;\n case \"3\":\n difficulty=3;\n difficultyHasBeenChosen=true;\n break;\n default:\n System.out.println(\"Please write a valid option\");\n }\n \n }while (difficultyHasBeenChosen==false);\n numberManiaGame(input, difficulty);\n }", "public interface GuessChecker {\n\n int[] CheckGuess(char[] Ans, char[] Code);\n\n int[] CorrectAns();\n\n}", "public static void main(String[] args){\n Scanner inputUser = new Scanner(System.in);\n\n //Simple program to guess number\n int correctValue = 6;\n int guessNumber;\n boolean guessStatus;\n\n System.out.print(\"enter your guess number: \");\n guessNumber = inputUser.nextInt();\n System.out.println(\"your guess number is \" + guessNumber);\n\n //logical operation\n guessStatus = (guessNumber == correctValue);\n System.out.println(\"your guessing: \" + guessStatus);\n\n //boolean algebra operation (AND / OR)\n System.out.print(\"input number between 4 and 9: \");\n guessNumber = inputUser.nextInt();\n\n guessStatus = (guessNumber > 4) && (guessNumber < 9);\n System.out.println(\"your guessing: \" + guessStatus);\n\n }", "private void initRandomNumber() {\n\t\tbtnAngka.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tif (!etAngka.equals(\"\")) {\n\t\t\t\t\thandleGuess(view);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public static int gameIteration(int gameNum, String playerName) {\n boolean gameOver = false;\n Scanner scan = new Scanner(System.in);\n int guessNum = 0;\n int turnCount = 0;\n int prevGuess = 0;\n\n while(!gameOver){\n System.out.printf(\"Ok %s, enter a guess: \\n\", playerName);\n if(scan.hasNextInt()){\n guessNum = scan.nextInt();\n if(turnCount == 0) {\n prevGuess = guessNum;\n }\n gameOver = turnChecker(gameNum, guessNum, prevGuess, turnCount);\n prevGuess = guessNum;\n turnCount += 1;\n } else {\n System.out.print(\"Enter a NUMBER not whatever you thought would be appropriate.\\n\");\n scan.nextLine();\n }\n\n }\n System.out.print(\"It took you \" + turnCount + \" guesses to guess the number \" + gameNum + \"!\\n\");\n return turnCount;\n }", "public abstract boolean isGuessCorrect(String guess);", "public static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Welcome to Hangman! If you guess wrong 6 times, then I win\");\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t\r\n\t\tboolean wannaPlay = true;\r\n\t\t\r\n\t\twhile(wannaPlay){\r\n\t\t\t//keep playing\r\n\t\t\tSystem.out.println(\"Alright: Let's play!\");\r\n\t\t\t\r\n\t\t\tHangman game = new Hangman();\r\n\t//\t\tRandom ran = new Random();\r\n\t//\t\tint hintIndex = Math.abs(ran.nextInt() % game.mysteryWord.length());\r\n\t\t\tdo{\r\n\t\t\t\t//Draw the things...\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(game.drawPicture());\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(game.getFormalCurrentGuess());\r\n\t\t\t//\tSystem.out.println(\"hint is : \" + game.mysteryWord.charAt(hintIndex));\r\n\t\t\t\t\r\n\t\t\t\t// Get the guess\r\n\t\t\t\tSystem.out.println(\"Enter a character that in the word\");\r\n\t\t\t\tchar guess = (sc.next().toLowerCase().charAt(0));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t\r\n\t\t\t\tif(game.isGuessAlready(guess)){\r\n\t\t\t\t\tSystem.out.println(\"Try again! you've already guessed that character.\");\r\n\t\t\t\t\tguess = sc.next().toLowerCase().charAt(0);\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(game.playGuess(guess)){\r\n\t\t\t\t\tSystem.out.println(\"Great guess. \\n\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"Unfortunately. \\n\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\twhile(!game.gameOver());\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"Press 'Y' if you wanna play agian\");\r\n\t\t\tCharacter response = (sc.next().toUpperCase().charAt(0));\r\n\t\t\t\r\n\t\t\twannaPlay = (response == 'Y');\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "public int play(NumberGame game) {\n\t\tint max = game.getUpperBound();\n\t\tint min = 0;\n\t\tint ans;\n\t\tboolean check = false;\n\t\tdo {\n\t\t\tans = (max + min) / 2;\n\t\t\tcheck = game.guess(ans);\n\t\t\tif (game.getMessage().contains(\"small\")) min = ans;\n\t\t\telse if (game.getMessage().contains(\"large\")) max = ans;\n\t\t} while (!check);\n\t\treturn ans;\n\t}", "@Override\r\n\tpublic Code nextGuess() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tRandom randGen = new Random();\r\n\t\tCode newCode;\r\n\t\t\r\n\t\tArrayList<String> values;\r\n\t\twhile(true)\r\n\t\t{values = new ArrayList<String>();\r\n\t\tfor (int i = 0; i < super.getNumVars(); i++)\r\n\t\t{\r\n\t\t\tint colorIndex = randGen.nextInt((super.getColorList().size()));\r\n\t\t\tvalues.add(super.getColorList().get(colorIndex));\r\n\t\t}\r\n\t\t\r\n\t\tnewCode = new Code(super.getNumVars());\r\n\t\t\r\n\t\tfor (int i = 0; i < values.size(); i++)\r\n\t\t{\r\n\t\t\tnewCode.addEntry(values.get(i));\r\n\t\t}\r\n\t\t//contains method for code\r\n\t\t\r\n\t\tboolean shouldBreak=true;//(guessHistory.size()==0?true:false);\r\n\t\tfor(int i=0,totalequal=0;i<guessHistory.size();++i,totalequal=0)\r\n\t\t{\r\n\t\t\tCode itrHistory=guessHistory.get(i);\r\n\t\t\tfor(int j=0;j<super.getNumVars();++j)\r\n\t\t\tif(newCode.colorAt(j).equals(itrHistory.colorAt(j)))\r\n\t\t\t\t\ttotalequal++;\r\n\t\t\t\t\r\n\t\t\tif(totalequal==super.getNumVars())\r\n\t\t\t\tshouldBreak=false;\r\n\t\t\t\r\n\t\t}\r\n\t\tif(shouldBreak)\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tguessHistory.add(newCode);\r\n\t\treturn newCode;\r\n\t}", "public static void main(String[] args) {\r\n\t\t // SET UP: user input versus a heuristic monte carlo simulator vs a random player\r\n\t\t{\r\n\t\t\tPlayer[] players = new Player[]{new Player(\"user\", DecisionType.SCANNER), new Player(\"monte carlo\", DecisionType.HEURISTIC_MONTE_CARLO_10000), new Player(\"random\", DecisionType.RANDOM)};\r\n\t\t\tScanner scanner = new Scanner(System.in);\r\n\t\t\tplayers[0].setScanner(scanner);\r\n\r\n\t\t\tGame game = new Game(players, true, false);\r\n\t\t\tint numRounds = 10;\r\n\t\t\tfor (int i = 0; i < numRounds; i++) {\r\n\t\t\t\tgame.startNewRound();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// SET UP: three players (three user input players)\r\n//\t\t{\r\n//\t\t\tPlayer[] players = new Player[]{new Player(\"1\", DecisionType.SCANNER), new Player(\"2\", DecisionType.SCANNER), new Player(\"3\", DecisionType.SCANNER)};\r\n//\t\t\tScanner scanner = new Scanner(System.in);\r\n//\t\t\tplayers[0].setScanner(scanner);\r\n//\t\t\tplayers[1].setScanner(scanner);\r\n//\t\t\tplayers[2].setScanner(scanner);\r\n//\r\n//\t\t\tGame game = new Game(players, true, false);\r\n//\t\t\tint numRounds = 10;\r\n//\t\t\tfor (int i = 0; i < numRounds; i++) {\r\n//\t\t\t\tgame.startNewRound();\r\n//\t\t\t}\r\n//\t\t}\r\n\r\n\t\t// SET UP: a heuristic monte carlo player vs a monte carlo player vs a random player\r\n//\t\t{\r\n//\t\t\tPlayer[] players = new Player[]{new Player(\"heuristic monte carlo\", DecisionType.HEURISTIC_MONTE_CARLO_10000), new Player(\"monte carlo\", DecisionType.MONTE_CARLO_10000), new Player(\"random\", DecisionType.RANDOM)};\r\n//\t\t\tGame game = new Game(players, true, false);\r\n//\t\t\tint numRounds = 10;\r\n//\t\t\tfor (int i = 0; i < numRounds; i++) {\r\n//\t\t\t\tgame.startNewRound();\r\n//\t\t\t}\r\n//\t\t}\r\n\r\n\t\t// SET UP: three random players\r\n//\t\t{\r\n//\t\t\tPlayer[] players = new Player[]{new Player(\"1\", DecisionType.RANDOM), new Player(\"2\", DecisionType.RANDOM), new Player(\"3\", DecisionType.RANDOM)};\r\n//\t\t\tGame game = new Game(players, true, false);\r\n//\t\t\tint numRounds = 10;\r\n//\t\t\tfor (int i = 0; i < numRounds; i++) {\r\n//\t\t\t\tgame.startNewRound();\r\n//\t\t\t}\r\n//\t\t}\r\n\t}", "public boolean guess(int number) {\n\t\tif (number == secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Correct! The secret is \"+secret+\"\\n\"+\"The count is \"+ count);\n\t\t\treturn true;\n\t\t} else if (number < secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too small.\");\n\t\t} else if (number > secret) {\n\t\t\tcount++;\n\t\t\tsetMessage(\"Sorry, too large.\");\n\t\t}\n\t\treturn false;\n\t}", "public HangmanGame(List<String> wordsList, int numIncorrectGuessesAllowed) {\n\t\tthis.wordsList = wordsList;\n\t\tthis.numIncorrectGuessesAllowed = numIncorrectGuessesAllowed;\n wordToGuess = wordsList.get(new Random().nextInt(wordsList.size())); \n\t\tnumIncorrectGuessesMade = 0;\n\t\tguessesMade = new HashSet<>();\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint startGame;\n\n\n\t\t\n\t\tScanner numb = new Scanner(System.in);\n\t\tScanner str = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Please to start enter a username: \");\n\t\tusername = str.nextLine();\n\t\tSystem.out.println(\"\\n\\n\\t\\t\"+username+\", You are welcome to....\\n\\t\\tWho Wins A Million!!\");\n\t\tSystem.out.println(\"\\n\\t\\tPress 1 to enter\\n\\t\\t(Or 0 to quit)\");\n\t\tstartGame = numb.nextInt();\n\t\t\n\t\t\n\t\tif (startGame == 1) {\n\t\t\t\n\t\t\t//if(totalScore >= 0) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"So how well do you know Cameroon ?\\n\\n\");\n\t\t\t\t\n\t\t\t\tquestionNo = 1;\n\t\t\t\tSystem.out.println(questionNo+\". Who is the President of Cameroon? \\n\\na. Maurice Kamto \\tb. Paul Biya \\nc. Cabral Libii \\td. Joshua Oshi\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\tquestionNo++;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(questionNo+\". How many administrative divisions does Cameroon have ?\\n\\na. 15 \\t\\t\\tb. 12 \\nc. 8 \\t\\t\\td. 10\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\tquestionNo++;\n\t\t\t\t\n\t\t\t\tSystem.out.println(questionNo+\". Which of the following is the most populated town ?\\n\\na. Yaounde \\t\\tb. Bafoussam \\nc. Douala \\t\\td. Bamenda\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\tquestionNo++;\n\t\t\t\t\n\t\t\t\tSystem.out.println(questionNo+\". When did Cameroon gained its independence ?\\n\\na. 1950 \\t\\tb. 1960 \\nc. 1961 \\t\\td. 1951\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\tquestionNo++;\n\t\t\t\t\n\t\t\t\tSystem.out.println(questionNo+\". What is the total area of Cameroon in square kilometers ?\\n\\na. 475 441 \\t\\tb. 475 442 \\nc. 475 443 \\t\\td. 475 444\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(\".....................................\");\n\t\t\t\tSystem.out.println(username+\" Statistics\");\n\t\t\t\tSystem.out.println(\".....................................\\n\");\n\t\t\t\tSystem.out.println(\"Total Questions Attempted: \"+questionNo);\n\t\t\t\tSystem.out.println(\"Total Correct Answers: \"+correctQuestions);\n\t\t\t\tSystem.out.println(\"Total Score: \"+totalScore);\n\t\t\t\tSystem.out.println(\"Money obtained: \"+prizeMoney);\n\t\t\t\t\n\t\t\t//}\n\t\t\t\n\t\t\n\t\t}else System.out.println(\"Exiting\");\n\t\t\n\t\tSystem.out.println(\"\\nEnd of the game!\");\n\t}", "public GuessingGameWidget(){\r\n\t\tRegion r = new Region();\r\n\t\tadd(r, 1, 5);\r\n\t\tGridPane.setHgrow(r, Priority.ALWAYS);\r\n\t\tGridPane.setVgrow(r, Priority.ALWAYS);\r\n\t\t\r\n\t\tTextArea area = new TextArea();\r\n\t\tadd(area, 3, 1);\r\n\t\tarea.setPrefSize(300,100); \r\n\t\tarea.setEditable(false);\r\n\t\t\r\n\t\tToggleGroup tga = new ToggleGroup();\r\n\t\t\r\n\t\tRadioButton A = new RadioButton(\"A\");\r\n\t\tadd(A, 0, 0);\r\n\t\tA.setToggleGroup(tga);\r\n\t\t\r\n\t\tRadioButton B = new RadioButton(\"B\");\r\n\t\tadd(B, 0, 1);\r\n\t\tB.setToggleGroup(tga);\r\n\t\t\r\n\t\tRadioButton C = new RadioButton(\"C\");\r\n\t\tadd(C, 1, 0);\r\n\t\tC.setToggleGroup(tga);\r\n\t\t\r\n\t\tRadioButton D = new RadioButton(\"D\");\r\n\t\tadd(D, 1, 1);\r\n\t\tD.setToggleGroup(tga);\r\n\t\t\r\n\t\tButton b = new Button(\"Guess\");\r\n\t\tadd(b, 3, 0);\r\n\t\tb.setOnAction(\r\n\t\t\tevent -> {\r\n\t\t\t\tdouble Guess = Math.random() * 0.5;\r\n\t\t\t\tSystem.out.println(Guess);\r\n\t\t\t\tString newText = \"\\n\";\r\n\t\t\t\tif (Guess <= 0.25) {\r\n\t\t\t\t\tCountplus++;\r\n\t\t\t\t\tarea.appendText(\"Your guess is Correct!\" + newText);\r\n\t\t\t\t\tarea.appendText(\"Countplus = \" + Countplus + \"Countminus =\" + Countminus + newText);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tCountminus++;\r\n area.appendText(\"Your guess is Incorrect!\" + newText); \r\n area.appendText(\"Countplus = \" + Countplus + \" Countminus = \" + Countminus + newText); \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t}", "public abstract boolean guess(String guess);", "public static void main(String[] args) {\n\t\tint MAX = 20;\r\n\t\tint MIN = 1;\r\n\t\tScanner number = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Guess a number between 1 and 20 \");\r\n\t\tint input = number.nextInt();\r\n\t\tint random = MIN + (int)(Math.random() * MAX);\r\n\t\tif(input == random)\r\n\t\tSystem.out.println(\"You were correct! The number was :\" + random);\r\n\t\t\r\n\t\telse\r\n\t\t\tSystem.out.println(\"You were incorrect! The number was :\" + random);\r\n\t\t\r\n\t\tif(input >= 21 )\r\n\t\t\tSystem.out.println(\"The range is 1 to 20. Please try again.\");\r\n\t}", "public void guessMethod(int num, Scanner sc) {\n int min = 0;\n int max = 0;\n while (true) {\n int str = checkInput(sc);\n int input = checkValue(sc, str);\n if (input != num) {\n if(input>num) {\n model.setMaxNumber(input);\n max = model.getMaxNumber();\n model.addMaxNumber();\n }else if(input<num){\n model.setMinNumber(input);\n min = model.getMinNumber();\n model.addMinNumber();\n }\n view.printMessage(View.RANGE+' '+min+'-'+max);\n } else {\n view.printMessage(View.CONGRAT);\n view.printMessage(View.STATISTIC);\n model.getStatistic();\n System.out.println(model.toString());\n break;\n }\n }\n }", "int start() {\n in = new Scanner(System.in);\n System.out.println(\"Java GuessTheMovie\");\n System.out.println(\"Please enter 0 to start game:\");\n int input = 0;\n try {\n input = in.nextInt();\n } catch (Exception e) {\n System.out.println(\"Wrong input! Please try again\");\n return 1;\n }\n return input;\n }", "protected void runGame() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tthis.getRndWord(filePosition);\n\t\twhile((! this.word.isFinished()) && (this.numOfWrongGuess <= this.allowance)) {\n\t\t\tthis.showInfo();\n\t\t\tthis.tryGuess(this.getGuessLetter(sc));\n\t\t}\n\t\tif (this.word.isFinished()) {\n\t\t\tthis.showStat();\n\t\t}else {\n\t\t\tthis.showFacts();\n\t\t}\n\t\tsc.close();\n\n\n\t}", "public static void main(String[] args) {\n\t\tRandom r = new Random();\n\t\tScanner scan = new Scanner(System.in);\n\t\tint secretNumber = r.nextInt(10);\n\t\tint userGuess=0;\n\t\tString userChoice=\"\";\n\n\t\t//\n\t\t\n\n\t\twhile(!userChoice.equalsIgnoreCase(\"n\"))\n\t\t{\n\t\t\tSystem.out.println(\"I've got a number between 1 and 10. What is it?\");\n\t\t\tSystem.out.println(\"Your guess:\");\n\t\t\ttry{\n\t\t\t\tuserGuess=scan.nextInt();\n\t\t\t\t\n\t\t\t\tif(userGuess<secretNumber)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"You guessed too low. Try again? (Y/N)\");\n\t\t\t\t\tuserChoice=scan.next();\n\t\t\t\t}\n\t\t\t\telse if(userGuess>secretNumber)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"You guessed too high. Try again? (Y/N)\");\n\t\t\t\t\tuserChoice=scan.next();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"You got it!\");\n\t\t\t\t\tuserChoice=\"n\";\n\t\t\t\t}\n\t\t\t\tif(!userChoice.equalsIgnoreCase(\"y\") && !userChoice.equalsIgnoreCase(\"n\"))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Really? You couldn't choose Y or N? Fine. You're done.\");\n\t\t\t\t\tuserChoice=\"n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(java.util.InputMismatchException e)\n\t {\n\t\t\t\tSystem.out.println(\"That's supposed to be an integer... Try again.\");\n\t scan.nextLine();\n\t }\n\t\t\t\n\t \n\t\t}\n\n\t\tSystem.out.println(\"Thanks for playing! Bye!\");\n\n\t}", "public void rightGuess()\r\n\t{\r\n\t\tif(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"good job! you've correctly guessed the panel \\n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\\n\\n\");\r\n\t\tString answer = sc.next();\r\n\t\tif(answer.compareTo(\"yes\") == 0 || answer.compareTo(\"Yes\") == 0)\r\n\t\t{\r\n\t\t\tuserTurn(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(userRanPan.getValue() == -1)\r\n\t\t\t\tnewGame.getUserHand().addDash(false,userRanPan);\r\n\t\t\telse\r\n\t\t\t\tnewGame.getUserHand().addPanel(userRanPan,false);\r\n\r\n\t\t\tuserGuess.clear();\r\n\t\t\tslide(previousGuess,userRanPan);\r\n\r\n\t\t\tif(userWon() == false)\r\n\t\t\t\tcompTurn(false);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//foo.repaint();\r\n\t}" ]
[ "0.6983741", "0.6813709", "0.67895275", "0.6729638", "0.66918635", "0.6605714", "0.65999407", "0.6519689", "0.6508522", "0.65045017", "0.6499328", "0.64987063", "0.6490076", "0.6480177", "0.6480058", "0.64685124", "0.6462557", "0.64441234", "0.642927", "0.63987243", "0.6375464", "0.6348797", "0.6331387", "0.63233936", "0.63031274", "0.62799776", "0.6246688", "0.624134", "0.623896", "0.6234289", "0.6201668", "0.6191007", "0.617639", "0.6167534", "0.6159968", "0.61383015", "0.6117912", "0.6076014", "0.60508823", "0.60336906", "0.6002935", "0.5998845", "0.59554225", "0.59448296", "0.5941957", "0.59380424", "0.5925266", "0.5921152", "0.59027237", "0.58885425", "0.58809614", "0.5874825", "0.58699495", "0.5865822", "0.58657056", "0.5830082", "0.5822701", "0.5784652", "0.5780281", "0.5766529", "0.5766215", "0.576386", "0.5763816", "0.57434106", "0.57326674", "0.57238024", "0.5717525", "0.5686521", "0.5672882", "0.5669925", "0.56647146", "0.5657527", "0.5651733", "0.5623566", "0.56226385", "0.561405", "0.5605719", "0.5605498", "0.56051147", "0.55954117", "0.55752784", "0.55748254", "0.55691516", "0.556811", "0.556099", "0.5553638", "0.5552647", "0.55475736", "0.5541363", "0.5536763", "0.5534593", "0.55336535", "0.55300415", "0.5510924", "0.55068845", "0.5505527", "0.54886776", "0.5487896", "0.54751575", "0.5474418", "0.54706526" ]
0.0
-1
If we know the parent of every node x, we know all nodes that are distance 1 from x. We can then perform a breadth first search from the target node to find the answer. We first do a depth first search where we annotate every node with information about it's parent. After, we do a breadth first search to find all nodes a distance K from the target.
public List<Integer> distanceK(TreeNode root, TreeNode target, int K) { List<Integer> res = new ArrayList(); if (root == null || target == null || K < 0) return res; map = new HashMap(); buildChildParentMap(root, null); Queue<TreeNode> q = new LinkedList(); q.add(null); q.add(target); Set<TreeNode> seen = new HashSet(); seen.add(target); seen.add(null); int d = 0; while (!q.isEmpty()) { TreeNode n = q.poll(); if (n == null) { if (d == K) { while (!q.isEmpty()) { res.add(q.poll().val); } break; } q.add(null); d++; } else { if (!seen.contains(n.left)) { seen.add(n.left); q.add(n.left); } if (!seen.contains(n.right)) { seen.add(n.right); q.add(n.right); } TreeNode par = map.get(n); if (!seen.contains(par)) { seen.add(par); q.add(par); } } } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int dfs(TreeNode node, TreeNode target, int K, List<Integer> res) {\r\n if (node == null) return -1;\r\n\r\n if (node.val == target.val) {\r\n // add nodes from current subtree\r\n addNodes(node, K, res);\r\n return 0;\r\n }\r\n\r\n int left = dfs(node.left, target, K, res);\r\n int right = dfs(node.right, target, K, res);\r\n \r\n // at most one of left and right could be not -1\r\n if (right != -1) {\r\n // current node is k far from target\r\n if (K == right + 1) res.add(node.val);\r\n // target is in the right subtree, add nodes in left subtree\r\n else addNodes(node.left, K - right - 2, res);\r\n return right + 1;\r\n }\r\n\r\n if (left != -1) {\r\n // current node is k far from target\r\n if (K == left + 1) res.add(node.val);\r\n // target is in the left subtree, add nodes in right subtree\r\n else addNodes(node.right, K - left - 2, res);\r\n return left + 1;\r\n }\r\n\r\n // both left and right are - 1\r\n return -1;\r\n }", "public static void main(String[] args) {\n Node root = new Node(10);\n root.right = new Node(-3);\n root.right.right = new Node(11);\n\n Node l1 = root.left = new Node(5);\n l1.right = new Node(2);\n l1.right.right = new Node(1);\n\n l1.left = new Node(3);\n l1.left.right = new Node(-2);\n l1.left.left = new Node(3);\n\n int k = 7;\n List<Node> path = new ArrayList<>();\n findPath(root, 7, path); //O(n^2) in worst, O(nlogn) if tree is balanced.\n\n }", "public int[] mRtreeFromSource(int s,int k){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] d = new double[intersection];\n int[] parent = new int[intersection];\n\n for (int i = 0; i <intersection ; i++) {\n d[i] = INFINITY;\n parent[i] = -1;\n }\n\n d[s] = 0;\n parent[s]=s;\n\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,d[i]);\n }\n while(!minHeap.isEmpty()){\n\n int extractedVertex = minHeap.extractMin();\n\n if(d[extractedVertex]==INFINITY)\n break;\n\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n\n double newKey = edge.weight ; //the different part with previous method\n double currentKey = d[destination];\n if(currentKey>=newKey){\n if(currentKey==newKey){\n if(extractedVertex<parent[destination]){\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n else {\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n }\n }\n }\n return parent;\n }", "int solve(int p, int current) {\n int id = getId(p, current);\n if (p >= 0 && memo.containsKey(id)) {\n return memo.get(id);\n }\n List<Integer> adjList = adj.get(current);\n int n = adjList.size();\n if (n == 0) {\n throw new RuntimeException();\n }\n if ((n == 2 && p >= 0) || (n == 1 && p < 0)) {\n // should cut the nodes under current\n int ans = getDepth(p, current) - 1;\n // System.out.println(\"ans(\" + p + \",\" + current + \")=\" + ans);\n memo.put(id, ans);\n return ans;\n }\n if (n == 1) {\n // System.out.println(\"ans(\" + p + \",\" + current + \")=nochild\");\n return 0;\n }\n int ans = Integer.MAX_VALUE;\n\n for (int i = 0; i < n; i++) {\n int a = adjList.get(i);\n if (a == p) {\n continue;\n }\n for (int j = i + 1; j < n; j++) {\n int b = adjList.get(j);\n if (b == p) {\n continue;\n }\n // try a & b combo\n int tmp = solve(current, a);\n tmp += solve(current, b);\n for (int k = 0; k < n; k++) {\n int c = adjList.get(k);\n if (c != a && c != b && c != p) {\n tmp += getDepth(current, c);\n }\n }\n ans = Math.min(ans, tmp);\n }\n }\n memo.put(id, ans);\n // System.out.println(\"ans(\" + p + \",\" + current + \")=\" + ans);\n return ans;\n }", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "public static void main(String[] args) {\n\n BDNode a = new BDNode(\"A\");\n BDNode b = new BDNode(\"B\");\n BDNode c = new BDNode(\"C\");\n BDNode d = new BDNode(\"D\");\n BDNode e = new BDNode(\"E\");\n\n a.link(b);\n a.link(d);\n b.link(a);\n b.link(c);\n b.link(e);\n c.link(b);\n c.link(d);\n d.link(a);\n d.link(c);\n d.link(e);\n e.link(b);\n e.link(d);\n\n BDNode target = e;\n\n/*\n // BFS\n Queue<BDNode> queue = new LinkedList<>();\n queue.offer(a);\n\n while(!queue.isEmpty()) {\n BDNode n = queue.poll();\n n.visit();\n System.out.println(n); // 찾는 여정 출력\n\n if(n.equals(target)) {\n System.out.println(\"BFS Found! \" + n);\n break;\n }\n\n for (BDNode l : n.links) {\n if(l.isVisited()) continue;\n if (queue.contains(l)) continue;\n queue.offer(l);\n }\n\n // 위랑 같은 표현\n// n.links.stream()\n// .filter(l -> !queue.contains(l))\n// .forEach(queue::offer);\n }\n*/\n\n // DFS\n Stack<BDNode> stack = new Stack<>();\n stack.push(a);\n\n while(!stack.isEmpty()) {\n BDNode n = stack.pop();\n n.visit();\n System.out.println(n); // 찾는 여정 출력\n\n if (n.equals(target)) {\n System.out.println(\"DFS Found! \" + n);\n break;\n }\n\n for (BDNode l : n.links) {\n if (l.isVisited()) continue;\n if (stack.contains(l)) continue;\n\n stack.push(l);\n }\n }\n\n\n }", "private static void breadthFirstSearch(int source, ArrayList<ArrayList<Integer>> nodes) {\n\t\tArrayList<ArrayList<Integer>> neighbours = nodes;\n\t\tQueue<Integer> queue= new LinkedList<Integer>();\n\t\t\n\t\tboolean[] visited = new boolean[nodes.size()];\n\t\t\n\t\tqueue.add(source);\n\t\tvisited[source]=true;\n\t\t\n\t\twhile(!queue.isEmpty()) {\n\t\t\tint k =queue.remove();\n\t\t\tSystem.out.println(k);\n\t\t\tfor(int p : nodes.get(k)) {\n\t\t\t\tif(!visited[p]) {\n\t\t\t\t\tqueue.add(p);\n\t\t\t\t\tvisited[p]=true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public static int traverseGraph(String artistKey, String targetName) {\n\t\t// set up the queue for BFS\n\t\tQueue<Node<Artist>> q = new LinkedList<Node<Artist>>();\n\t\tNode<Artist> nd = new Node<Artist>(new Artist(artistKey), 0);\n\t\t// find the neighbors of n and add them to n's adjacency list\n\t\tArtist nArtist = nd.getData();\n\t\tArrayList<Album> nAlbums = nArtist.getAlbums();\n\t\tfor (Album album : nAlbums) {\n\t\t\tArrayList<Song> songs = album.getSongs();\n\t\t\tfor (Song song : songs) {\n\t\t\t\tArrayList<Artist> artists = song.getAllArtists();\n\t\t\t\tfor (Artist result : artists) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (result != null\n\t\t\t\t\t\t\t\t&& nArtist != null\n\t\t\t\t\t\t\t\t&& !result.toString()\n\t\t\t\t\t\t\t\t\t\t.equals(nArtist.toString())) {\n\n\t\t\t\t\t\t\tNode<Artist> toAdd = new Node<Artist>(result,\n\t\t\t\t\t\t\t\t\tnd.getLevel() + 1);\n\t\t\t\t\t\t\tnd.addEdge(toAdd);\n\t\t\t\t\t\t\ttoAdd.addEdge(nd);\n\n\t\t\t\t\t\t\tif (toAdd.toString().toLowerCase()\n\t\t\t\t\t\t\t\t\t.equals(targetName.toLowerCase())) {\n\t\t\t\t\t\t\t\treturn toAdd.getLevel();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t// e.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(nd);\n\t\tq.add(nd);\n\n\t\t// perform BFS\n\t\twhile (!q.isEmpty()) {\n\t\t\tSystem.out.println(\"Queue: \" + q);\n\t\t\tNode<Artist> n = q.remove();\n\t\t\tSystem.out.println(n.getAdjacent());\n\t\t\t// go through each of the adjacent nodes to n and add it to the\n\t\t\t// queue.\n\t\t\tfor (Node<Artist> node : n.getAdjacent()) {\n\t\t\t\tif (!node.isVisited()) {\n\t\t\t\t\tnode.setVisited(true);\n\t\t\t\t\tArtist artist = node.getData();\n\t\t\t\t\tif (artist != null) {\n\t\t\t\t\t\tArrayList<Album> albums = artist.getAlbums();\n\t\t\t\t\t\tfor (Album album : albums) {\n\t\t\t\t\t\t\tArrayList<Song> songs = album.getSongs();\n\t\t\t\t\t\t\tfor (Song song : songs) {\n\t\t\t\t\t\t\t\tArrayList<Artist> artists = song\n\t\t\t\t\t\t\t\t\t\t.getAllArtists();\n\t\t\t\t\t\t\t\tfor (Artist result : artists) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tif (result != null\n\t\t\t\t\t\t\t\t\t\t\t\t&& artist != null\n\t\t\t\t\t\t\t\t\t\t\t\t&& !result.toString().equals(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tartist.toString())) {\n\t\t\t\t\t\t\t\t\t\t\tif (!GraphTraverser.artists\n\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(result.toString())) {\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(result);\n\n\t\t\t\t\t\t\t\t\t\t\t\tNode<Artist> toAdd = new Node<Artist>(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresult,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnode.getLevel() + 1);\n\t\t\t\t\t\t\t\t\t\t\t\tnode.addEdge(toAdd);\n\t\t\t\t\t\t\t\t\t\t\t\ttoAdd.addEdge(node);\n\t\t\t\t\t\t\t\t\t\t\t\tq.add(toAdd);\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (toAdd\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.equals(targetName\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toLowerCase())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn toAdd.getLevel();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tGraphTraverser.artists\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.add(result.toString());\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\t\t\t\t// do nothing\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}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// return -1 if not found.\n\t\treturn -1;\n\t}", "protected abstract Set<T> findNeighbors(T node, Map<T, T> parentMap);", "@Override\n\tpublic List<node_data> TSP(List<Integer> targets) {\n\t\tList<Integer> targets1 = new ArrayList<>();\n\t\tList<node_data> ans = new ArrayList<>();\n\t\tfor (Integer target: targets) {\n\t\t\tif(!targets1.contains(target)){\n\t\t\t\ttargets1.add(target);\n\t\t\t}\n\t\t}\n\t\tif(targets1.size()==1){\n\t\t\tans.add(this.GA.getNode(targets.get(0)));\n\t\t\treturn ans;\n\t\t}\n\t\tint help=targets1.get(0);\n\t\tint targetSize = targets1.size();\n\t\twhile(!targets1.isEmpty()) {\n\t\t\tdouble minWeight = Integer.MAX_VALUE;\n\t\t\tint geti=-1;\n\t\t\tfor (int j = 0; j <targetSize ; j++) {\n\t\t\t\tif(shortestPathDist(help,targets1.get(j)) !=0 &&shortestPathDist(help,targets1.get(j))<minWeight || targets1.size()==1 && shortestPathDist(help,targets1.get(j)) ==0) {\n\t\t\t\t\tminWeight = shortestPathDist(help, targets1.get(j));\n\t\t\t\t\tgeti = targets1.get(j);\n\t\t\t\t}\n\t\t\t}\n\t\t\tList<node_data> ans2 = new ArrayList<>();\n\t\t\tif(geti==-1) return null;\n\t\t\tif(targets1.size()>1) {\n\t\t\t\tans2 = shortestPath(help, geti);\n\t\t\t\tans.addAll(ans2);\n\t\t\t\ttargets1.remove((Integer) help);\n\t\t\t\ttargetSize--;\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttargets1.remove((Integer)geti);\n\t\t\t}\n\t\t\thelp=geti;\n\t\t}\n\t\tfor (int ii = 0; ii <ans.size()-1 ; ii++) {\n\t\t\tif(ans.get(ii)==ans.get(ii+1)){\n\t\t\t\tans.remove(ii);\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}", "public double mRtreeCostFromSource(int s,int k){\n int[] mRtree = mRtreeFromSource(s,k); //call the mRtreeFromSource method to find the parent of very vertex in the mRtree\n double cost =0;\n for (int i=0;i<mRtree.length;i++){\n if(mRtree[i]!=-1) {\n cost += coor[i].distTo(coor[mRtree[i]]);\n }\n }\n return cost;\n }", "private static void computePaths(Vertex source) {\n source.minDistance = 0;\n // retrieves with log(n) time\n PriorityQueue<Vertex> vertexPriorityQueue = new PriorityQueue<>();\n\n //BFS traversal\n vertexPriorityQueue.add(source);\n\n // O((v + e) * log(v))\n while (!vertexPriorityQueue.isEmpty()) {\n // this poll always returns the shortest distance vertex at log(v) time\n Vertex vertex = vertexPriorityQueue.poll();\n\n //visit each edge exiting vertex (adjacencies)\n for (Edge edgeInVertex : vertex.adjacencies) {\n // calculate new distance between edgeInVertex and target\n Vertex targetVertex = edgeInVertex.target;\n double edgeWeightForThisVertex = edgeInVertex.weight;\n double distanceThruVertex = vertex.minDistance + edgeWeightForThisVertex;\n if (distanceThruVertex < targetVertex.minDistance) {\n // modify the targetVertex with new calculated minDistance and previous vertex\n // by removing the old vertex and add new vertex with updates\n vertexPriorityQueue.remove(targetVertex);\n targetVertex.minDistance = distanceThruVertex;\n // update previous with the shortest distance vertex\n targetVertex.previous = vertex;\n vertexPriorityQueue.add(targetVertex);// adding takes log(v) time because needs to heapify\n }\n }\n }\n }", "private void GreedySearch(){\n\n Queue<Node> expanded = new LinkedList<>();\n ArrayList<Node> fringe = new ArrayList<>();\n ArrayList<Node> fringeTemp = new ArrayList<>();\n\n\n Node current = startNode;\n\n while(expanded.size() < 1000){\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal is reached.\n solutionPath(current);\n expanded.add(current);\n printExpanded(expanded);\n System.exit(0);\n }\n\n\n boolean b = cycleCheck(current,expanded);\n\n if(!b) {\n expanded.add(current);\n }\n\n if(!b){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n\n }\n }\n\n if(current.getDigit().last_changed != 1){\n\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n }\n\n\n\n for(Node n : fringe){\n heuristicSetter(n);\n\n }\n\n fringeTemp.addAll(fringe);\n //now all the nodes in fringe have the heuristic value.\n //We can get the last added minm\n Node minm;\n if(fringeTemp.size() != 0){\n minm = fringeTemp.get(0);\n }else{\n break;\n }\n for(int i = 1; i<fringeTemp.size(); i++){\n if(fringeTemp.get(i).getHeuristic() <= minm.getHeuristic()){\n minm = fringeTemp.get(i);\n }\n }\n\n //now we have the minm for the next stage.\n current = minm;\n fringeTemp.remove(minm);\n fringe.clear();\n }\n\n //While loop ends\n System.out.println(\"No solution found.\");\n printExpanded(expanded);\n\n\n\n }", "private int bfs(int startNode, Map<Integer, List<Integer>> adjacencyList, int[] distanceToNode) {\n int furthestNode = 1;\n int furthestDistance = Integer.MIN_VALUE;\n\n Queue<Integer> queue = new LinkedList<>();\n Arrays.fill(distanceToNode, -1);\n\n // Put start node in queue\n queue.add(startNode);\n // Set distance of the first node to 0 (0 edge to itself)\n distanceToNode[startNode - 1] = 0;\n\n // While queue is not empty\n while (!queue.isEmpty()) {\n // Pop node\n int curNode = queue.remove();\n\n // Iterate through node's neighbours\n for (int neighbour : adjacencyList.get(curNode)) {\n // If neighbour is not visited (distance not -1)\n if (distanceToNode[neighbour - 1] == -1) {\n // Calculate distance by taking curNode distance and add 1\n // Update distance in array as a way of marking it as visited\n distanceToNode[neighbour - 1] = distanceToNode[curNode - 1] + 1;\n\n // Add to queue to process next\n queue.add(neighbour);\n\n // If the distance is bigger than current furthest one, update\n if (distanceToNode[neighbour - 1] > furthestDistance)\n furthestNode = neighbour;\n }\n }\n }\n return furthestNode;\n }", "public void printKDistantIter(Node root, int k) {\r\n if(root == null) {\r\n return;\r\n }\r\n\r\n Queue<Node> queue = new LinkedList<>();\r\n queue.add(root);\r\n while(!queue.isEmpty() && k != 0) {\r\n k--;\r\n int nodeCount = queue.size();\r\n while(nodeCount > 0) {\r\n Node top = queue.poll();\r\n\r\n if(top.left != null) {\r\n queue.add(top.left);\r\n }\r\n\r\n if(top.right != null) {\r\n queue.add(top.right);\r\n }\r\n nodeCount--;\r\n }\r\n }\r\n\r\n while(!queue.isEmpty()) {\r\n Node node = queue.poll();\r\n System.out.println(node.data);\r\n }\r\n }", "public void bellman_ford(int input)\n{\n this.minimumTree = this._getKruskalTree(false);\n /*\n * Lets write the heritage of our minimum spanning tree to our Bellman Ford\n * arrays, and see what happens.\n */\n while (0 != minimumTree.size()) {\n Edge nextEdge = minimumTree.remove();\n this.bellmanParent[nextEdge.destVert] = nextEdge.srcVert;\n this.bellmanDistance[nextEdge.destVert] = nextEdge.distance;\n }\n System.out.println(\"shortest path \\t\\t\\t weight\");\n /*\n * We need to find the immediate children for the input vertex, and see how\n * far that gets us. Depending upon where the input is in the minimum\n * spanning tree, only a subtree may be accessible since this is a directed\n * graph.\n */\n for (int loop = 0;\n loop < this.nVerts;\n loop++\n ) {\n LinkedList<Integer> output = this._findShortestPath(input, loop);\n Integer result = output.removeFirst();\n int weight = 0;\n if (-1 == result) {\n continue;\n }\n System.out.print(this.vertexList[result].label);\n weight += this.bellmanDistance[result];\n while (0 != output.size()) {\n result = output.removeFirst();\n weight += this.bellmanDistance[result];\n System.out.print(\" -> \" + this.vertexList[result].label);\n }\n System.out.println(\" \\t\\t\\t\\t \" + weight);\n }\n}", "public int breadthFirstSearch(T srcId, T destId)\n {\n if (nodeList.isEmpty())\n {\n System.out.println(\"Empty graph\");\n return -1;\n }\n \n // queue used during the traversal\n LinkedList<QueueNode> queue = new LinkedList();\n \n // keeps track of node which are visited and added into the queue\n HashMap<T, Integer> visited = new HashMap();\n \n // find srcNode with id = srcId in graph\n GraphNode srcNode = nodeList.get(srcId);\n \n // if srcNode is not there in graph, breadth first traversal which starts at srcNode cannot be done \n if (srcNode == null)\n {\n System.out.println(\"Source vertex not found\");\n return -1;\n }\n \n int minNumberTrials = -1;\n \n // add srcNode in queue, mark it as visited\n queue.add(new QueueNode(srcNode, 0));\n visited.put(srcNode.nodeId, 1);\n \n while (!queue.isEmpty())\n {\n QueueNode currentNode = queue.remove();\n \n // if destination node found\n if (currentNode.graphNode.nodeId == destId)\n {\n minNumberTrials = currentNode.level;\n break;\n }\n \n // first neighbor of current graph node\n GraphNode neighbor = currentNode.graphNode.next;\n \n // add all neighbors of current graph node into the queue\n while (neighbor != null)\n {\n // if this neighbor is not visited earlier, mark it as visited\n // add it to the queue at appropriate level\n if (visited.get(neighbor.nodeId) == null)\n {\n visited.put(neighbor.nodeId, 1);\n queue.add(new QueueNode(findGraphNode(neighbor.nodeId), currentNode.level + 1));\n }\n neighbor = neighbor.next; \n }\n }\n \n return minNumberTrials;\n }", "public Node closestPrecedingNode(int id);", "@Override\n\tpublic void run() {\n\t\tMap<Integer, Integer> roots = new TreeMap<Integer, Integer>();\n\t\t\n\t\tEdge[] edges = new Edge[this.edges.length];\n\t\tint n, weight, relevantEdges, root, lowerBound = 0;\n\t\n\t\t// Sort edges by weight.\n\t\tquickSort(0, this.edges.length - 1);\n\t\n\t\t// Compute initial lower bound (best k - 1 edges).\n\t\t// Choosing the cheapest k - 1 edges is not very intelligent. There is no guarantee\n\t\t// that this subset of edges even induces a subgraph over the initial graph.\n\t\t// TODO: Find a better initial lower bound.\n\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\tlowerBound += this.edges[i].weight;\n\t\t}\n\t\n\t\t// Iterate over all nodes in the graph and run Prim's algorithm\n\t\t// until k - 1 edges are fixed.\n\t\t// As all induced subgraphs have k nodes and are connected according to Prim, they\n\t\t// are candidate solutions and thus submitted.\n\t\tfor (root = 0; root < taken.length; root++) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\n\t\t\ttaken[root] = true;\n\t\t\tn = 0;\n\t\t\tweight = 0;\n\t\t\trelevantEdges = this.edges.length;\n\n\t\t\twhile (n < solution.length) { \n\t\t\t\tfor (int i = 0; i < relevantEdges; i++) {\n\t\t\t\t\t// XOR to check if connected and no circle.\n\t\t\t\t\tif (taken[edges[i].node1] ^ taken[edges[i].node2]) {\n\t\t\t\t\t\ttaken[taken[edges[i].node1] ? edges[i].node2 : edges[i].node1] = true;\n\t\t\t\t\t\tsolution[n++] = edges[i];\n\t\t\t\t\t\tweight += edges[i].weight;\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Check for circle.\n\t\t\t\t\telse if (taken[edges[i].node1]) {\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\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// Sum up what we've just collected and submit this\n\t\t\t// solution to the framework.\n\t\t\tHashSet<Edge> set = new HashSet<Edge>(solution.length);\n\t\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\t\tset.add(solution[i]);\n\t\t\t}\n\t\t\tsetSolution(weight, set);\n\t\t\troots.put(weight, root);\n\t\t}\n\n\t\t// Now for the real business, let's do some Branch-and-Bound. Roots of \"k Prim Spanning Trees\"\n\t\t// are enumerated by weight to increase our chances to obtain the kMST earlier.\n\t\tfor (int item : roots.values()) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\t\t\ttaken[item] = true;\n\t\t\tbranchAndBound(edges, solution.length, 0, lowerBound);\n\t\t}\n\t}", "private static int breadthFirstSearch(Vertex start) throws Queue.UnderflowException, Queue.EmptyException {\n boolean visited[] = new boolean[48];\n //Keep a queue of vertecies and a queue of the depth of the verticies - they will be added to and poped from identically\n ListQueue<Vertex> queue = new ListQueue<Vertex>();\n ListQueue<Integer> numQueue = new ListQueue<Integer>();\n //Set the starting node as visited\n visited[start.index()] = true;\n queue.enqueue(start);\n numQueue.enqueue(new Integer(1));\n\n //Keep last\n int last = -1;\n //While the queue isnt empty\n while (!queue.isEmpty()) {\n //Pop off the top from both queues and mark as visited\n start = queue.dequeue();\n int current = numQueue.dequeue();\n visited[start.index] = true;\n //For all neigbors\n for (Vertex v : start.neighbors) {\n //If we havent visited it make sure to visit it\n if (visited[v.index()] == false) {\n //As we keep adding new nodes to visit keep track of the depth\n queue.enqueue(v);\n numQueue.enqueue(current + 1);\n }\n }\n //Keep track of the most recent depth before we pop it off (queue will be empty when we exit)\n last = current;\n }\n //Return the max of the depth\n return last;\n }", "static void topView( Node root) \n{ \n\t// Base case \n\tif (root == null) { \n\t\treturn; \n\t} \n\n\t// Take a temporary node \n\tNode temp = null; \n\n\t// Queue to do BFS \n\tQueue<Pair > q = new LinkedList<Pair>(); \n\n\t// map to store node at each vartical distance \n\tMap<Integer, Integer> mp = new TreeMap<Integer, Integer>(); \n\n\tq.add(new Pair( root, 0 )); \n\n\t// BFS \n\twhile (q.size()>0) { \n\n\t\ttemp = q.peek().first; \n\t\tint d = q.peek().second; \n\t\tq.remove(); \n\n\t\t// If any node is not at that vertical distance \n\t\t// just insert that node in map and print it \n\t\tif (mp.get(d) == null) {mp.put(d, temp.data); \n\t\t} \n\n\t\t// Continue for left node \n\t\tif (temp.left!=null) { \n\t\t\tq.add(new Pair( temp.left, d - 1 )); \n\t\t} \n\n\t\t// Continue for right node \n\t\tif (temp.right!=null) { \n\t\t\tq.add(new Pair( temp.right, d + 1 )); \n\t\t} \n\t} \n\tfor(Integer data:mp.values()){ \n\tSystem.out.print( data + \" \"); \n\t} \n}", "private double dijkstraSingleTarget(Map<Integer, List<Node>> graph, int vertices, int source, int target) {\n Queue<Node> minHeap = new PriorityQueue<>(\n Comparator.comparingDouble(a -> a.weight)\n );\n\n double[] dist = new double[vertices + 1]; //shortest distance for each vertex\n Arrays.fill(dist, 0.0);\n\n boolean visited[] = new boolean[vertices + 1];\n\n // Distance for starting node is 0\n dist[source] = -1;\n minHeap.add((new Node(-1,source)));\n\n while (!minHeap.isEmpty()) {\n Node topPair = minHeap.remove();\n int currNode = topPair.vertex;\n double currDistance = topPair.weight;\n\n if (!graph.containsKey(currNode)) {\n continue;\n }\n\n if (visited[currNode]) continue;\n visited[currNode] = true;\n\n\n for (Node edge : graph.get(currNode)) {\n double weight = edge.weight;\n int neighborNode = edge.vertex;\n double nextDist = currDistance * weight;\n\n if (!visited[neighborNode] && nextDist < dist[neighborNode]) {\n dist[neighborNode] = nextDist;\n minHeap.add((new Node(nextDist, neighborNode)));\n\n }\n\n }\n\n\n }\n\n return -dist[target];\n }", "private void breadthFirstSearch (int start, int[] visited, int[] parent){\r\n Queue< Integer > theQueue = new LinkedList< Integer >();\r\n boolean[] identified = new boolean[getNumV()];\r\n identified[start] = true;\r\n theQueue.offer(start);\r\n while (!theQueue.isEmpty()) {\r\n int current = theQueue.remove();\r\n visited[current] = 1; //ziyaret edilmis vertexler queuedan cikarilan vertexlerdir\r\n Iterator < Edge > itr = edgeIterator(current);\r\n while (itr.hasNext()) {\r\n Edge edge = itr.next();\r\n int neighbor = edge.getDest();\r\n if (!identified[neighbor]) {\r\n identified[neighbor] = true;\r\n theQueue.offer(neighbor);\r\n parent[neighbor] = current;\r\n }\r\n }\r\n }\r\n }", "private void expandNode() {\r\n\t\t\t// Dijkstra's algorithm to handle separately\r\n\t\t\tif (dijkstra.isSelected()) {\r\n\t\t\t\tCell u;\r\n\t\t\t\t// 11: while Q is not empty:\r\n\t\t\t\tif (graph.isEmpty()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// 12: u := vertex in Q (graph) with smallest distance in dist[]\r\n\t\t\t\t// ;\r\n\t\t\t\t// 13: remove u from Q (graph);\r\n\t\t\t\tu = graph.remove(0);\r\n\t\t\t\t// Add vertex u in closed set\r\n\t\t\t\tclosedSet.add(u);\r\n\t\t\t\t// If target has been found ...\r\n\t\t\t\tif (u.row == targetPos.row && u.col == targetPos.col) {\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// Counts nodes that have expanded.\r\n\t\t\t\texpanded++;\r\n\t\t\t\t// Update the color of the cell\r\n\t\t\t\tgrid[u.row][u.col] = CLOSED;\r\n\t\t\t\t// 14: if dist[u] = infinity:\r\n\t\t\t\tif (u.dist == INFINITY) {\r\n\t\t\t\t\t// ... then there is no solution.\r\n\t\t\t\t\t// 15: break;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\t// 16: end if\r\n\t\t\t\t}\r\n\t\t\t\t// Create the neighbors of u\r\n\t\t\t\tArrayList<Cell> neighbors = createSuccesors(u, false);\r\n\t\t\t\t// 18: for each neighbor v of u:\r\n\t\t\t\tfor (Cell v : neighbors) {\r\n\t\t\t\t\t// 20: alt := dist[u] + dist_between(u, v) ;\r\n\t\t\t\t\tint alt = u.dist + distBetween(u, v);\r\n\t\t\t\t\t// 21: if alt < dist[v]:\r\n\t\t\t\t\tif (alt < v.dist) {\r\n\t\t\t\t\t\t// 22: dist[v] := alt ;\r\n\t\t\t\t\t\tv.dist = alt;\r\n\t\t\t\t\t\t// 23: previous[v] := u ;\r\n\t\t\t\t\t\tv.prev = u;\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[v.row][v.col] = FRONTIER;\r\n\t\t\t\t\t\t// 24: decrease-key v in Q;\r\n\t\t\t\t\t\t// (sort list of nodes with respect to dist)\r\n\t\t\t\t\t\tCollections.sort(graph, new CellComparatorByDist());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// The handling of the other four algorithms\r\n\t\t\t} else {\r\n\t\t\t\tCell current;\r\n\t\t\t\tif (dfs.isSelected() || bfs.isSelected()) {\r\n\t\t\t\t\t// Here is the 3rd step of the algorithms DFS and BFS\r\n\t\t\t\t\t// 3. Remove the first state, Si, from OPEN SET ...\r\n\t\t\t\t\tcurrent = openSet.remove(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Here is the 3rd step of the algorithms A* and Greedy\r\n\t\t\t\t\t// 3. Remove the first state, Si, from OPEN SET,\r\n\t\t\t\t\t// for which f(Si) ≤ f(Sj) for all other\r\n\t\t\t\t\t// open states Sj ...\r\n\t\t\t\t\t// (sort first OPEN SET list with respect to 'f')\r\n\t\t\t\t\tCollections.sort(openSet, new CellComparatorByF());\r\n\t\t\t\t\tcurrent = openSet.remove(0);\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add it to CLOSED SET.\r\n\t\t\t\tclosedSet.add(0, current);\r\n\t\t\t\t// Update the color of the cell\r\n\t\t\t\tgrid[current.row][current.col] = CLOSED;\r\n\t\t\t\t// If the selected node is the target ...\r\n\t\t\t\tif (current.row == targetPos.row && current.col == targetPos.col) {\r\n\t\t\t\t\t// ... then terminate etc\r\n\t\t\t\t\tCell last = targetPos;\r\n\t\t\t\t\tlast.prev = current.prev;\r\n\t\t\t\t\tclosedSet.add(last);\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// Count nodes that have been expanded.\r\n\t\t\t\texpanded++;\r\n\t\t\t\t// Here is the 4rd step of the algorithms\r\n\t\t\t\t// 4. Create the successors of Si, based on actions\r\n\t\t\t\t// that can be implemented on Si.\r\n\t\t\t\t// Each successor has a pointer to the Si, as its predecessor.\r\n\t\t\t\t// In the case of DFS and BFS algorithms, successors should not\r\n\t\t\t\t// belong neither to the OPEN SET nor the CLOSED SET.\r\n\t\t\t\tArrayList<Cell> succesors;\r\n\t\t\t\tsuccesors = createSuccesors(current, false);\r\n\t\t\t\t// Here is the 5th step of the algorithms\r\n\t\t\t\t// 5. For each successor of Si, ...\r\n\t\t\t\tfor (Cell cell : succesors) {\r\n\t\t\t\t\t// ... if we are running DFS ...\r\n\t\t\t\t\tif (dfs.isSelected()) {\r\n\t\t\t\t\t\t// ... add the successor at the beginning of the list\r\n\t\t\t\t\t\t// OPEN SET\r\n\t\t\t\t\t\topenSet.add(0, cell);\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t// ... if we are runnig BFS ...\r\n\t\t\t\t\t} else if (bfs.isSelected()) {\r\n\t\t\t\t\t\t// ... add the successor at the end of the list OPEN SET\r\n\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t// ... if we are running A* or Greedy algorithms (step 5\r\n\t\t\t\t\t\t// of A* algorithm) ...\r\n\t\t\t\t\t} else if (aStar.isSelected() || guloso.isSelected()) {\r\n\t\t\t\t\t\t// ... calculate the value f(Sj) ...\r\n\t\t\t\t\t\tint dxg = current.col - cell.col;\r\n\t\t\t\t\t\tint dyg = current.row - cell.row;\r\n\t\t\t\t\t\tint dxh = targetPos.col - cell.col;\r\n\t\t\t\t\t\tint dyh = targetPos.row - cell.row;\r\n\t\t\t\t\t\tif (diagonal.isSelected()) {\r\n\t\t\t\t\t\t\t// with diagonal movements\r\n\t\t\t\t\t\t\t// calculate 1000 times the Euclidean distance\r\n\t\t\t\t\t\t\tif (guloso.isSelected()) {\r\n\t\t\t\t\t\t\t\t// especially for the Greedy ...\r\n\t\t\t\t\t\t\t\tcell.g = 0;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcell.g = current.g + (int) ((double) 1000 * Math.sqrt(dxg * dxg + dyg * dyg));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcell.h = (int) ((double) 1000 * Math.sqrt(dxh * dxh + dyh * dyh));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// without diagonal movements\r\n\t\t\t\t\t\t\t// calculate Manhattan distances\r\n\t\t\t\t\t\t\tif (guloso.isSelected()) {\r\n\t\t\t\t\t\t\t\t// especially for the Greedy ...\r\n\t\t\t\t\t\t\t\tcell.g = 0;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcell.g = current.g + Math.abs(dxg) + Math.abs(dyg);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcell.h = Math.abs(dxh) + Math.abs(dyh);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcell.f = cell.g + cell.h;\r\n\t\t\t\t\t\t// ... If Sj is neither in the OPEN SET nor in the\r\n\t\t\t\t\t\t// CLOSED SET states ...\r\n\t\t\t\t\t\tint openIndex = isInList(openSet, cell);\r\n\t\t\t\t\t\tint closedIndex = isInList(closedSet, cell);\r\n\t\t\t\t\t\tif (openIndex == -1 && closedIndex == -1) {\r\n\t\t\t\t\t\t\t// ... then add Sj in the OPEN SET ...\r\n\t\t\t\t\t\t\t// ... evaluated as f(Sj)\r\n\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t\t// Else ...\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// ... if already belongs to the OPEN SET, then ...\r\n\t\t\t\t\t\t\tif (openIndex > -1) {\r\n\t\t\t\t\t\t\t\t// ... compare the new value assessment with the\r\n\t\t\t\t\t\t\t\t// old one.\r\n\t\t\t\t\t\t\t\t// If old <= new ...\r\n\t\t\t\t\t\t\t\tif (openSet.get(openIndex).f <= cell.f) {\r\n\t\t\t\t\t\t\t\t\t// ... then eject the new node with state\r\n\t\t\t\t\t\t\t\t\t// Sj.\r\n\t\t\t\t\t\t\t\t\t// (ie do nothing for this node).\r\n\t\t\t\t\t\t\t\t\t// Else, ...\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// ... remove the element (Sj, old) from the\r\n\t\t\t\t\t\t\t\t\t// list\r\n\t\t\t\t\t\t\t\t\t// to which it belongs ...\r\n\t\t\t\t\t\t\t\t\topenSet.remove(openIndex);\r\n\t\t\t\t\t\t\t\t\t// ... and add the item (Sj, new) to the\r\n\t\t\t\t\t\t\t\t\t// OPEN SET.\r\n\t\t\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// ... if already belongs to the CLOSED SET,\r\n\t\t\t\t\t\t\t\t// then ...\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// ... compare the new value assessment with the\r\n\t\t\t\t\t\t\t\t// old one.\r\n\t\t\t\t\t\t\t\t// If old <= new ...\r\n\t\t\t\t\t\t\t\tif (closedSet.get(closedIndex).f <= cell.f) {\r\n\t\t\t\t\t\t\t\t\t// ... then eject the new node with state\r\n\t\t\t\t\t\t\t\t\t// Sj.\r\n\t\t\t\t\t\t\t\t\t// (ie do nothing for this node).\r\n\t\t\t\t\t\t\t\t\t// Else, ...\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// ... remove the element (Sj, old) from the\r\n\t\t\t\t\t\t\t\t\t// list\r\n\t\t\t\t\t\t\t\t\t// to which it belongs ...\r\n\t\t\t\t\t\t\t\t\tclosedSet.remove(closedIndex);\r\n\t\t\t\t\t\t\t\t\t// ... and add the item (Sj, new) to the\r\n\t\t\t\t\t\t\t\t\t// OPEN SET.\r\n\t\t\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\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}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public List<Integer> closestKValues(TreeNode root, double target, int k) {\n\t\tQueue<Integer> list = new LinkedList<>();\n\t\tStack<TreeNode> stk = new Stack<>();\n\t\twhile (!stk.isEmpty() || root != null) {\n\t\t\tif (root != null) {\n\t\t\t\tstk.push(root);\n\t\t\t\troot = root.left;\n\t\t\t} else {\n\t\t\t\tTreeNode node = stk.pop();\n\t\t\t\tif (list.size() < k) {\n\t\t\t\t\tlist.add(node.val);\n\t\t\t\t} else {\n\t\t\t\t\tint val = list.peek();\n\t\t\t\t\tif (Math.abs(val - target) > Math.abs(node.val - target)) {\n\t\t\t\t\t\tlist.poll();\n\t\t\t\t\t\tlist.add(node.val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\troot = node.right;\n\t\t\t}\n\t\t}\n\t\treturn new ArrayList<>(list);\n\t}", "private void getAllNodesBreadthFirstSearch(List<Expression> nodesList)\n/* */ {\n/* 156 */ int indx = 0;\n/* 157 */ nodesList.add(this);\n/* */ \n/* 159 */ while (indx < nodesList.size()) {\n/* 160 */ Expression node = (Expression)nodesList.get(indx++);\n/* 161 */ for (Expression child : node.childs) {\n/* 162 */ nodesList.add(child);\n/* */ }\n/* */ }\n/* */ }", "private void computeShortestPath(){\n T current = start;\n boolean atEnd = false;\n while (!unvisited.isEmpty()&& !atEnd){\n int currentIndex = vertexIndex(current);\n LinkedList<T> neighbors = getUnvisitedNeighbors(current); // getting unvisited neighbors\n \n //what is this doing here???\n if (neighbors.isEmpty()){\n \n }\n \n // looping through to find distances from start to neighbors\n for (T neighbor : neighbors){ \n int neighborIndex = vertexIndex(neighbor); \n int d = distances[currentIndex] + getEdgeWeight(current, neighbor);\n \n if (d < distances[neighborIndex]){ // if this distance is less than previous distance\n distances[neighborIndex] = d;\n closestPredecessor[neighborIndex] = current; // now closest predecessor is current\n }\n }\n \n if (current.equals(end)){\n atEnd = true;\n }\n else{\n // finding unvisited node that is closest to start node\n T min = getMinUnvisited();\n if (min != null){\n unvisited.remove(min); // remove minimum neighbor from unvisited\n visited.add(min); // add minimum neighbor to visited\n current = min;\n }\n }\n }\n computePath();\n totalDistance = distances[vertexIndex(end)];\n }", "public void Djkstra(int source) {\n\t\tfor (int i = 0; i < vertices; i++) {\n\t\t\tdist[i] = Integer.MAX_VALUE; // added infinity to all ,\n\t\t}\n\t\t\n\t\tdist[source] = 0;\n\n\t\t// add source vertex to priority queue\n\t\tq.add(new Node(source, 0));\n\n\n\t\t// while my all vertices are not selected as a min among smallest one time\n\t\t// refracted in visited\n\t\twhile (visited.size() != vertices) {\n\n\t\t\t// pick from priority queue the smallest/min distance\n\t\t\tint i = q.remove().node;\n\n\t\t\t// once node is removed from queue add to set\n\t\t\tvisited.add(i);\n\n\t\t\t// relax adjacent vertex of this node;\n\t\t\t// And add the new node to queue bcoz distance has got updated so add new node as i dont have any method to update \n\t\t\t// already present node and its distance\n\t\t\t\n\n\t\t\tfor (Node v : graph[i]) {\n\t\t\t\tif (!visited.contains(v.node)) {\n\t\t\t\t\tif (dist[i] + v.cost < dist[v.node]) {\n\t\t\t\t\t\tdist[v.node] = dist[i] + v.cost;\n\t\t\t\t\t\tq.add(new Node(v.node, dist[v.node]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public static Vertex breathFirstSearch(Graph g, Vertex root) {\n\n for (Vertex v : g) {\n v.seen = false;\n v.parent = null;\n v.distance = Integer.MAX_VALUE;\n }\n\n Queue<Vertex> queue = new LinkedList<Vertex>();\n root.seen = true;\n root.distance = 0;\n queue.add(root);\n Vertex maxDistNode = null;\n while (!queue.isEmpty()) {\n Vertex current = queue.remove();\n\n for (Edge e : current.Adj) {\n Vertex other = e.otherEnd(current);\n if (!other.seen) {\n other.seen = true;\n other.distance = current.distance + 1;\n other.parent = current;\n queue.add(other);\n }\n }\n maxDistNode = current;\n }\n return maxDistNode;\n }", "public void shortestPathsNodes() {\n for (int sourceNode = 0; sourceNode < wordGraph.V(); sourceNode++) {\n BreadthFirstDirectedPaths bfs = new BreadthFirstDirectedPaths(wordGraph, sourceNode);\n\n for (int goalNode = 0; goalNode < wordGraph.V(); goalNode++) {\n Iterable<Integer> shortestPath = bfs.pathTo(goalNode);\n int pathLength = -1;\n if (shortestPath != null) {\n for (int edge : shortestPath) {\n pathLength++;\n }\n }\n if (pathLength != -1) {\n }\n System.out.println(pathLength);\n }\n }\n }", "public double frogPosition(int n, int[][] edges, int t, int target) {\n Map<Integer, List<Integer>> tree = new HashMap<>();\n for(int[] edge : edges) {\n List<Integer> children = tree.getOrDefault(edge[0], new ArrayList<>());\n children.add(edge[1]);\n tree.put(edge[0], children);\n\n children = tree.getOrDefault(edge[1], new ArrayList<>());\n children.add(edge[0]);\n tree.put(edge[1], children);\n }\n\n Queue<Node> queue = new LinkedList<>();\n Set<Integer> visited = new HashSet<>();\n queue.offer(new Node(1, 1.0));\n while(!queue.isEmpty() && t >= 0) {\n int size = queue.size();\n for(int i = 0; i < size; i++) {\n Node node = queue.poll();\n\n visited.add(node.index);\n List<Integer> children = tree.getOrDefault(node.index, new ArrayList<>())\n .stream()\n .filter(obj -> !visited.contains(obj))\n .collect(Collectors.toList());\n if(node.index == target && (t == 0 || children.size() == 0)) {\n return node.p;\n }\n for(int child : children) {\n queue.offer(new Node(child, node.p / (double)children.size()));\n }\n }\n t--;\n }\n return 0;\n }", "@Override\n public Double calculateShortestPathFromSource(String from, String to) {\n Node source = graph.getNodeByName(from);\n Node destination = graph.getNodeByName(to);\n source.setDistance(0d);\n Set<Node> settledNodes = new HashSet<>();\n PriorityQueue<Node> unsettledNodes = new PriorityQueue<>(Comparator.comparing(Node::getDistance));\n unsettledNodes.add(source);\n while (unsettledNodes.size() != 0) {\n Node currentNode = unsettledNodes.poll();\n for (Map.Entry<Node, Double> adjacencyPair : currentNode.getAdjacentNodes().entrySet()) {\n Node adjacentNode = adjacencyPair.getKey();\n Double distance = adjacencyPair.getValue();\n if (!settledNodes.contains(adjacentNode)) {\n calculateMinimumDistance(adjacentNode, distance, currentNode);\n unsettledNodes.add(adjacentNode);\n }\n }\n settledNodes.add(currentNode);\n }\n return destination.getDistance() == Double.MAX_VALUE ? -9999d : destination.getDistance();\n }", "public void breadthFirstSearch(){\n Deque<Node> q = new ArrayDeque<>(); // In an interview just write Queue ? Issue is java 8 only has priority queue, \n // meaning I have to pass it a COMPARABLE for the Node class\n if (this.root == null){\n return;\n }\n \n q.add(this.root);\n while(q.isEmpty() == false){\n Node n = (Node) q.remove();\n System.out.print(n.val + \", \");\n if (n.left != null){\n q.add(n.left);\n }\n if (n.right != null){\n q.add(n.right);\n }\n }\n }", "public static void findClosestSharedParentBST() {\n \n // initialize graph (adjacency list) as a BST\n int[][] bst = {\n {1,2}, // vertex 0 ....\n {3,4},\n {5,6},\n {7,8},\n {},\n {},\n {},\n {9},\n {},\n {} // vertex 9\n }; \n // Given 2 Nodes in a BST, find their closest shared parent\n Graph g = new Graph(bst);\n g.dijsktra(g.getVertices().get(0));\n List<Vertex> path1 = g.getShortestPath(g.getVertices().get(1));\n List<Vertex> path2 = g.getShortestPath(g.getVertices().get(9));\n\n // parent will be the last item in each path before the diverge\n // EX: [1,2,3], [1,2,4,5]. - searched for 3 and 5. parent is 2.\n // EX: [1,2], [1,2,4,5]. - searched for 2 and 5. parent is 2.\n int min = Math.min(path1.size(), path2.size()) -1;\n int parentidx = 0;\n for (int i = 0; i <= min; i++) {\n if (path1.get(i) == path2.get(i)) {\n parentidx = i;\n } else {\n break;\n }\n }\n System.out.println(\"shared parent: \" + path1.get(parentidx));\n }", "private List<Pair<Integer, Integer>> getBestPath(Pair<Integer, Integer> curLocation, Pair<Integer, Integer> dest) {\n\t\tList<Pair<Integer, Integer>> path = new LinkedList<Pair<Integer, Integer>>();\n\t\t\n\t\t\n\t\tNode current = new Node(curLocation.getX(), curLocation.getY(), getHitProbability(curLocation.getX(), curLocation.getY()));\n\t\tNode target = new Node(dest.getX(), dest.getY(), getHitProbability(dest.getX(), dest.getY()));\n\t\tList<Node> openSet = new ArrayList<>();\n List<Node> closedSet = new ArrayList<>();\n \n \n while (true) {\n openSet.remove(current);\n List<Node> adjacent = getAdjacentNodes(current, closedSet, target);\n\n // Find the adjacent node with the lowest heuristic cost.\n for (Node neighbor : adjacent) {\n \tboolean inOpenset = false;\n \tList<Node> openSetCopy = new ArrayList<>(openSet);\n \tfor (Node node : openSetCopy) {\n \t\tif (neighbor.equals(node)) {\n \t\t\tinOpenset = true;\n \t\t\tif (neighbor.getAccumulatedCost() < node.getAccumulatedCost()) {\n \t\t\t\topenSet.remove(node);\n \t\t\t\topenSet.add(neighbor);\n \t\t\t}\n \t\t}\n \t}\n \t\n \tif (!inOpenset) {\n \t\topenSet.add(neighbor);\n \t}\n }\n\n // Exit search if done.\n if (openSet.isEmpty()) {\n System.out.printf(\"Target (%d, %d) is unreachable from position (%d, %d).\\n\",\n target.getX(), target.getY(), curLocation.getX(), curLocation.getY());\n return null;\n } else if (/*isAdjacent(current, target)*/ current.equals(target)) {\n break;\n }\n\n // This node has been explored now.\n closedSet.add(current);\n\n // Find the next open node with the lowest cost.\n Node next = openSet.get(0);\n for (Node node : openSet) {\n if (node.getCost(target) < next.getCost(target)) {\n next = node;\n }\n }\n// System.out.println(\"Moving to node: \" + current);\n current = next;\n }\n \n // Rebuild the path using the node parents\n path.add(new Pair<Integer, Integer>(curLocation.getX(), curLocation.getY()));\n while(current.getParent() != null) {\n \tcurrent = current.getParent();\n \tpath.add(0, new Pair<Integer, Integer>(current.getX(), current.getY()));\n }\n \n if (path.size() > 1) {\n \tpath.remove(0);\n }\n \n\t\treturn path;\n\t}", "public List<Integer> _closestKValues(TreeNode root, double target, int k) {\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tfinal double targetValue = target;\n\t\tQueue<Integer> heap = new PriorityQueue<>(k, new Comparator<Integer>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Integer arg0, Integer arg1) {\n\t\t\t\tif (Math.abs(arg0 - targetValue) > Math.abs(arg1 - targetValue))\n\t\t\t\t\treturn 1;\n\t\t\t\telse if (Math.abs(arg0 - targetValue) < Math.abs(arg1 - targetValue))\n\t\t\t\t\treturn -1;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t\taddToHeap(root, heap);\n\t\tfor(int i=0; i<k; i++) {\n list.add(heap.poll());\n }\n\t\treturn list;\n\t}", "public SegmentTreeNode<T> getNode (int target) {\n\t\t// have we narrowed down?\n\t\tif (left == target) {\n\t\t\tif (right == left+1) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// press onwards\n\t\tint mid = (left+right)/2;\n\n\t\tif (target < mid) { return lson.getNode (target); }\n\t\treturn rson.getNode (target);\n\t}", "private List<BaseNode> findClosestNodes(BaseNode fromNode, List<BaseNode> toNodes,\n\t\t\tFloydWarshallShortestPaths<BaseNode, DefaultWeightedEdge> paths) {\n\t\t\n\t\tdouble shortestPath = 0;\n\t\tList<BaseNode> closestNodes = new ArrayList<>();\n\n\t\tfor (BaseNode toNode : toNodes) {\n\t\t\tGraphPath<BaseNode, DefaultWeightedEdge> path = paths.getPath(fromNode, toNode);\n\t\t\t// new closest found\n\t\t\tif ((shortestPath > path.getWeight() && path.getWeight() != 0) || shortestPath == 0) {\n\t\t\t\tshortestPath = path.getWeight();\n\t\t\t\tclosestNodes.clear();\n\t\t\t}\n\t\t\t// add closest to result list\n\t\t\tif (shortestPath != 0 && shortestPath == path.getWeight()) {\n\t\t\t\tclosestNodes.add(toNode);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn closestNodes;\n\t}", "public static Tree solve() {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n int[] arrayNode = new int[n + 1];\n for (int i = 1; i <= n; i++) {\n arrayNode[i] = scan.nextInt();\n }\n\n Color[] arrayColor = new Color[n + 1];\n for (int i = 1; i <= n; i++) {\n if (scan.nextInt() == 0) {\n arrayColor[i] = Color.RED;\n } else {\n arrayColor[i] = Color.GREEN;\n }\n }\n\n List<Integer>[] adjacentsList = new List[n + 1];\n for (int i = 1; i <= n; i++) {\n adjacentsList[i] = new ArrayList<Integer>();\n }\n\n for (int i = 0; i < n - 1; i++) {\n int x = scan.nextInt();\n int y = scan.nextInt();\n\n adjacentsList[x].add(y);\n adjacentsList[y].add(x);\n }\n\n scan.close();\n\n List<Integer>[] childrenList = new List[n + 1];\n for (int i = 1; i <= n; i++) {\n childrenList[i] = new ArrayList<Integer>();\n }\n\n int[] depths = new int[n + 1];\n boolean[] visited = new boolean[n + 1];\n\n Queue<Integer> queue = new LinkedList<Integer>();\n depths[1] = 0;\n queue.offer(1);\n while (!queue.isEmpty()) {\n int head = queue.poll();\n\n if (visited[head]) {\n continue;\n }\n visited[head] = true;\n\n for (int adjacent : adjacentsList[head]) {\n if (!visited[adjacent]) {\n childrenList[head].add(adjacent);\n depths[adjacent] = depths[head] + 1;\n queue.offer(adjacent);\n }\n }\n }\n\n Tree[] nodes = new Tree[n + 1];\n for (int i = 1; i <= n; i++) {\n if (childrenList[i].isEmpty()) {\n nodes[i] = new TreeLeaf(arrayNode[i], arrayColor[i], depths[i]);\n } else {\n nodes[i] = new TreeNode(arrayNode[i], arrayColor[i], depths[i]);\n }\n }\n for (int i = 1; i <= n; i++) {\n for (int child : childrenList[i]) {\n ((TreeNode) nodes[i]).addChild(nodes[child]);\n }\n }\n return nodes[1];\n }", "public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {\n TreeNode cur = root;\n while (true) {\n if (cur.val > p.val && cur.val > q.val) cur = cur.left;\n else if (cur.val < p.val && cur.val < q.val) cur = cur.right;\n else return cur;\n }\n}", "public int largestSmaller(TreeNode root, int target) {\n if(root == null) {\n return (int)(-1 * Math.pow(2, 31));\n }\n TreeNode nextNode = root;\n Deque<TreeNode> stack = new LinkedList<>();\n List<Integer> result = new ArrayList<>();\n while(nextNode != null || !stack.isEmpty()) {\n if(nextNode != null) {\n stack.offerFirst(nextNode);\n nextNode = nextNode.left;\n }\n else {\n nextNode = stack.pollFirst();\n result.add(nextNode.key);\n nextNode = nextNode.right;\n }\n }\n int i = 0;\n for(i = result.size() - 1; i >= 0; i--) {\n if(result.get(i) < target) {\n break;\n }\n }\n if(i == -1) {\n return Integer.MIN_VALUE;\n }\n return result.get(i);\n }", "private void search(int offset, MetricSpaceObject query, ResultCollector collector, double parentToQueryDistance) {\n buffer.position(offset);\n\n //the node should consist of a pointer to each child node then the point data, then the value data\n double nodeRadius = buffer.getDouble();\n double parentToThisDistance = buffer.getDouble();\n int left = buffer.getInt();\n int right = buffer.getInt();\n \n double searchRadius = collector.getRadius();\n\n //check if we can skip a distance calculation using the triangle inequality\n if (!optimise || Double.isNaN(parentToQueryDistance)\n || Math.abs(parentToThisDistance - parentToQueryDistance) <= nodeRadius + searchRadius)\n {\n int vantagePointId = buffer.getInt();\n double distance = query.getDistance(vantagePointId);\n\n if (distance <= searchRadius) {\n //this point is within the distance threshold to the query object, so add it to the results\n collector.add(new SearchResult(query.getObjectID(), vantagePointId, distance));\n \n //update the search radius in case the add changed it\n searchRadius = collector.getRadius();\n }\n\n if (left != 0 && distance <= nodeRadius + searchRadius) {\n //points within a distance threshold to the query object could be inside the radius,\n //so search the left subtree\n search(left, query, collector, distance);\n }\n\n if (right != 0 && distance >= nodeRadius - searchRadius) {\n //points within a distance threshold to the query object could be outside the radius,\n //so search the right subtree\n search(right, query, collector, distance);\n }\n }\n else if (right != 0) {\n search(right, query, collector, Double.NaN);\n }\n }", "private void calculateDistances() {\n for (int point = 0; point < ntree.size(); point++) {\n calculateDistances(point);\n }\n }", "public void kruskalMST()\n{\n PriorityQueue<Edge> completeTree = this._getKruskalTree(false);\n /*\n * Once we have the queue, we can display the tree and see how much it\n * weighs.\n */\n while (0 != completeTree.size()) {\n Edge nextEdge = completeTree.remove();\n System.out.println(\n this.vertexList[nextEdge.srcVert].label + \" --- \"\n + this.vertexList[nextEdge.destVert].label\n + \": \" + nextEdge.distance\n );\n }\n}", "private int BFS() {\n adjList.cleanNodeFields();\n\n //Queue for storing current shortest path\n Queue<Node<Integer, Integer>> q = new LinkedList<>();\n\n //Set source node value to 0\n q.add(adjList.getNode(startNode));\n q.peek().key = 0;\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, Integer>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, Integer> neighbor, u;\n long speed = (long) (cellSideLength * 1.20);\n\n while (!isCancelled() && q.size() != 0) {\n u = q.poll();\n\n //Marks node as checked\n checkedNodesGC.fillRect((u.value >> 16) * cellSideLength + 0.5f,\n (u.value & 0x0000FFFF) * cellSideLength + 0.5f,\n (int) cellSideLength - 1, (int) cellSideLength - 1);\n\n //endNode found\n if (u.value == endNode) {\n //Draws shortest path\n Node<Integer, Integer> current = u, prev = u;\n\n while ((current = current.prev) != null) {\n shortestPathGC.strokeLine((prev.value >> 16) * cellSideLength + cellSideLength / 2,\n (prev.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2,\n (current.value >> 16) * cellSideLength + cellSideLength / 2,\n (current.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2);\n prev = current;\n }\n return u.d;\n }\n\n //Wait after checking node\n try {\n Thread.sleep(speed);\n } catch (InterruptedException interrupted) {\n if (isCancelled())\n break;\n }\n\n //Checking Neighbors\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, Integer>, Integer> neighborKeyValuePair : neighbors) {\n neighbor = neighborKeyValuePair.getKey();\n //Relaxation step\n //Checks if neighbor hasn't been checked, if so the assign the shortest path\n if (!neighbor.visited) {\n //Adds checked neighbor to queue\n neighbor.key = u.d + 1;\n neighbor.d = u.d + 1; //Assign shorter path found to neighbor\n neighbor.prev = u;\n neighbor.visited = true;\n q.add(neighbor);\n }\n }\n }\n return Integer.MAX_VALUE;\n }", "private int kthSmallestTreeNode(Tree tree, int k){\n List<Integer> values = new ArrayList<>();\n List<Integer> arr = printTree(tree, values);\n System.out.println(\"\\nPrinting out the whole list created by In order traversal\\n\");\n System.out.print(arr);\n return arr.get(k);\n}", "private int first_leaf() { return n/2; }", "public void greedyBFS(String input)\r\n\t{\r\n\t\tNode root_gbfs = new Node (input);\r\n\t\tNode current = new Node(root_gbfs.getState());\r\n\t\t\r\n\t\tNodeComparator gbfs_comparator = new NodeComparator();\r\n\t\tPriorityQueue<Node> queue_gbfs = new PriorityQueue<Node>(12, gbfs_comparator);\r\n\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\r\n\t\tint nodes_popped = 0;\r\n\t\tint pqueue_max_size = 0;\r\n\t\tint pq_size = 0;\r\n\t\t\r\n\t\tcurrent.cost = 0;\r\n\t\tcurrent.total_cost = 0;\r\n\t\t\r\n\t\twhile(!goal_gbfs)\r\n\t\t{\r\n\t\t\tvisited.add(current.getState());\r\n\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\r\n\t\t\tfor (String a : children)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\tvisited.add(nino.getState());\r\n\t\t\t\t\t\r\n\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\tint greedy_cost = greedybfsCost(nino.getState(), root_gbfs.getState());\r\n\t\t\t\t\tnino.setTotalCost(greedy_cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\tpq_size++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Repeated State checking. Removing the same node from PQ if the path cost is less then the current one \r\n\t\t\t\t\telse if (queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (Node original : queue_gbfs)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (original.equals(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tNode copy = original;\r\n\t\t\t\t\t\t\t\tif (nino.getTotalCost() < copy.getTotalCost())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.remove(copy);\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.add(nino);\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}\r\n\t\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\tcurrent = queue_gbfs.poll();\r\n\t\t\tnodes_popped++;\r\n\t\t\t\r\n\t\t\tif (pq_size > pqueue_max_size)\r\n\t\t\t{\r\n\t\t\t\tpqueue_max_size = pq_size;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpq_size--;\r\n\t\t\tgoal_gbfs = isGoal(current.getState());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tgoal_gbfs = false;\r\n\t\tSystem.out.println(\"GBFS Solved!!\");\r\n\t\tSolution.performSolution(current, root_gbfs, nodes_popped, pqueue_max_size);\r\n\t}", "public static void computePaths(Point source) {\n\n\t\tsource.setMinimumDistance(0.0);\n\t\tPriorityQueue<Point> pointQueue = new PriorityQueue<Point>();\n\t\tpointQueue.add(source);\n\t\twhile (!pointQueue.isEmpty()) {\n\t\t\tPoint u = pointQueue.poll();\n\t\t\tif (u.getAdjacencies() != null) {\n\t\t\t\tfor (Edge e : u.getAdjacencies()) {\n\n\t\t\t\t\tPoint target = e.getTarget();\n\t\t\t\t\tdouble weight = e.getWeight();\n\t\t\t\t\tdouble distanceThroughP = weight + u.getMinimumDistance();\n\n\t\t\t\t\tif (distanceThroughP < target.getMinimumDistance()) {\n\t\t\t\t\t\tpointQueue.remove(target);\n\n\t\t\t\t\t\ttarget.setMinimumDistance(distanceThroughP);\n\t\t\t\t\t\ttarget.setPrevious(u);\n\t\t\t\t\t\tpointQueue.add(target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }", "@SuppressWarnings(\"null\")\n\tpublic static Node optimalIterativeSolution (Node Tree, int target) {\n\t\tNode curr = Tree;\n\t\tNode Closest = null;\n\t\tClosest.val = Integer.MAX_VALUE;\n\t\twhile (curr != null) {\n\t\t\tif (Math.abs(target - Closest.val) > Math.abs(target - curr.val)) {\n\t\t\t\tClosest = curr;\n\t\t\t} else if (target < curr.val) {\n\t\t\t\tcurr = curr.left;\n\t\t\t} else if (target > curr.val) {\n\t\t\t\tcurr = curr.right;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn Closest;\n\t}", "void bellman_ford(int s)\n {\n int dist[]=new int[V]; \n \n //to track the path from s to all\n int parent[]=new int[V] ;\n //useful when a vertex has no parent\n for(int i=0;i<V;i++)\n parent[i]=-2;\n \n for(int i=0;i<V;i++) \n dist[i]=INF;\n \n //start from source vertex\n dist[s]=0;\n parent[s]=-1;\n \n //we have to iterate over all the edges for V-1 times\n //each ith iteration finds atleast ith path length dist\n //worst case each ith will find ith path length \n \n for(int i=1;i<V;i++) \n {\n for(int j=0;j<E;j++)\n {\n //conside for all edges (u,v), wt\n int u=edge[j].src;\n int v=edge[j].dest;\n int wt=edge[j].wt; \n //since dist[u]=INF and adding to it=>overflow, therefore check first\n if( dist[u]!=INF && dist[u]+wt < dist[v])\n {\n dist[v]=dist[u]+wt;\n parent[v]=u;\n } \n }\n }\n \n //iterate for V-1 times, one more iteration necessarily gives a path length of atleast V in W.C=>cycle\n for(int j=0;j<E;j++) \n {\n int u=edge[j].src;\n int v=edge[j].dest;\n int wt=edge[j].wt;\n if( dist[u]!=INF && dist[u]+wt < dist[v])\n {\n System.out.println(\"Graph has cycle\");\n return;\n } \n }\n \n //print the distance to all from s\n System.out.println(\"from source \"+s+\" the dist to all other\");\n print_dist(dist); \n print_path(parent,dist,s); \n \n }", "public void breadthFirstTraverse() {\n\t\t// track whether vertex was visited\n\t\tHashMap<Integer, Boolean> visited = buildVisited();\n\t\t// store neighbors\n\t\tQueue<Integer> queue = new LinkedList<Integer>();\n\n\t\t// arbitrarily add first element\n\t\tInteger current = (Integer) edges.keySet().toArray()[0];\n\t\tqueue.add(current);\n\n\t\twhile (queue.peek() != null) {\n\n\t\t\tcurrent = queue.remove();\n\t\t\tSystem.out.println(\"current: \" + current);\n\t\t\tvisited.put(current, true);\n\n\t\t\tfor (Integer neighbor: edges.get(current)) {\n\t\t\t\tif (!visited.get(neighbor)) {\n\t\t\t\t\tqueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static Graph dijkstra(Graph graph, Node source) {\n source.distance = 0;\n Set<Node> settledNodes = new HashSet<>();\n Set<Node> unsettledNodes = new HashSet<>();\n unsettledNodes.add(source);\n \n while (unsettledNodes.size() != 0) {\n Node currentNode = Graph.getLowestDistanceNode(unsettledNodes);\n unsettledNodes.remove(currentNode);\n for (Map.Entry<Node, Integer> adjacencyPair: \n currentNode.adjacentNodes.entrySet()) {\n Node adjacentNode = adjacencyPair.getKey();\n Integer edgeWeight = adjacencyPair.getValue();\n if (!settledNodes.contains(adjacentNode)) {\n Graph.calculateMinimumDistance(adjacentNode, edgeWeight, currentNode);\n unsettledNodes.add(adjacentNode);\n }\n }\n settledNodes.add(currentNode);\n }\n return graph;\n }", "private void treeBreadthFirstTraversal() {\n Node currNode = root;\n java.util.LinkedList<Node> queue = new java.util.LinkedList<Node>();\n\n // Highlights the first Node.\n queueNodeSelectAnimation(currNode, \"Exploring \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n\n // Explores Nodes until the queue is empty.\n while (true) {\n\n // Marks that this Node's children should be explored.\n for (int i = 0; i < getNumChildren(); ++i) {\n if (currNode.children[i] != null) {\n queue.addLast(currNode.children[i]);\n queueQueueAddAnimation(currNode.children[i],\n \"Queueing \" + currNode.children[i].key,\n AnimationParameters.ANIM_TIME);\n\n }\n }\n\n // Pops the next Node from the queue.\n if (!queue.isEmpty()) {\n currNode = queue.pop();\n queueListPopAnimation(\"Popped \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n queueNodeSelectAnimation(currNode, \"Exploring \" + currNode.key,\n AnimationParameters.ANIM_TIME);\n\n }\n // If the queue is empty, breaks.\n else break;\n\n }\n }", "@Override\r\n\tpublic void getMinimumSpanningTree(GraphStructure graph) {\r\n\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\tdistanceArray[0]=0;\r\n\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\tList<Edge> list;\r\n\t\twhile(spanningTreeSet.size()!=numberOfVertices) {\r\n\t\t\tfor (int vertex=0; vertex<numberOfVertices;vertex++) {\r\n\t\t\t\tif(! spanningTreeSet.contains(vertex)) {\r\n\t\t\t\t\tspanningTreeSet.add(vertex);\r\n\t\t\t\t\tlist = adjacencyList[vertex];\r\n\t\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[vertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nvertex\\tdistance from source\");\r\n\t\tfor (int i=0;i<numberOfVertices;i++) {\r\n\t\t\tSystem.out.println(i+\"\\t\"+distanceArray[i]);\r\n\t\t}\r\n\t}", "public List<GeographicPoint> dijkstra(GeographicPoint start, \n\t\t\t\t\t\t\t\t\t\t GeographicPoint goal, Consumer<GeographicPoint> nodeSearched)\n\t{\n\t\t// TODO: Implement this method in WEEK 4\n\n\t\t// Hook for visualization. See writeup.\n\t\t//nodeSearched.accept(next.getLocation());\n\t\t\n\t\t//initialize distance of each MapNode from start to infinity\n\t\t\n\t\tSet<GeographicPoint> visited = new HashSet<GeographicPoint>();\n\t\tPriorityQueue<MapNode> queue = new PriorityQueue<MapNode>();\n\t\tHashMap<GeographicPoint, List<GeographicPoint>> path = new HashMap<GeographicPoint, List<GeographicPoint>>();\n\t\tint count = 0;\n\t\t\n\t\tif (!map.containsKey(start) || !map.containsKey(goal))\n\t\t\treturn null;\n\t\t\n\t\tfor (GeographicPoint temp : map.keySet())\n\t\t\tpath.put(temp, new ArrayList<GeographicPoint>());\n\t\t\n\t\tMapNode startNode = map.get(start);\n\t\tstartNode.setTimeToStart(0.0);\n\t\tstartNode.setDistanceToStart(0.0);\n\t\tqueue.add(startNode);\n\t\t\n\t\twhile (!queue.isEmpty()) {\n\t\t\tMapNode currNode = queue.poll();\n\t\t\tnodeSearched.accept(currNode.getLocation());\n\t\t\t\n\t\t\tif (!visited.contains(currNode.getLocation())) {\n\t\t\t\tvisited.add(currNode.getLocation());\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\tif (currNode.getLocation().equals(goal))\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tHashMap<MapEdge, GeographicPoint> neighbours = currNode.getNeighbours();\n\t\t\t\tfor (MapEdge edge : neighbours.keySet()) {\n\t\t\t\t\t\n\t\t\t\t\tif (!visited.contains(edge.getEnd())) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tMapNode addNode = map.get(neighbours.get(edge));\n\t\t\t\t\t\tdouble tempTime = currNode.getTimeToStart() + ((edge.getDistance())/(edge.getSpeedLimit()));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (tempTime < addNode.getTimeToStart()) {\n\t\t\t\t\t\t\taddNode.setTimeToStart(tempTime);\n\t\t\t\t\t\t\tqueue.add(addNode);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tList<GeographicPoint> temp = path.get(neighbours.get(edge));\n\t\t\t\t\t\t\ttemp.add(currNode.getLocation());\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\tSystem.out.println(\"Dijkstra: \" + count);\n\t\treturn backTrack(path,goal);\n\t}", "private void computePaths(Vertex source, Vertex target, ArrayList<Vertex> vs)\n {\n \tfor (Vertex v : vs)\n \t{\n \t\tv.minDistance = Double.POSITIVE_INFINITY;\n \t\tv.previous = null;\n \t}\n source.minDistance = 0.;\t\t// distance to self is zero\n IndexMinPQ<Vertex> vertexQueue = new IndexMinPQ<Vertex>(vs.size());\n \n for (Vertex v : vs) vertexQueue.insert(Integer.parseInt(v.id), v);\n\n\t\twhile (!vertexQueue.isEmpty()) \n\t\t{\n\t \t// retrieve vertex with shortest distance to source\n\t \tVertex u = vertexQueue.minKey();\n\t \tvertexQueue.delMin();\n\t\t\tif (u == target)\n\t\t\t{\n\t\t\t\t// trace back\n\t\t\t\twhile (u.previous != null)\n\t\t\t\t{;\n\t\t\t\t\tu = u.previous;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n \t// Visit each edge exiting u\n \tfor (Edge e : u.adjacencies)\n \t\t{\n \t\tVertex v = e.target;\n\t\t\t\tdouble weight = e.weight;\n \tdouble distanceThroughU = u.minDistance + weight;\n\t\t\t\tif (distanceThroughU < v.minDistance) \n\t\t\t\t{\n\t\t\t\t\tint vid = Integer.parseInt(v.id);\n\t\t \t\tvertexQueue.delete(vid);\n\t\t \t\tv.minDistance = distanceThroughU;\n\t\t \t\tv.previous = u;\n\t\t \t\tvertexQueue.insert(vid,v);\n\t\t\t\t}\n\t\t\t}\n }\n }", "int[] bfs(int[][] graph,int source){\n int len=graph.length;\n int shortest_path[]=new int[len];\n int parent[]=new int[len];\n Arrays.fill(shortest_path, Integer.MAX_VALUE/2);\n shortest_path[source]=0;\n Queue<Integer> q=new LinkedList<>();\n q.add(source);\n while (!q.isEmpty()) { \n int u=q.poll();\n for(int v:graph[u]){\n if(shortest_path[v]==Integer.MAX_VALUE/2){\n q.add(v);\n shortest_path[v]=shortest_path[u]+1;\n parent[v]=u;\n }\n }\n }\n return shortest_path;\n }", "void BFS(int s, int d) \r\n { \r\n int source = s;\r\n int destination = d;\r\n boolean visited[] = new boolean[V];\r\n int parent[] = new int[V];\r\n \r\n // Create a queue for BFS \r\n LinkedList<Integer> queue = new LinkedList<Integer>(); \r\n \r\n // Mark the current node as visited and enqueue it \r\n \r\n visited[s]=true; \r\n queue.add(s); \r\n System.out.println(\"Search Nodes: \");\r\n while (queue.size() != 0) \r\n { \r\n int index = 0;\r\n \r\n // Dequeue a vertex from queue and print it \r\n \r\n s = queue.poll();\r\n \r\n System.out.print(convert2(s)); \r\n \r\n if(s == destination)\r\n {\r\n break;\r\n }\r\n \r\n System.out.print(\" -> \");\r\n while(index < adj[s].size()) \r\n { \r\n \r\n \r\n int n = adj[s].get(index); \r\n if (!visited[n]) \r\n { \r\n visited[n] = true;\r\n parent[n] = s;\r\n queue.add(n); \r\n }\r\n index = index+ 2;\r\n \r\n \r\n }\r\n \r\n \r\n \r\n }\r\n int check = destination;\r\n int cost = 0, first, second = 0;\r\n String string = \"\" + convert2(check);\r\n while(check!=source)\r\n {\r\n \r\n first = parent[check];\r\n string = convert2(first) + \" -> \" + string;\r\n while(adj[first].get(second) != check)\r\n {\r\n second++;\r\n }\r\n cost = cost + adj[first].get(second +1);\r\n check = first;\r\n second = 0;\r\n \r\n }\r\n \r\n System.out.println(\"\\n\\nPathway: \");\r\n \r\n System.out.println(string);\r\n \r\n \r\n System.out.println(\"\\nTotal cost: \" + cost);\r\n }", "private LinkedList<Integer> _findShortestPath(int source, int destination)\n{\n LinkedList<Integer> output = new LinkedList<Integer>();\n if (this.bellmanParent[destination] == source) {\n output.addFirst(destination);\n output.addFirst(source);\n return output;\n }\n /*\n * Our source is only part of the subtree, and we requested a node beyond\n * its reach. Lets flag it so that the calling function knows to ignore this\n * result.\n */\n if (this.bellmanParent[destination] == destination) {\n output.addFirst(-1);\n return output;\n }\n output = this._findShortestPath(source, this.bellmanParent[destination]);\n output.addLast(destination);\n return output;\n}", "public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {\n\n int BOTH_DONE = 0;\n int LEFT_DONE = 1;\n int BOTH_PENDING = 2;\n\n Stack<Pair<TreeNode, Integer>> stack = new Stack<>();\n TreeNode LCA = null;\n stack.push(new Pair<>(root, BOTH_PENDING));\n\n while (!stack.isEmpty()) {\n Pair<TreeNode, Integer> topPair = stack.peek();\n if (topPair.second != BOTH_DONE) {\n //mark LCA on first entry, on back track , if reprocess then we'd send LCA incorrectly because\n //same p or q will be repeated when back tracking for example from left path\n if ((topPair.second == BOTH_PENDING) && (topPair.first == p || topPair.first == q)) {\n //node matched\n if (LCA != null) {\n return LCA;\n } else {\n LCA = topPair.first;\n }\n }\n\n //move left or right based on the state of the node\n TreeNode child;\n if (topPair.second == LEFT_DONE) {\n child = topPair.first.right;\n } else {\n child = topPair.first.left;\n }\n stack.pop();\n stack.push(new Pair<>(topPair.first, topPair.second - 1));\n if (child != null)\n stack.push(new Pair<>(child, BOTH_PENDING));\n\n } else {\n //if both childs visited, pop the element and move the LCA to the prior node which\n //was parent of the current node with LCA\n if (LCA == topPair.first) {\n stack.pop();\n LCA = stack.peek().first;\n } else {\n stack.pop();\n }\n }\n }\n return null;\n }", "public int minCost(int[][] distance) {\n Map<Index, Integer> minCostDP = new HashMap<>();\n Map<Index, Integer> parent = new HashMap<>();\n\n List<Set<Integer>> allSets;\n\n for (Set<Integer> set : allSets) {\n for (int currentVertex = 1; currentVertex < distance.length; currentVertex++) {\n if (set.contains(currentVertex)) continue;\n Index index = Index.createIndex(currentVertex,set);\n int minCost = Integer.MAX_VALUE;\n int minPrevVertex = 0;\n\n Set<Integer> copySet = new HashSet<>();\n for (int prevVertex : set) {\n int cost = distance[prevVertex][currentVertex] + getCost(copySet, prevVertex, minCostDP);\n }\n }\n }\n }", "public Set<? extends Position> findNearest(Position position, int k);", "@Override\n public List<node_data> shortestPath(int src, int dest) {\n reset();\n for (node_data node : G.getV()) {\n node.setWeight(Double.POSITIVE_INFINITY);\n }\n\n DWGraph_DS.Node currentNode = (DWGraph_DS.Node) G.getNode(src);\n currentNode.setWeight(0);\n PriorityQueue<node_data> unvisitedNodes = new PriorityQueue(G.nodeSize(), weightComperator);\n unvisitedNodes.addAll(G.getV());\n HashMap<Integer, node_data> parent = new HashMap<>();\n parent.put(src, null);\n\n while (currentNode.getWeight() != Double.POSITIVE_INFINITY) {\n if (G.getNode(dest).getTag() == 1) {\n break;\n }\n for (edge_data edge : G.getE(currentNode.getKey())) {\n DWGraph_DS.Node neighbor = (DWGraph_DS.Node) G.getNode(edge.getDest());\n double tmpWeight = currentNode.getWeight() + edge.getWeight();\n if (tmpWeight < neighbor.getWeight()) {\n neighbor.setWeight(tmpWeight);\n unvisitedNodes.remove(neighbor);\n unvisitedNodes.add(neighbor);\n parent.put(neighbor.getKey(), currentNode);\n }\n }\n currentNode.setTag(1);\n if(currentNode.getKey()==dest) break;\n unvisitedNodes.remove(currentNode);\n currentNode = (DWGraph_DS.Node) unvisitedNodes.poll();\n }\n /*\n Rebuild the path list\n */\n if (!parent.keySet().contains(dest)) return null;\n List<node_data> pathList = new ArrayList<>();\n currentNode = (DWGraph_DS.Node) G.getNode(dest);\n while (parent.get(currentNode.getKey()) != null) {\n pathList.add(currentNode);\n currentNode = (DWGraph_DS.Node) parent.get(currentNode.getKey());\n }\n Collections.reverse(pathList);\n return pathList;\n }", "public List<Node> computeDijkstraShortestPath(Node source, Node destination) {\n\n source.minDistance = 0.;\n PriorityQueue<Node> nodeQueue = new PriorityQueue<Node>();\n nodeQueue.add(source);\n\n int destinationGroup = destination._groupID;\n\n while (!nodeQueue.isEmpty()) {\n Node v = nodeQueue.poll();\n\n Log.i(\"bbb\", \"In dijsk node name \"+ v._waypointName);\n //Stop searching when reach the destination node\n\n\n if(destinationGroup!=0){\n\n if(v._groupID==destinationGroup){\n destination = navigationGraph.get(navigationGraph.size()-1).nodesInSubgraph.get(v._waypointID);\n Log.i(\"bbb\", \"destination is: \"+destination._waypointName);\n\n break;\n }\n\n }\n\n if (v._waypointID.equals(destination._waypointID))\n break;\n\n\n // Visit each edge that is adjacent to v\n for (Edge e : v._edges) {\n Node a = e.target;\n Log.i(\"bbb\", \"node a \"+a._waypointName);\n double weight = e.weight;\n double distanceThroughU = v.minDistance + weight;\n if (distanceThroughU < a.minDistance) {\n nodeQueue.remove(a);\n a.minDistance = distanceThroughU;\n a.previous = v;\n Log.i(\"bbb\", \"set previous\");\n nodeQueue.add(a);\n }\n }\n }\n\n Log.i(\"bbb\", \"destination is: \"+destination._waypointName);\n\n return getShortestPathToDestination(destination);\n }", "@SuppressWarnings(\"null\")\n\tpublic static void optimalRecursiveSolution (Node Tree, int target) {\n\t\tNode Closest = null;\n\t\tClosest.val = Integer.MAX_VALUE;\n\t\tNode ret = recursiveHelper(Tree, target, Closest);\n\t\tSystem.out.println(String.format(\"%d\", ret.val));\n\t}", "double treeNodeTargetFunctionValue(){\n\t\t\t//loop counter variable\n\t\t\tint i;\n\t\t\t\n\t\t\t//stores the cost\n\t\t\tdouble sum = 0.0;\n\n\t\t\tfor(i=0; i<this.n; i++){\n\t\t\t\t//stores the distance\n\t\t\t\tdouble distance = 0.0;\n\n\t\t\t\t//loop counter variable\n\t\t\t\tint l;\n\n\t\t\t\tfor(l=0;l<this.points[i].dimension;l++){\n\t\t\t\t\t//centroid coordinate of the point\n\t\t\t\t\tdouble centroidCoordinatePoint;\n\t\t\t\t\tif(this.points[i].weight != 0.0){\n\t\t\t\t\t\tcentroidCoordinatePoint = this.points[i].coordinates[l] / this.points[i].weight;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcentroidCoordinatePoint = this.points[i].coordinates[l];\n\t\t\t\t\t}\n\t\t\t\t\t//centroid coordinate of the centre\n\t\t\t\t\tdouble centroidCoordinateCentre;\n\t\t\t\t\tif(this.centre.weight != 0.0){\n\t\t\t\t\t\tcentroidCoordinateCentre = this.centre.coordinates[l] / this.centre.weight;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcentroidCoordinateCentre = this.centre.coordinates[l];\n\t\t\t\t\t}\n\t\t\t\t\tdistance += (centroidCoordinatePoint-centroidCoordinateCentre) * \n\t\t\t\t\t\t\t(centroidCoordinatePoint-centroidCoordinateCentre) ;\n\t\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tsum += distance*this.points[i].weight;\t\n\t\t\t}\n\t\t\treturn sum;\n\t\t}", "private static void dfsBribe(int n, List<Integer>[] ch, long[] w) {\n if (ch[n].size() == 0){\n In[n] = w[n];\n OutD[n] = Long.MAX_VALUE;\n OutU[n] = 0;\n }\n //recurrance case: non.leaf, do dfs for all subordinates then calculate In, OutUp & OutDown.\n else{\n for (int c:ch[n])\n dfsBribe(c, ch, w); //running once for each child thereby O(N)\n In[n] = w[n];\n for (int c:ch[n]){ //O(N) running time\n In[n] += OutU[c];\n OutU[n] += Math.min(In[c], OutD[c]);\n OutD[n] += Math.min(In[c], OutD[c]);\n }\n OutD[n] += delta(n, ch); //add delta for no in Children\n }\n\n }", "public static void main(String[] args) {\n addNode(3);\n Node ans = lowestCommonAncestorFast(root.left, root.left.right.right);\n System.out.print(ans.val);\n }", "public void floyd_warshall()\n{\n /*\n * We get the minimum tree again, but we allow cycles this time. This gives\n * us the complete tree, but with edges ranked by priority.\n */\n this.minimumTree = this._getKruskalTree(true);\n for (int loop = 0;\n loop < this.nVerts;\n loop++\n ) {\n this.bellman_ford(loop);\n }\n}", "private int getNearestNode(LatLng vic) {\n\t\tint node = 0;\n\t\tfor(int j=0; j<nodeList.size()-1; j++){\n\t\t\tdouble dist1 = getWeight(vic, nodeList.get(node));\n\t\t\tdouble dist2 = getWeight(vic, nodeList.get(j));\n\t\t\tif(dist1 > dist2){\n\t\t\t\tnode = j;\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}", "public Map<Node<T>, Cost> dijkstra(T start) throws NodeNotFoundException {\n Node<T> origin = findNode(start);\n Map<Node<T>, Cost> costs = new HashMap<>();\n List<Node<T>> alreadyVisited = new ArrayList<>();\n\n // Step 1 : Initialization\n // Set every cost to infinity, except for the starting summit which is set to 0\n for(Node<T> node : getNodes()) {\n if(origin.equals(node)) { costs.put(node, new Cost(0.0)); }\n else { costs.put(node, new Cost()); }\n }\n\n while(ArrayMethods.similarity(getNodes(), alreadyVisited) != order()) {\n // Step 2 : Taking the node with the smallest cost\n Node<T> reference = Cost.findMin(costs, alreadyVisited);\n\n // Step 3 : Updating the table with the costs from that node\n for(WeightedLink link : findLinks(reference.getData())) {\n Node<T> other = (Node<T>) link.getOther(reference);\n Cost oldCost = costs.get(other);\n double old = oldCost.getCost();\n double cost = link.getWeight() + costs.get(reference).getCost();\n\n costs.put(other, (cost < old) ? new Cost(cost, reference) : oldCost);\n }\n\n // Step 4 : Repeat with the smallest costing summit that wasn't visited already\n alreadyVisited.add(reference);\n }\n\n return costs;\n }", "public List<T> wantedNodesIterative(Predicate<T> p) {\n //PART 4 \n if(root == null){\n return null;\n }\n LinkedList<TreeNode<T>> stack = new LinkedList<>();\n stack.add(root);\n \n List<T> wantedNodes =new LinkedList<>();\n TreeNode<T> current;\n \n while(!stack.isEmpty()){\n current = stack.pop();\n if(p.check(current.data)){\n wantedNodes.add(current.data);\n }\n if(current.right != null){\n stack.addFirst(current.right);\n }\n if(current.left != null){\n stack.addFirst(current.left);\n }\n }\n return wantedNodes;\n }", "public Node pred(int time) {\n\t\tNode x = root;\n\t\tNode y = null;\n\t\twhile(x != null) {\n\t\t\tint tx = x.getTime();\n\t\t\tif (tx <= time) {\n\t\t\t\ty = x; // y points to the deepest node (yet found) that is bigger than k. Might be the predecessor.\n\t\t\t\tx = x.getRight();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tx = x.getLeft();\n\t\t\t}\n\t\t}\n\t\treturn y;\n\t}", "public void ids (String input, int limit)\r\n\t\t{\r\n\t\t\tNode root_ids= new Node (input);\r\n\t\t\tNode current = new Node(root_ids.getState());\r\n\t\t\t\r\n\t\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\tStack<Node> stack_dfs = new Stack<Node>();\r\n\t\t\t\r\n\t\t\tint nodes_popped = 0;\r\n\t\t\tint stack_max_size = 0;\r\n\t\t\tint stack_max_total = 0;\r\n\t\t\tint depth = 0;\r\n\t\t\t\r\n\t\t\tcurrent.cost = 0;\r\n\t\t\tcurrent.depth = 0;\r\n\t\t\t\r\n\t\t\tgoal_ids = isGoal(current.getState());\r\n\t\t\t\r\n\t\t\twhile(depth <= limit)\r\n\t\t\t{\r\n\t\t\t\tif (goal_ids == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Clear the visited array for backtracking purposes\r\n\t\t\t\tvisited.clear();\r\n\t\t\t\t\r\n\t\t\t\twhile(!goal_ids)\r\n\t\t\t\t{\r\n\t\t\t\t\tvisited.add(current.getState());\r\n\t\t\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\t\r\n\t\t\t\t\t// Depth limit check. This loop never runs if the node depth is greater then the limit\r\n\t\t\t\t\tif (current.getDepth() < limit)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (String a : children)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Repeated state check\r\n\t\t\t\t\t\t\tif (!stack_dfs.contains(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tstack_dfs.add(nino);\r\n\t\t\t\t\t\t\t\tstack_max_size++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (current.getDepth() >= limit - 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint copy = stack_max_size;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (copy > stack_max_total)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tstack_max_total = copy;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tdepth++;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// If there is no solution found at the depth limit, return no solution\r\n\t\t\t\t\tif (stack_dfs.empty() == true)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSolution.noSolution(limit);\t\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcurrent = stack_dfs.pop();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Set depth of node so it can be checked in next iteration\r\n\t\t\t\t\tcurrent.setDepth(current.parent.getDepth() + 1);\r\n\t\t\t\t\tnodes_popped++;\r\n\t\t\t\t\tstack_max_size--;\r\n\t\t\t\t\tgoal_ids = isGoal(current.getState());\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgoal_ids = false;\r\n\t\t\tSystem.out.println(\"IDS Solved!!\");\r\n\t\t\t\r\n\t\t\tif (stack_max_total > stack_max_size)\r\n\t\t\t{\r\n\t\t\t\tstack_max_size = stack_max_total;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSolution.performSolution(current, root_ids, nodes_popped, stack_max_size);\r\n\t\t}", "private int dfsInOrderIterativeSol(TreeNode root, int k) {\n // Corner Case\n if (root == null) {\n return 0;\n }\n\n Stack<TreeNode> stack = new Stack<>();\n TreeNode node = root;\n int countNum = 0;\n\n while (!stack.isEmpty() || node != null) {\n if (node != null) {\n stack.push(node); // just like the recursion\n node = node.left;\n } else {\n TreeNode curNode = stack.pop();\n countNum++;\n if (countNum == k) {\n return curNode.val;\n }\n node = curNode.right;\n }\n }\n return 0;\n\n // // push nodes till the left end\n // while (root != null) {\n // stack.push(root);\n // root = root.left;\n // }\n\n // while (k != 0) {\n // TreeNode curNode = stack.pop();\n // k -= 1;\n // if (k == 0) {\n // return curNode.val;\n // }\n\n // TreeNode rightNode = curNode.right;\n // // push the right node till the left end still!!!\n // while(rightNode != null) {\n // stack.push(rightNode);\n // rightNode = rightNode.left;\n // }\n // }\n\n // return 0; // never hit if k is valid and root is not null\n }", "private ProblemModel findCheapestNode(){\n\t\tProblemModel ret = unvisitedPM.peek();\n\t\t\n\t\tfor(ProblemModel p : unvisitedPM){ \n\t\t\t//f(s) = depth + cost to make this move\n\t\t\tif(p.getCost() + p.getDepth() <= ret.getCost() + ret.getDepth()) ret = p;\n\t\t}\n\t\tunvisitedPM.remove(ret);\n\t\treturn ret;\n\t}", "public void dijksra (Node v, Node w){\n v.distance = 0;\n v.parent = v;\n dijkstasQueue.add(v);\n\n int i = 0;\n while (dijkstasQueue.size() != 0){ //O(V), but because it runs by weight, the average runtime can be dropped down to O(log(V))\n if(w.known){\n return;\n }\n i++;\n\n Node t = dijkstasQueue.poll();\n if (t == null){\n System.out.println(\"Whoop went null\"); //should never happen\n return;\n }\n\n t.known = true;\n long s = System.currentTimeMillis();\n GraphNode l = adjNodeMap.get(t.name);\n GraphNode[] cons = l.getConnections();\n for(GraphNode c : cons){ //O(E), runs for every connection.\n Node j = nodeMap.get(c.id);\n if (j != null){\n if (!(j.known)){\n double cvw = getNodeWeight(t,j);\n if(t.distance + cvw < j.distance){\n j.distance = t.distance + cvw;\n j.parent = t;\n dijkstasQueue.add(j);\n }\n }\n }\n }\n long e = System.currentTimeMillis();\n }\n }", "public Node predecessor(Node target){\n\t\tif(target.getLeft() != null)\n\t\t\t//if have left child, max of left is predecessor\n\t\t\treturn treeMax(target);\n\t\tNode parent = target.getParent();\n\t\twhile(parent != null && parent.getRight() != target){\n\t\t\t//loop until curNode is right child (>) of parent\n\t\t\ttarget = parent;\n\t\t\tparent = target.parent;\n\t\t}\n\t\treturn parent; //if null means no successor\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(1);\n root.right = new TreeNode(4);\n root.left.right = new TreeNode(2);\n\n System.out.println(kthSmallest(root, 1));\n }", "public List<Node<E>> breadthFirst(Node<E> start){\n\n //set that will contain visited nodes\n HashSet<Node<E>> visited = new HashSet<>();\n\n // resulting nodes\n List<Node<E>> result = new ArrayList<>();\n\n //queue for traversal\n Queue<Node<E>> nodeList = new LinkedList<>();\n //check if the node exists in the graph\n\n if(start == null){\n throw new IllegalArgumentException(\"Node cannot be null\");\n }\n\n if(nodes.containsKey(start)){\n nodeList.add(start);\n visited.add(start);\n result.add(start);\n } else{\n throw new IllegalArgumentException(\"Node is not in the graph\");\n }\n\n //traverse through the queue\n while(!nodeList.isEmpty()){\n Node<E> curNode = nodeList.poll();\n\n //check if the node has been visited, if not add to the result\n if(!visited.contains(curNode)){\n result.add(curNode);\n }\n\n //add the node to visited\n visited.add(curNode);\n //get all the neighbors of the node and add to the queue\n nodes.get(curNode).forEach( neighbor -> {\n if(!visited.contains(neighbor)) {\n nodeList.add(neighbor);\n }\n });\n\n }\n\n return result;\n }", "public int getKthNodeFromEnd(int k){\n // [10 -> 20 -> 30 -> 40 -> 50]\n // k = 1(50) dist = 0;\n // k = 2(40) dist = 1\n\n if(isEmpty()) throw new IllegalStateException();\n\n int distance = k - 1;\n var pointerOne = first;\n var pointerSecond = first;\n\n for(int i = 0; i < distance; i++){\n if(pointerSecond.next != null)\n pointerSecond = pointerSecond.next;\n else\n throw new IllegalArgumentException();\n }\n\n while(pointerSecond.next != null){\n pointerOne = pointerOne.next;\n pointerSecond = pointerSecond.next;\n }\n\n return pointerOne.value;\n }", "DendrogramNode<T> getParent();", "private void searchForNearest(KdNode kdNode, Point2D p, RectHV rectangle) {\n int comparison;\n // 2 rectangles that will store the coordinates of the rectangles that are delimited by kdNode's children,\n // used in order to calculate the distance to them and see if it's worth looking down the path inside them as well\n // (i.e. if the distance from point p to the rectangle is less than the distance to an already established nearest)\n RectHV rectLeftBelow, rectRightAbove;\n\n if (kdNode.point.equals(p)) {\n // if the point we're looking at actually equals the query point, we return here,\n // as we can no longer find a distance lower than 0\n nearest = kdNode.point;\n return;\n }\n\n // if the point in the current node is closer to the searched node, we update nearest\n if (p.distanceSquaredTo(kdNode.point) < p.distanceSquaredTo(nearest))\n nearest = kdNode.point;\n\n if (kdNode.dimension) { // if this KdNode is vertical (root.dimension == true), then we have left/right rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n kdNode.point.x(), rectangle.ymax());\n rectRightAbove = new RectHV(kdNode.point.x(), rectangle.ymin(),\n rectangle.xmax(), rectangle.ymax());\n }\n else { // if this KdNode is horizontal (root.dimension == false), then we have below/above rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n rectangle.xmax(), kdNode.point.y());\n rectRightAbove = new RectHV(rectangle.xmin(), kdNode.point.y(),\n rectangle.xmax(), rectangle.ymax());\n }\n // we look at which rectangle is nearest to the query point, in order to go down that path first\n comparison = Double.compare(rectLeftBelow.distanceSquaredTo(p),\n rectRightAbove.distanceSquaredTo(p));\n\n if (comparison < 0) { // if distance to left/lower rectangle is lower than to right/upper\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n // if it's larger than to nearest, the distance to the other\n // rectangle will certainly be even larger, so we return here\n else return;\n }\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n // else return; // return statement not needed, if (comparison < 0) statement terminates here anyway\n }\n }\n else { // comparison < 0, the opposite situation holds: distance to right/upper rectangle is lower than to left/lower\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n else return;\n }\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n }\n\n }\n }", "public DSAQueue breadthFirstSearch(String start, String target)\n\t{\n\t\tif(!vertices.isEmpty())\n\t\t{\n\t\t\tDSAQueue queue = new DSAQueue();\n\t\t\tDSAStack visited = new DSAStack();\t//creates empty stack\n\t\t\tDSAGraphVertex vx = getVertex(start); //vertex to start on (root)\n\t\t\tDSAGraphVertex dest = getVertex(target); //vertex to start on (dest)\n\n\t\t\tclear(); //sets all visited on all vertices == false\n\t\t\tvx.setVisited(); // Marks root as visited\n\t\t\tqueue.enqueue(vx); //adds start point to queue\n\n\t\t\tbfs(vx, visited, queue, dest); //begin recursion\n\n\t\t\tqueue.enqueue(dest); //if successful adds destination to queue\n\n\t\t\treturn queue;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new NoSuchElementException(\"List is empty or start or end elements don't exist\");\n\t\t}\n\t}", "public static void computePaths(Vertex source){\n\t\tsource.minDistance=0;\n\t\t//visit each vertex u, always visiting vertex with smallest minDistance first\n\t\tPriorityQueue<Vertex> vertexQueue=new PriorityQueue<Vertex>();\n\t\tvertexQueue.add(source);\n\t\twhile(!vertexQueue.isEmpty()){\n\t\t\tVertex u = vertexQueue.poll();\n\t\t\tSystem.out.println(\"For: \"+u);\n\t\t\tfor (Edge e: u.adjacencies){\n\t\t\t\tVertex v = e.target;\n\t\t\t\tSystem.out.println(\"Checking: \"+u+\" -> \"+v);\n\t\t\t\tdouble weight=e.weight;\n\t\t\t\t//relax the edge (u,v)\n\t\t\t\tdouble distanceThroughU=u.minDistance+weight;\n\t\t\t\tif(distanceThroughU<v.minDistance){\n\t\t\t\t\tSystem.out.println(\"Updating minDistance to \"+distanceThroughU);\n\t\t\t\t\tv.minDistance=distanceThroughU;\n\t\t\t\t\tv.previous=u;\n\t\t\t\t\t//move the vertex v to the top of the queue\n\t\t\t\t\tvertexQueue.remove(v);\n\t\t\t\t\tvertexQueue.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void bfs(int nodeKey) {\n Queue<Integer> q = new LinkedList<>();\n // initialize all the nodes\n for (node_data node : G.getV())\n node.setTag(0);\n\n int currentNode = nodeKey;\n\n // iterate the graph and mark nodes that have been visited\n while (G.getNode(currentNode) != null) {\n for (edge_data edge : G.getE(currentNode)) {\n node_data dest = G.getNode(edge.getDest());\n if (dest.getTag() == 0) {\n q.add(dest.getKey());\n }\n G.getNode(currentNode).setTag(1);\n }\n if(q.peek()==null)\n currentNode=-1;\n else\n currentNode = q.poll();\n }\n }", "private void breadthFirstSearch(Node sourceNode, Node destinationNode, String path, HashSet<Character> visited) {\n // Create a list of nodes to visit (children of nodes)\n LinkedList<Node> nextToVisit = new LinkedList<>();\n // Add the first node to the list\n nextToVisit.add(sourceNode);\n\n // Traverse level by level by traversing to all of its children first\n while(!nextToVisit.isEmpty()) {\n Node node = nextToVisit.remove();\n // If its visited already, continue to the next child\n if(visited.contains(node.charId)) {\n continue;\n }\n // Mark the node as visited\n path += \"->\" + node.charId;\n visited.add(node.charId);\n // If destination is reached\n if(node == destinationNode) {\n paths.add(path);\n return;\n }\n // Add all of its children to the next node to visit\n for(Node children : node.adjacent) {\n nextToVisit.add(children);\n }\n }\n\n }", "public static ArrayList<GraphNode> getPathTo(\n GraphNode startNode,\n GraphNode targetNode,\n int optimizeFor\n ) {\n PriorityQueue<GraphNodeWrapper> openList = new PriorityQueue<>(new GraphNodeWrapperComparator(targetNode));\n HashSet<GraphNode> closedSet = new HashSet<>();\n HashMap<GraphNode, Float> distanceToStart = new HashMap<>();\n distanceToStart.put(startNode, 0.f);\n\n GraphNodeWrapper startNodeWrapper = new GraphNodeWrapper(startNode);\n openList.add(startNodeWrapper);\n\n GraphNodeDistance graphNodeDistance = new GraphNodeDistance(optimizeFor);\n\n do {\n GraphNodeWrapper currentNode = openList.poll();\n assert currentNode != null;\n\n if (currentNode.graphNode.equals(targetNode)) {\n return currentNode.toList();\n }\n\n closedSet.add(currentNode.graphNode);\n\n expandNode(currentNode, openList, closedSet, distanceToStart, targetNode, graphNodeDistance);\n } while (!openList.isEmpty());\n\n return null;\n }", "public static void bfs (String input)\r\n\t{\r\n\t\tNode root_bfs = new Node (input);\r\n\t\tNode current = new Node(root_bfs.getState());\r\n\t\t\r\n\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\tQueue<Node> queue_bfs = new LinkedList<Node>();\r\n\t\t\r\n\t\tint nodes_popped = 0;\r\n\t\tint queue_max_size = 0;\r\n\t\tint queue_size = 0;\r\n\t\tcurrent.cost = 0;\r\n\t\t\r\n\t\t// Initial check for goal state\r\n\t\tgoal_bfs = isGoal(current.getState());\r\n\t\t\r\n\t\twhile(!goal_bfs)\r\n\t\t{\r\n\t\t\t// Add the current node to the visited array\r\n\t\t\tvisited.add(current.getState());\r\n\t\t\t// Get the nodes children from the successor function\r\n\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\r\n\t\t\tfor (String a : children)\r\n\t\t\t{\r\n\t\t\t\t// State checking, don't add already visited nodes to the queue\r\n\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t// Create child node from the children array and add it to the current node\r\n\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Obtaining the path cost\r\n\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// State check and adding the child to the queue. Increasing size counter\r\n\t\t\t\t\tif (!queue_bfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue_bfs.add(nino);\r\n\t\t\t\t\t\tqueue_size++;\r\n\t\t\t\t\t}\r\n\t\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\t// Pop a node off the queue\r\n\t\t\tcurrent = queue_bfs.poll();\r\n\t\t\tnodes_popped++;\r\n\t\t\t\r\n\t\t\t// Added this because my queue size variable was always one off based on where my goal check is\r\n\t\t\tif (queue_size > queue_max_size)\r\n\t\t\t{\r\n\t\t\t\tqueue_max_size = queue_size;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Decrease queue size because a node has been popped and check for goal state\r\n\t\t\tqueue_size--;\r\n\t\t\tgoal_bfs = isGoal(current.getState());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Now that a solution has been found, set the boolean back to false for another run\r\n\t\tgoal_bfs = false;\r\n\t\tSystem.out.println(\"BFS Solved!!\");\r\n\t\t\r\n\t\t// Send metrics to be printed to the console\r\n\t\tSolution.performSolution(current, root_bfs, nodes_popped, queue_max_size);\r\n\t\t\t\r\n\t}", "private List<Path> expandExecution(Path input) {\n\t\tList<Path> childInputs = new ArrayList<>(); //store the paths generated from given path\n\t\t\n\t\t//search from the top node which have not been searched before\n\t\tfor(int j = input.bound; j < input.path.size() - 1; j++){\n\t\t\tdouble[] probabilityArray = cfg.getTransition_matrix().getRow(input.path.get(j));\n\t\t\tfor(int i = 0; i < probabilityArray.length; i++){\n\t\t\t\t//the node been visited before only have two situation:1.has been searched,2.the path contains it in the workList \n\t\t\t\tif(probabilityArray[i] > 0 && i != input.path.get(j + 1) && unvisited.contains(i)){\n\t\t\t\t\tList<Integer> tempPath = new ArrayList<>();\n\t\t\t\t\tfor(int index = 0; index < j + 1; index++)\n\t\t\t\t\t\ttempPath.add(input.path.get(index));\n\t\t\t\t\ttempPath.add(i);\n\t\t\t\t\t\n\t\t\t\t\tPath newInput = new Path(tempPath, j + 1);\n\t\t\t\t\tchildInputs.add(newInput);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn childInputs;\n\t}", "public TreeNode lowestCommonAncestor_1(TreeNode root, TreeNode p, TreeNode q){\n Deque<TreeNode> stack = new ArrayDeque<>();\n Map<TreeNode, TreeNode> parent = new HashMap<>();\n parent.put(root, null);\n stack.push(root);\n\n // Iterate until we find both the nodes p and q\n while(!parent.containsKey(p) || !parent.containsKey(q)){\n TreeNode node = stack.pop();\n if (node.left != null){\n parent.put(node.left, node);\n stack.push(node.left);\n }\n if (node.right != null){\n parent.put(node.right, node);\n stack.push(node.right);\n }\n }\n // Ancestors set() for node p\n Set<TreeNode> ancestors = new HashSet<>();\n // Process all ancestors for node p using parent pointers.\n while(p!=null){\n ancestors.add(p);\n p = parent.get(p);\n }\n // The first ancestors of q which appears in\n // p's ancestor set() is their lowest common ancestor\n while(!ancestors.contains(q))\n q = parent.get(q);\n return q;\n }", "static int downToZero(Node root) {\n /*\n * Write your code here.\n */\n Queue<Node> queue = new PriorityQueue<>();\n queue.add(root);\n int min = 100001;\n while (!queue.isEmpty()){\n Node current = queue.poll();\n if(current.value <= 4){\n if (current.value == 4){\n min = current.depth + 3;\n return min;\n }\n min = current.depth+current.value;\n return min;\n }\n Node toAdd1 = new Node(current.value-1, current.depth+1);\n queue.add(toAdd1);\n for(int i = 2; i<=Math.sqrt(current.value); i++){\n if(current.value%i==0){\n Node toAdd = new Node(current.value/i, current.depth+1);\n queue.add(toAdd);\n }\n }\n }\n return min;\n }", "private ArrayList<Vertex> dfs(boolean[] visited, Vertex start, Vertex target) {\n \n //TEST VALUES: if start/end are out of bounds of array of vertices\n if (start.getID() < 0) {\n return null;\n }\n \n if (target.getID() > arrayOfVertices.length) {\n return null;\n }\n \n \n //base case: if start = target, return start vertex right there.\n if (start == target) {\n solution.add(0, start);\n return solution;\n }\n \n //has this vertex been visited before? yes? then just return. if no, \n if (visited[start.getID()]) {\n return null;\n }\n \n //since it hasn't been visited before, mark it as visited\n visited[start.getID()] = true;\n \n //does it have kids? no? return.\n if (start.getDegree() == 0) {\n return null;\n }\n \n //create ArrayList of adjacent vertices to the given start\n ArrayList<Vertex> adjacents = start.getAdjacent();\n \n //go through its edges, for loop. to go through edges\n for (int i = 0; i < start.getDegree(); i++) {\n \n //(from testing)\n NavigateMaze.advance(start.getID(), adjacents.get(i).getID());\n \n //do the dfs; if it's not equal to null \n //(i.e. we found the target, then add it to path\n if (dfs(visited, adjacents.get(i), target) != null) {\n //then add to path\n solution.add(0, start); \n return solution;\n }\n \n //(from testing)\n else {\n NavigateMaze.backtrack(adjacents.get(i).getID(), start.getID());\n }\n \n } \n \n //return null\n return null;\n }", "public void siftDown( int k) \r\n {\r\n int v, j;\r\n \r\n v = h[k];\r\n while(k <= N/2)\r\n {\r\n j = 2k;\r\n if(j>N && dist[h[j]] > dist[h[j+1]])//If the node is > left child\r\n {\r\n ++j;//Increment child \r\n }\r\n if(dist[v] <= dist[h[j]])//If the parent is greater than the child\r\n {\r\n break;//Stop the system\r\n }\r\n h[k] = h[j];//If the parent is greater than the child, child is given parent pos\r\n\t\t\thPos[h[k]] = k;//Update pos of last child\r\n k=j;//Assign a new vertex pos\r\n }\r\n h[k] = v; //assign vertex for heap \r\n hPos[v] = k;//Update the vertex in hPos\r\n\t\t\r\n // code yourself --\r\n // must use hPos[] and dist[] arrays\r\n }", "public List<Node<E>> depthFirst(Node<E> start){\n\n //set that will contain visited nodes\n HashSet<Node<E>> visited = new HashSet<>();\n\n // resulting nodes\n List<Node<E>> result = new ArrayList<>();\n\n //stack for traversal\n Stack<Node<E>> nodeList = new Stack<>();\n //check if the node exists in the graph\n\n if(start == null){\n throw new IllegalArgumentException(\"Node cannot be null\");\n }\n\n if(nodes.containsKey(start)){\n nodeList.push(start);\n visited.add(start);\n result.add(start);\n } else{\n throw new IllegalArgumentException(\"Node is not in the graph\");\n }\n\n //traverse through the queue\n while(!nodeList.isEmpty()){\n Node<E> curNode = nodeList.pop();\n\n //check if the node has been visited, if not add to the result\n if(!visited.contains(curNode)){\n result.add(curNode);\n }\n\n //add the node to visited\n visited.add(curNode);\n //get all the neighbors of the node and add to the stack\n nodes.get(curNode).forEach( neighbor -> {\n if(!visited.contains(neighbor)) {\n nodeList.push(neighbor);\n }\n });\n\n }\n\n return result;\n }", "@Override\r\n public List<T> breadthFirstPath(T start, T end) {\r\n\r\n Vertex<T> startV = vertices.get(start);\r\n Vertex<T> endV = vertices.get(end);\r\n\r\n LinkedList<Vertex<T>> vertexList = new LinkedList<>();\r\n //Set<Vertex<T>> visited = new HashSet<>();\r\n ArrayList<Vertex<T>> visited = new ArrayList<>();\r\n\r\n LinkedList<Vertex<T>> pred = new LinkedList<>();\r\n int currIndex = 0;\r\n\r\n pred.add(null);\r\n\r\n vertexList.add(startV);\r\n visited.add(startV);\r\n\r\n LinkedList<T> path = new LinkedList<>();\r\n\r\n if (breadthFirstSearch(start, end) == false) {\r\n path = new LinkedList<>();\r\n return path;\r\n } else {\r\n while (vertexList.size() > 0) {\r\n Vertex<T> next = vertexList.poll();\r\n if(next == null){\r\n continue;\r\n }\r\n if (next == endV) {\r\n path.add(endV.getValue());\r\n break;\r\n }\r\n for (Vertex<T> neighbor : next.getNeighbors()) {\r\n if (!visited.contains(neighbor)) {\r\n pred.add(next);\r\n visited.add(neighbor);\r\n vertexList.add(neighbor);\r\n }\r\n }\r\n currIndex++;\r\n //path.add(next.getValue());\r\n\r\n }\r\n while (currIndex != 0) {\r\n Vertex<T> parent = pred.get(currIndex);\r\n path.add(parent.getValue());\r\n currIndex = visited.indexOf(parent);\r\n }\r\n }\r\n Collections.reverse(path);\r\n return path;\r\n }", "public void calcSP(Graph g, Vertex source){\n // Algorithm:\n // 1. Take the unvisited node with minimum weight.\n // 2. Visit all its neighbours.\n // 3. Update the distances for all the neighbours (In the Priority Queue).\n // Repeat the process till all the connected nodes are visited.\n\n // clear existing info\n// System.out.println(\"Calc SP from vertex:\" + source.name);\n g.resetMinDistance();\n source.minDistance = 0;\n PriorityQueue<Vertex> queue = new PriorityQueue<Vertex>();\n queue.add(source);\n\n while(!queue.isEmpty()){\n Vertex u = queue.poll();\n for(Edge neighbour:u.neighbours){\n// System.out.println(\"Scanning vector: \"+neighbour.target.name);\n Double newDist = u.minDistance+neighbour.weight;\n\n // get new shortest path, empty existing path info\n if(neighbour.target.minDistance>newDist){\n // Remove the node from the queue to update the distance value.\n queue.remove(neighbour.target);\n neighbour.target.minDistance = newDist;\n\n // Take the path visited till now and add the new node.s\n neighbour.target.path = new ArrayList<>(u.path);\n neighbour.target.path.add(u);\n// System.out.println(\"Path\");\n// for (Vertex vv: neighbour.target.path) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n\n// System.out.println(\"Paths\");\n neighbour.target.pathCnt = 0;\n neighbour.target.paths = new ArrayList<ArrayList<Vertex>>();\n if (u.paths.size() == 0) {\n ArrayList<Vertex> p = new ArrayList<Vertex>();\n p.add(u);\n neighbour.target.paths.add(p);\n neighbour.target.pathCnt++;\n } else {\n for (ArrayList<Vertex> p : u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n// for (Vertex vv : p1) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n }\n\n //Reenter the node with new distance.\n queue.add(neighbour.target);\n }\n // get equal cost path, add into path list\n else if (neighbour.target.minDistance == newDist) {\n queue.remove(neighbour.target);\n for(ArrayList<Vertex> p: u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n queue.add(neighbour.target);\n }\n }\n }\n }", "static void iterativeDfs(Node startingNode) {\n Set<Node> markedAsVisited = new HashSet<>();\n\n // creates a stack for piling up the nodes to visit\n ArrayDeque<Node> toBeVisited = new ArrayDeque<>();\n\n // sets the starting node as to be visited\n toBeVisited.push(startingNode);\n\n // adds the starting node to the set of marked as visited nodes\n markedAsVisited.add(startingNode);\n\n // while there nodes to visit\n while (!toBeVisited.isEmpty()) {\n\n // gets the current node\n Node current = toBeVisited.pop();\n\n // processes the node\n System.out.print(\"Node \" + current.val + \", \");\n\n // loops over the neighbours of the current node\n for (Node neighbour: current.neighbours) {\n\n // if the neighbour has not been already visited\n if (! markedAsVisited.contains(neighbour)) {\n\n // adds the neighbour to the ones to be visited\n toBeVisited.push(neighbour);\n\n // adds the neighbour to the set of marked as visited nodes\n markedAsVisited.add(neighbour);\n }\n }\n }\n }" ]
[ "0.6578503", "0.5975008", "0.5951113", "0.58189064", "0.5761184", "0.57286555", "0.5710582", "0.5661377", "0.5653593", "0.56292826", "0.56186", "0.56095827", "0.56026655", "0.55927426", "0.5582312", "0.55645597", "0.5533985", "0.55206543", "0.55204403", "0.55188006", "0.5518394", "0.5505971", "0.54975855", "0.54910046", "0.54887515", "0.5481783", "0.5474429", "0.5454641", "0.54542047", "0.54429924", "0.5412832", "0.54120547", "0.54061675", "0.54022616", "0.5389408", "0.53795224", "0.5378135", "0.5363869", "0.533396", "0.5333493", "0.53325355", "0.5324512", "0.5317478", "0.5314685", "0.5312334", "0.53111583", "0.53104514", "0.53084135", "0.53076756", "0.53016657", "0.52864665", "0.5284964", "0.5284635", "0.52831", "0.5276201", "0.5275592", "0.5273473", "0.52712613", "0.5269892", "0.52650815", "0.52632403", "0.52601194", "0.5247635", "0.5231202", "0.5226239", "0.52207565", "0.52152467", "0.5214697", "0.5204154", "0.5203436", "0.51925635", "0.5183981", "0.5176757", "0.5175723", "0.51739955", "0.5168465", "0.5157185", "0.5146113", "0.5144231", "0.5138001", "0.5136247", "0.5134663", "0.5133952", "0.5133499", "0.51316583", "0.5130808", "0.5129027", "0.512694", "0.51239973", "0.51224846", "0.5120368", "0.51182115", "0.51176834", "0.5117228", "0.51143664", "0.5113541", "0.5108903", "0.51087403", "0.5105813", "0.51034087" ]
0.68864655
0
Create an array to store objects of class Building
public static void main(String[] args) { Building building[] = new Building[5]; //Populate the array building[0] = new Building("MSB",3,4,"white"); building[1] = new Building("STM",5,4,"white"); building[2] = new Building("SBS",6,4,"blue"); building[3] = new Building("SLS",2,5,"red"); building[4] = new Building("FIT",1,8,"white"); //Invoking display method on each object in the array System.out.println("<---------- Start of Report ------------>"); System.out.println(" "); for(int i = 0; i<building.length; i++) { building[i].printReport(); System.out.println(" "); } System.out.println("<---------- End of Report ------------>"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BuildingList() {\n Building temp = new Building(1);\n temp.createSubAreas(6);\n temp.setSystemPass(\"0000\");\n URL url = this.getClass().getClassLoader()\n .getResource(\"singleHouse.jpg\");\n temp.setImage(url);\n\n buildings.add(temp);\n temp = new Building(2);\n url = this.getClass().getClassLoader()\n .getResource(\"commercial.jpg\");\n temp.setImage(url);\n buildings.add(temp);\n }", "public void generateRooms(){ //TODO it's public just for testing\n rooms = new ArrayList<>();\n for(Color color : roomsToBuild)\n rooms.add(new Room(color));\n }", "public void generateBuildings(MainApplication app){\n\t\tfor (int i = 0; i < TOTAL_BUILDINGS; i++) {\n\t\t\tthis.buildings[i] = new Building(app, 290 + i*125, BUILDING_Y_LOCATION, BUILDING_SPRITE, BUILDING_SPRITE_DESTROYED);\n\t\t}\n\t}", "private void getAllBuildings(JSONArray myjsonArray) {\r\n try {\r\n for(int j=0; j<myjsonArray.length(); j++) {\r\n JSONObject o = myjsonArray.getJSONObject(j);\r\n Build b = new Build(o.getString(\"description\"),Double.parseDouble(o.getString(\"latitude\")),\r\n Double.parseDouble( o.getString(\"longitude\")), o.getString(\"name\"));\r\n allBuildings_.add(b);\r\n }\r\n } catch (JSONException e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n public void create_building(ArrayList bulding){\n House house = new House(Adress.RUE_DE_LA_PAIX);\n System.out.println(\"Vous venez de créer une maison\");\n bulding.add(house);\n }", "public ClassType[] getArray(){\n\t\t\tClassType[] temp = new ClassType[count];\n\t\t\tfor (int i = 0; i < count; i++){\n\t\t\t\ttemp[i] = new ClassType(anArray[i]);\n\t\t\t}\n\t\t\treturn temp;\n\t\t}", "public static Product[] createOrder()\n {\n Order order = new Order();\n Random r = new Random();\n int x;\n order.orderNumber++;\n int itemCount = 1 + r.nextInt(50);\n order.orderContents = new Product[itemCount];\n for (x = 0 ; x < itemCount; x++){\n Product item = productMaker.generateProduct();\n order.orderContents[x] = item;\n }\n\n return order.orderContents;\n\n }", "private void buildBoats() {\n\t\tboats.add(new Boat(\"red\"));\n\t\tboats.add(new Boat(\"pink\"));\n\t\tboats.add(new Boat(\"blue\"));\n\t\tboats.add(new Boat(\"yellow\"));\n\t\tboats.add(new Boat(\"orange\"));\n\t\tboats.add(new Boat(\"green\"));\n\t\tboats.add(new Boat(\"purple\"));\n\t}", "public void constructArray(){\n\t\tfor (int col = 0; col < cols; col++){\n\t\t\tfor (int row = 0; row < rows; row++){\n\t\t\t\tmap[col][row] = new Pixel();\n\t\t\t}\n\t\t}\n\t}", "public static Array<Gizmo> makeGizmosFor (AComponent component) {\n Array<Gizmo> list = new Array<>();\n if(map.containsKey(component.getClass())) {\n Array<Class<? extends Gizmo>> classes = map.get(component.getClass());\n\n for(Class clazz: classes) {\n try {\n Gizmo instance = (Gizmo) ClassReflection.newInstance(clazz);\n list.add(instance);\n } catch (ReflectionException e) {\n return list;\n }\n }\n }\n\n return list;\n }", "public abstract Animal[] createGeneration (int count, Animal[] lastGeneration);", "public void inicialisation(){\r\n\t\t\r\n\t\tgoods = new AutoParts[0];\r\n\t\tclient = new Client[0];\r\n\t\t\r\n\t\tshop = new Shopping[0];\r\n\t\tsale = new Sale[0];\r\n\t\ttransaction = new Document[0];\r\n\t\t\r\n\t\tbalancesAutoParts = new BalancesAutoParts[0];\r\n\t\t\r\n\t\tprices = new Prices[0];\r\n\t\t\r\n\t\tagriment = new Agreement[0];\r\n\t\t\r\n\t}", "public Grid() { //Constructs a new grid and fills it with Blank game objects.\r\n\t\tthis.grid = new GameObject[10][10];\r\n\t\tthis.aliveShips = new Ships[4];\r\n\t\tfor (int i = 0; i < this.grid.length; i++) {\r\n\t\t\tfor (int j = 0; j < this.grid[i].length; j++) {\r\n\t\t\t\tthis.grid[i][j] = new Blank(i,j);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public List<Unit> build() {\n return units;\n }", "public ArrayList<String> getObjects(){\n ArrayList<String> objs = new ArrayList<>();\n for (int i = 0; i < field.length; i++){\n objs.add(\"Asteroid\");\n }\n return objs;\n }", "abstract Object build();", "Object build();", "private void getSurvivor() {\r\n survivors = new Survivor[childNum + teacherNum + soldierNum];\r\n int i = 0;\r\n\r\n // Add Child objects\r\n for (i = 0; i < childNum; i++) {\r\n survivors[i] = new Child();\r\n\t\t}\r\n\r\n // Add Teacher objects\r\n for (; i < childNum + teacherNum; i++) {\r\n survivors[i] = new Teacher();\r\n\t\t}\r\n\r\n // Add Soldier objects\r\n for (; i < childNum + teacherNum + soldierNum; i++) {\r\n survivors[i] = new Soldier();\r\n\t\t}\r\n }", "public static MasterCoder[] maker(Grid grid) {\n\n\n MasterCoder[] masterCoders = new MasterCoder[MasterCoderType.values().length];\n\n for (int i = 0; i < masterCoders.length; i++) {\n\n masterCoders[i] = new MasterCoder(MasterCoderType.values()[i], grid.makeGridPosition(MasterCoderType.values()[i].getRepresentable()));\n }\n\n return masterCoders;\n }", "private static String [] init(String className, TypeTree tree) {\n // Use a Linked to avoid resizing.\n Collection<String> types = new LinkedList<String>();\n String [] typearray;\n\t if (className.equals(EntryRep.matchAnyClassName())) {\n\t\t// handle \"match any\" specially\" -- search from ROOT\n\t\t// Simplification suggested by \n\t\t// Lutz Birkhahn <lutz.birkhahn@GMX.DE>\n\t\tclassName = ROOT;\n\t } else {\n\t\t// add this class\n\t\ttypes.add(className);\n\t }\n\n\t // add all subclasses\n\t walkTree(tree.classSet(className), types, tree);\n\n\t // Convert it to an array and then randomize\n\t typearray = types.toArray(new String[types.size()]);\n\t int randnum = 0;\n\t String tmpobj = null;\n int length = typearray.length;\n\t for (int i = 0; i < length; i++) {\n\t\trandnum = numgen.nextInt(length - i);\n\t\ttmpobj = typearray[i];\n\t\ttypearray[i] = typearray[randnum];\n\t\ttypearray[randnum] = tmpobj;\n\t }\n return typearray;\n\t}", "public GameBoard(){\r\n boardCells = new GameCell[NUMBER_OF_CELLS];\r\n for( int i= 0; i< NUMBER_OF_CELLS; i++ ){\r\n boardCells[i] = new GameCell(i);//\r\n }\r\n }", "private void createInstances()\n {\n Room EnchantedForest, IdyllicGlade, GumdropHill, DenseWoods, VolcanoHell, SecretHotSpring, MagmaChamber, MysteriousCloud, SkyParadise, Cirrostratus, Nimbostratus, Stratocumulus, WaterTemple, Whirlpool, EyeoftheStorm, BossQuarters, Portal;\n \n random = new Random();\n allrooms = new ArrayList<Room>();\n \n // create the rooms providing an ID to be passed into the room constructor\n EnchantedForest = new EnchantedForestRoom();\n allrooms.add(EnchantedForest);\n IdyllicGlade = new IdyllicGladeRoom();\n allrooms.add(IdyllicGlade);\n GumdropHill = new GumdropHillRoom();\n allrooms.add(GumdropHill);\n DenseWoods = new DenseWoodsRoom();\n allrooms.add(DenseWoods);\n VolcanoHell = new VolcanoHellRoom();\n allrooms.add(VolcanoHell);\n SecretHotSpring = new SecretHotSpringRoom();\n allrooms.add(SecretHotSpring);\n MagmaChamber = new MagmaChamberRoom();\n allrooms.add(MagmaChamber);\n MysteriousCloud = new MysteriousCloudRoom();\n allrooms.add(MysteriousCloud);\n SkyParadise = new SkyParadiseRoom();\n allrooms.add(SkyParadise);\n Cirrostratus = new CirrostratusRoom();\n allrooms.add(Cirrostratus);\n Nimbostratus = new NimbostratusRoom();\n allrooms.add(Nimbostratus);\n Stratocumulus = new StratocumulusRoom();\n allrooms.add(Stratocumulus);\n WaterTemple = new WaterTempleRoom();\n allrooms.add(WaterTemple);\n Whirlpool = new WhirlpoolRoom();\n allrooms.add(Whirlpool);\n EyeoftheStorm = new EyeoftheStormRoom();\n allrooms.add(EyeoftheStorm);\n BossQuarters = new BossQuartersRoom(); \n allrooms.add(BossQuarters);\n Portal = new PortalRoom();\n \n \n // initialise room exits, items and creatures\n EnchantedForest.setExit(\"east\", IdyllicGlade);\n EnchantedForest.setExit(\"west\", GumdropHill);\n EnchantedForest.setExit(\"south\", DenseWoods);\n \n IdyllicGlade.setExit(\"west\", EnchantedForest);\n \n GumdropHill.setExit(\"down\", EnchantedForest);\n GumdropHill.setExit(\"up\", MysteriousCloud);\n\n DenseWoods.setExit(\"north\", EnchantedForest);\n DenseWoods.setExit(\"south\", VolcanoHell);\n \n MagmaChamber.setExit(\"north\",VolcanoHell);\n \n VolcanoHell.setExit(\"east\", SecretHotSpring);\n VolcanoHell.setExit(\"north\", DenseWoods);\n VolcanoHell.setExit(\"west\", MysteriousCloud);\n VolcanoHell.setExit(\"south\", MagmaChamber);\n \n SecretHotSpring.setExit(\"west\", VolcanoHell);\n \n MysteriousCloud.setExit(\"west\", VolcanoHell);\n MysteriousCloud.setExit(\"in\", Portal);\n MysteriousCloud.setExit(\"up\", SkyParadise);\n \n SkyParadise.setExit(\"down\", MysteriousCloud);\n SkyParadise.setExit(\"up\", Cirrostratus);\n SkyParadise.setExit(\"east\", Nimbostratus);\n \n Cirrostratus.setExit(\"north\", SkyParadise);\n Cirrostratus.setExit(\"down\", WaterTemple);\n \n Nimbostratus.setExit(\"west\", SkyParadise);\n Nimbostratus.setExit(\"east\", Stratocumulus);\n \n Stratocumulus.setExit(\"west\", Nimbostratus);\n Stratocumulus.setExit(\"down\", WaterTemple);\n \n WaterTemple.setExit(\"up\",Stratocumulus);\n WaterTemple.setExit(\"high\", Cirrostratus);\n WaterTemple.setExit(\"down\", Whirlpool);\n WaterTemple.setExit(\"in\", BossQuarters);\n \n Whirlpool.setExit(\"up\", WaterTemple);\n Whirlpool.setExit(\"down\", EyeoftheStorm);\n \n EyeoftheStorm.setExit(\"up\", Whirlpool);\n EyeoftheStorm.setExit(\"in\", BossQuarters);\n \n BossQuarters.setExit(\"out\", WaterTemple);\n \n currentRoom = EnchantedForest; \n }", "public Floor(){\n populateRooms();\n level = new Room[5][5];\n }", "public abstract Object build();", "public void addGameObjects() {\n\t\tint baseObject = 4 + random.nextInt(5);\n\t\tint energyDroneObject = 2+ random.nextInt(5);\n\t\t\n\t\tfor (int i = 1; i < baseObject; i++) {\n\t\t\tgameObjects.add(new Bases(i));\n\t\t\t baseCount++;\n\t\t}\n\t\tfor (int i = 0; i < energyDroneObject; i++) {\n\t\t\tgameObjects.add(new EnergyStation());\n\t\t\tenergyStationCount++;\n\t\t}\n\t\tfor (int i = 0; i < energyDroneObject ; i++) {\n\t\t\tgameObjects.add(new Drone());\n\t\t\tdroneCount++;\n\t\t}\n\t\tgameObjects.add(new Cyborg());\n\t\tcyborgCount++;\n\t}", "@Override\r\n\tpublic void buildImpl() {\n\t\tint nbLasers =(int)Math.ceil((double)lanesPerLink.length / (double)linksPerLaser);\r\n\t\tlasers = new Laser[nbLasers];\r\n\t\tpoweredChannelForLaserI = new int[nbLasers];\r\n\t\tpoweredHorizonForLaserI = new double[nbLasers];\r\n\t\tcanBeExtended = new boolean[nbLasers];\r\n\t\tboolean timeLine = lue.isWithTimeLine();\r\n\t\tfor (int i = 0; i < nbLasers ; i++) {\r\n\t\t\tlasers[i] = laserTemplate.getCopy(i, nbLasers, timeLine);\r\n\t\t\tlasers[i].setLinkUtilisationExperiment(lue);\r\n\t\t}\r\n\t}", "public OccList()\n {\n int capacity = 8;\n data = new Occ[capacity];\n // initialize data with empty occ\n for (int i=0; i<capacity; i++) data[i] = new Occ(); \n }", "public static void init() {\n buildings = new HashMap<Long, JSONObject>();\n arr = new ArrayList();\n buildingOfRoom = new HashMap<Long, Long>();\n }", "public Object build();", "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 List<Brick> build() {\n\t\treturn this.mapBuilder.build();\n\t}", "public EmployeeWageBuilder() {\n\t\tcompanyEmpWageArrayList = new ArrayList<>();\n\t\tcompanyEmpWageMap = new HashMap<>();\n\n\tprivate int numOfCompany = 0;\n\tprivate CompanyEmpWage[] companyEmpWageArray;\n\tprivate ArrayList<CompanyEmpWage> companyEmpWageArrayList;\n\n\n\t// created array of type CompanyEmpWage\n\tpublic EmployeeWageBuilder() {\n\t\tcompanyEmpWageArray = new CompanyEmpWage[5];\n\n\t\tcompanyEmpWageArrayList = new ArrayList<>();\n\n\n\t}", "Array createArray();", "T[] getObjects() {\n\t\treturn this.array;\n\t}", "@Override\n public Object[] createRow() {\n ObjectDescriptor.TypeObject newTypeObjectInstance = ObjectDescriptor.newInstance();\n List<PropertyDescriptor> descriptors = typeObjectDescriptor.getObjectProperties();\n InitValuesFiller.fill(newTypeObjectInstance, descriptors);\n\n return new Object[]{ StringUtils.EMPTY, newTypeObjectInstance };\n }", "public ArrayList<Building> getBuildings() {\n \treturn buildings;\t\n }", "public static SortBuilder[] allInstances() {\n \t\treturn (SortBuilder[]) allInstances.toArray(new SortBuilder[allInstances.size()]);\n \t}", "public Cbuilding() { }", "protected List<FloorDef> genEntities() {\n List<FloorDef> list = new ArrayList<>();\n\n // MUST ADD THE WORK IDS AFTER\n\n list.add(new FloorDef(1, 10, 7001));\n list.add(new FloorDef(2, 3, 7002));\n list.add(new FloorDef(3, 10, 7003));\n list.add(new FloorDef(4, 0, 7004));\n\n //int[] workIDs = new int[]{};\n\n //for (int i = 0; i < workIDs.length)\n\n return list;\n }", "public ZYArraySet(){\n elements = (ElementType[])new Object[DEFAULT_INIT_LENGTH];\n }", "private Array(Builder builder) {\n super(builder);\n }", "public ArrayList<Genome_ga> makeGenomeList(int length){\n\t\tArrayList<Genome_ga> genomelist = new ArrayList<Genome_ga>();\r\n\t\tfor(int i =0; i<length;i++) {\r\n\t\t\tgenomelist.add(make1Genome());\r\n\t\t}\r\n\r\n\t\tgenomelist = evg.evalGenomeList(genomelist);\r\n\r\n\t\treturn genomelist;\r\n\t}", "private void createBin(int size) \n\t{\n\t// create an array of the appropriate type\n\tfBin = (Object[]) Array.newInstance(fClass, size);\t\n\t}", "public static SpaceShip[] createSpaceShips(String[] args) {\n \t\n \tSpaceShip[] spaceShips = new SpaceShip[args.length];\n \tint index = 0; // The index where each new SpaceShip object will be located on array. Start with 0\n \t\t\t\t // grows by 1 after each SpaceShip is added.\n \t\n for (String arg : args){\n \t// For each argument, check the requested SpaceShip type and add to spaceShips array the right\n \t// type.\n \tswitch (arg) {\n \t\tcase HUMAN:\n \t\t\tspaceShips[index] = new Human();\n \t\t\tbreak;\n \t\t\n \t\tcase RUNNER:\n \t\t\tspaceShips[index] = new Runner();\n \t\t\tbreak;\n \t\t\t\n \t\tcase BASHER:\n \t\t\tspaceShips[index] = new Basher();\n \t\t\tbreak;\n \t\t\t\n \t\tcase AGGRESSIVE:\n \t\t\tspaceShips[index] = new Aggressive();\n \t\t\tbreak;\n \t\t\t\n \t\tcase DRUNKARD:\n \t\t\tspaceShips[index] = new Drunkard();\n \t\t\tbreak;\n \t\t\t\n \t\tcase SPECIAL:\n \t\t\tspaceShips[index] = new Special();\n \t\t\tbreak;\n \t}\n \t\n \tindex++;\n }\n \n return spaceShips;\n }", "public World(double width, double height) {\n this.width = width;\n this.height = height;\n\n\n shapes = new Shape[3]; // an array of references (change to non-zero size)\n // Create the actual Shape objects (sub types)\n // ....\n\n shapes[0] = new Line(50,100,50,50, Color.BLUE);\n shapes[1] = new Circle(75,75,30,Color.BLACK);\n shapes[2] = new Rectangle(40,50,40,40,Color.GREEN);\n\n\n }", "public void initializePopulation(){\n\t\t// create the population\n\t\tfor(int i = 0; i < POPULATION_SIZE; i++){\n\t\t\t// get a random length for the building sequence\n\t\t\tint randArraySize = randomGenerator.nextInt(possiblePieces.length-1)+1;\n\t\t\t\n\t\t\tBuildingPiece[] pieceSequence = new BuildingPiece[randArraySize];\n\t\t\tfor(int j = 0; j < randArraySize; j++){\n\t\t\t\t// get a random possible piece and insert it into the sequence\n\t\t\t\tint randIndex = randomGenerator.nextInt(possiblePieces.length);\n\t\t\t\tpieceSequence[j] = possiblePieces[randIndex];\n\t\t\t}\n\t\t\t\n\t\t\t/* add a new number sequence with the newly created \n\t\t\t * sequence from the input */\n\t\t\tpopulation.add(new Building(pieceSequence, generation, possiblePieces));\n\t\t}\n\t}", "public void addBuildables(){\n this.allBuildables.add(new Nexus());\n this.allBuildables.add(new Pylon());\n this.allBuildables.add(new Assimilator());\n this.allBuildables.add(new Gateway());\n this.allBuildables.add(new CyberneticsCore());\n this.allBuildables.add(new RoboticsFacility());\n this.allBuildables.add(new Stargate());\n this.allBuildables.add(new TwilightCouncil());\n this.allBuildables.add(new TemplarArchives());\n this.allBuildables.add(new DarkShrine());\n this.allBuildables.add(new RoboticsBay());\n this.allBuildables.add(new FleetBeacon());\n this.allBuildables.add(new Probe());\n this.allBuildables.add(new Zealot());\n this.allBuildables.add(new Stalker());\n this.allBuildables.add(new Sentry());\n this.allBuildables.add(new Observer());\n this.allBuildables.add(new Immortal());\n this.allBuildables.add(new Phoenix());\n this.allBuildables.add(new VoidRay());\n this.allBuildables.add(new Colossus());\n this.allBuildables.add(new HighTemplar());\n this.allBuildables.add(new DarkTemplar());\n this.allBuildables.add(new Carrier());\n }", "private Object createArray(Class<?> clazz)\n\t{\n\t\tObject mockValue;\n\t\tClass<?> componentType = clazz.getComponentType();\n\t\tmockValue = createInstanceOfType(componentType);\n\t\tObject array = Array.newInstance(componentType, MOCK_ARRAY_SIZE);\n\t\tfor (int ctr = 0; ctr < MOCK_ARRAY_SIZE; ctr++)\n\t\t{\n\t\t\tArray.set(array, ctr, mockValue);\n\t\t}\n\t\tmockValue = array;\n\t\treturn mockValue;\n\t}", "@Override\n public List<Building> allBuildings() {\n return dao.all(Building.class);\n }", "private Complejo[] crearComplejos(double[][] numeros) {\n\t\tComplejo[] complejos = new Complejo[numeros.length];\n\t\tfor (int i = 0; i < numeros.length;i++) {\n\t\t\tcomplejos[i] = new Complejo(numeros[i][0],numeros[i][1]);\n\t\t}\n\t\treturn complejos;\n\t}", "public Structure[] getBuildingsOnStage(){\n\t\treturn this.buildings;\n\t}", "public BuildHistory(){\n buildHistory = new ArrayList<Build>();\n }", "public Driver() {\r\n\t\tShoe shoes[] = new Shoe[10]; //Array of ten shoes\r\n\t}", "Object[] getChildArray();", "public Building(String[] line){\n setId(Integer.parseInt(line[0]));\n setRank(Integer.parseInt(line[1]));\n setName(line[2]);\n setCity(line[3]);\n setCountry(line[4]);\n setHeight_m(Double.parseDouble(line[5]));\n setHeight_ft(Double.parseDouble(line[6]));\n setFloors(line[7]);\n setBuild(line[8]);\n setArchitect(line[9]);\n setArchitectual_style(line[10]);\n setCost(line[11]);\n setMaterial(line[12]);\n setLongitude(line[13]);\n setLatitude(line[14]);\n // setImage(line[15]);\n\n }", "public Bag() {\n\t\tinstances = new ArrayList<double[]>();\n\t\tname = \"\";\n\t}", "static List<Shape> createShapeArray(){\n return Arrays.asList(new Rectangle(new Point(0,0),new Point(0,4),new Point(2,4), new Point(2,0)),\n new Rectangle(new Point(0,0),new Point(0,2),new Point(2,2), new Point(2,0)),\n new Rectangle(new Point(0,0),new Point(0,3),new Point(2,3), new Point(2,0)),\n new Circle(new Point(0,0),new Point(0,1)),\n new Circle(new Point(1,0),new Point(1,4)),\n new Circle(new Point(1,0),new Point(0,2)),\n new Triangle(new Point(0,0),new Point(0,2),new Point(2,0)),\n new Triangle(new Point(0,0),new Point(0,4),new Point(4,0)),\n new Triangle(new Point(0,0),new Point(0,1),new Point(1,0)));\n\n }", "public void crearAtracciones(){\n \n //Añado atracciones tipo A\n for (int i = 0; i < 4 ; i++){\n Atraccion atraccion = new A();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo B\n for (int i = 0; i < 6 ; i++){\n Atraccion atraccion = new B();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo C\n for (int i = 0; i < 4 ; i++){\n Atraccion atraccion = new C();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo D\n for (int i = 0; i < 3 ; i++){\n Atraccion atraccion = new D();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo E\n for (int i = 0; i < 7 ; i++){\n Atraccion atraccion = new E();\n atracciones.add(atraccion);\n }\n \n }", "public Building() {\n\t}", "public void createAnimals() {\n\t\tanimals = new Animal[noAnimals];\n\n\t\tfor (int i = 0; i < noAnimals; i++) {\n\t\t\tanimals[i] = new Animal(noAnimals);\n\t\t\tanimals[i].setDiffCo(diffCo[i]);\n\t\t\tanimals[i].setDiffusionRate(diffusionRate[i]);\n animals[i].initiateDensities(getIo().getNeighbours().length,getIo().getNeighbours()[0].length);\n\t\t}\n\t\n\t\t animals[0].setName(\"Hare\"); \n\t\t animals[1].setName(\"Puma\");\n\t}", "private void getZombie() {\r\n zombies = new Zombie[cInfectedNum + tankNum];\r\n int i = 0;\r\n\r\n // Add CommonInfected objects\r\n for (i = 0; i < cInfectedNum; i++) {\r\n zombies[i] = new CommonInfected();\r\n\t\t}\r\n\r\n // Add Tank objects\r\n for (; i < cInfectedNum + tankNum; i++) {\r\n zombies[i] = new Tank();\r\n\t\t}\r\n }", "private static Image[][] getBuildings(int factionNum)\n\t{\n\t\tString begin = buildingDirectory;\n\t\tif (factionNum == Human.FACTION_NUM)\n\t\t\tbegin += \"human_\";\n\t\telse if (factionNum == Swarm.FACTION_NUM)\n\t\t\tbegin += \"swarm_\";\n\t\telse if (factionNum == MechStorm.FACTION_NUM)\n\t\t\tbegin += \"mech_\";\n\t\tImage[][] buildingSprites = new Image[2][8];\n\t\tfor (int buildType = 0; buildType < 8; buildType++) {\n\t\t\ttry {\n\t\t\t\tbuildingSprites[0][buildType] = ImageIO.read(new File(begin + buildType + \".png\"));\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\t\t}\n\t\tfor (int buildType = 0; buildType < 8; buildType++) {\n\t\t\ttry {\n\t\t\t\tbuildingSprites[1][buildType] = ImageIO.read(new File(begin\n\t\t\t\t\t\t+ buildType + \"_trans.png\"));\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\t\t}\n\t\treturn buildingSprites;\n\t}", "public Dungeon() {\n dungeon = new Object[10];\n }", "private void buildModel() {\n\t\trabbitSpace = new RabbitsGrassSimulationSpace(xSize, ySize);\n\n\t\trabbitSpace.spreadGrass(initGrass);\n\n\t\tfor (int i = 0; i < numRabbits && i < xSize * ySize; i++) {\n\t\t\taddNewRabbit();\n\t\t}\n\n\t\tfor (int i = 0; i < rabbitList.size(); i++) {\n\t\t\tRabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n\t\t\trabbit.report();\n\t\t}\n\t}", "public Building() {\n mElevators = new ArrayList<>();\n mFloors = new ArrayList<>();\n }", "protected abstract Object[] getComponents();", "@Override\n\t\tpublic BaoBeiBean[] newArray(int size) {\n\t\t\treturn new BaoBeiBean[size];\n\t\t}", "public static ArrayList<Node> findBuildings(Node cityModel) {\n\t\tArrayList<Node> buildings = new ArrayList<Node>();\n\n\t\tfor (Node cityObjectMember : findChildrenOfNode(cityModel, Label.label(CityGMLClass.CITY_OBJECT_MEMBER + \"\"))) {\n\t\t\t// each city object member can have max 1 building\n\t\t\tArrayList<Node> nodes = findChildrenOfNode(cityObjectMember, Label.label(CityGMLClass.BUILDING + \"\"));\n\t\t\tif (nodes.size() > 0) {\n\t\t\t\tbuildings.add(nodes.get(0));\n\t\t\t}\n\t\t}\n\n\t\treturn buildings;\n\t}", "public DesignADataStructure() {\n arr = new ArrayList<>();\n map = new HashMap<>();\n }", "private static void randomizedEntry() {\r\n\t\tfor (int i = 0; i < shops.length; i++) {\r\n\t\t\tshops[i] = new Shop();\r\n\t\t}\r\n\t}", "public Object[][] buildNewGraphDataModel() {\r\n\t\t\r\n\t\tresetDataStructures();\r\n\t\tGraph g = UIFacade.getInstance().getGraph();\r\n\t\t\r\n\t\tObject[][] result = new Object[g.getN()][5];\r\n\t\t\r\n\t\tfor (int i = 0; i < g.getN(); i++) {\r\n\t\t\tNode node = g.getNode(i);\r\n\t\t\tComponentProperties cp = node.getProperties();\r\n //\t\t\t ID\r\n\t\t\tresult[i][0] = new Integer(\r\n\t\t\t\t\t((ID)cp.getPropertyByName(\"ID\")).getValue()); \t\t\t\r\n\t\t\tresult[i][1] = new Integer(DEFAULT_CLIENT_DEMAND); // Demand\t\t\t\r\n\t\t\tresult[i][2] = new Double(DEFAULT_CLIENT_TW_BEGIN);\r\n\t\t\tresult[i][3] = new Double(DEFAULT_CLIENT_TW_END);\r\n\t\t\tresult[i][4] = new Double(DEFAULT_CLIENT_TW_SERVICE);\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "@Override\n\tpublic void generate() {\n\t\tJavaObject object = new JavaObject(objectType);\n\n\t\t// Fields\n\t\taddFields(object);\n\n\t\t// Empty constructor\n\t\taddEmptyConstructor(object);\n\n\t\t// Types constructor\n\t\taddTypesConstructor(object);\n\n\t\t// Clone constructor\n\t\taddCloneConstructor(object);\n\n\t\t// Setters\n\t\taddSetters(object);\n\n\t\t// Build!\n\t\taddBuild(object);\n\n\t\t// Done!\n\t\twrite(object);\n\t}", "private void createFeatures() {\n\t\tfeatures = new Feature[NUM_FEATURES];\n\n\t\t// Create dummy feature\n\t\tfeatures[0] = new DummyFeature(width, height, 0, 0 - THRESHOLD);\n\n\t\t// Create the rest of the features\n\t\tfor (int i = 1; i < NUM_FEATURES; i++) {\n\t\t\tfeatures[i] = new Feature(width, height, i);\n\t\t}\n\t}", "private void createArctic(BufferedReader in) {\n try {\n String tempRegionName = in.readLine();\n int maxStaff = Integer.parseInt(in.readLine());\n int numStaff = Integer.parseInt(in.readLine());\n \n Staff[] readStaffList = new Staff[maxStaff]; //creating a local array of Staff; later to be fed as a field to the constructor \n for (int i = 0; i < numStaff; i++) {\n int id = Integer.parseInt(in.readLine());\n //readStaffList[i] = this.searchStaffTemp(id);\n readStaffList[i] = findStaff(id, 0, this.numStaff); //id is the same thing as staffNum in the staff class \n //creates an array of initialized staff objects by searching \n //using the staffNum read from the file\n }\n \n int maxAnimals = Integer.parseInt(in.readLine());\n int numAnimals = Integer.parseInt(in.readLine());\n \n Animal[] animals = new Animal[numAnimals]; //creating a local array of Animals;\n for (int i = 0; i < numAnimals; i++) {\n animals[i] = new Animal(in.readLine(), Integer.parseInt(in.readLine()));\n }\n \n regionList[this.numRegions] = new Arctic(readStaffList, animals, tempRegionName, new RegionSpec(numStaff, maxStaff, numAnimals, maxAnimals, Integer.parseInt(in.readLine()), Double.parseDouble(in.readLine())), \n Integer.parseInt(in.readLine()), Double.parseDouble(in.readLine()), Double.parseDouble(in.readLine()), Boolean.parseBoolean(in.readLine()));\n //constructor call \n } catch (IOException iox) {\n System.out.println(\"Error reading file\");\n }\n this.numRegions++; //updates the global field numRegions\n }", "private void initObjects()\n {\n //creating a new board of 8x8 array \n board = new Disc[Constants.ROWS][Constants.COLUMNS];\n //loops through and creates all empty discs to be filled\n for(int row = 0; row < Constants.ROWS; row++)\n {\n for(int col = 0; col < Constants.COLUMNS; col++)\n {\n board[row][col] = new Disc();\n }\n }\n//initial board setup \n board[3][3].setDisColor(Constants.LIGHT);\n board[3][4].setDisColor(Constants.DARK);\n board[4][3].setDisColor(Constants.DARK);\n board[4][4].setDisColor(Constants.LIGHT);\n \n }", "public static void createArmy() {\n Unit unitOne = new Unit(\"Unit One\");\n Unit unitTwo = new Unit(\"Unit Two\");\n Unit unitThree = new Unit(\"Unit Three\");\n Unit unitFour = new Unit(\"Unit Four\");\n Unit unitFive = new Unit(\"Unit Five\");\n\n Knight knightOne = new Knight(\"Knight One\");\n Knight knightTwo = new Knight(\"Knight Two\");\n Knight knightThree = new Knight(\"Knight Three\");\n\n General general = new General(\"General\");\n Doctor doctor = new Doctor(\"Doctor\");\n }", "public ArrayList createArrayMonster(Pane gamePane){\r\n\r\n\t\tarrayMonster = new ArrayList<Monster>();\r\n\r\n\t\tarrayMonster.add(monster);\r\n\r\n\t\treturn arrayMonster;\r\n\r\n\t}", "public SpecimenArray()\r\n\t{\r\n\t\tsuper();\r\n\t}", "private Set<BoardObject> populateBoard(){\r\n\t\tSet<BoardObject> ob = new HashSet<BoardObject>();\r\n\t\tob.addAll(createCharacters());\r\n\t\tob.addAll(createWeapons());\r\n\t\treturn ob;\r\n\t}", "Object createArray(int capacity);", "Array<Object> getInstanceValues();", "public Distributor[] toDistributorArray()\r\n {\r\n Distributor[] a = new Distributor[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = (Distributor) vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }", "@Override\n public Object build() {\n return this.getChildren().stream()\n .map(child -> (org.opensearch.search.aggregations.AbstractAggregationBuilder) child.build()).collect(Collectors.toList());\n }", "public Company(int size) {\n employees = new Person[size];\n }", "@Override\n public void makeArray(Grid myGrid) {\n allShapes = new Triangle[myGrid.gridRows()][myGrid.gridColumns()];\n for (int r = 0; r < myGrid.gridRows(); r++) {\n for (int c = 0; c < myGrid.gridColumns(); c++) {\n Triangle mynewPixel = new Triangle(r, c, triangleBase(), cellHeight());\n allShapes[r][c] = mynewPixel;\n }\n }\n }", "protected ArrayList<Ship> initiateShips(){\n ArrayList<Ship> initialShips = new ArrayList<>();\n\n //battleship\n for (int i=0;i<1;i++){\n Battleship battleship = new Battleship();\n initialShips.add(battleship);\n }\n\n //cruiser\n for (int i=0;i<2;i++){\n Cruiser cruiser = new Cruiser();\n initialShips.add(cruiser);\n }\n\n //destroyer\n for (int i=0;i<3;i++){\n Destroyer destroyer = new Destroyer();\n initialShips.add(destroyer);\n }\n\n //submarine\n for (int i=0;i<4;i++){\n Submarine submarine = new Submarine();\n initialShips.add(submarine);\n }\n\n return initialShips;\n }", "public SongArray(){\n }", "public List<Building> getBoardBuildings() {\n return mPersonalBoardCards.getBoardBuildings();\n }", "public List<BuildingType> getAllBuildingType()\r\n\t{\n\t\tList<BuildingType> list = new ArrayList<BuildingType>();\r\n\t\t// This is the SP to be called\r\n\t\tString query = \"{ call readAllBuildingType}\";\t\r\n\t\t// Open a connection to DB\r\n\t\tif(conn == null)\r\n\t\t\tconn = JdbcSqlServerConnection.getConnection();\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// Prepare the call for SP\r\n\t\t\tcs = conn.prepareCall(query);\r\n\t\t\t// make SP call\r\n\t\t\trs = cs.executeQuery();\r\n\t\t\t//loop the recordset\r\n\t\t\twhile(rs.next())\r\n\t\t\t{\r\n\t\t\t\tBuildingType buildType = new BuildingType();\r\n\t\t\t\tbuildType.setID(rs.getInt(1));\r\n\t\t\t\tbuildType.setDescription(rs.getNString(2));\r\n\t\t\t\tlist.add(buildType);\r\n\t\t\t}\r\n\t\t}catch(Exception ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//close che db coonection\r\n\t\tif(conn!=null)\r\n\t\t\ttry {\r\n\t\t\t\tJdbcSqlServerConnection.closeConnection(conn);\r\n\t\t\t} catch (SQLException 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//return the list of BuildingType\r\n\t\treturn list;\r\n\t\t\r\n\t}", "public Grid()\n {\n height = 4;\n\twidth = 4;\n\tcases = new Case[height][width];\n }", "static RenderBall[] make(Box box)\n\t{\n RenderBall[] rB = new RenderBall[box.nbBalls];\n\t\tfor (int i = 0; i < box.nbBalls; i++)\n\t\t{\n\t\t\trB[i] = new RenderBall();\n\t\t\trB[i].c.r = (int)(Math.random() * 195 + 30);\n\t\t\trB[i].c.v = (int)(Math.random() * 195 + 30);\n\t\t\trB[i].c.b = (int)(Math.random() * 195 + 30);\n\t\t\tif (i == box.nbBalls - 1)\n\t\t\t{\n\t\t\t\trB[i].c.r = 255;\n\t\t\t\trB[i].c.v = 255;\n\t\t\t\trB[i].c.b = 255;\n\t\t\t}\n\t\t}\n return rB;\n\t}", "public List<PuzzleInstance> generateInstance() {\n\n final String[] POSITION = {\"Up\", \"Down\", \"Left\", \"Right\"};// In this order\n List<PuzzleInstance> puzzleInstances = new ArrayList<>();\n\n for (String traverse : POSITION) {\n int tempI=-1, tempJ=-1;\n switch (traverse) {\n case \"Up\":\n tempI = row - 1; \n tempJ = coloum;\n break;\n case \"Down\":\n tempI = row + 1; \n tempJ = coloum;\n break;\n case \"Left\":\n tempI = row; \n tempJ = coloum - 1;\n break;\n case \"Right\":\n tempI = row; \n tempJ = coloum + 1;\n break;\n }\n \n if((tempI < 0 || tempJ <0)|| (tempI >= rowColoumSize || tempJ >=rowColoumSize )){\n System.out.println(\"Out of bound\");\n // skip it nothing to add in the list\n }else{\n final Integer[][] puzzleGenerator = cloneArray(puzzle); \n int temp = puzzleGenerator [tempI][tempJ];\n puzzleGenerator[tempI][tempJ] = 0;\n puzzleGenerator[row][coloum] = temp;\n \n PuzzleInstance puzzleInstance = new PuzzleInstance(cloneArray(puzzleGenerator),rowColoumSize,cost_of_path+1,traverse, this);\n puzzleInstances.add(puzzleInstance); \n }\n }\n\n return puzzleInstances;\n \n \n }", "private void generateModel() {\n // Initialize a new model object\n mCm = new CategoryModel[nodes.length];\n\n for (int i = 0; i < nodes.length; i++) {\n mCm[i] = new CategoryModel(nodes[i].id, nodes[i].title);\n }\n }", "private RubyArray(Ruby runtime, RubyClass klass, int length) {\n super(runtime, klass);\n values = new IRubyObject[length];\n }", "@Override // android.os.Parcelable.Creator\n public /* bridge */ /* synthetic */ CounterConfiguration[] newArray(int i) {\n return new CounterConfiguration[i];\n }", "public abstract Case[][] generate();", "public TerrainObject build() {\n\t\tfor(int i=0; i<paramsSet.length-3; i++)\n\t\t\tif(!paramsSet[i])\n\t\t\t\tthrow new IllegalArgumentException(\"Needed parameter (No. \"+i+\") for TerrainObject hasn't been set\");\n\t\treturn new TerrainObject(x, y, z, xW, yW, zW, scale, seed, noise);\n\t}", "private static Inventory[] createInventoryList() {\n Inventory[] inventory = new Inventory[3];\r\n \r\n Inventory potion = new Inventory();\r\n potion.setDescription(\"potion\");\r\n potion.setQuantityInStock(0);\r\n inventory[Item.potion.ordinal()] = potion;\r\n \r\n Inventory powerup = new Inventory();\r\n powerup.setDescription(\"powerup\");\r\n powerup.setQuantityInStock(0);\r\n inventory[Item.powerup.ordinal()] = powerup;\r\n \r\n Inventory journalclue = new Inventory();\r\n journalclue.setDescription(\"journalclue\");\r\n journalclue.setQuantityInStock(0);\r\n inventory[Item.journalclue.ordinal()] = journalclue;\r\n \r\n return inventory;\r\n }", "public void createSpaceClasses(){\n\t//add the number of classe demand in a list of superchannel\n\t\tspaceSC_List = new ArrayList<OpticalSuperChannel>();\n\t\tfor ( int i = 1 ; i < this.spatialDimension+1 ; i++ ) {\n\t\t\tspaceSC_List.add(new OpticalSuperChannel( i , this.signalBw, this.channelSpacing, this.bandGuard,\n\t\t\t\t\tthis.slotBw, this.modulationFormat));\n\t\t}\n\n\n\t}", "private void makeObject() {\n\t\t\n\t\tItem I1= new Item(1,\"Cap\",10.0f,\"to protect from sun\");\n\t\tItemMap.put(1, I1);\n\t\t\n\t\tItem I2= new Item(2,\"phone\",100.0f,\"Conversation\");\n\t\tItemMap.put(2, I2);\n\t\t\n\t\tSystem.out.println(\"Objects Inserted\");\n\t}", "public ArrayRegister(int size) {\r\n persons = new Person[size];\r\n count = 0;\r\n }" ]
[ "0.6170417", "0.5944964", "0.5913196", "0.5889156", "0.5882357", "0.58768326", "0.58384746", "0.57742447", "0.56602013", "0.5640148", "0.5633379", "0.5571676", "0.55716586", "0.55671173", "0.55637777", "0.5558168", "0.55493265", "0.55423915", "0.551214", "0.5487149", "0.5483893", "0.5481238", "0.5474496", "0.5463536", "0.5454173", "0.54379386", "0.54257226", "0.5421654", "0.54170763", "0.5406933", "0.54037666", "0.5382437", "0.53722095", "0.536953", "0.5362854", "0.53596956", "0.5336321", "0.5324769", "0.5318689", "0.5302464", "0.53012973", "0.52824897", "0.5281421", "0.52762544", "0.5269884", "0.52490795", "0.52437323", "0.5238735", "0.5234888", "0.52264065", "0.52104807", "0.5208103", "0.5203937", "0.52036697", "0.5191352", "0.51903796", "0.5180666", "0.5176493", "0.5174302", "0.5173638", "0.5165107", "0.516283", "0.5144243", "0.5136441", "0.51324624", "0.5127872", "0.51264524", "0.5125418", "0.5121017", "0.51204306", "0.51141775", "0.51082647", "0.5094694", "0.508777", "0.50821584", "0.50808495", "0.5079343", "0.50781703", "0.5077539", "0.5076763", "0.50764793", "0.5075755", "0.50723183", "0.50658673", "0.50645393", "0.50581896", "0.503611", "0.50343996", "0.502925", "0.5016358", "0.50160694", "0.50155056", "0.5010908", "0.50069904", "0.5006736", "0.5006453", "0.5003491", "0.5003175", "0.49911806", "0.49909624", "0.49848074" ]
0.0
-1
endregion region Private Methods
private Set<String> getContextRelevantLabels(CompositeControllerContext context) { if (context.getVertexControllerContext().isPresent()) { return getVertexContextRelevantLabels(context); } return getElementContextRelevantLabels(context); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n protected void getExras() {\n }", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "protected OpinionFinding() {/* intentionally empty block */}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n public void func_104112_b() {\n \n }", "private TMCourse() {\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "private void m50366E() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void smell() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void method_4270() {}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override public int describeContents() { return 0; }", "public void mo4359a() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "private void kk12() {\n\n\t}", "protected void mo6255a() {\n }", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "public void mo12628c() {\n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private Singletion3() {}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public void mo21782G() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "protected Problem() {/* intentionally empty block */}", "@Override\n public void init() {\n\n }", "public void mo21793R() {\n }", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "public final void mo91715d() {\n }", "public void mo21779D() {\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "private ReportGenerationUtil() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "private MApi() {}", "private void poetries() {\n\n\t}", "public void mo21825b() {\n }", "public void mo115190b() {\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}", "private static void iterator() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\n void init() {\n }", "public void mo21785J() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "private DiscretePotentialOperations() {\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "private void getStatus() {\n\t\t\n\t}", "private OMUtil() { }", "public abstract void mo70713b();", "protected boolean func_70814_o() { return true; }", "@Override\n public void init() {\n }", "private PrngFixes() {\n }" ]
[ "0.65270585", "0.6388565", "0.62739754", "0.6255089", "0.6251729", "0.6216305", "0.6199533", "0.61808753", "0.6116142", "0.6116142", "0.6053167", "0.6046995", "0.60004693", "0.59820765", "0.5960422", "0.5960422", "0.59574", "0.5925643", "0.59235185", "0.5919939", "0.59197676", "0.59132123", "0.5890134", "0.5869832", "0.58592755", "0.5845582", "0.5838149", "0.58359504", "0.5834508", "0.5830219", "0.58298206", "0.58198833", "0.58180934", "0.58180934", "0.58180934", "0.58180934", "0.58180934", "0.58180934", "0.5817982", "0.58153296", "0.58149546", "0.580939", "0.58059675", "0.58039063", "0.5798205", "0.57881147", "0.57808876", "0.5773885", "0.5765677", "0.57620955", "0.57560015", "0.575517", "0.575517", "0.57384485", "0.5731976", "0.57279366", "0.57172817", "0.5688272", "0.5681309", "0.5675067", "0.56747544", "0.5669623", "0.5669623", "0.5669623", "0.5669623", "0.5669623", "0.5669623", "0.5669623", "0.5667311", "0.566449", "0.56643015", "0.56622195", "0.566136", "0.56613153", "0.56605333", "0.5659622", "0.56589437", "0.5655792", "0.56524324", "0.56524324", "0.56505084", "0.56492007", "0.5646776", "0.5646575", "0.56444466", "0.56443846", "0.56427145", "0.56376916", "0.5634479", "0.56292266", "0.56283444", "0.56283444", "0.5625393", "0.56229675", "0.56222546", "0.5622049", "0.56217897", "0.562049", "0.56151307", "0.5614713", "0.56139106" ]
0.0
-1
currently assuming homogeneous bulk
private Set<String> getVertexContextRelevantLabels(VertexControllerContext context) { return Stream.ofAll(context.getBulkVertices()) .take(1) .map(Element::label) .toJavaSet(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private List<BulkLoadElementTO> populateBulkLoadElementTO( int numElements ) {\n List<BulkLoadElementTO> lTOList = new ArrayList<BulkLoadElementTO>();\n\n for ( int i = 0; i < numElements; i++ ) {\n lTOList.add( new BulkLoadElementTO( i, WAREHOUSE_STOCK_LEVEL, QUEUED, \"\", C0, C1, C2 ) );\n }\n\n return lTOList;\n\n }", "public void processLargeInList(Set values);", "void setArrayGeneric(int paramInt)\n/* */ {\n/* 1062 */ this.length = paramInt;\n/* 1063 */ this.datums = new Datum[paramInt];\n/* 1064 */ this.pickled = null;\n/* 1065 */ this.pickledCorrect = false;\n/* */ }", "private static boolean isBulkOperation(Operation op, Collection<Operation> ops) {\n if (op instanceof GetOperation) {\n GetOperation gop = (GetOperation) op;\n return gop.getKeys().size() > 1;\n } else if (op instanceof StoreOperation) {\n return ops.size() > 1;\n } else if (op instanceof DeleteOperation) {\n return ops.size() > 1;\n }\n return op.isBulkOperation();\n }", "public static boolean recognizeBulk(byte[] data)\n {\n return false;\n }", "protected void handleEntitiesIndividually() {\n\n\t\tfinal Set<Long> originalBatch = getUidsToLoad();\n\t\tfinal Set<Long> batchOfOne = new HashSet<Long>();\n\n\t\t/**\n\t\t * We replace the batch of all the uids with our own which we'll only put one uid at a time.\n\t\t */\n\t\tsetBatch(batchOfOne);\n\n\t\tLOG.info(\"Loading \" + originalBatch.size() + \" entities individually\");\n\n\t\tfor (final Long uid : originalBatch) {\n\n\t\t\ttry {\n\n\t\t\t\tbatchOfOne.clear();\n\t\t\t\tbatchOfOne.add(uid);\n\n\t\t\t\tfinal Collection<ENTITY> loadedEntity = loadBatch();\n\t\t\t\tgetPipelinePerformance().addCount(\"loader:entities_loaded_individually\", loadedEntity.size());\n\n\t\t\t\tfor (final ENTITY entity : loadedEntity) {\n\t\t\t\t\tgetNextStage().send(entity);\n\t\t\t\t\tgetPipelinePerformance().addCount(\"loader:entities_out\", 1);\n\n\t\t\t\t}\n\t\t\t} catch (final Exception e) {\n\t\t\t\tgetPipelinePerformance().addCount(\"loader:individual_entity_loading_failures\", 1);\n\n\t\t\t\tLOG.error(\"Could not load entity with uid \" + uid + \" for indexing, this entity will not be indexed. \", e);\n\t\t\t}\n\n\t\t}\n\n\t\t/** Put the original set of uids back. */\n\t\tsetBatch(originalBatch);\n\n\t}", "private void collectTags\n (int[] i, int i0, int i1, long[] T) {\n for (int o=i0; o<i1; o++) // 1\n T[o] = data[i[o]]; // 1\n }", "public interface BulkableAction<T extends JestResult> extends DocumentTargetedAction<T> {\r\n public String getBulkMethodName();\r\n public Collection<Object> getParameter(String key);\r\n}", "int insertBatch(List<Basicinfo> list);", "@Override\r\n public void process() {\r\n if (isDirectEmbeddableCollection()) {\r\n ObjectArrayMapping mapping = new ObjectArrayMapping();\r\n \r\n // Add the mapping to the descriptor.\r\n setMapping(mapping);\r\n \r\n // Set the reference class name.\r\n mapping.setReferenceClassName(getReferenceClassName());\r\n \r\n // Set the attribute name.\r\n mapping.setAttributeName(getAttributeName());\r\n \r\n // Will check for PROPERTY access\r\n setAccessorMethods(mapping);\r\n \r\n mapping.setStructureName(getDatabaseType());\r\n \r\n // Process the @Column or column element if there is one.\r\n // A number of methods depend on this field so it must be\r\n // initialized before any further processing can take place.\r\n mapping.setField(new ObjectRelationalDatabaseField(getDatabaseField(getDescriptor().getPrimaryTable(), MetadataLogger.COLUMN)));\r\n } else {\r\n ArrayMapping mapping = new ArrayMapping();\r\n \r\n // Add the mapping to the descriptor.\r\n setMapping(mapping);\r\n \r\n // Set the attribute name.\r\n mapping.setAttributeName(getAttributeName());\r\n \r\n // Will check for PROPERTY access\r\n setAccessorMethods(mapping);\r\n \r\n mapping.setStructureName(getDatabaseType());\r\n \r\n // Process the @Column or column element if there is one.\r\n // A number of methods depend on this field so it must be\r\n // initialized before any further processing can take place.\r\n mapping.setField(new ObjectRelationalDatabaseField(getDatabaseField(getDescriptor().getPrimaryTable(), MetadataLogger.COLUMN)));\r\n }\r\n }", "private static String getUpsertBulkByUser(Context ctx, User user) {\n StringBuilder bulk = new StringBuilder();\n List<Date> dates = new UserManager().getQuestionnaireDateListByUserName(user.getName());\n if (dates != null) {\n for (Date date : dates) {\n JSONObject params = new JSONObject();\n try {\n MetaQuestionnaire meta = new MetaQuestionnaireManager().getMetaDataByCreationDate(date);\n if (meta != null) {\n params.put(\"operation-type\", meta.getOperationType());\n PsychoSocialSupportState psychoSocialSupportState = meta.getPsychoSocialSupportState();\n params.put(\"need-psychosocial-support\", psychoSocialSupportState == PsychoSocialSupportState.ACCEPTED);\n params.put(\"had-psychosocial-support\", meta.getPastPsychoSocialSupportState());\n }\n params.put(\"creation-date\", EntityDbManager.dateFormat.format(date));\n String userName = Security.getUserNameByEncryption(user);\n params.put(\"user-name\", userName);\n\n } catch (Exception e) {\n Log.e(CLASS_NAME, e.getLocalizedMessage());\n }\n\n\n DistressThermometerQuestionnaire distressThermometerQuestionnaire = new DistressThermometerQuestionnaireManager().getDistressThermometerQuestionnaireByDate(user.getName(), date);\n if (distressThermometerQuestionnaire != null) {\n if (Questionnairy.canStatisticsBeDisplayed(distressThermometerQuestionnaire.getProgressInPercent()))\n params = addAllKeyValuePairs(distressThermometerQuestionnaire.getAsJSON(), params);\n }\n\n\n QolQuestionnaire qol = new QualityOfLifeManager().getQolQuestionnaireByDate(user.getName(), date);\n if (qol != null) {\n if (Questionnairy.canStatisticsBeDisplayed(qol.getProgressInPercent())) {\n if (qol.getGlobalHealthScore() > 0) {\n params = addAllKeyValuePairs(qol.getQLQC30AsJSON(), params);\n params = addAllKeyValuePairs(qol.getBN20AsJSON(), params);\n }\n }\n }\n\n\n HADSDQuestionnaire hads = new HADSDQuestionnaireManager().getHADSDQuestionnaireByDate_PK(user.getName(), date);\n if (hads != null) {\n if (Questionnairy.canStatisticsBeDisplayed(hads.getProgressInPercent()))\n if(hads.getAnxietyScore() > 0 ){\n params = addAllKeyValuePairs(hads.getAsJSON(), params);\n }\n }\n\n\n FearOfProgressionQuestionnaire fearQuestionnaire = new FearOfProgressionManager().getQuestionnaireByDate(user.getName(), date);\n if (fearQuestionnaire != null) {\n if (Questionnairy.canStatisticsBeDisplayed(fearQuestionnaire.getProgressInPercent()))\n if (fearQuestionnaire.getScore() >= 12 && fearQuestionnaire.getScore() <=60) {\n params = addAllKeyValuePairs(fearQuestionnaire.getAsJSON(), params);\n }\n\n }\n\n\n bulk.append(ElasticQuestionnaire.getGenericBulk(date, getType(), params.toString()));\n }\n\n }\n return bulk.toString();\n }", "protected abstract Object[] getData();", "@Override\n public void afterBulk(long executionId,\n BulkRequest request,\n BulkResponse response) {\n }", "private void setData(T data, int size, List<? extends T> memory, T type) { }", "@Override\n public void beforeBulk(long executionId,\n BulkRequest request) {\n }", "private BulkRequestBuilder GetEsBulkRequest(final ProcessSession session, final List<FlowFile> flowFiles) {\n\n final BulkRequestBuilder bulk = esClient.prepareBulk();\n for (FlowFile file : flowFiles) {\n final byte[] content = new byte[(int) file.getSize()];\n session.read(file, new InputStreamCallback() {\n @Override\n public void process(final InputStream in) throws IOException {\n StreamUtils.fillBuffer(in, content, true);\n\n final String input = new String(content);\n final JsonParser parser = new JsonParser();\n final JsonObject json = parser.parse(input).getAsJsonObject();\n bulk.add(esClient.prepareIndex(getIndex(json), getType(json), getId(json))\n .setSource(getSource(json)));\n\n }\n\n });\n\n }\n return bulk;\n }", "private List<Object> workerBase(List<Object> objectRow, Schema fileSchema, List<String> columnNames,\n List<TypeInfo> columnTypes, GenericRecord record)\n throws AvroSerdeException {\n for(int i = 0; i < columnNames.size(); i++) {\n TypeInfo columnType = columnTypes.get(i);\n String columnName = columnNames.get(i);\n Object datum = record.get(columnName);\n Schema datumSchema = record.getSchema().getField(columnName).schema();\n Schema.Field field = AvroSerdeUtils.isNullableType(fileSchema)?AvroSerdeUtils.getOtherTypeFromNullableType(fileSchema).getField(columnName):fileSchema.getField(columnName);\n objectRow.add(worker(datum, field == null ? null : field.schema(), datumSchema, columnType));\n }\n\n return objectRow;\n }", "@Override\n\tpublic boolean checkHomogeneous(List<int[]> input) {\n\t\treturn false;\n\t}", "void prefetchValues(Collection<R> entities);", "protected void prepareEntityToNodeMap()\r\n\t{\n\t}", "@Override\n protected Object freshBatch(Object reuse)\n {\n throw new NotImplementedException();\n }", "@Override\r\n\tprotected void saveData(List<ApplMstHousestatus> bList, int numOfBulkRecord) {\n\t\tList<ApplMstHousestatusDest> amhdList = new ArrayList<>();\r\n\t\tfor(ApplMstHousestatus amh : bList) {\r\n\t\t\tApplMstHousestatusDest amhd = new ApplMstHousestatusDest();\r\n\t\t\ttry {\r\n\t\t\t\tBeanUtils.copyProperties(amhd, amh);\r\n\t\t\t} catch (IllegalAccessException | InvocationTargetException e) {\r\n\t\t\t\tlogger.error(e);\r\n\t\t\t}\r\n\t\t\tamhdList.add(amhd);\r\n\t\t}\r\n\t\tif(amhdList.size() > 0)\r\n\t\t\tservice2.save(amhdList, numOfBulkRecord);\r\n\t}", "private BulkOperation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private void bulkInsertIntoDataAnalyzing(ArrayList<DataInfo> tmp) {\r\n sqliteDBHelper.insertIntoDataAnalyzingBulk(tmp);\r\n sqliteDBHelper.insertIntoScannedAppsBulk(tmp);\r\n }", "public void testTypedCollection()\r\n\t{\r\n broker.beginTransaction();\r\n for (int i = 1; i < 4; i++)\r\n {\r\n ProductGroupWithTypedCollection example = new ProductGroupWithTypedCollection();\r\n example.setId(i);\r\n ProductGroupWithTypedCollection group =\r\n (ProductGroupWithTypedCollection) broker.getObjectByQuery(\r\n new QueryByIdentity(example));\r\n assertEquals(\"should be equal\", i, group.getId());\r\n //System.out.println(group + \"\\n\\n\");\r\n\r\n broker.delete(group);\r\n broker.store(group);\r\n }\r\n broker.commitTransaction();\r\n\t}", "void processMultiValue(int numDocs, int[][] outGroupIds);", "@Override\n public Optional<List<Object[]>> getPopulateTempTableContent() {\n List<Object[]> batchArgs = new ArrayList<>();\n\n for (DataSet dataSet : objects) {\n CategoryCombo categoryCombo = dataSet.getCategoryCombo();\n\n for (OrganisationUnit orgUnit : dataSet.getSources()) {\n if (!categoryCombo.isDefault()) {\n if (orgUnit.hasCategoryOptions()) {\n Set<CategoryOption> orgUnitOptions = orgUnit.getCategoryOptions();\n\n for (CategoryOptionCombo optionCombo : categoryCombo.getOptionCombos()) {\n Set<CategoryOption> optionComboOptions = optionCombo.getCategoryOptions();\n\n if (orgUnitOptions.containsAll(optionComboOptions)) {\n Date startDate =\n DateUtils.min(\n optionComboOptions.stream()\n .map(co -> co.getStartDate())\n .collect(Collectors.toSet()));\n Date endDate =\n DateUtils.max(\n optionComboOptions.stream()\n .map(co -> co.getAdjustedEndDate(dataSet))\n .collect(Collectors.toSet()));\n\n List<Object> values =\n Lists.newArrayList(\n dataSet.getId(), orgUnit.getId(), optionCombo.getId(), startDate, endDate);\n\n batchArgs.add(values.toArray());\n }\n }\n }\n } else {\n List<Object> values =\n Lists.newArrayList(\n dataSet.getId(), orgUnit.getId(), defaultOptionCombo.getId(), null, null);\n\n batchArgs.add(values.toArray());\n }\n }\n }\n\n return Optional.of(batchArgs);\n }", "@Test\n public void testUnionOnSchemaCastOnByteArray() throws Exception {\n PigServer pig = new PigServer(Util.getLocalTestMode());\n String query =\n \" l1 = load '\" + INP_FILE_2NUMS + \"' as (i, j);\"\n + \" f1 = foreach l1 generate (int)i, (int)j;\"\n + \"u = union onschema f1, l1;\"\n ; \n Util.registerMultiLineQuery(pig, query);\n Iterator<Tuple> it = pig.openIterator(\"u\");\n \n List<Tuple> expectedRes = \n Util.getTuplesFromConstantTupleStrings(\n new String[] {\n \"(1,2)\",\n \"(5,3)\",\n \"(1,2)\",\n \"(5,3)\"\n });\n Util.checkQueryOutputsAfterSort(it, expectedRes);\n\n }", "Datatype[] internalize(Datatype[] args) throws CCAException;", "public void bulkAdd(){\n employees.add(new Employee(23.0, 15000.0, \"Shayan\"));\n employees.add(new Employee(22.0, 60000.0, \"Rishabh\"));\n employees.add(new Employee(23.0, 45000.0, \"Ammar\"));\n employees.add(new Employee(25.0, 30000.0, \"Fahad\"));\n employees.add(new Employee(21.0, 50000.0, \"Ankur\"));\n }", "public BulkWriteOperation initializeUnorderedBulkOperation() {\n return new BulkWriteOperation(false, this);\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tpublic void migrateDataByBatch() {\n\t\tpool = new HTablePool(conf, 1024);\n\t\tSQLExporter sqlExporter = \n\t\t\tnew SQLExporter(url, username, password, catalog);\n\t\twhile(sqlExporter.hasNextDataTable()) {\n\t\t\tEntry entry = sqlExporter.next();\n\t\t\tString tableName = REGION + \".\" + (String) entry.getKey();\n\t\t\tList<Map<String, Object>> list = (List<Map<String, Object>>) entry.getValue();\n\t\t\t/**\n\t\t\t * table to migrate data.\n\t\t\t */\n\t\t\tHTable table = (HTable) pool.getTable(tableName);\n\t\t\t\n\t\t\t/**\n\t\t\t * set write buffer size.\n\t\t\t */\n\t\t\ttry {\n\t\t\t\ttable.setWriteBufferSize(WRITE_BUFFER_SIZE);\n\t\t\t\ttable.setAutoFlush(false);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tint counter = 0;\n\t\t\tList<Put> puts = new ArrayList<Put>();\n\t\t\tint size = list.size();\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\t\n\t\t\t\tPut put = new Put((new Integer(i)).toString().getBytes());\n\t\t\t\t\n\t\t\t\tMap<String, Object> map = list.get(i);\n\t\t\t\tcounter ++;\n\t\t\t\t/**\n\t\t\t\t * add one row to be put.\n\t\t\t\t */\n\t\t\t\tfor (Map.Entry<String, Object> m : map.entrySet()) {\t\n\t\t\t\t\tput.add(FAMILY.getBytes(), m.getKey().getBytes(), \n\t\t\t\t\t\t\tm.getValue().toString().getBytes());\t\n\t\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * add `put` to list puts. \n\t\t\t\t */\n\t\t\t\tputs.add(put);\n\t\t\t\t\n\t\t\t\tif ((counter % LIST_PUTS_COUNTER == 0) || (i == size - 1)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttable.put(puts);\n\t\t\t\t\t\ttable.flushCommits();\n\t\t\t\t\t\tputs.clear();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else continue;\n\t\t\t}\n\t\t}\n\t}", "private void prepare( ) {\n super.prepare( schema.getCount( ) );\n serializer = new FieldSerializer[ fieldCount ];\n for ( int i = 0; i < fieldCount; i++ ) {\n FieldSchema field = schema.getField( i );\n serializer[i] = serializerByType[ field.getType().ordinal() ];\n }\n }", "public abstract List<T> convertToEntities(List<D> dtos);", "private void updateEntityArray(ArrayList<Entity> array, GameContainer gc, StateBasedGame sb, int delta){\r\n \t\tfor(int i=0; i<array.size(); i++){\r\n \t\t\tarray.get(i).update(gc, sb, delta);\r\n \t\t\tif(array.get(i).getHealth() <= 0){\r\n \t\t\t\tarray.remove(i);\r\n \t\t\t\ti--;\r\n \t\t\t}\r\n \t\t}\r\n \t}", "@Override\n\tpublic int insert_all(Object[] ob) {\n\t\treturn 0;\n\t}", "public String getBulk() {\n return ElasticQuestionnaire.getGenericBulk(getCreationDate_PK(), ElasticQuestionnaire.getType(), getAsJSON().toString());\n }", "int insertSelective(BPBatchBean record);", "E[] getAll();", "public synchronized void addUniqueMultiple(List<kelondroRow.Entry> rows) throws IOException {\n TreeMap<Integer, byte[]> indexed_result = super.addMultiple(rows);\r\n // indexed_result is a Integer/byte[] relation\r\n // that is used here to store the index\r\n Iterator<Map.Entry<Integer, byte[]>> i = indexed_result.entrySet().iterator();\r\n Map.Entry<Integer, byte[]> entry;\r\n while (i.hasNext()) {\r\n entry = i.next();\r\n index.puti(entry.getValue(), entry.getKey().intValue());\r\n }\r\n assert this.size() == index.size() : \"content.size() = \" + this.size() + \", index.size() = \" + index.size();\r\n \t\t\r\n }", "@Override\n protected Map<Object, R> apply(List<?> values) {\n Map<Object, ? extends PreparedTransformer<? extends R>> transformers =\n (Map<Object, ? extends PreparedTransformer<? extends R>>) values.get(0);\n\n // the values to pass to those transformers are the rest of our inputs\n Object[] passedValues = values.subList(1, values.size()).toArray();\n\n // results is an Object[] array containing elements of type R\n Object[] results = transformers.values()\n .stream()\n .map(preparedTransformer -> preparedTransformer.internalAPI()\n .applyUnsafe(preparedTransformer.internalAPI().createExecutionCache(1), passedValues))\n .toArray();\n\n // we use an Object2ObjectArrayMap because it's *very* cheap to construct (once you have the key & value arrays)\n return new Object2ObjectArrayMap<>(transformers.keySet().toArray(), results);\n }", "<T, U> Collection<U> map(Collection<T> sources, TypeToken<Collection<U>> destinationTypeToken);", "public GlBuffer commit(final Chunk<E>[] chunks, boolean push){\n\t\t//android.util.//Log.d(TAG,\"update(\"+chunks+\", \"+commit+\")\");\n\t\tint startPosition = 0;\n\t\tint offset = this.stride;\n\t\tswitch(this.datatype){\n\t\t\tcase TYPE_FLOAT :\n\t\t\t\tif(this.buffer == null){\n\t\t\t\t\tthis.buffer = ByteBufferPool.getInstance().getDirectFloatBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((FloatBuffer)this.buffer).put(((float[])chunk.data),compIndex,chunk.components);\n }\n }\n\t\t\t\tbreak;\n case TYPE_INT :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectIntBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((IntBuffer)this.buffer).put(((int[])chunk.data),compIndex,chunk.components);\n }\n }\n break;\n\t\t\tcase TYPE_SHORT :\n\t\t\t\tif(this.buffer == null){\n\t\t\t\t\tthis.buffer = ByteBufferPool.getInstance().getDirectShortBuffer(this.size >> 1);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 1;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ShortBuffer)this.buffer).put(((short[])chunk.data),compIndex,chunk.components);\n }\n }\n\t\t\t\tbreak;\n default :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectByteBuffer(this.size);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ByteBuffer)this.buffer).put(((byte[])chunk.data),compIndex,chunk.components);\n }\n }\n break;\n\t\t}\n\n //Update server if needed\n if(push){\n push();\n }\n\n\t\treturn this;\n\t}", "private void expand() { \n\t\tComparable[] temp = new Comparable[ _data.length * 2 ];\n\t\tfor( int i = 0; i < _data.length; i++ )\n\t \ttemp[i] = _data[i];\n\t\t_data = temp;\n }", "@Override\n public void afterBulk(long executionId,\n BulkRequest request,\n Throwable failure) {\n }", "public List<IndexedObjectInformation> bulkIndexItem(final List<T> items) {\n Function<T, IndexQuery> itemToIndexQueryMapper = item -> new IndexQueryBuilder()\n .withId(String.valueOf(item.getId()))\n .withObject(item)\n .build();\n\n List<IndexQuery> queries = items.stream()\n .map(itemToIndexQueryMapper)\n .collect(Collectors.toList());\n return elasticsearchOperations.bulkIndex(queries, getIndexCoordinates());\n }", "private static void fillTypedBOW(Set<TypedBOW> typedBOW, EntityTemplate annotation) {\n\n\t\tAbstractAnnotation rootAnnotation = annotation.getRootAnnotation();\n\n\t\tfinal Set<String> bow = extractEntityTypeBOW(rootAnnotation.getEntityType());\n\n\t\tif (rootAnnotation.isInstanceOfDocumentLinkedAnnotation()) {\n\t\t\tbow.addAll(extractDocLinkedBOW(rootAnnotation.asInstanceOfDocumentLinkedAnnotation()));\n\t\t}\n\t\ttypedBOW.add(new TypedBOW(bow, null));\n\n\t\tfinal Map<SlotType, Set<AbstractAnnotation>> propertyAnnotations = annotation.filter().docLinkedAnnoation()\n\t\t\t\t.multiSlots().singleSlots().merge().nonEmpty().build().getMergedAnnotations();\n\n\t\tfor (Entry<SlotType, Set<AbstractAnnotation>> prop : propertyAnnotations.entrySet()) {\n\n//\t\t\tif (!(prop.getKey() == SlotType.get(\"hasDeliveryMethod\") || prop.getKey() == SCIOSlotTypes.hasCompound\n//\t\t\t\t\t|| prop.getKey() == SlotType.get(\"hasDosage\")))\n//\t\t\t\tcontinue;\n\n\t\t\tSet<String> tmp = extractEntityTypeBOW(rootAnnotation.getEntityType());\n\n\t\t\tfor (AbstractAnnotation val : prop.getValue()) {\n//\t\t\t\ttmp.addAll(extractEntityTypeBOW(val.getEntityType()));\n\t\t\t\ttmp.addAll(extractDocLinkedBOW(val.asInstanceOfDocumentLinkedAnnotation()));\n\t\t\t}\n\n\t\t\ttypedBOW.add(new TypedBOW(tmp, prop.getKey()));\n\n\t\t}\n\n\t\t/*\n\t\t * Recursive search for terms.\n\t\t */\n\t\tfor (Set<AbstractAnnotation> props : annotation.filter().entityTemplateAnnoation().multiSlots().singleSlots()\n\t\t\t\t.merge().nonEmpty().build().getMergedAnnotations().values()) {\n\t\t\tfor (AbstractAnnotation prop : props) {\n\t\t\t\tfillTypedBOW(typedBOW, prop.asInstanceOfEntityTemplate());\n\t\t\t}\n\t\t}\n\n\t}", "@POST\n @Path(\"/bulk\")\n @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })\n @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })\n @Override\n public BlockConsistencyGroupBulkRep getBulkResources(final BulkIdParam param) {\n return (BlockConsistencyGroupBulkRep) super.getBulkResources(param);\n }", "private void handleArrayElementFeature(XMLStreamReader reader, int attributeIndex, String attrName, String typeName, Type nodeType, Feature feature, ByteArrayOutputStream baos, TypeSystem ts) {\n final String[] valueSplit = reader.getAttributeValue(attributeIndex).split(\" \");\n writeInt(valueSplit.length, baos);\n Stream<String> arrayValues = Stream.of(valueSplit);\n // The list subtype names have already been resolved at the calling method\n String arrayTypeName = XmiSplitUtilities.isMultiValuedFeatureAttribute(nodeType, attrName) ? typeName : feature.getRange().getName();\n Type arrayType = ts.getType(arrayTypeName);\n if (ts.subsumes(ts.getType(CAS.TYPE_NAME_DOUBLE_ARRAY), arrayType) || ts.subsumes(ts.getType(CAS.TYPE_NAME_FLOAT_LIST), arrayType)) {\n arrayValues.mapToDouble(Double::valueOf).forEach(d -> writeDouble(d, baos));\n } else if (ts.subsumes(ts.getType(CAS.TYPE_NAME_SHORT_ARRAY), arrayType)) {\n arrayValues.mapToInt(Integer::valueOf).forEach(i -> writeShort((short) i, baos));\n } else if (ts.subsumes(ts.getType(CAS.TYPE_NAME_BYTE_ARRAY), arrayType)) {\n arrayValues.mapToInt(Integer::valueOf).forEach(baos::write);\n } else if (ts.subsumes(ts.getType(CAS.TYPE_NAME_BOOLEAN_ARRAY), arrayType)) {\n arrayValues.map(s -> Boolean.valueOf(s) ? 1 : 0).forEach(baos::write);\n } else if (ts.subsumes(ts.getType(CAS.TYPE_NAME_INTEGER_ARRAY), arrayType) || ts.subsumes(ts.getType(CAS.TYPE_NAME_INTEGER_LIST), arrayType)) {\n arrayValues.mapToInt(Integer::valueOf).forEach(i -> writeInt(i, baos));\n } else if (ts.subsumes(ts.getType(CAS.TYPE_NAME_LONG_ARRAY), arrayType)) {\n arrayValues.mapToLong(Long::valueOf).forEach(l -> writeLong(l, baos));\n } else if (ts.subsumes(ts.getType(CAS.TYPE_NAME_STRING_ARRAY), arrayType)) {\n // String arrays should only be embedded into the element if they are empty\n if (arrayValues.filter(Predicate.not(String::isBlank)).count() > 0)\n throw new IllegalArgumentException(\"Unhandled case of a StringArray that is embedded into the type element but is not empty for feature '\" + attrName + \"' of type '\" + typeName + \"'.\");\n // String of length 0\n writeInt(0, baos);\n } else throw new IllegalArgumentException(\"Unhandled feature '\" + attrName + \"' of type '\" + typeName + \"'.\");\n }", "void insertBatch(List<InspectionAgency> recordLst);", "private static Object[] m59444a(Iterable<?> iterable, Object[] objArr) {\n int i = 0;\n for (Object obj : iterable) {\n int i2 = i + 1;\n objArr[i] = obj;\n i = i2;\n }\n return objArr;\n }", "private boolean processItems(Map<String, String> row, List<Item> itemBuffer, Integer bufSize,\n Map<String, Dept> deptsAdded, Map<String, Collection> collectionsAdded,\n Map<String, List<String>> allIrns, Map<String, Integer> mediaCounts) {\n boolean batchAdded = false;\n if (row == null) return batchAdded;\n\n // Create list of Entities, then batch-insert using repo.saveAll(). Would be nice to be able to skip indiviual malformed\n // Items, but difficult with batch saving. Instead, skip the entire batch containing the malformed entry.\n\n // TODO: maybe handle blank lines and malformed items/dates more gracefully. Can a required Dept/Collection actually be missing?\n // That shouldn't be the case unless there were some exceptions earlier on.\n if (itemBuffer.size() == bufSize) {\n try {\n itemRepo.saveAll(itemBuffer);\n }\n catch (DataIntegrityViolationException exception) {\n System.out.printf(\"Skipped batch: contained duplicate item(s), starting with the item with reference number '%s'\\n\",\n extractDuplicateItemRef(extractUsefulErrorMessage(exception)));\n //System.out.println(extractUsefulErrorMessage(exception));\n }\n catch (NestedRuntimeException exception) {\n System.out.println(\"Skipped batch: contained malformed item(s), blank line, or a required Dept/Collection was missing. Details:\");\n System.out.println(extractUsefulErrorMessage(exception));\n } finally {\n itemRepo.flush();\n }\n itemBuffer.clear();\n batchAdded = true;\n }\n\n // TODO: trim whitespace etc for all values?\n\n Item item = new Item();\n // id is auto-generated\n\n // TODO: check for null collection and skip this individual Item (never add it to the buffer, and reduce the\n // total number of items to add (i.e. fullBatches and/or lastBatchSize etc))\n item.setCollection(collectionsAdded.get(sanitizeString(row.get(collectionHeading))));\n item.setItemRef(row.get(itemRefHeading).trim());\n\n if (row.get(locationHeadingArchive) != null) {\n item.setLocation(row.get(locationHeadingArchive));\n } else if (row.get(locationHeadingMuseum) != null) {\n item.setLocation(row.get(locationHeadingMuseum));\n }\n\n if (row.get(nameHeading) != null &&\n !truncateString(row.get(nameHeading), 200).isEmpty()) {\n item.setName(truncateString(row.get(nameHeading), 200));\n } else {\n item.setName(row.get(itemRefHeading));\n }\n\n if (row.get(descriptionHeadingMuseum) != null) {\n item.setDescription(row.get(descriptionHeadingMuseum));\n } else if (row.get(descriptionHeadingArchive) != null) {\n item.setDescription(row.get(descriptionHeadingArchive));\n }\n\n if (allIrns.get(row.get(itemRefHeading)) != null) {\n item.setMediaIrns(stringifyIrns(allIrns.get(row.get(itemRefHeading))));\n }\n\n if (mediaCounts.get(row.get(itemRefHeading)) == null) {\n item.setMediaCount(0);\n } else {\n item.setMediaCount(mediaCounts.get(row.get(itemRefHeading)));\n }\n\n if (row.get(copyrightHeading) !=null) {\n item.setCopyrighted(row.get(copyrightHeading));\n } else {\n item.setCopyrighted(\"Unknown\");\n }\n\n\n if (row.get(displayDateHeadingArchive) != null && !StringUtils.isAllBlank(row.get(displayDateHeadingArchive))) {\n item.setDisplayDate(row.get(displayDateHeadingArchive));\n } else if (row.get(displayDateHeadingMuseum) != null && !StringUtils.isAllBlank(row.get(displayDateHeadingMuseum))) {\n item.setDisplayDate(row.get(displayDateHeadingMuseum));\n }\n\n if (item.getDisplayDate() != null) {\n DateMatcher dateMatcher = new DateMatcher();\n dateMatcher.matchAttempt(item.getDisplayDate());\n item.setStartDate(dateMatcher.startDate);\n item.setEndDate(dateMatcher.endDate);\n }\n\n if (row.get(extentHeadingArchive) != null) {\n item.setExtent(row.get(extentHeadingArchive));\n } else if (row.get(extentHeadingMuseum) != null) {\n item.setExtent(row.get(extentHeadingMuseum));\n }\n\n // Missing/already used\n //item.setPhysTechDesc();\n\n item.setCollectionDisplayName(truncateString(sanitizeString(row.get(collectionDisplayNameHeading)), 200));\n item.setThumbnailIrn();\n itemBuffer.add(item);\n return batchAdded;\n }", "int batchInsertSelective(@Param(\"list\") List<Token1155InventoryWithBLOBs> list, @Param(\"selective\") Token1155InventoryWithBLOBs.Column ... selective);", "public java.util.List<Object> generateDataSet(java.util.List<Object> genericProperties);", "private void processMetadataFromLoader() {\n\n int recordCount = mdi.readInt();\n\n long currentTime = System.currentTimeMillis();\n synchronized (entities) {\n clearOldTempIndexes(currentTime);\n\n for (int i = 0; i < recordCount; i++) {\n int tempIndex = mdi.readInt();\n assert DirectProtocol.isValidTempIndex(tempIndex);\n String symbol = mdi.readCharSequence().toString().intern();\n\n ConstantIdentityKey key;\n int entityIndex = entities.get(symbol, NOT_FOUND_VALUE);\n if (entityIndex == NOT_FOUND_VALUE) {\n entityIndex = entities.size();\n key = new ConstantIdentityKey(symbol);\n entities.put(key, entityIndex);\n } else {\n key = entities.getKeyObject(symbol);\n }\n\n // Note: key is guarantied to be same object as in \"entities\" field\n tempIndexes.put(tempIndex, key);\n\n sendMetadata(symbol, entityIndex);\n }\n if (recordCount > 0) {\n lastTempIndexAdded = currentTime;\n }\n }\n }", "default DataSet bulkUpdateDataSetItems(List<String> primaryKeys, DataSetItem dataSetItem, AuthenticationInfo authenticationInfo, Parameters params) {\n throw new UnsupportedOperationException(\"Bulk update is not supported by this web service\");\n }", "void bulkInsertOrReplace (List<Consumption> entities);", "@Test\r\n\tpublic void testToArrayType() {\r\n\t\tMunitions[] sample1 = new Munitions[5];\r\n\t\tsample1 = list.toArray(sample1);\r\n\t\tAssert.assertEquals(15, sample1.length);\r\n\t\tfor (int i = 0; i < sample1.length; i++) {\r\n\t\t\tAssert.assertNotNull(sample1[i]);\r\n\t\t}\r\n\t\tMunitions[] sample2 = new Munitions[20];\r\n\t\tsample2 = list.toArray(sample2);\r\n\t\tAssert.assertEquals(20, sample2.length);\r\n\t\tfor (int i = 0; i < sample2.length - list.size(); i++) {\r\n\t\t\tAssert.assertNotNull(sample1[i]);\r\n\t\t}\r\n\t}", "public SampletypeBean[] save(SampletypeBean[] pObjects) throws SQLException \n {\n for (int iIndex = 0; iIndex < pObjects.length; iIndex ++){\n save(pObjects[iIndex]);\n }\n return pObjects;\n }", "private Object[] buildResult(RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException\n { Deleting objects: we need to create a new object array\n\t\t// It's useless to call RowDataUtil.resizeArray\n\t\t//\n\t\tObject[] outputRowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() );\n\t\tint outputIndex = 0;\n\t\t\n\t\t// Copy the data from the incoming row, but remove the unwanted fields in the same loop...\n\t\t//\n\t\tint removeIndex=0;\n\t\tfor (int i=0;i<rowMeta.size();i++) {\n\t\t\tif (removeIndex<data.removeNrs.length && i==data.removeNrs[removeIndex]) {\n\t\t\t\tremoveIndex++;\n\t\t\t} else\n\t\t\t{\n\t\t\t\toutputRowData[outputIndex++]=rowData[i];\n\t\t\t}\n\t\t}\n\n // Add the unpivoted fields...\n\t\t//\n for (int i=0;i<data.targetResult.length;i++)\n {\n Object resultValue = data.targetResult[i];\n DenormaliserTargetField field = meta.getDenormaliserTargetField()[i];\n switch(field.getTargetAggregationType())\n {\n case DenormaliserTargetField.TYPE_AGGR_AVERAGE :\n long count = data.counters[i];\n Object sum = data.sum[i];\n if (count>0)\n {\n \tif (sum instanceof Long) resultValue = (long)((Long)sum / count);\n \telse if (sum instanceof Double) resultValue = (double)((Double)sum / count);\n \telse if (sum instanceof BigDecimal) resultValue = ((BigDecimal)sum).divide(new BigDecimal(count));\n \telse resultValue = null; // TODO: perhaps throw an exception here?<\n }\n break;\n case DenormaliserTargetField.TYPE_AGGR_COUNT_ALL :\n if (resultValue == null) resultValue = Long.valueOf(0);\n if (field.getTargetType() != ValueMetaInterface.TYPE_INTEGER)\n {\n resultValue = data.outputRowMeta.getValueMeta(outputIndex).convertData(new ValueMeta(\"num_values_aggregation\", ValueMetaInterface.TYPE_INTEGER), resultValue);\n }\n break;\n default: break;\n }\n outputRowData[outputIndex++] = resultValue;\n }\n \n return outputRowData;\n }", "@Test\n public void testLoadToStagingTable() {\n\n // create a list of 8 transfer objects and set the batch size to 5\n List<BulkLoadElementTO> lTOList = populateBulkLoadElementTO( 8 );\n setBatchSize( 5 );\n\n // load the data to the staging table. All data should be written with two batch operations\n // (one for 5 rows and one for 3 rows)\n iBulkLoadDataService.loadToStagingTable( lTOList, iFileImportKey );\n\n // assert whether all 8 rows have been written to the staging table\n BulkLoadElementTableRow lBulkLoadElementRow;\n for ( int i = 0; i < 8; i++ ) {\n lBulkLoadElementRow = iBulkLoadElementDao.findByPrimaryKey(\n new BulkLoadElementKey( iFileImportKey.getDbId(), iFileImportKey.getId(), i ) );\n\n assertEquals( \"Component 1 (C0)\", C0, lBulkLoadElementRow.getC0() );\n\n }\n }", "@Override\n protected List<Serializable> persistEntities(PersistentEntity persistentEntity, Iterable objs) {\n List<Serializable> keys = new ArrayList<Serializable>();\n for (Object obj : objs) {\n keys.add(persist(obj));\n }\n return keys;\n }", "@Override\n public <T> List<StateValue<T>> loadBulk(String correlationId, List<String> keys) {\n // Cleanup the stored states\n this.cleanup();\n\n List<StateValue<T>> result = new ArrayList<>();\n\n for (var key : keys) {\n T value = this.load(correlationId, key);\n result.add(new StateValue<T>(key, value));\n }\n\n return result;\n }", "BoundQuery<?,Ttuple> getAll(Type<?> type) \n throws DataException;", "@Test\n public void testOmittedValues() {\n TupleMetadata schema = new SchemaBuilder()\n .add(\"id\", MinorType.INT)\n .addMapArray(\"m\")\n .addNullable(\"a\", MinorType.INT)\n .addNullable(\"b\", MinorType.VARCHAR)\n .resumeSchema()\n .buildSchema();\n ResultSetLoaderImpl.ResultSetOptions options = new ResultSetOptionBuilder()\n .readerSchema(schema)\n .rowCountLimit(ValueVector.MAX_ROW_COUNT)\n .build();\n ResultSetLoader rsLoader = new ResultSetLoaderImpl(fixture.allocator(), options);\n RowSetLoader rootWriter = rsLoader.writer();\n\n int mapSkip = 5;\n int entrySkip = 3;\n int rowCount = 1000;\n int entryCount = 10;\n\n rsLoader.startBatch();\n ArrayWriter maWriter = rootWriter.array(\"m\");\n TupleWriter mWriter = maWriter.tuple();\n for (int i = 0; i < rowCount; i++) {\n rootWriter.start();\n rootWriter.scalar(0).setInt(i);\n if (i % mapSkip != 0) {\n for (int j = 0; j < entryCount; j++) {\n if (j % entrySkip != 0) {\n mWriter.scalar(0).setInt(i * entryCount + j);\n mWriter.scalar(1).setString(\"b-\" + i + \".\" + j);\n }\n maWriter.save();\n }\n }\n rootWriter.save();\n }\n\n RowSet result = fixture.wrap(rsLoader.harvest());\n assertEquals(rowCount, result.rowCount());\n RowSetReader reader = result.reader();\n ArrayReader maReader = reader.array(\"m\");\n TupleReader mReader = maReader.tuple();\n for (int i = 0; i < rowCount; i++) {\n assertTrue(reader.next());\n assertEquals(i, reader.scalar(0).getInt());\n if (i % mapSkip == 0) {\n assertEquals(0, maReader.size());\n continue;\n }\n assertEquals(entryCount, maReader.size());\n for (int j = 0; j < entryCount; j++) {\n assertTrue(maReader.next());\n if (j % entrySkip == 0) {\n assertTrue(mReader.scalar(0).isNull());\n assertTrue(mReader.scalar(1).isNull());\n } else {\n assertFalse(mReader.scalar(0).isNull());\n assertFalse(mReader.scalar(1).isNull());\n assertEquals(i * entryCount + j, mReader.scalar(0).getInt());\n assertEquals(\"b-\" + i + \".\" + j, mReader.scalar(1).getString());\n }\n }\n }\n result.clear();\n rsLoader.close();\n }", "public java.util.List<Object> execute(java.util.List<Object> inputData);", "protected abstract void splitBAMs();", "private Set<Product> payloadToProductSet(LinkedHashMap body) { //throws Exception {\n //System.out.println(\"body: \" + body.toString());\n ArrayList arrayListProducts = (ArrayList) body.get(\"product\");\n //System.out.println(\"arrayList: \" + arrayListProducts);\n Set<Product> productSet = new HashSet<>();\n// try {\n arrayListProducts.forEach(\n productIndex -> {\n ((HashMap) productIndex).values().forEach(\n productValue -> {\n Product product = new Product();\n TreeMap<Tab, TreeMap<Category, TreeMap<Item, TreeSet<Tag>>>> tabMap = new TreeMap();\n //System.out.println(\"productValue: \" + productValue);\n ((HashMap) productValue).forEach(\n (substanceKey, substanceValue) -> {\n //System.out.println(\"substanceKey: \" + substanceKey);\n //System.out.println(\"substanceValue: \" + substanceValue);\n ((HashMap) substanceValue).values().forEach(\n tabArrayWrapped -> {\n //System.out.println(\"tabArrayWrapped: \" + tabArrayWrapped);\n ((ArrayList) tabArrayWrapped).forEach(\n tabArrayUnwrapped -> {\n //System.out.println(\"tabArrayUnwrapped: \" + tabArrayUnwrapped);\n ((HashMap) tabArrayUnwrapped).forEach(\n (tabKey, tabValue) -> {\n TreeMap<Category, TreeMap<Item, TreeSet<Tag>>> categoryMap = new TreeMap<>();\n //System.out.println(\"tabValue: \" + tabValue);\n ((HashMap) tabValue).values().forEach(\n categoryWrapped -> {\n //System.out.println(\"categoryWrapped: \" + categoryWrapped);\n ((ArrayList) categoryWrapped).forEach(\n categoryUnwrapped -> {\n //System.out.println(\"categoryUnwrapped: \" + categoryUnwrapped);\n ((HashMap) categoryUnwrapped).forEach(\n (categoryKey, categoryValue) -> {\n TreeMap<Item, TreeSet<Tag>> itemMap = new TreeMap();\n //System.out.println(\"categoryValue: \" + categoryValue);\n ((HashMap) categoryValue).values().forEach(\n itemWrapped -> {\n //System.out.println(\"itemWrapped: \" + itemWrapped);\n ((ArrayList) itemWrapped).forEach(\n itemUnwrapped -> {\n\n Item item = new Item();\n //System.out.println(\"itemUnwrapped: \" + itemUnwrapped);\n ((HashMap) itemUnwrapped).forEach(\n (itemKey, itemValue) -> {\n //System.out.println(\"itemKey: \" + itemKey + \" itemValue: \" + itemValue);\n if (itemKey.equals(\"Title\")) {\n item.setName(itemValue.toString());\n }\n if (itemKey.equals(\"Description\")) {\n item.setDescription(itemValue.toString());\n }\n if (itemKey.equals(\"Tag\")) {\n TreeSet<Tag> tagSet = new TreeSet();\n ((ArrayList) itemValue).forEach(tagName -> tagSet.add(new Tag(tagName.toString())));\n itemMap.put(item, tagSet);\n categoryMap.put(new Category(categoryKey.toString()), itemMap);\n tabMap.put(new Tab(tabKey.toString()), categoryMap);\n product.getProduct().put(new Substance(substanceKey.toString()), tabMap);\n productSet.add(product);\n }\n });\n });\n });\n });\n });\n });\n });\n });\n });\n });\n });\n });\n// }\n// catch (Exception ex){\n// System.out.println(\"Ex: \" + ex.getMessage());\n// }\n\n return productSet;\n }", "public static void buildElements(Object p,Object v,List<DataElement> dataVect) {\n if(!(p instanceof Iterable<?>)) p=null;\r\n if(!(v instanceof Iterable<?>)) v=null;\r\n if(p==null && v==null) return;\r\n Iterator<?> pi=(p==null)?null:((Iterable<?>)p).iterator();\r\n Iterator<?> vi=(v==null)?null:((Iterable<?>)v).iterator();\r\n while((pi!=null && pi.hasNext()) || (vi!=null && vi.hasNext())) {\r\n Object po=(pi==null)?null:pi.next();\r\n Object vo=(vi==null)?null:vi.next();\r\n int[] params=null;\r\n float[] vals=null;\r\n // if(po instanceof NativeArray) po=new IterableNativeArray((NativeArray)po);\r\n if(po instanceof int[]) params=(int[])po;\r\n else if(po instanceof Iterable<?>) {\r\n Iterable<?> i=(Iterable<?>)po;\r\n int cnt=0;\r\n for(Iterator<?> iter=i.iterator(); iter.hasNext(); iter.next()) {\r\n cnt++;\r\n }\r\n params=new int[cnt];\r\n cnt=0;\r\n for(Object o:i) {\r\n params[cnt]=ScriptUtil.objectToInt(o);\r\n cnt++;\r\n }\r\n } else if(po!=null) {\r\n params=new int[1];\r\n params[0]=ScriptUtil.objectToInt(po);\r\n }\r\n // if(vo instanceof NativeArray) vo=new IterableNativeArray((NativeArray)vo);\r\n if(vo instanceof float[]) vals=(float[])vo;\r\n else if(vo instanceof Iterable<?>) {\r\n Iterable<?> i=(Iterable<?>)vo;\r\n int cnt=0;\r\n for(Iterator<?> iter=i.iterator(); iter.hasNext(); iter.next()) {\r\n cnt++;\r\n }\r\n vals=new float[cnt];\r\n cnt=0;\r\n for(Object o:i) {\r\n vals[cnt]=ScriptUtil.objectToFloat(o);\r\n cnt++;\r\n }\r\n } else if(vo!=null) {\r\n vals=new float[1];\r\n vals[0]=ScriptUtil.objectToFloat(vo);\r\n }\r\n if(params==null) params=new int[0];\r\n if(vals==null) vals=new float[0];\r\n dataVect.add(new DataElement(params,vals));\r\n }\r\n }", "public void map( Chunk bv ) { }", "public void cleanse(Set<Bundles> active) {\r\n // Clear the ent_2_i's\r\n ent_2_i.clear(); post_processors = null;\r\n\r\n // Initialize by creating a lookup for the post processors\r\n Map<BundlesDT.DT, Set<PostProc>> pp_lu = new HashMap<BundlesDT.DT, Set<PostProc>>();\r\n String pp_strs[] = BundlesDT.listEnabledPostProcessors();\r\n for (int i=0;i<pp_strs.length;i++) {\r\n PostProc pp = BundlesDT.createPostProcessor(pp_strs[i], this);\r\n BundlesDT.DT dt = pp.type();\r\n if (pp_lu.containsKey(dt) == false) pp_lu.put(dt, new HashSet<PostProc>());\r\n pp_lu.get(dt).add(pp);\r\n }\r\n\r\n // First, accumulate all of the active entities\r\n Set<String> active_entities = new HashSet<String>();\r\n Iterator<Bundles> it_bs = active.iterator();\r\n while (it_bs.hasNext()) {\r\n Bundles bundles = it_bs.next();\r\n Iterator<Tablet> it_tab = bundles.tabletIterator();\r\n while (it_tab.hasNext()) {\r\n Tablet tablet = it_tab.next();\r\n // Figure out which fields are in the tablet\r\n\tList<Integer> fld_is = new ArrayList<Integer>();\r\n\tfor (int fld_i=0;fld_i<bundles.getGlobals().numberOfFields();fld_i++) {\r\n\t if (tablet.hasField(fld_i)) fld_is.add(fld_i);\r\n }\r\n\tint fields[] = new int[fld_is.size()]; for (int i=0;i<fields.length;i++) fields[i] = fld_is.get(i);\r\n\t// Go through the individual bundle elements\r\n\tIterator<Bundle> it = tablet.bundleIterator();\r\n\twhile (it.hasNext()) {\r\n\t Bundle bundle = it.next();\r\n\t for (int i=0;i<fields.length;i++) {\r\n // System.err.println(\"cleanse:fields[\" + i + \"] = \" + fields[i]); // abc DEBUG\r\n\t String ent = bundle.toString(fields[i]);\r\n\t active_entities.add(ent); \r\n addFieldEntity(fields[i], ent);\r\n\t // Add the post processor versions...\r\n BundlesDT.DT datatype = BundlesDT.getEntityDataType(ent);\r\n if (pp_lu.containsKey(datatype)) {\r\n\t Iterator<PostProc> it_pp = pp_lu.get(datatype).iterator();\r\n\t while (it_pp.hasNext()) {\r\n\t String converts[] = it_pp.next().postProcess(ent);\r\n\t\tfor (int j=0;j<converts.length;j++) {\r\n active_entities.add(converts[j]);\r\n }\r\n }\r\n\t }\r\n\t }\r\n\t}\r\n }\r\n }\r\n // Re-add the range values\r\n addRangeIntegers();\r\n // Clear the caches\r\n CacheManager.clearCaches();\r\n // Lastly, clear transforms\r\n resetTransforms();\r\n }", "public abstract ParallelLongArray allUniqueElements();", "void onParsableDataResult(List<T> parsableData);", "private void fetchColumnValuePairs(AnalysisFileStructureModel hfsm) {\n if(null==hfsm||null==hfsm.getColumnNameList()||hfsm.getColumnNameList().isEmpty()||\n null==hfsm.getColumnTypeList()||hfsm.getColumnTypeList().isEmpty()||hfsm.getColumnTypeList().size()!=hfsm.getColumnNameList().size()){\n String errString=\"AnalysisHadoopFileStructureModel nor column names nor getColumnTypeList can not be null nor have diffrent sizes\";\n throw new IllegalArgumentException(errString);\n }\n\n List<String> hColumnNames = hfsm.getColumnNameList();\n List<String> hColumnValues = hfsm.getColumnTypeList();\n\n generateTheColumnNameColumnTypeMap(hColumnNames, hColumnValues);\n\n }", "@Override\n\tpublic long insertObjs(T... t) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tfor (T obj : t) {\n\t\t\tlist.add(obj);\n\t\t}\n\t\treturn insertObjs(list);\n\t\t// int optNum = 0;\n\t\t// for(T obj : t){\n\t\t// InsertBuider<T> buider = insertBuider();\n\t\t// buider.addValue(obj);\n\t\t// helper.getDatabase(false).insert(buider.tableInfo.tableName, null,\n\t\t// buider.cvs);\n\t\t// optNum++;\n\t\t// }\n\t\t// return optNum;\n\t}", "void processSingleValue(int numDocs, int[] outGroupIds);", "private void writeColumnsFromBag(ByteBuffer key, DataBag bag) throws IOException\n {\n List<Mutation> mutationList = new ArrayList<Mutation>();\n for (Tuple pair : bag)\n {\n Mutation mutation = new Mutation();\n if (DataType.findType(pair.get(1)) == DataType.BAG) // supercolumn\n {\n SuperColumn sc = new SuperColumn();\n sc.setName(objToBB(pair.get(0)));\n List<org.apache.cassandra.thrift.Column> columns = new ArrayList<org.apache.cassandra.thrift.Column>();\n for (Tuple subcol : (DataBag) pair.get(1))\n {\n org.apache.cassandra.thrift.Column column = new org.apache.cassandra.thrift.Column();\n column.setName(objToBB(subcol.get(0)));\n column.setValue(objToBB(subcol.get(1)));\n column.setTimestamp(FBUtilities.timestampMicros());\n columns.add(column);\n }\n if (columns.isEmpty())\n {\n if (allow_deletes)\n {\n mutation.deletion = new Deletion();\n mutation.deletion.super_column = objToBB(pair.get(0));\n mutation.deletion.setTimestamp(FBUtilities.timestampMicros());\n }\n else\n throw new IOException(\"SuperColumn deletion attempted with empty bag, but deletes are disabled, set \" +\n PIG_ALLOW_DELETES + \"=true in environment or allow_deletes=true in URL to enable\");\n }\n else\n {\n sc.columns = columns;\n mutation.column_or_supercolumn = new ColumnOrSuperColumn();\n mutation.column_or_supercolumn.super_column = sc;\n }\n }\n else\n mutation = mutationFromTuple(pair);\n mutationList.add(mutation);\n // for wide rows, we need to limit the amount of mutations we write at once\n if (mutationList.size() >= 10) // arbitrary, CFOF will re-batch this up, and BOF won't care\n {\n writeMutations(key, mutationList);\n mutationList.clear();\n }\n }\n // write the last batch\n if (mutationList.size() > 0)\n writeMutations(key, mutationList);\n }", "@Test\n public void bulkUploadTest() throws IOException {\n\n JsonArray result = searchService.matchAllQuery(getIndexes(), 10);\n assertEquals(6, result.size());\n }", "@Override\r\n\tpublic void deleteInBatch(Iterable<Employee> arg0) {\n\t\t\r\n\t}", "@Test\n public void testMultiInsertData() throws Exception {\n String tenantId = \"5cab9a0c-b22e-4640-ac7e-7426dd9fea73\";\n List<Item> items = itemDao.getAllNotDeleteItems(tenantId);\n System.out.println(items.size());\n int pointsDataLimit = 1000;//限制条数\n int size = items.size();\n //判断是否有必要分批\n if (pointsDataLimit < size) {\n int part = size / pointsDataLimit;//分批数\n System.out.println(\"共有 : \" + size + \"条,!\" + \" 分为 :\" + part + \"批\");\n for (int i = 0; i < part; i++) {\n //1000条\n List<Item> listPage = items.subList(0, pointsDataLimit);\n String json = EsJsonUtils.generateMultiInsertItem(listPage);\n System.out.println(json);\n elasticSearchDao.bulkDealData(TENANT_ID + Constants.INDEX_SPLIT + Constants.ITEM,Constants.ITEM,json);\n //剔除\n items.subList(0, pointsDataLimit).clear();\n }\n if (!items.isEmpty()) {\n String json = EsJsonUtils.generateMultiInsertItem(items);\n System.out.println(json);\n elasticSearchDao.bulkDealData(TENANT_ID+ Constants.INDEX_SPLIT + Constants.ITEM,Constants.ITEM,json);\n }\n }\n }", "protected abstract Object[] getValues(T t);", "@SuppressWarnings(\"unchecked\")\n\tprivate Entity[] castEntityAsArray(final Entity entity)\n\t{\n\t\t// determine the type of class this is at runtime and create an array for it\n\t\tClass<? extends Entity> anyTypeClass = (Class<? extends Entity>) entity.getClass();\n\t\tEntity[] newArray = (Entity[]) Array.newInstance(anyTypeClass, 1);\n\t\tnewArray[0] = entity;\n\t\treturn newArray;\n\t}", "private<T> void addManyResults(T... results)\n {\n int i =0;\n for(T result : results)\n {\n this.add(\"morgen-main-result\"+i, new LazyDynamicPrimitive<>(result));\n i++;\n }\n\n results = null; // Prevents Heap pollution\n }", "int insertSelective(AccountAccountTemplateEntityWithBLOBs record);", "public abstract ArrayList<Object> calculateTransform(ArrayList<Integer> arr);", "@Override\n public void write(List<? extends SubmittedVariantEntity> submittedVariantsRemapped) {\n List<SubmittedVariantEntity> svesToInsert = new ArrayList<>(submittedVariantsRemapped);\n\n // Resolve duplicate hashes and accessions before inserting; note that hash resolution must happen first.\n ImmutablePair<List<SubmittedVariantEntity>, List<SubmittedVariantOperationEntity>> duplicateHashDiscards =\n resolveDuplicateHashes(svesToInsert);\n ImmutablePair<List<SubmittedVariantEntity>, List<SubmittedVariantOperationEntity>> duplicateAccessionDiscards =\n resolveDuplicateAccessions(svesToInsert);\n\n List<SubmittedVariantEntity> svesToDiscard = Stream.concat(duplicateHashDiscards.getLeft().stream(),\n duplicateAccessionDiscards.getLeft().stream())\n .collect(Collectors.toList());\n List<SubmittedVariantOperationEntity> discardOperations = Stream.concat(duplicateHashDiscards.getRight().stream(),\n duplicateAccessionDiscards.getRight().stream())\n .collect(Collectors.toList());\n\n BulkOperations bulkOperations = mongoTemplate.bulkOps(BulkOperations.BulkMode.UNORDERED,\n SubmittedVariantEntity.class,\n collection);\n // Deal with discards before inserts, to avoid DuplicateKeyExceptions\n if (discardOperations.size() > 0) {\n try {\n BulkOperations svoeBulkOperations = mongoTemplate.bulkOps(BulkOperations.BulkMode.UNORDERED,\n SubmittedVariantOperationEntity.class,\n operationCollection);\n svoeBulkOperations.insert(discardOperations);\n BulkWriteResult bulkWriteResult = svoeBulkOperations.execute();\n remappingIngestCounts.addRemappedVariantsDiscarded(bulkWriteResult.getInsertedCount());\n\n } catch (DuplicateKeyException exception) {\n // As we check for hash collisions in submitted variants, we should only get duplicate keys from\n // trying to insert an identical DISCARD operation, which shouldn't happen even when rerunning\n // (since identical SVEs are skipped).\n MongoBulkWriteException writeException = ((MongoBulkWriteException) exception.getCause());\n BulkWriteResult bulkWriteResult = writeException.getWriteResult();\n\n List<String> duplicatesSkipped = MongoBulkWriteExceptionUtils\n .extractUniqueHashesForDuplicateKeyError(writeException).collect(Collectors.toList());\n logger.warn(\"Duplicate key exception when inserting DISCARD operations: \" + duplicatesSkipped);\n\n remappingIngestCounts.addRemappedVariantsDiscarded(bulkWriteResult.getInsertedCount());\n remappingIngestCounts.addRemappedVariantsSkipped(duplicatesSkipped.size());\n }\n }\n if (svesToDiscard.size() > 0) {\n bulkOperations.remove(query(where(\"_id\").in(\n svesToDiscard.stream().map(SubmittedVariantEntity::getHashedMessage)\n .collect(Collectors.toSet()))));\n bulkOperations.execute();\n }\n\n if (svesToInsert.size() > 0) {\n bulkOperations.insert(svesToInsert);\n BulkWriteResult bulkWriteResult = bulkOperations.execute();\n remappingIngestCounts.addRemappedVariantsIngested(bulkWriteResult.getInsertedCount());\n }\n }", "@Override\n public void map(Chunk cs[]) {\n _vocabHM = VOCABHM;\n\n for (Chunk chk : cs) if (chk instanceof CStrChunk) {\n ValueStringCount tmp = new ValueStringCount();\n for (int row = 0; row < chk._len; row++) {\n chk.atStr(tmp, row);\n ValueStringCount tmp2 = VOCABHM.get(tmp);\n if (tmp2 == null) {\n VOCABHM.put(tmp, tmp);\n tmp = new ValueStringCount();\n } else tmp2.inc();\n }\n } // silently ignores other column types\n }", "private Object arrayToSPLArray(String name, JSONArray jarr, Type ptype) throws Exception {\n\t\tif(l.isLoggable(TraceLevel.DEBUG)) {\n\t\t\tl.log(TraceLevel.DEBUG, \"Creating Array: \" + name);\n\t\t}\n\t\tCollectionType ctype = (CollectionType) ptype;\n\t\tint cnt=0;\n\t\tString cname = \"List: \" + name;\n\n\t\tswitch(ctype.getElementType().getMetaType()) {\n\t\tcase INT8:\n\t\tcase UINT8: \n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tbyte[] arr= new byte[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Byte)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT16:\n\t\tcase UINT16:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tshort[] arr= new short[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Short)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT32:\n\t\tcase UINT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tint[] arr= new int[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Integer)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase INT64:\n\t\tcase UINT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tlong[] arr= new long[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Long)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase BOOLEAN:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tboolean[] arr= new boolean[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Boolean)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tfloat[] arr= new float[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Float)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tdouble[] arr= new double[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Double)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase USTRING:\n\t\t{\n\t\t\tList<String> lst = new ArrayList<String>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((String)obj);\n\t\t\t}\n\t\t\treturn lst.toArray(new String[lst.size()]);\n\t\t} \n\n\t\tcase BSTRING:\n\t\tcase RSTRING:\n\t\t{\n\t\t\tList<RString> lst = new ArrayList<RString>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((RString)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase TUPLE:\n\t\t{\n\t\t\tList<Tuple> lst = new ArrayList<Tuple>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Tuple)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase LIST:\n\t\tcase BLIST:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase SET:\n\t\tcase BSET:\n\t\t{\n\t\t\tSet<Object> lst = new HashSet<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase DECIMAL32:\n\t\tcase DECIMAL64:\n\t\tcase DECIMAL128:\n\t\t{\n\t\t\tList<BigDecimal> lst = new ArrayList<BigDecimal>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((BigDecimal)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase TIMESTAMP:\n\t\t{\n\t\t\tList<Timestamp> lst = new ArrayList<Timestamp>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Timestamp)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\n\t\t//TODO -- not yet supported types\n\t\tcase BLOB:\n\t\tcase MAP:\n\t\tcase BMAP:\n\t\tcase COMPLEX32:\n\t\tcase COMPLEX64:\n\t\tdefault:\n\t\t\tthrow new Exception(\"Unhandled array type: \" + ctype.getElementType().getMetaType());\n\t\t}\n\n\t}", "protected GenericBatch(int textureUnits, int texCoordCount, int size, boolean hasColor, VertexAttribute... generic)\n\t{\n\t\tsuper(size, createAttributes(texCoordCount, hasColor, generic));\n\t\tthis.hasColor = hasColor;\n\t\tthis.textures = new TextureRegion[textureUnits];\n\t\tthis.texCoordCount = texCoordCount;\n\t\tthis.genericAttribs = generic;\n\t}", "private List<Entity> processEntities(List<Mapping> mappings, Map record) throws Exception{\n\n\t\tList<Entity> builtEnts = new ArrayList<Entity>();\n\t\t\n\t\tList<Entity> entities = buildEntities();\n\t\t\n\t\tboolean isOmitted = isOmitted(record);\n\t\t\n\t\t/*\n\t\tfor(String omkeyfull: OMISSIONS_MAP.keySet()) {\n\t\t\t\n\t\t\tString[] omkeys = omkeyfull.split(\":\");\n\t\t\t\n\t\t\tisOmitted = iterateOmkeys(Arrays.asList(omkeys), record);\n\t\t\t\n\t\t}\n*/\t\t\n\t\t\n\t\tif(!isOmitted){\n\t\t\t\n\t\t\tfor(Mapping mapping: mappings){\n\t\t\t\tList<Object> relationalValue = new ArrayList<Object>();\n\n\t\t\t\tif(!IS_DIR) {\n\t\t\t\t\t\n\t\t\t\t\tString[] array = new String[mapping.getKey().split(\":\").length - 1];\n\t\t\t\t\tarray[0] = mapping.getKey().split(\":\")[0] + \":\" + RELATIONAL_KEY;\n\t\t\t\t\trelationalValue = findValueByKey(record,array);\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tString[] array = new String[mapping.getKey().split(\":\").length - 1];\n\t\t\t\t\tarray[0] = mapping.getKey().split(\":\")[0] + \":\" + RELATIONAL_KEY;\n\t\t\t\t\trelationalValue = findValueByKey(record,array);\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tDataType dt = DataType.initDataType(StringUtils.capitalize(mapping.getDataType()));\n\t\t\t\t\n\t\t\t\tif(!mapping.getDataType().equalsIgnoreCase(\"OMIT\")){\n\t\t\t\t\tList<Object> values = new ArrayList<Object>();\n\t\t\t\t\t\n\t\t\t\t\tif(!IS_DIR) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tString[] array = new String[mapping.getKey().split(\":\").length - 1];\n\t\t\t\t\t\tarray[0] = mapping.getKey();\n\t\t\t\t\t\tvalues = findValueByKey2(record,new ArrayList(Arrays.asList(array)));\n\t\t\t\t\t\t//values = findValueByKey2(record, new ArrayList(Arrays.asList(mapping.getKey().split(\":\"))));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tString[] array = new String[mapping.getKey().split(\":\").length - 1];\n\t\t\t\t\t\tarray[0] = mapping.getKey();\n\t\t\t\t\t\tvalues = findValueByKey2(record,new ArrayList(Arrays.asList(array)));\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\tMap<String,String> options = mapping.buildOptions(mapping);\n\t\t\t\t\t\n\t\t\t\t\tif(!options.isEmpty()) {\n\t\t\t\t\t\tif(options.containsKey(\"TYPE\")) {\n\t\t\t\t\t\t\tString type = options.get(\"TYPE\");\n\t\t\t\t\t\t\tif(type.equalsIgnoreCase(\"datediffin\")) {\n\n\t\t\t\t\t\t\t\tString dateDiffFrom = options.containsKey(\"DIFFFROM\") ? options.get(\"DIFFFROM\").replaceAll(\"-\",\":\"): null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString mask = options.containsKey(\"MASK\") ? options.get(\"MASK\"): null;\n\n\t\t\t\t\t\t\t\tString diffIn = options.containsKey(\"DIFFIN\") ? options.get(\"DIFFIN\"): null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tLocalDate startDateInclusive = null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tLocalDate endDateExclusive = null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(dateDiffFrom.equalsIgnoreCase(\"sysdate\")) {\n\t\t\t\t\t\t\t\t\tstartDateInclusive = LocalDate.now();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tObject fromO = \n\t\t\t\t\t\t\t\t\t\t\tfindValueByKey(new LinkedHashMap(record), dateDiffFrom.split(\":\")).get(0);\n\n\t\t\t\t\t\t\t\t\tif(mask != null) {\n\t\t\t\t\t\t\t\t\t\tif(fromO != null) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tString from = fromO.toString();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tstartDateInclusive = LocalDate.parse(from, DateTimeFormatter.ofPattern(mask) );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t} else throw new Exception(\"No mask given\");\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor(int x = 0; x < values.size(); x++) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString value = values.get(0).toString();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tendDateExclusive = value.isEmpty() ? null: LocalDate.parse(value, DateTimeFormatter.ofPattern(mask) );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(endDateExclusive != null) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPeriod period = Period.between(endDateExclusive, startDateInclusive );\n\n\t\t\t\t\t\t\t\t\t\tvalues.remove(x);\n\t\t\t\t\t\t\t\t\t\tif(diffIn.equalsIgnoreCase(\"years\")) {\n\t\t\t\t\t\t\t\t\t\t\tvalues.add(x, period.getYears());\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\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} else if(type.equalsIgnoreCase(\"datedifffrom\")) {\n\t\t\t\t\t\t\t\tString dateDiffFrom = options.containsKey(\"DIFFFROM\") ? options.get(\"DIFFFROM\").replaceAll(\"-\",\":\"): null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString mask = options.containsKey(\"MASK\") ? options.get(\"MASK\"): null;\n\n\t\t\t\t\t\t\t\tString diffIn = options.containsKey(\"DIFFIN\") ? options.get(\"DIFFIN\"): null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tLocalDate startDateInclusive = null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tLocalDate endDateExclusive = null;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(dateDiffFrom.equalsIgnoreCase(\"sysdate\")) {\n\t\t\t\t\t\t\t\t\tstartDateInclusive = LocalDate.now();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tObject fromO = \n\t\t\t\t\t\t\t\t\t\t\tfindValueByKey(new LinkedHashMap(record), dateDiffFrom.split(\":\")).get(0);\n\n\t\t\t\t\t\t\t\t\tif(mask != null) {\n\t\t\t\t\t\t\t\t\t\tif(fromO != null) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tString from = fromO.toString();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tstartDateInclusive = LocalDate.parse(from, DateTimeFormatter.ofPattern(mask) );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t} else throw new Exception(\"No mask given\");\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor(int x = 0; x < values.size(); x++) {\n\t\t\t\t\t\t\t\t\tif(values.get(0) != null) {\n\t\t\t\t\t\t\t\t\t\tString value = values.get(0).toString();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tendDateExclusive = value.isEmpty() ? null: LocalDate.parse(value, DateTimeFormatter.ofPattern(mask) );\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(endDateExclusive != null) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tPeriod period = Period.between(startDateInclusive, endDateExclusive);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvalues.remove(x);\n\t\t\t\t\t\t\t\t\t\t\tif(diffIn.equalsIgnoreCase(\"years\")) {\n\t\t\t\t\t\t\t\t\t\t\t\tvalues.add(x, period.getYears());\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tString mappingK = mapping.getKey().split(\":\")[0];\n\t\t\t\t\tString recordK = record.keySet().iterator().next().toString().split(\":\")[0];\n\t\t\t\t\tif(mappingK.equals(recordK)) {\n\t\t\t\t\t\tif(values == null) throw new Exception(\"Following Mapping does not exist in the datafile: \\n\"\n\t\t\t\t\t\t\t\t+ mapping.toCSV() + \"\\n\" +\n\t\t\t\t\t\t\t\t\" be sure that the column and file exist.\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(relationalValue == null) throw new Exception(\"Following Mapping does not exist in the datafile: \\n\"\n\t\t\t\t\t\t\t\t+ mapping.toCSV() + \"\\n\" +\n\t\t\t\t\t\t\t\t\" be sure that the column and file exist.\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tSet<Entity> newEnts = new HashSet<Entity>();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(values.isEmpty()) {\n\t\t\t\t\t\t\tif(INCLUDE_EMPTY_VALUES == true) {\n\t\t\t\t\t\t\t\tnewEnts = dt.generateTables(mapping, entities, values, relationalValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewEnts = dt.generateTables(mapping, entities, values, relationalValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(newEnts != null && newEnts.size() > 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tbuiltEnts.addAll(newEnts);\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}\n\t\t\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn builtEnts;\t\t\n\t}", "B database(S database);", "int batchInsertSelective(@Param(\"list\") List<UserShare5Min> list, @Param(\"selective\") UserShare5Min.Column ... selective);", "@Override\n\tpublic <T> void insertMany(List<T> list) throws Exception {\n\t\t\n\t}", "boolean addAllByteArray(Collection<byte[]> c);", "@Override\n public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)\n {\n\n }", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "public Item(String name, double price, double bulk, double bulkPrice) {\n this(name, price);\n hasBulk = true;\n this.bulk = bulk;\n this.bulkPrice = bulkPrice;\n if(bulk < 0 || bulkPrice < 0) throw new IllegalArgumentException();\n }", "private void populateData() {\n\t\tList<TrafficRecord> l = TestHelper.getSampleData();\r\n\t\tfor(TrafficRecord tr: l){\r\n\t\t\tput(tr);\r\n\t\t}\r\n\t\t \r\n\t}", "@Override\n\tpublic String enableBulk() throws Throwable {\n\t\treturn null;\n\t}", "int insertSelective(@Param(\"record\") TbSerdeParams record, @Param(\"selective\") TbSerdeParams.Column ... selective);", "public BulkWriteOperation initializeOrderedBulkOperation() {\n return new BulkWriteOperation(true, this);\n }" ]
[ "0.5621326", "0.5610368", "0.51877433", "0.51570743", "0.51517266", "0.51514596", "0.5001242", "0.4959352", "0.49474055", "0.4913765", "0.4903194", "0.4884098", "0.48784786", "0.48603734", "0.48563582", "0.48344785", "0.48270828", "0.48105076", "0.47895968", "0.4783529", "0.47735047", "0.47651422", "0.47647044", "0.47402692", "0.4734813", "0.4708784", "0.4707531", "0.47061077", "0.47053453", "0.46908158", "0.4682702", "0.4675916", "0.4672699", "0.46672928", "0.46668455", "0.46660504", "0.46647823", "0.46591702", "0.4653758", "0.465364", "0.464282", "0.46426404", "0.4623723", "0.4622344", "0.46184805", "0.46170938", "0.4613737", "0.46107492", "0.46086174", "0.459808", "0.45976427", "0.45956644", "0.45849243", "0.45838043", "0.4580988", "0.45591107", "0.4557762", "0.4555767", "0.45552802", "0.4551545", "0.45491138", "0.45445937", "0.454093", "0.4538748", "0.45344964", "0.45303106", "0.4528757", "0.45166132", "0.45144823", "0.45044586", "0.4504114", "0.45013723", "0.44846448", "0.44828153", "0.448072", "0.44806474", "0.4470451", "0.4462066", "0.44596168", "0.44554946", "0.44518495", "0.44488624", "0.44467878", "0.44440082", "0.44357792", "0.44356436", "0.44351804", "0.44334078", "0.44331548", "0.44325367", "0.44294092", "0.4422923", "0.44221097", "0.44218022", "0.4420424", "0.44135854", "0.44134676", "0.44114348", "0.44114077", "0.441089", "0.4403298" ]
0.0
-1
/ Construtor do Cliente
public ResultBusca(int pontFolha, int pos, boolean encontrou) { this.pontFolha = pontFolha; this.pos = pos; this.encontrou = encontrou; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Cliente(){}", "public Interfaz_RegistroClientes() {\n initComponents();\n limpiar();\n }", "public Cliente() {\n\t\tsuper();\n\t}", "public TelaCliente() {\n initComponents();\n conexao=ModuloConexao.conector();\n }", "public GerenciarCliente() {\n initComponents();\n }", "public TelaAlterarCliente() {\n\t\tinitComponents();\n\t}", "public Ctacliente() {\n\t}", "public Cliente() {\r\n\t\tSystem.out.println(\"El cliente es: Diego Juarez \"+\"\\n\");\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t}", "public DmaiClient() {\r\n\t\tthis.mainView = new MainView();\r\n\t\tconnexionServeur();\r\n\r\n\t}", "public Echange_Client() throws UnknownHostException, IOException {\n start_Connexion(); \n }", "public ClienteServicio() {\n }", "public Cliente() {\n }", "public CadastroClientes() {\n initComponents();\n }", "public TelaPesquisarClientes() {\n initComponents();\n }", "public Client() {\r\n\t// TODO Auto-generated constructor stub\r\n\t \r\n }", "public Client() {\n\t\t// TODO Auto-generated constructor stub\n\t}", "public TelaCliente() {\n initComponents();\n }", "public TelaCliente() {\n initComponents();\n }", "@Override\n\tpublic void createClient() {\n\t\t\n\t}", "public Clientes() {\n initComponents();\n }", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public TelaCliente() {\n \n CadCli = new Dao_CadastroCliente();\n initComponents();\n BtPesquisarConsulta.setEnabled(false);\n BtSalvarCli.setEnabled(false);\n BtAlterarCli.setEnabled(false);\n TipodeViaCli.setEnabled(false);\n TxEstadoCli.setEnabled(false);\n BtBuscarCli.setEnabled(false);\n BtLimparCli.setEnabled(false);\n TxTipoPessoa.setEnabled(false);\n PnlPj.setVisible(false);\n PnlPf.setVisible(false);\n centralizarComponente();\n\n }", "public ClientsSpeicher() {\n mDb = new MyArrowDB().getInstance();\n }", "public TelaCliente() {\n\n try {\n Handler console = new ConsoleHandler();\n Handler file = new FileHandler(\"/tmp/roquerou.log\");\n console.setLevel(Level.ALL);\n file.setLevel(Level.ALL);\n file.setFormatter(new SimpleFormatter());\n LOG.addHandler(file);\n LOG.addHandler(console);\n LOG.setUseParentHandlers(false);\n } catch (IOException io) {\n LOG.warning(\"O ficheiro hellologgin.xml não pode ser criado\");\n }\n\n initComponents();\n NivelDAO nd = new NivelDAO();\n if (nd.buscar() == 3) {\n botaoNovoCliente.setEnabled(false);\n buscarcli.setEnabled(false);\n tabelaCliente.setEnabled(false);\n popularCombo();\n setarLabels();\n\n LOG.info(\"Abertura da Tela de Clientes\");\n } else {\n popularCombo();\n setarLabels();\n\n LOG.info(\"Abertura da Tela de Clientes\");\n }\n }", "public AgregarClientes(Directorio directorio) {\n initComponents();\n this.directorio=directorio;\n \n \n }", "public CadastroCliente() {\n initComponents();\n }", "@Override\n\tpublic void createClient(Client clt) {\n\t\t\n\t}", "private CorrelationClient() { }", "private ClientBootstrap() {\r\n init();\r\n }", "public TelaCadastroCliente() {\n initComponents();\n }", "public TelaCadastroCliente() {\n initComponents();\n }", "public TurnoVOClient() {\r\n }", "public CadastrarCliente() {\n initComponents();\n initComponents();\n FormatCamp();\n setLocation(110, 0);\n }", "public AbaloneClient() {\n server = new AbaloneServer();\n clientTUI = new AbaloneClientTUI();\n }", "public GameServerClient(){\r\n\t\tinitComponents();\r\n\t\t}", "public Client() {}", "public Client() {\n }", "public void conectServer() {\n\n\t}", "public JFAgregarCliente() {\n initComponents();\n inicializarCombos();\n }", "public ListaCliente() {\n initComponents();\n carregarTabela();\n }", "public Client_app() {\n initComponents();\n }", "public MiAhorcadoCliente() throws RemoteException{}", "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 InscriptionClient() {\n initComponents();\n }", "public Cliente(String nome) {\n super(nome);\n }", "public Client() {\n initComponents();\n setIcon();\n }", "private static void esperarCliente() {\n try {\n socket = serverSocket.accept();\n System.out.println(\"Cliente conectado...\");\n } catch (IOException ex) {\n Logger.getLogger(ServidorUnicauca.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public ManterCliente() {\n try {\n initComponents();\n BloquearCampos();\n bt_salvar.setEnabled(false);\n bt_editar.setEnabled(false);\n txt_codigo.setEditable(true);\n mascaraCNPJ = new MaskFormatter(\"###.###.###/####-##\");\n mascaraCPF = new MaskFormatter(\"###.###.###-##\");\n } catch (ParseException ex) {\n JOptionPane.showMessageDialog(null, \"Erro ao carregar formulário. Contate o suporte.\");\n }\n }", "public static void main(String[] args) {\n//\t\tnew CluelessClient();\n\t}", "public void setCodCli(ICliente codigo);", "private void createClient() {\n tc = new TestClient();\n }", "public JFNuevoCliente() {\n initComponents();\n \n }", "public Cliente(){\r\n this.nome = \"\";\r\n this.email = \"\";\r\n this.endereco = \"\";\r\n this.id = -1;\r\n }", "public AreaClientes() {\n initComponents();\n cargarTabla();\n editarCliente(false);\n \n }", "public Server(){\r\n \r\n this.m_Clients = new TeilnehmerListe();\r\n this.m_Port = 7575;\r\n }", "public UConnecte() {\n\t\tsuper();\n\t}", "public ControlCenter(){\n serverConnect = new Sockets();\n serverConnect.startClient(\"127.0.0.1\", 5000);\n port = 5000;\n }", "public OCSPCliente(String servidorURL)\r\n {\r\n this.servidorURL = servidorURL;\r\n }", "public FormaServer() {\n initComponents();\n srediFormu();\n \n }", "public ServiceClient() {\n\t\tsuper();\n\t}", "public void updateClient()\n\t{\n\t\t// TODO\n\t}", "public void makeClient() {\n try {\n clienteFacade.create(cliente);\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cliente creado exitosamente\", null));\n } catch (Exception e) {\n System.err.println(\"Error en la creacion del usuario: \" + e.getMessage());\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_FATAL, e.getMessage(), null));\n }\n }", "public EO_ClientsImpl() {\n }", "public Client(String nom, String prenom, String adresse,CalculerTarif calculerTarif) {\n // Initialisation des données du client.\n this.nom = nom;\n this.prenom = prenom;\n this.adresse = adresse;\n this.calculerTarif = calculerTarif;\n this.listeVehicule = new ArrayList<Vehicule>();\n \n // On ajoute le client à la liste des clients du parking, car le client est forcément un client du parking.\n Parking.getInstance().addClient(this);\n }", "public clientesBean() {\n this.clie = new Clientes();\n }", "public viewClients() {\n initComponents();\n }", "public ClienteSub() {\n initComponents();\n }", "public ClientesAgregar() {\n initComponents();\n }", "private void listaClient() {\n\t\t\r\n\t\tthis.listaClient.add(cliente);\r\n\t}", "@Override\n\tpublic void altaCliente(Cliente cliente) {\n\t}", "public UPKClient() {\n connectToServer(BASE_URL);\n }", "private void addClient () {\n ArrayList<String> info = loadOnePlayerInfo();\n Ntotal++;\n Nnow++;\n\n System.out.println(\"Vai ser inicializado o utilizador \" + info.get(0));\n initThread(info.get(0), info.get(1));\n }", "public void createClient() {\n client = new UdpClient(Util.semIp, Util.semPort, this);\n\n // Le paso true porque quiero que lo haga en un hilo nuevo\n client.connect(true);\n }", "public clientesagregarclass() {\n initComponents();\n }", "public frmClient() {\n initComponents();\n clientside=new Client(this);\n \n }", "public Sesion(String codigoCliente) {\n cliente = new Cliente(codigoCliente);\n estado = Estado.inicioBot;\n accion = Accion.registrar;\n valor = ValorAIngresar.nombre;\n mensajeRecibido = null;\n respuesta = new Respuesta();\n }", "public clientHome() {\n initComponents();\n }", "public alterarSenhaCliente() {\n }", "public HGDClient() {\n \n \t}", "public ClientGui() throws RemoteException, NotBoundException, Exception {\n // Layout initiieren\n initComponents();\n \n //Dem Client mitteilen, wo sein TrustStore liegt. Dieser wurde zuvor mit Keytool erzeugt:\n //keytool erzeugt KeyStore dann wird selbstsigniertes Zertifikat exportiert um im Client importiert und als Vertrauenswürdig erteilt\n System.setProperty(\"javax.net.ssl.trustStore\", \"clientstore.jks\");\n System.setProperty(\"javax.net.ssl.trustStorePassword\", \"password\");\n \n //Dem Client mitteilen, wo sein KeyStore liegt, in diesem Fall gleichzeitig sein TrustStore\n System.setProperty(\"javax.net.ssl.keyStore\", \"clientstore.jks\");\n System.setProperty(\"javax.net.ssl.keyStorePassword\", \"password\");\n\n //KeyStore aus der Datei laden\n KeyStore ks = KeyStore.getInstance(\"JKS\");\n ks.load(new FileInputStream(\"clientstore.jks\"), \"password\".toCharArray());\n \n // SSLServerSocketFactory initialisieren\n SSLServerSocketFactory sssf ;\n \n try{\n //SSLRMIClientSocketFactory erzeugen\n SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();\n //Verbindung aufbauen zum Registry auf Localhost, Port 2222 und dem SslRMiClientSocketFactory, um mittels RMI Methodenaufrufe zu starten.\n Registry registry =LocateRegistry.getRegistry(\"localhost\", 2222, csf);\n \n \n //Verbindung aufbauen zum Registry um mittels RMI Methodenaufrufe zu starten. Ohne RMI,deshalbt auskommentiert\n //Registry registry =LocateRegistry.getRegistry(\"localhost\", 2222);\n \n //Anlegenen eines TestRemotes Objektes um auf die Methoden zugreifen zu können.\n remote= (TestRemote) registry.lookup(\"remote\");\n }catch(NotBoundException | RemoteException e){\n Logger.getLogger(ClientGui.class.getName()).log(Level.SEVERE, null, e);\n \n }\n \n //Überprüfen ob Methodenaufruf klappt\n System.out.println(remote.isLoginValid(\"heiko\"));\n //AES Objekt erzeugen um auf die Methoden der Klasse zuzugreifen zu können.\n aes = new AES();\n //RSA Schlüsselpaar erzeugen und in Datei speichern\n generateRSA();\n //Liste wer online ist updaten\n online(remote.online());\n \n \n }", "public CoronosClient(String ip){\n //GUI creator\n loginBuilder();\n uiBuilder();\n\n //create Socket + Streams\n try {\n s = new Socket(ip, 16789);\n oos = new ObjectOutputStream(s.getOutputStream());\n ois = new ObjectInputStream(s.getInputStream());\n serverListener();\n } catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (BindException be) {\n be.printStackTrace();\n } catch(ConnectException ce){\n JOptionPane.showMessageDialog(loginButton, \"Failed to connect to server, please contact your System Administrator\", \"Connection Error\", JOptionPane.ERROR_MESSAGE);\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "void startClient(String name, Config.ClientConfig config);", "public void novo() {\n cliente = new Cliente();\n }", "public Conexion(){\n \n }", "private ClientController() {\n }", "public Clientes() {\n\t\tclientes = new Cliente[MAX_CLIENTES];\n\t}", "public CreChqTrnValVerUVOClient() {\n }", "public Cliente() {\n initComponents();\n Saida.setSaida(txtSaida);\n }", "public VistaListacomprasnocliente() {\n // You can initialise any data required for the connected UI components here.\n }", "private void cclient() throws Exception {\n\n\t\tws.xml c = this.ls.cclient();\n\t\tfor (String[] row : c.t) {\n\t\t\tString pat1 = row[0];\n\t\t\tcomboBox.addItem(pat1);\n\t\t}\n\t}", "@SuppressWarnings(\"empty-statement\")\n public void runClient() {\n // setup MQTT Client\n String clientID = \"apto01\";\n String pass = \"1234\";\n connOpt = new MqttConnectOptions();\n\n connOpt.setCleanSession(true);\n connOpt.setKeepAliveInterval(30);\n connOpt.setUserName(\"isis2503\");\n connOpt.setPassword(pass.toCharArray());\n\n alertaLogic = new AlertLogic();\n\n // Connect to Broker\n try {\n myClient = new MqttClient(BROKER_URL, clientID);\n myClient.setCallback(this);\n myClient.connect(connOpt);\n } catch (MqttException e) {\n e.printStackTrace();\n System.exit(-1);\n }\n\n System.out.println(\"Connected to \" + BROKER_URL);\n\n // setup topic\n // topics on m2m.io are in the form <domain>/<stuff>/<thing>\n // subscribe to topic if subscriber\n if (subscriber) {\n try {\n int subQoS = 0;\n myClient.subscribe(infoInoTopic, subQoS);\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }\n // disconnect\n try {\n // wait to ensure subscribed messages are delivered\n while (subscriber);\n myClient.disconnect();\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }", "public Client(String nickname) throws RemoteException {\n\t\n\tthis.nickname=nickname;\n\n\t\t\t\t\t\t\t\t}", "private ClientController(){\n\n }", "public MainCliente(Sistema sistem, int id) {\n initComponents();\n this.sistem = sistem;\n this.id = id;\n }", "public JSipClient() {\n\t\tinitComponents();\n\t}", "public void iniciar() {\n abrirPuerto();\n\n while (true) {\n esperarCliente();\n lanzarHilo();\n }\n }", "private void startKlient() {\n\t\tSystem.out.println(\"Trying to connect\");\r\n\t\ttry (Socket serverkontakt = new Socket(\"127.0.0.1\", 8000);\r\n\t\t// Step 2 - obtaining input/output streams\r\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(\r\n\t\t\t\t\t\tserverkontakt.getOutputStream())) {\r\n\t\t\toutput.flush();\r\n\t\t\tSystem.out.println(\"Connected\");\r\n\t\t\tsendObject(output);\r\n\t\t} catch (EOFException eofException) {\r\n\t\t\tSystem.out.println(\"Server closing connection\\n\");\r\n\t\t} catch (IOException ioException) {\r\n\t\t\tSystem.out.println(\"Problem with server connection\\n\");\r\n\t\t}\r\n\t}", "private void criaContaCliente (String cpf) {\n this.contasClientes.put(cpf, new Conta(cpf));\n }", "public ServeurGestion(int portClient){\r\n try {\r\n ecoute=new ServerSocket(portClient);\r\n appels=new Vector<>();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ServeurGestion.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public AlterarCliente() {\n initComponents();\n setTitle(\"LocVideo\");\n }", "public TelaPrincipal() {\r\n initComponents();\r\n con.conecta();\r\n }" ]
[ "0.7723482", "0.76770616", "0.76337236", "0.7605895", "0.74944013", "0.7439284", "0.7375117", "0.73412234", "0.7325702", "0.7301214", "0.72385097", "0.72320056", "0.7160857", "0.71540153", "0.71510077", "0.7135075", "0.71208596", "0.71208596", "0.7110555", "0.7041568", "0.7040657", "0.70112085", "0.7002143", "0.7001959", "0.69990313", "0.6987838", "0.69699275", "0.69321495", "0.69224703", "0.6885183", "0.6885183", "0.6885124", "0.68799734", "0.68723965", "0.6842794", "0.6836026", "0.6819763", "0.6796484", "0.67448074", "0.6724644", "0.67154646", "0.66994643", "0.669251", "0.66881335", "0.66792923", "0.66724086", "0.6669167", "0.66603726", "0.6656995", "0.665135", "0.66486317", "0.6637538", "0.66371644", "0.6634282", "0.6623217", "0.66202354", "0.65974224", "0.6596045", "0.65938574", "0.6593787", "0.6581547", "0.6576478", "0.6564901", "0.6563645", "0.65587246", "0.6552264", "0.6549579", "0.6539722", "0.6535179", "0.65349895", "0.6529397", "0.65268856", "0.65169543", "0.65147567", "0.65132344", "0.6507924", "0.6502419", "0.6496577", "0.6491133", "0.64900404", "0.6483097", "0.6480934", "0.64789915", "0.6475971", "0.6473935", "0.6471936", "0.64696795", "0.64681906", "0.6463885", "0.645712", "0.644942", "0.64491075", "0.64468205", "0.6433816", "0.6431365", "0.6426568", "0.64248866", "0.64237255", "0.6422111", "0.64195305", "0.6417462" ]
0.0
-1
constructor; public so we can instantiate instances; name matches the class
public Fraction(){ numerator = 0; denominator = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Instantiation(){}", "Reproducible newInstance();", "public MyClass1(String name) {\n\t\tsuper();\n\t\tthis.name = name;\n\t}", "Instance createInstance();", "public Name() {\n\n }", "public Instance() {\n }", "private SomePojoClass(String name) {\n this.name = name;\n }", "private void __sep__Constructors__() {}", "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "defaultConstructor(){}", "public CyanSus() {\n\n }", "private PoliticalSystem(String name) {\n\t\tthis.name = name;\n\t}", "public Class(String name) {\n\t\tthis.name = name;\n\t\tarrayMethods = new ArrayList<Method>();\n\t\tcode_Smells = new HashMap<String, Boolean>();\n\n\t}", "VehicleClass() {}", "private Panino(String name) {\n this.name = name;\n }", "protected abstract void construct();", "public OOP_207(){\n\n }", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "public Self__1() {\n }", "public Chick() {\n\t}", "public Person(String inName)\n {\n name = inName;\n }", "private Driver(){\n }", "private A(){\n System.out.println(\"Instance created\");\n }", "@Override\r\n public void instantiate() {\r\n }", "public Factory() {\n\t\tclassMap = new TreeMap<String,Class<T> >();\n\t}", "private TypicalPersons() {}", "private TypicalPersons() {}", "public ClassTemplate() {\n\t}", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "public ObjectsPublicTest(String name) {\n\t\tsuper(name);\n\t}", "public BasicSpecies() {\r\n\r\n\t}", "public Person(String name){\n\t\t\n\t\t\n\t\tthis.myName = name;\n\t\t\n\t}", "public Classe() {\r\n }", "public Person(String name)\n {\n this.name = name;\n }", "private SingleObject(){}", "void DefaultConstructor(){}", "private Cat() {\n\t\t\n\t}", "public Musik(){}", "public Country (String instanceName)\n {\n name = instanceName;\n }", "public Car(){\n\t\t\n\t}", "public Contructor(int year, String name) {\n // constructor name must match class name and cannot have return type\n // all classes have constructor by default\n // f you do not create a class constructor yourself, Java creates one for you.\n // However, then you are not able to set initial values for object attributes.\n // constructor can also take parameters\n batchYear = year;\n studentName = name;\n }", "public Person() {\n\t\t\n\t}", "public Spec__1() {\n }", "public Person(String name){\n\t\tthis.name = name ; \n\t}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "private MApi() {}", "public SlanjePoruke() {\n }", "private SingleObject()\r\n {\r\n }", "public Factory() {\n\t\tsuper();\n\t}", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "public Rol() {}", "public ObjectFactory() {\n\t}", "public Taginstance() {\n\t\tthis(\"taginstance\", null);\n\t}", "private TMCourse() {\n\t}", "public Trening() {\n }", "public Person(String name) {\n this.name = name;\n }", "public Activator() {\r\n\t}", "public HexComputerPlayer1(String name) {\n // invoke superclass constructor\n super(name); // invoke superclass constructor\n }", "private ObjectFactory() { }", "public Aritmetica(){ }", "public ObjectFactory() {\r\n\t}", "public Supercar() {\r\n\t\t\r\n\t}", "NamedClass createNamedClass();", "private PerksFactory() {\n\n\t}", "private SingleObject(){\n }", "public FruitStand() {}", "private StickFactory() {\n\t}", "public ControlClass(String expID){\r\n \tinitialize(expID,null,null,null); \t\r\n }", "private Driver() {\n\n }", "public Member() {}", "public Core(String name) {\r\n\t\tsuper(name);\r\n\t}", "public Person() {}", "public Person() {\n\t\tthis.name = \"Unknown\"; \n\t}", "public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {\t \r\n\tClass<?> t = Class.forName(\"Java_Oops.ForNameObjectCreation\");\r\n\tObjectCreation_1 obj = ((ObjectCreation_1) t.newInstance());\r\n\t \t\t\t\t obj.display();\t\r\n\t\t\t\t\t }", "public Chick()\n {\n super(\"chick\");\n }", "public Foret(){\n super(\"Foret\");\n }", "public Implementor(){}", "private InstanceUtil() {\n }", "public CyberPet ( String str )\r\n {\r\n name = str;\r\n }", "public ObjectFactoryMenu() {\n }", "Classroom() {}", "public Instance(YangString nameValue) throws JNCException {\n super(Routing.NAMESPACE, \"instance\");\n Leaf name = new Leaf(Routing.NAMESPACE, \"name\");\n name.setValue(nameValue);\n insertChild(name, childrenNames());\n }", "protected SDB_ServiceClass( String s )\n {\n name = s;\n nameHash.put( s, this );\n intValue = index;\n intHash.put( new Integer( intValue ), this );\n }", "public School() {\r\n }", "public Calculator() {\r\n\t\t/*\r\n\t\t * Constructor - Method name which has the same class name is called a Consatructor\r\n\t\t */\r\n\t\tSystem.out.println(\"Calling constructor\");\r\n\t}", "private HierarchyFactory ()\n {\n }", "public IterName(){\n }", "public MyObject(String objectName){\n\n this.objectName = objectName;\n }", "public Person() {\n }", "public Person() {\n }", "public Person() {\n }", "public Person() {\n }", "private SpTreeMan() {\n }", "private NameUtil() {\n }", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public MockClass(String arg) {\n\t}", "public Pitonyak_09_02() {\r\n }", "public Member() {\r\n\t}" ]
[ "0.7536449", "0.7176174", "0.67975605", "0.6795441", "0.67638075", "0.671935", "0.66798", "0.66592044", "0.66535634", "0.664889", "0.6610141", "0.6544287", "0.6464062", "0.6451994", "0.6441928", "0.642795", "0.641051", "0.6396511", "0.63874924", "0.63811135", "0.6376553", "0.6376318", "0.63718504", "0.63574535", "0.6346089", "0.6339177", "0.63320786", "0.63320786", "0.6323633", "0.63137937", "0.6307705", "0.6295809", "0.62917805", "0.6286303", "0.6279972", "0.62719035", "0.62687653", "0.6261286", "0.6255363", "0.6250694", "0.6250512", "0.6250064", "0.62495875", "0.6243774", "0.624336", "0.6241539", "0.62405676", "0.6240431", "0.62325877", "0.6223971", "0.62132597", "0.62085253", "0.6206368", "0.6196837", "0.61942935", "0.6194273", "0.61932635", "0.61901516", "0.6189406", "0.6181628", "0.6177934", "0.6177554", "0.61715597", "0.6169544", "0.6168685", "0.61682665", "0.6167039", "0.6166349", "0.6164916", "0.6163252", "0.615733", "0.6153195", "0.61485267", "0.6140781", "0.61371404", "0.61323065", "0.6130529", "0.6130525", "0.6129316", "0.6120395", "0.61189055", "0.6109316", "0.610914", "0.61078304", "0.610369", "0.6099448", "0.6098384", "0.60947037", "0.6094342", "0.60928196", "0.60928196", "0.60928196", "0.60928196", "0.6088679", "0.608477", "0.60825026", "0.60825026", "0.60825026", "0.6081905", "0.6076555", "0.60751975" ]
0.0
-1
second constructor with parameters
public Fraction(int num, int den){ numerator = num; if (den != 0){ denominator = den; } else{ denominator = 1; } reduce(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void __sep__Constructors__() {}", "ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}", "public Constructor(){\n\t\t\n\t}", "Reproducible newInstance();", "protected abstract void construct();", "Constructor() {\r\n\t\t \r\n\t }", "public Video( int arg1, int arg2 ) { \n\t\tsuper( );\n\t}", "public bwq(String paramString1, String paramString2)\r\n/* 10: */ {\r\n/* 11: 9 */ this.a = paramString1;\r\n/* 12:10 */ this.f = paramString2;\r\n/* 13: */ }", "ConstuctorOverloading(int num){\n\t\tSystem.out.println(\"I am contructor with 1 parameter\");\n\t}", "public Thaw_args(Thaw_args other) {\r\n }", "public Tiempo2( int h ) { \n this( h, 0, 0 ); // invoca al constructor de Tiempo2 con tres argumentos\n }", "public PotionEffect(int paramInt1, int paramInt2)\r\n/* 16: */ {\r\n/* 17: 28 */ this(paramInt1, paramInt2, 0);\r\n/* 18: */ }", "public static void main(String[] args) {\n My obj2=new My(9);//--->called overloaded Constructor\n }", "public Tiempo2( int h, int m ) { \n this( h, m, 0 ); // invoca al constructor de Tiempo2 con tres argumentos\n }", "public SeqArg(Argument a1, Argument a2){\n this.a1 = a1;\n this.a2 = a2;\n }", "public Person2(String fname, String lname) {\n this.fname = fname;\n this.lname = lname;\n }", "private StubPrivateConstructorPair(Object firstObject, Object secondObject) {\r\n super(firstObject, secondObject);\r\n }", "private Instantiation(){}", "@Test\n\tpublic void testProfessorConstructor2params(){\n\t\tString firstname = \"Steven\";\n\t\tString lastName = \"Beaty\";\n\t\tProfessor testProfessor = new Professor(firstname, lastName);\n\t\tAssert.assertEquals(\"Steven\", testProfessor.getFirstName());\n\t\tAssert.assertEquals(\"Beaty\", testProfessor.getLastName());\n\t}", "public MethodEx2() {\n \n }", "public MyGeneric(A a, B b) { // TODO: check parameter type\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t}", "public SnakesAndLadders()\n {\n this(2);\n }", "public Complex(){\r\n\t this(0,0);\r\n\t}", "public a(int i, Object obj, Object obj2) {\n super(0);\n this.a = i;\n this.b = obj;\n this.c = obj2;\n }", "public tn(String paramString, ho paramho)\r\n/* 12: */ {\r\n/* 13:11 */ super(paramString, paramho);\r\n/* 14: */ }", "defaultConstructor(){}", "public PotionEffect(int paramInt1, int paramInt2, int paramInt3)\r\n/* 21: */ {\r\n/* 22: 32 */ this(paramInt1, paramInt2, paramInt3, false, true);\r\n/* 23: */ }", "public Card() { this(12, 3); }", "public static void copyConstructor(){\n\t}", "public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }", "public Tiempo2( Tiempo2 tiempo ) {\n // invoca al constructor de Tiempo2 con tres argumentos\n this( tiempo.obtenerHora(), tiempo.obtenerMinuto(), tiempo.obtenerSegundo() );\n }", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "Constructor(int i,String n ,int x){ //taking three parameters which shows that it is constructor overloaded\r\n\t\t id = i; \r\n\t\t name = n; \r\n\t\t marks =x; \r\n\t\t }", "public Person(String first, String last) {\n // Set instance var firstname to what is called from constructor\n this.firstName = first; \n // Set instance var lastname to what is called from constructor\n this.lastName = last;\n }", "public TwoSum() {\n\n }", "public BaseParameters(){\r\n\t}", "public Complex(int r, int i){\r\n\t this((double) r, (double) i);\r\n\t\t//chain the input from this constructor to the next constructor,\r\n\t\t// which has a (double, double) signature\r\n\t}", "public BankAcc(){\r\n //uses another constuctor\r\n this(593,2.5,\"Deg\",\"Deg\",\"Deg\");\r\n System.out.println(\"EMpty\");;\r\n }", "private InstantiateTransformer(Class[] paramTypes, Object[] args) {\n super();\n if (((paramTypes == null) && (args != null))\n || ((paramTypes != null) && (args == null))\n || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {\n throw new IllegalArgumentException(\"InstantiateTransformer: The parameter types must match the arguments\");\n }\n if ((paramTypes == null) && (args == null)) {\n iParamTypes = null;\n iArgs = null;\n } else {\n iParamTypes = (Class[]) paramTypes.clone();\n iArgs = (Object[]) args.clone();\n }\n }", "public AllDifferent()\n {\n this(0);\n }", "public Student() {\n//\t\tname = \"\";\n//\t\tage = 0;\n\t\t\n\t\t\n\t\t//call constructors inside of other constructors\n\t\tthis(999,0);\n\t}", "public Lotto2(){\n\t\t\n\t}", "public Par(A itemA, B itemB) {\r\n\t\tthis.itemA = itemA;\r\n\t\tthis.itemB = itemB;\r\n\t}", "private Pair(U first, V second) {\n\t\t\tthis.first = first;\n\t\t\tthis.second = second;\n\t\t}", "DefaultConstructor(int a){}", "public Clade() {}", "public c(Object obj) {\n super(1);\n this.a = obj;\n }", "public Container2DImpl() {\n\t\tthis(100, 100);\n\t}", "void DefaultConstructor(){}", "private ChainingMethods() {\n // private constructor\n\n }", "T newInstance(Object... args);", "public Factory(Class<? extends K> class1, Object... params) {\n\t\ttry {\n\t\t\tthis.params = params;\n\t\t\tif (params != null && params.length > 0) {\n\t\t\t\tClass<?>[] clazzes = new Class<?>[params.length];\n\t\t\t\tint i = 0;\n\t\t\t\tfor (Object param : params) {\n\t\t\t\t\tclazzes[i++] = param.getClass();\n\t\t\t\t}\n\t\t\t\tconstructor = class1.getConstructor(clazzes);\n\t\t\t} else {\n\t\t\t\tconstructor = class1.getConstructor();\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tlog.error(\"Error initializing factory\", e);\n\t\t\tthrow new Error(\"Internal error initializing factory\", e);\n\t\t}\n\t}", "public Pasien() {\r\n }", "private FloatCtrl(long param1Long, String param1String1, float param1Float1, float param1Float2, float param1Float3, String param1String2) {\n/* 435 */ this(param1Long, new FCT(param1String1, null), param1Float1, param1Float2, param1Float3, param1String2);\n/* */ }", "public Parameters() {\n\t}", "public Video( int arg1 ) { \n\t\tsuper( );\n\t}", "public CacheFIFO(int paramInt)\r\n/* 11: */ {\r\n/* 12: 84 */ super(paramInt);\r\n/* 13: */ }", "public Tuple2() {\n }", "public Employee()\n\t{\n\t\tthis(\"(2)Invoke Employee's overload constructor\");\n\t\tSystem.out.println(\"(3)Employee's no-arg constructor is invoked\");\n\t}", "public static void main(String[] args) {\nconstructorDemo obj=new constructorDemo();\nconstructorDemo obj1=new constructorDemo(\"My Parameter\");\nconstructorDemo obj2=new constructorDemo(123);\nconstructorDemo obj3=new constructorDemo(123,6);\nSystem.out.println(\"code after creating object\");\nobj.hello();\nobj.hello(\"hi\");\n\t}", "public b3(){\n super();\n }", "public ArgList(Object arg1, Object arg2) {\n super(2);\n addElement(arg1);\n addElement(arg2);\n }", "public y1(z1 z1Var, Object obj) {\n super(1);\n this.a = z1Var;\n this.b = obj;\n }", "public Connection(Profile person1, Profile person2) {\n\t\n\t\tthis.person1=person1;\n\t\tthis.person2=person2;\n\t}", "public Pair(Pair<T,V> p){\r\n this.v1 = p.v1;\r\n this.v2 = p.v2;\r\n }", "public void testCtor2() {\n instance = new LogMessage(type, id, operator, message);\n\n assertEquals(\"'type' should be correct.\", type, instance.getType());\n assertEquals(\"'id' should be correct.\", id, instance.getId());\n assertEquals(\"'message' should be correct.\", message, instance.getMessage());\n assertNull(\"'error' should be correct.\", instance.getError());\n }", "public static void main(String[] args) {\n\t\tnew FirstConstructor();\r\n\t\tnew FirstConstructor(\"Baxter\");\r\n\t}", "public CacheFIFO()\r\n/* 16: */ {\r\n/* 17: 95 */ this(20);\r\n/* 18: */ }", "public Bicycle() {\n // You can also call another constructor:\n // this(1, 50, 5, \"Bontrager\");\n System.out.println(\"Bicycle.Bicycle- no arguments\");\n gear = 1;\n cadence = 50;\n speed = 5;\n name = \"Bontrager\";\n }", "public CyanSus() {\n\n }", "public Pair(Card firstCard, Card secondCard){\r\n this.firstCard = firstCard;\r\n this.secondCard = secondCard;\r\n }", "public static void main(String[] args) {\n\t\tnew TestConstructor2();\r\n\r\n\t}", "public Person(String vorname, String nachname) {\n\n\t}", "Composite() {\n\n\t}", "public aed(World paramaqu)\r\n/* 9: */ {\r\n/* 10: 24 */ super(paramaqu);\r\n/* 11: */ }", "public Recv_args(String arg1, String arg2) {\r\n\t\tsuper();\r\n\t\trecv_args = new BRecv_args(arg1, arg2);\r\n\t}", "public Self__1() {\n }", "public Supercar() {\r\n\t\t\r\n\t}", "public DatasetHelper(DatasetHelper another){\n id= another.id;\n hash = another.hash;\n catalogueId = another.catalogueId;\n sourceType = another.sourceType;\n sourceLang = another.sourceLang;\n model = ModelFactory.createDefaultModel().add(another.model);\n uriSchema = another.uriSchema;\n }", "@Test\n\tpublic void constructor2Test() {\n\t\tOrderItem orderItem = new OrderItem(2L, 3L, 2, 22.5);\n\t\tassertTrue(orderItem instanceof OrderItem);\n\t}", "public static StaticFactoryInsteadOfConstructors of(Object one, Object two, Object three) {\n return new StaticFactoryInsteadOfConstructors();\n }", "public\nNuc2D(NucNode nuc)\nthrows Exception\n{\n\tsuper (nuc);\n}", "public static void main(String[] args) {\n ConstructorIntro obj2 = new ConstructorIntro(10);\n\n }", "private static class <init> extends <init>\n{\n\n public void a(Object obj, StringBuilder stringbuilder)\n {\n au au1 = (au)obj;\n y y1 = new y();\n y1.a(\"$ts\", Integer.valueOf(au1.a()));\n y1.a(\"$inc\", Integer.valueOf(au1.b()));\n a.a(y1, stringbuilder);\n }", "public Pair(T v1, V v2) {\r\n this.v1 = v1;\r\n this.v2 = v2;\r\n }", "private void translateConstructor( ) {\n \n Set<MethodInfoFlags> flags = EnumSet.noneOf( MethodInfoFlags.class );\n \n AVM2Method method = new AVM2Method( null, flags );\n avm2Class.avm2Class.constructor = method;\n \n AVM2MethodBody body = method.methodBody;\n body.maxStack = 1;\n body.maxRegisters = 1;\n body.maxScope = 11;\n body.scopeDepth = 10;\n \n InstructionList il = body.instructions;\n \n// il.append( OP_getlocal0 );\n// il.append( OP_pushscope );\n il.append( OP_getlocal0 );\n il.append( OP_constructsuper, 0 );\n \n// il.append( OP_findpropstrict, new AVM2QName( PUBLIC_NAMESPACE, \"drawTest\" ));\n il.append( OP_getlocal0 );\n \n il.append( OP_callpropvoid, new AVM2QName( EmptyPackage.namespace, \"drawTest\" ), 0 );\n\n il.append( OP_returnvoid );\n }", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "private Params()\n {\n }", "public Sock( /*int n , int ar[]*/)\n{\n\t//this.n=n;\n\t//this.ar=ar;\n}", "public Demo3() {}", "public Contructor(int year, String name) {\n // constructor name must match class name and cannot have return type\n // all classes have constructor by default\n // f you do not create a class constructor yourself, Java creates one for you.\n // However, then you are not able to set initial values for object attributes.\n // constructor can also take parameters\n batchYear = year;\n studentName = name;\n }", "public MLetter(Parameters parametersObj) {\r\n\t\tsuper(parametersObj);\r\n\t}", "public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }", "public Pair(S n1, S n2) {\n\t\tkey1 = n1;\n\t\tkey2 = n2;\n\t}", "public ahr(aqu paramaqu)\r\n/* 20: */ {\r\n/* 21: 34 */ super(paramaqu);\r\n/* 22: 35 */ a(0.25F, 0.25F);\r\n/* 23: */ }", "private Font(long paramLong, Object paramObject) {\n/* 1031 */ this.a = paramLong;\n/* 1032 */ this.b = paramObject;\n/* */ }", "public p7p2() {\n }", "public static NewExpression new_(Constructor constructor) { throw Extensions.todo(); }", "public Pair(T first, T second) {\r\n this.first = first;\r\n this.second = second;\r\n }", "public ZTest1() {\n this(\"z_test1\", null);\n }", "public Cohete() {\n\n\t}" ]
[ "0.67057794", "0.6670783", "0.6511239", "0.6504086", "0.64539593", "0.6435065", "0.64331794", "0.64084715", "0.6335842", "0.6326897", "0.6320715", "0.6279636", "0.624311", "0.6232865", "0.61944497", "0.6189587", "0.6181447", "0.6164037", "0.6155848", "0.61310184", "0.6093873", "0.60655195", "0.6062649", "0.60379493", "0.60310966", "0.6007978", "0.6003962", "0.5989321", "0.5986123", "0.5950572", "0.59423345", "0.5930761", "0.5928125", "0.59194964", "0.5915322", "0.5912939", "0.5909237", "0.5868172", "0.5867547", "0.5866911", "0.5854593", "0.5843626", "0.58373713", "0.58351535", "0.5829713", "0.5819344", "0.5818638", "0.5814373", "0.5811481", "0.58071125", "0.5805027", "0.580382", "0.5800237", "0.5795854", "0.57940173", "0.5789458", "0.5789124", "0.5786018", "0.57858247", "0.57732224", "0.5766394", "0.5762392", "0.57485366", "0.5739328", "0.573617", "0.57291746", "0.57238156", "0.5720513", "0.5720225", "0.5718082", "0.57161534", "0.57108283", "0.5709815", "0.5709511", "0.57092357", "0.5701726", "0.56976974", "0.5695337", "0.5688738", "0.5680849", "0.5672396", "0.56719726", "0.56703615", "0.5667003", "0.56658375", "0.5662058", "0.5660067", "0.5658768", "0.5656289", "0.5654564", "0.5651894", "0.5648382", "0.5647428", "0.56397843", "0.5632111", "0.56294084", "0.5627693", "0.5627446", "0.56273353", "0.56267285", "0.56216824" ]
0.0
-1
a method like __str__
public String toString(){ return numerator + "/" + denominator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "@Override String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString() ;", "abstract public String toString();", "@Override public String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "public String toString() { return stringify(this, true); }", "@Override\n\tpublic abstract String toString();", "@Override\n public String toString() {\n return (this.str);\n }", "@Override\r\n String toString();", "@Override\n String toString();", "@Override\n String toString();", "@Override\n\tpublic abstract String toString ();", "@Override\n\tString toString();", "public String toString();", "@Override\r\n public String toString();", "@Override\n public abstract String toString();", "@Override\r\n\tpublic String toString();", "@Override\n public String toString();", "@Override\n public String toString();", "@Override\n\tpublic String toString();", "abstract public String toString ();", "@Override\n String toString();", "@Override\n\tpublic String toString()\n\t{\n\t\treturn this.str;\n\t}", "@Override\n public String toString() {\n String str = \"\";\n\n //TODO: Complete Method\n\n return str;\n }", "public String represent();", "public String toString() {\n\t}", "public String toString() { return \"\"; }", "public String toString() { return \"\"; }", "@Override\n public final String toString() {\n return asString(0, 4);\n }" ]
[ "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.808237", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.8072218", "0.80559355", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.8022558", "0.79288685", "0.7876798", "0.7870864", "0.7837854", "0.7837854", "0.7837854", "0.7837854", "0.7837854", "0.7837854", "0.7837854", "0.7796227", "0.7786289", "0.77856004", "0.7758883", "0.77371985", "0.77371985", "0.7729741", "0.7713111", "0.7704189", "0.77006894", "0.76851803", "0.76616526", "0.7640024", "0.7640024", "0.7633334", "0.76229274", "0.76005554", "0.7596862", "0.7466268", "0.7430268", "0.7376721", "0.735566", "0.735566", "0.7338289" ]
0.0
-1
new location data has been received and can be accessed
public void onPositionChanged() { latPeriodic = location.getLatitude(); lonperiodic = location.getLongitude(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNewLocationRecieved(LocationWrapper locationWrapper, LocationType type);", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tmylat=location.getLatitude();\n\t\tmylong=location.getLongitude();\n\t\tgetData();\n\t\t\n\t}", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n StringBuffer sb = new StringBuffer(256);\n sb.append(\"time : \");\n /**\n * 时间也可以使用systemClock.elapsedRealtime()方法 获取的是自从开机以来,每次回调的时间;\n * location.getTime() 是指服务端出本次结果的时间,如果位置不发生变化,则时间不变\n */\n sb.append(location.getTime());\n sb.append(\"\\nlocType : \");// 定位类型\n sb.append(location.getLocType());\n sb.append(\"\\nlocType description : \");// *****对应的定位类型说明*****\n sb.append(location.getLocTypeDescription());\n sb.append(\"\\nlatitude : \");// 纬度\n sb.append(location.getLatitude());\n sb.append(\"\\nlontitude : \");// 经度\n sb.append(location.getLongitude());\n sb.append(\"\\nradius : \");// 半径\n sb.append(location.getRadius());\n sb.append(\"\\nCountryCode : \");// 国家码\n sb.append(location.getCountryCode());\n sb.append(\"\\nCountry : \");// 国家名称\n sb.append(location.getCountry());\n sb.append(\"\\ncitycode : \");// 城市编码\n sb.append(location.getCityCode());\n sb.append(\"\\ncity : \");// 城市\n sb.append(location.getCity());\n sb.append(\"\\nDistrict : \");// 区\n sb.append(location.getDistrict());\n sb.append(\"\\nStreet : \");// 街道\n sb.append(location.getStreet());\n sb.append(\"\\naddr : \");// 地址信息\n sb.append(location.getAddrStr());\n sb.append(\"\\nUserIndoorState: \");// *****返回用户室内外判断结果*****\n sb.append(location.getUserIndoorState());\n sb.append(\"\\nDirection(not all devices have value): \");\n sb.append(location.getDirection());// 方向\n sb.append(\"\\nlocationdescribe: \");\n sb.append(location.getLocationDescribe());// 位置语义化信息\n sb.append(\"\\nPoi: \");// POI信息\n if (location.getPoiList() != null && !location.getPoiList().isEmpty()) {\n for (int i = 0; i < location.getPoiList().size(); i++) {\n Poi poi = (Poi) location.getPoiList().get(i);\n sb.append(poi.getName() + \";\");\n }\n }\n if (location.getLocType() == BDLocation.TypeGpsLocation) {// GPS定位结果\n sb.append(\"\\nspeed : \");\n sb.append(location.getSpeed());// 速度 单位:km/h\n sb.append(\"\\nsatellite : \");\n sb.append(location.getSatelliteNumber());// 卫星数目\n sb.append(\"\\nheight : \");\n sb.append(location.getAltitude());// 海拔高度 单位:米\n sb.append(\"\\ngps status : \");\n sb.append(location.getGpsAccuracyStatus());// *****gps质量判断*****\n sb.append(\"\\ndescribe : \");\n sb.append(\"gps定位成功\");\n } else if (location.getLocType() == BDLocation.TypeNetWorkLocation) {// 网络定位结果\n // 运营商信息\n if (location.hasAltitude()) {// *****如果有海拔高度*****\n sb.append(\"\\nheight : \");\n sb.append(location.getAltitude());// 单位:米\n }\n sb.append(\"\\noperationers : \");// 运营商信息\n sb.append(location.getOperators());\n sb.append(\"\\ndescribe : \");\n sb.append(\"网络定位成功\");\n } else if (location.getLocType() == BDLocation.TypeOffLineLocation) {// 离线定位结果\n sb.append(\"\\ndescribe : \");\n sb.append(\"离线定位成功,离线定位结果也是有效的\");\n\n } else if (location.getLocType() == BDLocation.TypeServerError) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"服务端网络定位失败,可以反馈IMEI号和大体定位时间到loc-bugs@baidu.com,会有人追查原因\");\n } else if (location.getLocType() == BDLocation.TypeNetWorkException) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"网络不同导致定位失败,请检查网络是否通畅\");\n\n } else if (location.getLocType() == BDLocation.TypeCriteriaException) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机\");\n }\n// logMsg(sb.toString());\n slatitude = String.valueOf(location.getLatitude());\n Log.i(\"slatitude::::\", slatitude);\n slongitude = String.valueOf(location.getLongitude());\n Log.i(\"slongitude::::\", slongitude);\n sname = String.valueOf(location.getAddrStr());\n Log.i(\"sname::::\", sname);\n UserLocationInfo.myAddress = location.getAddrStr();\n UserLocationInfo.myLatitude = location.getLatitude();\n UserLocationInfo.myLongitude = location.getLongitude();\n UserLocationInfo.myCity = location.getCity();\n UserLocationInfo.cityCode = location.getCityCode();\n UserLocationInfo.altitude = location.getAltitude();\n }\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n }", "@Override\n public void onLocationChanged(Location location) {\n latitude=String.valueOf(location.getLatitude());\n longitude= String.valueOf(location.getLongitude());\n\n System.out.println(\"asdfgh==\"+latitude);\n\n\n /* Geocoder geocoder;\n List<Address> addresses;\n geocoder = new Geocoder(SafetyActivity.this, Locale.getDefault());\n\n try {\n addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n String address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n String city = addresses.get(0).getLocality();\n String state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n String postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName();\n\n System.out.println(\"addresses==\"+address);\n // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n StringBuffer sb = new StringBuffer(256);\n sb.append(location.getCity());\n logMsg(sb.toString());\n City = sb.toString();\n }\n }", "@Override\n public void onReceiveLocation(BDLocation dbLocation) {\n if (dbLocation == null || mapView == null) {\n return;\n }\n //得到定位数据\n MyLocationData myLoationData = new MyLocationData.Builder()\n .accuracy(dbLocation.getRadius()) //设置精度\n .direction(dbLocation.getDirection()) //定位数据的方向信息\n .latitude(dbLocation.getLatitude())\n .longitude(dbLocation.getLongitude())\n .build();\n baiduMap.setMyLocationData(myLoationData);\n //如果是第一次登陆\n if (isFirstLoc) {\n isFirstLoc = false;\n LatLng latLng = new LatLng(dbLocation.getLatitude(), dbLocation.getLongitude());\n MapStatusUpdate mapStatusUpdate = MapStatusUpdateFactory.newLatLng(latLng);\n baiduMap.animateMapStatus(mapStatusUpdate);\n }\n Log.i(\"aaa\", \"-----\");\n showInfo(dbLocation);\n Log.i(\"aaa\", \"-----\");\n }", "public void getLocationInfo() {\n startLocationService();\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n\n mCurSheng = location.getProvince() ;\n mCurShi = location.getCity() ;\n mCurQu = location.getDistrict() ;\n\n final String locationDesc ;\n List<Poi> poiList = location.getPoiList() ;\n if(poiList.size() > 0){\n locationDesc = poiList.get(0).getName() ;\n }else{\n locationDesc = location.getLocationDescribe() ;\n }\n\n LogUtils.showLog(\"testLocations\" ,\"sendCircle--\" + locationDesc) ;\n\n if(mCurSheng != null && mCurShi != null){\n mCurLon = location.getLongitude() +\"\" ;\n mCurLat = location.getLatitude() +\"\" ;\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mLocationTv.setText(null == locationDesc ? \"点击获取位置\" : locationDesc);\n }\n });\n\n mLocationService.unregisterListener(mListener); //注销掉监听\n mLocationService.stop(); //停止定位服务\n\n MyApplication.updateCurLocation(location) ;\n\n handler.sendEmptyMessage(MSG_LOCATION) ;\n }\n\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n\n clientlat = location.getLatitude();\n clientlon = location.getLongitude();\n System.out.println(\"latitude is \"+clientlat);\n System.out.println(\"longitude is \"+clientlon);\n }", "private void updateWithNewLocation(Location location)\n {\n\n float fLatitude = (float)0.0;\n float fLongitude = (float)0.0;\n float fHepe=(float)10000.0;\n byte ucNapUsed = 0;\n byte ucWiperErrorCode = 0;\n\n if (Config.LOGD) Log.d(TAG,\"Network Location callback\");\n\n if( location != null)\n {\n //read params from location structure return by WPS\n fLatitude = (float)(location.getLatitude());\n fLongitude = (float)(location.getLongitude());\n fHepe = location.getAccuracy();\n\n if(bScanCompleted == true)\n {\n ucNapUsed= (byte)aResults.size();\n }\n else\n {\n ucNapUsed = 50;\n }\n\n }\n else\n {\n ucWiperErrorCode = 99;\n }\n startWiperReport();\n native_notify_wiper_position(fLatitude,fLongitude,fHepe,ucNapUsed,ucWiperErrorCode);\n endWiperReport();\n\n }", "public void onLocationChanged(Location location) {\n lastKnownLocation = location;\n geofenceHelper(getContext());\n }", "private void getLocation() {\n\n }", "public void gotLocation(Location location){\r\n \tif(location!=null){\r\n\t \tConstants.gpslat = location.getLatitude()+\"\";\r\n\t Constants.gpslng = location.getLongitude()+\"\";\r\n\t Log.d(\"location changed: lattitue & longitude\",Constants.gpslat+\" & \"+Constants.gpslng);\r\n \t}\r\n }", "private void setLocationData(Location location){\r\n currentLat = location.getLatitude();\r\n currentLng = location.getLongitude();\r\n }", "@Override\r\n public void onLocationChanged(Location location) {\r\n // - Update local variables\r\n setLocationData(location);\r\n\r\n if (location != null) {\r\n Log.e(TAG, \"== location != null\");\r\n // - Send result through a broadcast\r\n sendBroadcastToActivity(currentLat, currentLng);\r\n }\r\n }", "@Override\n public void onLocationChanged(Location loc)\n {\n \t\n \tint lat = (int) (loc.getLatitude() * 1E6);\n\t\t\tint lng = (int) (loc.getLongitude() * 1E6);\n\t\t\t point = new GeoPoint(lat, lng);\n\t\t\t \n\t\t\t /** remove the previous overlay so the another\n\t\t\t can be added **/\n\t\t\t itemizedOverlay.removeOverlay(0);\n\t\t\t \n\t\t\n\t\t\t //this follows the same steps in the OnCreate function at start up.\n\t\t\t // //Initialize a normal MapOVerlay item with new point.\n\t\t\t OverlayItem overlayitem = new OverlayItem(point, \"kiddda!\", \"sasri kal!\");\n\t\t \n\t\t itemizedOverlay.addOverlay(overlayitem);\n\t\t mapOverlays.add(itemizedOverlay);\n\t\t // move to new point.\n\t\t\tcontroller.animateTo(point); \n\t\t\t \n\t\n\t\t\t//debug message to say the location has been read.\n\t\t\tLog.i(\"Listener\", \"location read\");\n\t\t\t \n\t\t\n\n\t\t \n // String Text = \"My current location is: \" +\n\t\t\tLog.i(\"service check\",\" Latitude = \" + loc.getLatitude() +\n \" Longitude = \" + loc.getLongitude());\n \n // Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_LONG).show();\n \n }", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\tcurrent_location=location;\n\t\t\tlatitude=current_location.getLatitude();\n\t\t\tlongitude=current_location.getLongitude();\n\t\t\t//Toast.makeText(AgentSectionActivity.this,\"LATITUDE IS : \"+latitude+\"\\n LONGITUDE IS :\"+longitude+\"\",4000).show();\n\t\t\tsenddata(logged_user,Double.toString(latitude),Double.toString(longitude));\n\t\t}", "@Override\n public void onLocationChanged(Location location) {\n if(!firstLocCheck){\n drive = new Drive(location.getLatitude(),location.getLongitude(),Car.carList.get(carIndex),startTime);\n firstLocCheck = true;\n } else {\n Drive.curLat = location.getLatitude();\n Drive.curLong = location.getLongitude();\n }\n System.out.println(\"Location has changed\");\n System.out.println(location.getLatitude() + \" | \" + location.getLongitude());\n\n //updateLoc(location);\n //locProvider = location.getProvider();\n }", "public void onLocationChanged(Location location) {\n sendResult(location);\n }", "private void _Setup_GetLocData() {\n\t\tString log_msg = \"CONS.LocData.LONGITUDE=\"\n\t\t\t\t\t+ String.valueOf(CONS.LocData.LONGITUDE);\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\t\n\t\tIntent i = this.getIntent();\n\t\t\n\t\tthis.longitude\t= i.getDoubleExtra(\n\t\t\t\t\t\t\tCONS.IntentData.iName_Showmap_Longitude,\n\t\t\t\t\t\t\tCONS.IntentData.Showmap_DefaultValue);\n\t\t\n\t\tthis.latitude\t= i.getDoubleExtra(\n\t\t\t\tCONS.IntentData.iName_Showmap_Latitude,\n\t\t\t\tCONS.IntentData.Showmap_DefaultValue);\n\t\t\n\t\t// Log\n\t\tlog_msg = \"this.latitude=\" + String.valueOf(this.latitude)\n\t\t\t\t\t\t+ \"/\"\n\t\t\t\t\t\t+ \"this.longitude=\" + String.valueOf(this.longitude);\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\t\n\t}", "public void sendData() {\r\n\t\t// HoverBot specific implementation of sendData method\r\n\t\tSystem.out.println(\"Sending location information...\");\r\n\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n lastLatitude = Double.toString(location.getLatitude());\n lastLongitude = Double.toString(location.getLongitude());\n //lastLocation = Double.toString(location.getLatitude()) + \",\" + Double.toString(location.getLongitude()) ;\n //String b = lastLocation;\n // Get into right format\n // Logic to handle location object\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n String myUrl = \"https://a.mapillary.com/v3/map_features?layers=trafficsigns\" +\n \"&radius=600\" +\n \"&client_id=YUNMM3lQRXRUR1Y0MDBwcEVLaFJsUTo2ZWFjY2Y0YWJhM2JmYmM5\" +\n \"&per_page=\" + numberOfResults +\n \"&closeto=\" + location.getLongitude() + \",\" + location.getLatitude();\n //String to place our result in\n String result = null;\n //Instantiate new instance of our class\n HttpGetRequest getRequest = new HttpGetRequest();\n //Perform the doInBackground method, passing in our url\n try {\n result = getRequest.execute(myUrl).get();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n try {\n JSONObject jObject = new JSONObject(result);\n JSONArray features = jObject.getJSONArray(\"features\");\n for (int i=0; i < numberOfResults; i++){\n try {\n JSONObject featuresObject = features.getJSONObject(i);\n // Pulling items from the array\n JSONObject properties = featuresObject.getJSONObject(\"properties\");\n nearbyRoadSigns[i] = properties.getString(\"value\");\n\n System.out.println(nearbyRoadSigns[i]);\n\n } catch (JSONException e) {\n // Oops\n }\n }\n locationManager.removeUpdates(this);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n wayLatitude = location.getLatitude();\n wayLongitude = location.getLongitude();\n SharedStore.getInstance().save(Double.toString(wayLatitude),\"CurrentLat\");\n SharedStore.getInstance().save(Double.toString(wayLongitude),\"CurrentLong\");\n Log.e(\"getLocation\", String.valueOf(wayLatitude));\n }\n }", "public void updateLocation();", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n // Logic to handle location object\n mLastLocation = location;\n Log.wtf(\"-GPS\", \"getLocation 169 : \" + mLastLocation.getLatitude() + \",\" + mLastLocation.getLongitude());\n\n } else {\n Log.wtf(\"-GPS\", \"getLocation 171 : \" + mLastLocation);\n\n }\n }", "private void loadData() {\n gps = new GPSTracker(LocationActivity.this);\n if (from.equals(\"home\")) {\n if (lat == 0 && lon == 0) {\n if (gps.canGetLocation()) {\n if (TextbookTakeoverApplication.isNetworkAvailable(LocationActivity.this)) {\n lat = gps.getLatitude();\n lon = gps.getLongitude();\n Log.v(\"lati\", \"lat\" + lat);\n Log.v(\"longi\", \"longi\" + lon);\n } else {\n // TextbookTakeoverApplication.dialog(LocationActivity.this, \"Error!\", \"Please check your connection and try again\");\n }\n } else {\n if (!alertDialog.isShowing()) {\n alertDialog.show();\n }\n got = true;\n }\n }\n } else if (from.equals(\"add\")) {\n if (AddProductDetail.lat == 0 && AddProductDetail.lon == 0) {\n if (gps.canGetLocation()) {\n if (TextbookTakeoverApplication.isNetworkAvailable(LocationActivity.this)) {\n Log.v(\"lati\", \"lat\" + AddProductDetail.lat);\n Log.v(\"longi\", \"longi\" + AddProductDetail.lat);\n } else {\n // TextbookTakeoverApplication.dialog(LocationActivity.this, \"Error!\", \"Please check your connection and try again\");\n }\n } else {\n if (!alertDialog.isShowing()) {\n alertDialog.show();\n }\n got = true;\n }\n }\n }\n\n }", "private void onDataSendBegin() {\n Observable<Location> observable = ObservableFactory.from(SmartLocation.with(this).location().oneFix());\n observable.timeout(8, TimeUnit.SECONDS)\n .subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Observer<Location>() {\n @Override\n public void onSubscribe(Disposable d) {\n currentLocation = null;\n }\n\n @Override\n public void onNext(Location loc) {\n currentLocation = loc;\n }\n\n @Override\n public void onError(Throwable e) {\n Log.e(\"onDataSendBegin\", \"onError: yes\", e);\n Toast.makeText(PanelActivity.this, \"Unable to fetch precise location, try in another way.\", Toast.LENGTH_SHORT).show();\n currentLocation = locationUtils.getLocation();\n if (currentLocation == null) {\n Log.e(\"TAG\", \"无法获取设备定位信息(包括最近一次成功定位)!\");\n }\n sendLocation();\n }\n\n @Override\n public void onComplete() {\n sendLocation();\n }\n });\n }", "@Override\n public void onLocationChanged(final Location location) {\n // Lay vi tri hien tai cua minh\n myLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (firstLocation == true) {\n // Neu day la lan dau co thong tin vi tri thi chuyen camera ve vi tri nay\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n firstLocation = false;\n }\n // Gui vi tri cua minh len server\n String myLocationMessage = String.format(\"{\\\"COMMAND\\\":\\\"MEMBER_CURRENT_LOCATION\\\", \\\"LATITUDE\\\": \\\"%s\\\", \\\"LONGITUDE\\\": \\\"%s\\\"}\", myLocation.latitude, myLocation.longitude);\n OnlineManager.getInstance().sendMessage(myLocationMessage);\n // Refresh danh sach timesheet\n if (tourTimesheetAdapter != null) {\n tourTimesheetAdapter.notifyDataSetChanged();\n }\n }", "private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }", "@Override \n public void onLocationChanged(Location location) { \n mostRecentLocation = location; \n }", "private void Location() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_ACCESS_FINE_LOCATION);\n }\n\n //Google Play Location stored in loc variable\n fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n fusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n\n\n @Override\n public void onSuccess(Location location) {\n\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n loc = location;\n getAddressFromLocation(loc.getLatitude(), loc.getLongitude());\n\n }\n }\n });\n }", "@Override\n\t\tpublic void onReceiveLocation(BDLocation arg0) {\n\t\t\tlat = \"\" + arg0.getLatitude();\n\t\t\tlon = \"\" + arg0.getLongitude();\n\t\t\tSystem.out.println(\"lat ---> \" + lat);\n\t\t\tSystem.out.println(\"lon ---> \" + lon);\n\t\t\tlocationService.unregisterListener(mListener); // 注销掉监听\n\t\t\tlocationService.stop(); // 停止定位服务\n\t\t\t// System.out.println(\"des ---> \" + describe);\n\t\t\t// System.out.println(\"error ---> \" + arg0.getLocType());\n\t\t\t// System.out.println(\"District ---> \" + arg0.getDistrict());\n\t\t\t// System.out.println(\"Street ---> \" + arg0.getStreet());\n\t\t\t// System.out.println(\"getStreetNumber ---> \" +\n\t\t\t// arg0.getStreetNumber());\n\t\t\t// System.out.println(\"address ---> \" +\n\t\t\t// arg0.getAddress().streetNumber);\n\t\t\t// System.out.println(\"addressStr ---> \" + arg0.getAddrStr());\n\t\t\t// System.out.println(\"getBuildingID ---> \" + arg0.getBuildingID());\n\t\t\t// System.out.println(\"getBuildingName ---> \" +\n\t\t\t// arg0.getBuildingName());\n\t\t\t// System.out.println(\"getFloor ---> \" + arg0.getFloor());\n\t\t}", "public void onLocationChanged(Location newlocation) {\n\t\t\t\t\n\t\t\t\tif (newlocation != null) \n\t\t\t\t{\n\t\t\t\t\tlocationManager.removeUpdates(this);\n\t\t\t\t\tpoint=getGeoPoint(newlocation);\n\t\t\t\t\t//String altitiude = \"Altitiude: \" + newlocation.getAltitude();\n\t\t\t\t\t//String accuracy = \"Accuracy: \" + newlocation.getAccuracy();\n\t\t\t\t\t//String time = \"Time: \" + newlocation.getTime();\n\t\t\t\t\tmapController.animateTo(point);\n\t\t\t\t\t\n\t\t\t\t\tlatitudes= String.valueOf(newlocation.getLatitude() * 1E6);\n\t\t\t\t\tlongitudes= String.valueOf (newlocation.getLongitude() * 1E6);\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"latd\",latitudes));\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"lotd\",longitudes));\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"id\",LoginId));\n\t\t\t\t\tArrayList<NameValuePair> result=db.getServerData(nameValuePairs,\"updatecoordinates.php\");\n\t\t\t\t\tnameValuePairs.clear();\n\t\t\t\t\tfor(int i=0;i<result.size();i++)\n\t\t\t\t\t{\n\t\t\t\t\t\ts=result.get(i).getName();\n\t\t\t\t\t\tif(s.equals(\"Error\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Co-Ords Updated\", 3000);\n\t\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\t\ttt.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Co-Ords Updated Error\", 3000);\n\t\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\t\ttt.show();break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresult.clear();\n\t\t\t\t\t\n\t\t\t\t\tmapView.invalidate();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Override\n public void onLocationChanged(final Location location) {\n\n if(mLastLocation==null || location.distanceTo(mLastLocation)>getResources().getInteger(R.integer.min_distance_listen))\n {\n new GetNearBy().executePreHeavy();\n }\n\n mLastLocation=location;\n\n android.util.Log.e(\"onLocationChanged\",mLastLocation.getLatitude()+\" - \"+mLastLocation.getLongitude());\n\n\n\n }", "private void getLocation() {\n //if you don't have permission for location services yet, ask\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n //have the app ask for location permission\n } else {\n fusedLocationClient.requestLocationUpdates\n (getLocationRequest(), mLocationCallback,\n null /* Looper */);\n //uses the type of request and the location callback to update the location\n /**fusedLocationClient.getLastLocation().addOnSuccessListener(\n new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n TextView error = findViewById(R.id.errorMsg);\n error.setVisibility(View.VISIBLE);\n\n if (location != null) {\n lastLocation = location;\n error.setText(\"location: \" + lastLocation.getLatitude());\n } else {\n error.setText(\"location not available\");\n }\n }\n });**/\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n setLocation(location);\n mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n mTime = new SimpleDateFormat(K.TIMESTAMP_FORMAT_STRING).format(Calendar\n .getInstance().getTime()).toString();\n androidLocationUI.updateUI();\n if (application.isLogging()) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n saveData();\n }\n }).start();\n }\n }", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n public void onLocationChanged(Location location) {\n if (ActivityCompat.checkSelfPermission(TourTabsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(TourTabsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n // Bat gps thi di chuyen camera den vi tri cua minh\n myLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (firstLocation == true) {\n // Neu day la lan dau co thong tin vi tri thi chuyen camera ve vi tri nay\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n firstLocation = false;\n }\n // Gui vi tri cua minh len server\n String myLocationMessage = String.format(\"{\\\"COMMAND\\\":\\\"MEMBER_CURRENT_LOCATION\\\", \\\"LATITUDE\\\": \\\"%s\\\", \\\"LONGITUDE\\\": \\\"%s\\\"}\", myLocation.latitude, myLocation.longitude);\n OnlineManager.getInstance().sendMessage(myLocationMessage);\n // Refresh danh sach timesheet\n if(tourTimesheetAdapter != null){\n tourTimesheetAdapter.notifyDataSetChanged();\n }\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "public void getLocation(){\n }", "public void startLocationUpdate() {\n if (locationCallback != null) {\n try {\n locationCallback = new LocationCallback() {//khoi tao dinh nghia (extent)\n\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }\n };\n fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, null);//dang ky voi he thong app lang nghe su thay doi cua location\n\n } catch (SecurityException e) {\n e.getMessage();\n\n }\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n\n MyLat = location.getLatitude();\n MyLong = location.getLongitude();\n\n Log.e(TAG, \"MyLat = \" + MyLat);\n Log.e(TAG, \"MyLong = \" + MyLong);\n\n\n LatLng latLng = (new LatLng(location.getLatitude(), location.getLongitude()));\n mMap.clear();\n\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 17.0f));\n\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.draggable(true);\n\n BitmapDescriptor markerIcon = vectorToBitmap(R.drawable.ic__fill_placeholder,\n ContextCompat.getColor(getApplicationContext(),\n R.color.rv_hader));\n\n markerOptions.icon(markerIcon);\n markerOptions.title(\"My Location\");\n if (session.getMobileNumber() != null) {\n markerOptions.snippet(session.getMobileNumber());\n }\n mMap.addMarker(markerOptions);\n\n String add = getAddress(location.getLatitude(), location.getLongitude());\n Log.e(getClass().getSimpleName(), \"getAddress : \" + add);\n currentAddress = add;\n if (add != null)\n tv_current_locName.setText(add);\n else\n tv_current_locName.setText(\"Not Find\");\n } else {\n Log.d(TAG, \"onComplete: current location is null\");\n TastyToast.makeText(getApplicationContext(), getString(R.string.unable_toget_current_location), TastyToast.LENGTH_LONG, TastyToast.ERROR);\n Intent mIntent = new Intent(getApplicationContext(), MetaDataList.class); // the activity that holds the fragment\n Bundle mBundle = new Bundle();\n\n mBundle.putSerializable(\"metaDataItem\", metaDataItem);\n mIntent.setAction(\"UpdateLatLong\");\n mIntent.putExtra(\"SelectedNameDetail\", mBundle);\n startActivity(mIntent);\n finish();\n }\n }", "@Override\n public void locationFetched(Location mLocation, Location oldLocation, String time, String locationProvider) {\n GetAccurateLocationApplication.mCurrentLocation = mLocation;\n GetAccurateLocationApplication.oldLocation = oldLocation;\n GetAccurateLocationApplication.locationProvider = locationProvider;\n GetAccurateLocationApplication.locationTime = time;\n }", "@Override\n public void onLocationChanged(Location location) {\n Location location1 = location;\n\n }", "@Override\n public void onLocationChanged(Location location) {\n currentLatitude = location.getLatitude();\n currentLongitude = location.getLongitude();\n\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onSuccess: Location : \" + locationResult);\n if (locationResult == null) {\n return;\n }\n for (Location location : locationResult.getLocations()) {\n // Update UI with location data\n Toast.makeText(MainActivity.this, \"Location : \" + location, Toast.LENGTH_SHORT).show();\n }\n }", "public void onLocationChanged(Location location) {\n btsLocation.one_time_refresh();\r\n serviceToken = btsLocation.getToken();\r\n verify(serviceToken, pollDatabases(serviceToken));\r\n \r\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n mLastLocation = location;\n Log.i(\"mLastLocation\", String.valueOf(mLastLocation.getLatitude()) + \" \" + String.valueOf(mLastLocation.getLongitude()));\n }\n }", "@Override\n \tpublic void onLocationChanged(Location location) {\n \t\tthis.location = location;\n \t}", "public org.afscme.enterprise.organization.LocationData getLocationData() {\n return locationData;\n }", "private void createLocationCallback() {\n mLocationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n\n mLastLocation = locationResult.getLastLocation();\n mRequestingLocationUpdate = false;\n\n startAddressLookupService();\n }\n };\n }", "void onLocationChanged( String newLocation ) {\n Uri uri = mUri;\n if (null != uri) {\n long date = WeatherContract.WeatherEntry.getDateFromUri(uri);\n Uri updatedUri = WeatherContract.WeatherEntry.buildWeatherLocationWithDate(newLocation, date);\n mUri = updatedUri;\n getLoaderManager().restartLoader(DETAILED_WEATHER_LOADER, null, this);\n }\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onLocationResult: got location result.\");\n Location location = locationResult.getLastLocation();\n if (location != null) {\n GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude());\n userInfoDoc.get().addOnCompleteListener(task -> {\n Boolean av = (Boolean) task.getResult().get(\"Availability\");\n saveUserLocation(geoPoint , av);\n });\n saveDistance(geoPoint);\n\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "@Override\n\t\tpublic void onReceiveLocation(BDLocation location) {\n\t\t\t\n\t\t Lng = (float) location.getLatitude();//经度\n\t\t\t Lat = (float) location.getLongitude();//维度\n\t\t\t Log.e(TAG, \"Lng: \" + Lng);\n\t\t\t Log.e(TAG, \"Lat: \" + Lat);\n\t\t\t LocationUtil.stopLocation();\n\t\t\tLocationUtil.startReverseGeoCode(Lng, Lat, getGeoCoderResultListener);\n\t\t\t\n\t\t}", "@Override\n public void onSuccess(Location loc) {\n if (loc != null && loc.getLatitude() != 0) {\n cLoc = loc;\n }\n }", "@Override\n public geo_location getLocation() {\n return location;\n }", "@Override\n\tpublic SystemStatusMessage updateCurrentLocation() {\n\t\t\n\t\tDataStore dataStore = getSystemComputer().getStorageDevice();\n\t\t\n\t\t// Look for subspace beacons in navigation archive\n\t\tMap<String,DataRecord> subspaceBeacons = dataStore.getData(CelestialObject.category(), SubspaceBeacon.type());\n\t\t\n\t\t\n\t\t\n\t\t\n\t\treturn null;\n\t}", "public void onLocationChanged(Location location) {\n\t\t\t\tupdatenewlocation(location);\n\t\t\t\t\n\t\t\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n\n\n Bundle bundle = intent.getExtras();\n Location nLocation = (Location) bundle.get(\"New location\");\n LatLng there = new LatLng(nLocation.getLatitude(), nLocation.getLongitude());\n mMap.addPolyline(new PolylineOptions().add(there).color(0));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(there));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(there.latitude, there.longitude), 12.0f));\n\n Log.v(TAG, \"RECEIVED A NEW LOCATION\");\n\n }", "private void setLastLocation() {\n\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n // Permission has already been granted\n mFusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n lastLatitude = Double.toString(location.getLatitude());\n lastLongitude = Double.toString(location.getLongitude());\n //lastLocation = Double.toString(location.getLatitude()) + \",\" + Double.toString(location.getLongitude()) ;\n //String b = lastLocation;\n // Get into right format\n // Logic to handle location object\n }\n }\n });\n }\n }", "@Override\n \t\t\tpublic void onLocationChanged(Location loc) {\n \t \n \t\t\t}", "@Override\n public void onLocationChanged(Location location) {\n }", "@Override\n\t\t\tpublic void onReceiveLocation(BDLocation location) {\n\t\t\t\tif(location == null){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t/*StringBuffer sb = new StringBuffer();\n\t\t\t\tsb.append(location.getLongitude()+\",\");\n\t\t\t\tsb.append(location.getLatitude());*/\n\t\t\t\tresult = location.getLongitude()+\",\"+location.getLatitude();\n\t\t\t\t\n\t\t\t}", "@SuppressWarnings(\"MissingPermission\")\n private void getLastLocation() {\n mFusedLocationClient.getLastLocation()\n .addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful() && task.getResult() != null) {\n mLastLocation = task.getResult();\n getWeather(mLastLocation);\n } else {\n Log.w(TAG, \"getLastLocation:exception\", task.getException());\n showSnackbar(getString(R.string.no_location_detected));\n }\n }\n });\n }", "private void getLastKnownLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n Task<Location> task = fusedLocationProviderClient.getLastLocation();\n task.addOnSuccessListener(new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n lastKnownLocation = location;\n lastKnownLatLng = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());\n riderMarker = mMap.addMarker(new MarkerOptions().position(lastKnownLatLng).title(\"Your Location\")); // adding marker to rider location\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(lastKnownLatLng, 18)); // focusing on rider location\n if (ActivityCompat.checkSelfPermission(RiderMapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(RiderMapsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n\n riderInfoHashMap.put(NodeNames.RIDERID,currentUserId);\n riderInfoHashMap.put(NodeNames.RIDERLATITUDE,lastKnownLocation.getLatitude());\n riderInfoHashMap.put(NodeNames.RIDERLONGITUDE,lastKnownLocation.getLongitude());\n\n nodeReference = NodeNames.RIDERS + \"/\" + currentUserId;\n referenceHashMap = new HashMap<>();\n referenceHashMap.put(nodeReference,riderInfoHashMap);\n databaseReference.updateChildren(referenceHashMap, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(@Nullable DatabaseError error, @NonNull DatabaseReference ref) {\n if(error==null){\n Toast.makeText(RiderMapsActivity.this,\"Request your Cab ride\",Toast.LENGTH_SHORT).show();\n }else {\n Toast.makeText(RiderMapsActivity.this,\"error: \" + error.getMessage(),Toast.LENGTH_LONG).show();\n }\n }\n });\n\n // searching for nearby available driver\n\n searchCab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n if(requestCancelled){\n rideEndedByRider(); // rider cancelled ride\n }else {\n requestCancelled = true;\n GeoFire geoFire = new GeoFire(riderRequestsDatabaseReference);\n geoFire.setLocation(currentUserId, new GeoLocation(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()));\n\n progressDialog.setTitle(\"Getting Your Driver\");\n progressDialog.setMessage(\"Please wait while we are looking for nearby drivers\");\n progressDialog.show();\n\n getClosestDriver();\n }\n }\n });\n }\n }\n });\n }", "public void onNewLocationFromGPS(Location location) {\n gpsLocationFound = true;\n currentLocation = location;\n this.setLocationText(getLocationForPrint(location.getLatitude(),\n location.getLongitude()));\n requestForValidationOfQibla();\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }", "@Override\n public void onConnected(Bundle bundle) {\n mLastLocation=LocationServices.FusedLocationApi.getLastLocation(mLocationClient);\n if(mLastLocation!=null){\n double latitude=mLastLocation.getLatitude();\n double longitude=mLastLocation.getLongitude();\n\n Geocoder geocoder=new Geocoder(this, Locale.ENGLISH);\n try{\n List<Address> addresses=geocoder.getFromLocation(latitude,longitude,1);\n if(addresses!=null){\n Address fetchedAddresses=addresses.get(0);\n label=\"Location: \"+fetchedAddresses.getFeatureName()+\", \"+fetchedAddresses.getSubLocality()+\", \"+fetchedAddresses.getLocality()+\", \"+fetchedAddresses.getPostalCode()+\", \"+fetchedAddresses.getAdminArea()+\", \"+fetchedAddresses.getCountryName();\n }\n else{\n tvLocationLabel.setText(\"Location Not Found\");\n Snackbar.make(findViewById(android.R.id.content),\"Location Not Found\",Snackbar.LENGTH_LONG).show();\n }\n }catch (Exception e){\n Snackbar.make(findViewById(android.R.id.content),\"Unable to Get Location\",Snackbar.LENGTH_SHORT).show();\n tvLocationLabel.setText(\"Location Not Found\");\n e.printStackTrace();\n }\n }\n }", "@Override\r\n\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\tLog.d(\"demo\", \"Lat:\" + location.getLatitude() + \" Long:\"+location.getLongitude());\r\n\t\t\t}", "public void sendLastLocation() {\n\t\tif (listeners.size() == 0)\n\t\t\treturn;\n\n\t\tLocation locationToSend = getLastKnownLocation();\n\n\t\tif (locationToSend != null) {\n\t\t\toldLocation = locationToSend;\n\t\t\tfor(Listener ls: listeners){\n\t\t\t\tls.newLocation(locationToSend);\n\t\t\t}\n\t\t\tlog.debug(\"LocationReceiver send last location\");\n\t\t}\n\t}", "public abstract Location[] retrieveLocation();", "private void handleActionGetLocation(final ResultReceiver res) {\n //Bundle up and send the data returned by the gps sensor.\n mGPSSensor = new LocationSensor(this);\n mGPSSensor.getCurrentLocation(new AndroidSensorCallback() {\n @Override\n public void onSensorCallback(Location location) {\n if (location == null) {\n return;\n }\n\n Bundle b = new Bundle();\n b.putDouble(\"lat\", location.getLatitude());\n b.putDouble(\"lng\", location.getLongitude());\n b.putDouble(\"alt\", location.getAltitude());\n res.send(0, b);\n return;\n }\n });\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n Location location = locationResult.getLastLocation();\n if (location != null) {\n onLocationChanged(location);\n }\n }", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tphysAddr = this.initLocationManager();\n\t}", "private void updateLocationToServer() {\n\n if (Utility.isConnectingToInternet(getActivity())) {\n\n if (mGpsTracker.canGetLocation()) {\n\n if (Utility.ischeckvalidLocation(mGpsTracker)) {\n\n Animation fade1 = AnimationUtils.loadAnimation(getActivity(), R.anim.flip);\n btnRefreshLocation.startAnimation(fade1);\n Map<String, String> params = new HashMap<String, String>();\n if (!AppConstants.isGestLogin(getActivity())) {\n params.put(\"iduser\", SharedPref.getInstance().getStringVlue(getActivity(), userId));\n } else {\n params.put(\"iduser\", \"0\");\n }\n\n params.put(\"latitude\", \"\" + mGpsTracker.getLatitude());\n params.put(\"longitude\", \"\" + mGpsTracker.getLongitude());\n RequestHandler.getInstance().stringRequestVolley(getActivity(), AppConstants.getBaseUrl(SharedPref.getInstance().getBooleanValue(getActivity(), isStaging)) + updatelocation, params, this, 5);\n fade1.cancel();\n } else {\n mGpsTracker.showInvalidLocationAlert();\n }\n } else {\n showSettingsAlert(5);\n }\n } else {\n Utility.showInternetError(getActivity());\n }\n\n }", "public void getLocation() {\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n } else {\n mFusedLocationClient.getLastLocation().addOnSuccessListener(\n location -> {\n if (location != null) {\n // Start the reverse geocode AsyncTask\n new FetchAddressTask(DetailsTextActivity.this,\n DetailsTextActivity.this).execute(location);\n txtLocation.setText(getString(R.string.loading));\n Log.d(\"myTag\", \"have location\");\n } else {\n txtLocation.setText(R.string.no_location);\n }\n }\n );\n }\n }", "public void onLocationChanged(Location location) {\r\n currentLocation = new GeoPoint(location);\r\n DatabaseInteractor.sendPosition(act, PreferenceData.getUserId(act), currentLocation.getLatitude(), currentLocation.getLongitude());\r\n\t\tguidoMap.showMyLocation();\r\n }", "@Override\n\t\tpublic void onReceivePoi(BDLocation location) {\n\t\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n loc = location;\n getAddressFromLocation(loc.getLatitude(), loc.getLongitude());\n\n }\n }", "private void getlocation() {\n\t\t\t\ttry {\n\n\t\t\t\t\tgps = new GPSTracker(RegisterActivity.this);\n\t\t\t\t\tLog.d(\"LOgggg\", \"inCurrentlocation\");\n\n\t\t\t\t\t// check if GPS enabled\n\t\t\t\t\tif (gps.canGetLocation()) {\n\n\t\t\t\t\t\tlatitude = gps.getLatitude();\n\t\t\t\t\t\tlongitude = gps.getLongitude();\n\n\t\t\t\t\t\tLog.i(\"latitude\", \"\" + latitude);\n\t\t\t\t\t\tLog.i(\"longitude\", \"\" + longitude);\n\n\t\t\t\t\t\tnew getLoc().execute(\"\");\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgps.showSettingsAlert();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n String message = intent.getStringExtra(\"Status\");\n Bundle b = intent.getBundleExtra(\"Location\");\n lastKnownLoc = (Location) b.getParcelable(\"Location\");\n if (lastKnownLoc != null) {\n latitude = String.valueOf(lastKnownLoc.getLatitude());\n longitude = String.valueOf(lastKnownLoc.getLongitude());\n\n }\n }", "public LocationData(Location loc)\n {\n update(loc);\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n Toast.makeText(MainActivity.this,\n location.toString(),Toast.LENGTH_LONG).show();\n }\n else{\n Toast.makeText(MainActivity.this,\n \"Location object not received\",Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n Toast.makeText(getContext(), \"location: \" + location, Toast.LENGTH_LONG).show();\n EventBus.getDefault().post(new LocationEvent(location));\n }\n }", "@Override\n public void onDataChanged(DataEventBuffer dataEventBuffer) {\n for (DataEvent event : dataEventBuffer) {\n if (event.getType() == DataEvent.TYPE_CHANGED) {\n // DataItem changed\n DataItem item = event.getDataItem();\n if (item.getUri().getPath().compareTo(\"/latlnglist\") == 0) {\n\n DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();\n\n Log.d(\"hudwear\", \"new data, sending message to handler\");\n\n Message m = new Message();\n Bundle b = new Bundle();\n b.putDouble(\"latitude\", dataMap.getDouble(\"latitude\"));\n b.putDouble(\"longitude\", dataMap.getDouble(\"longitude\"));\n m.setData(b);\n handler.sendMessage(m);\n }\n\n } else if (event.getType() == DataEvent.TYPE_DELETED) {\n // DataItem deleted\n }\n }\n }", "@Override\n public void Handle() {\n fusedLocationClient = LocationServices.getFusedLocationProviderClient(context);\n\n // Fetch the last location\n fusedLocationClient.getLastLocation()\n .addOnSuccessListener((Activity) context, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n // Logic to handle location object\n Map<String, Double> latlng = new HashMap<String, Double>();\n latlng.put(\"longitude\", location.getLongitude());\n latlng.put(\"latitude\", location.getLatitude());\n Log.d(\"Location\", \"Location retreived \" + latlng.toString());\n result.success(latlng);\n } else {\n Log.d(\"Location\", \"unable to retreive location\");\n result.success(null);\n }\n }\n });\n }", "@Override\n\tpublic void onLocationChanged(Location loc)\n\t{\n\t}", "public void onLocationChanged(Location location) {\n \n \t}", "public void onSuccess(Location location) {\n if (location != null) {\n //onLocationChanged(location);\n }\n }", "public byte[] getLocation() {\r\n return location;\r\n }", "public void onLocationChanged(Location location) {\n }", "@Override\n public void onConnected(Bundle arg0) {\n mLastLocation=locationHelper.getLocation();\n }", "public void onPositionChanged() {\n\n currentLat = location.getLatitude();\n currentLng = location.getLongitude();\n\n }", "public void onPositionChanged() {\n\n currentLat = location.getLatitude();\n currentLng = location.getLongitude();\n\n }", "public String getLocation(){\n return this.location;\n }" ]
[ "0.71324795", "0.7090135", "0.7090135", "0.7090129", "0.6920941", "0.690132", "0.689085", "0.68868077", "0.6839888", "0.6837929", "0.67416996", "0.67335063", "0.670364", "0.6653464", "0.66399324", "0.66298306", "0.6628944", "0.66187453", "0.661309", "0.6606783", "0.65901554", "0.6587172", "0.65734607", "0.65502167", "0.65367234", "0.6527533", "0.6486302", "0.6482294", "0.6459935", "0.64596814", "0.6455628", "0.64349115", "0.64290434", "0.6412674", "0.6411475", "0.6410881", "0.63838816", "0.6379329", "0.63675636", "0.63627183", "0.6361552", "0.6357727", "0.6357727", "0.6353272", "0.6346909", "0.6335836", "0.6330883", "0.6329646", "0.6327108", "0.6321626", "0.6319538", "0.63071597", "0.63057697", "0.6299384", "0.62948996", "0.629431", "0.62892616", "0.62858766", "0.6280154", "0.62773794", "0.6276723", "0.62762773", "0.6272029", "0.62706906", "0.6266766", "0.62640697", "0.62627596", "0.6261823", "0.62618124", "0.6261113", "0.6254831", "0.6253365", "0.6224158", "0.6221374", "0.62085193", "0.62079537", "0.6198376", "0.61983716", "0.61979955", "0.6187577", "0.6180939", "0.6178768", "0.6169871", "0.61662376", "0.61623096", "0.61577547", "0.6157525", "0.6157222", "0.6155069", "0.614833", "0.6144892", "0.61435485", "0.61424696", "0.61284566", "0.61281854", "0.6122692", "0.61171466", "0.6115951", "0.6114195", "0.6114195", "0.611254" ]
0.0
-1
Get extra data included in the Intent
@Override public void onReceive(Context context, Intent intent) { String message = intent.getStringExtra("message"); Log.d("receiver", "Got message: " + message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getExtra();", "private void getExtrasFromCallingActivity() {\n extras = getIntent().getExtras();\n if (extras != null) {\n testIdString = extras.getString(\"TEST_ID_FOR_QUESTIONS\");\n } else {\n testIdString = \"-1\";\n }\n }", "public String[] getExtraInfo() {\n return extraInfo;\n }", "private void getIntentData() {\n\t\ttry{\n\t\t\tIN_CATEGORYID = getIntent().getStringExtra(CATEGORY_ID) == null ? \"0\" : getIntent().getStringExtra(CATEGORY_ID);\n\t\t\tIN_ARTICLENAME = getIntent().getStringExtra(ARTICLENAME) == null ? \"\" : getIntent().getStringExtra(ARTICLENAME) ;\n\t\t\tIN_ARTICLEID = getIntent().getStringExtra(ARTICLEID) == null ? \"\" : getIntent().getStringExtra(ARTICLEID);\n\t\t}catch(Exception e){\n\t\t}\n\t}", "private void getIntentData() {\n if (getIntent() != null) {\n destinationLat = getIntent().getDoubleExtra(\"destinationLat\", 48.893478);\n destinationLng = getIntent().getDoubleExtra(\"destinationLng\", 2.334595);\n }\n }", "private void getIntentData() {\r\n if (getIntent() != null && getIntent().getExtras() != null) {\r\n // Handling intent data from DirectoryDetailsActivity class\r\n if (Constant.ALBUM_TYPE.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n position = getIntent().getIntExtra(Constant.POSITION, 0);\r\n nameKey = getIntent().getStringExtra(Constant.KEY_NAME);\r\n } else if (Constant.LIST_TYPE.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n imageDataModel = getIntent().getParcelableExtra(Constant.DATA);\r\n } else if (Constant.SECURE_TAB.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n imageDataModel = getIntent().getParcelableExtra(Constant.DATA);\r\n } else {\r\n // Handling other intent data like camera intent\r\n Uri uri = getIntent().getData();\r\n GalleryHelper.getImageFolderMap(this);\r\n File file = new File(getRealPathFromURI(uri));\r\n nameKey = FileUtils.getParentName(file.getParent());\r\n GalleryHelperBaseOnId.getMediaFilesOnIdBasis(this, GalleryHelper.imageFolderMap.get(nameKey).get(0).getBucketId());\r\n }\r\n }\r\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 }", "void getBundleData(Intent intent);", "@Override\n\tprotected void getIntentData(Bundle savedInstanceState) {\n\n\t}", "public static Object getExtraObject(Activity context, String key) {\n \tObject param = null;\n \tBundle bundle = context.getIntent().getExtras();\n \tif(bundle!=null){\n \t\tparam = bundle.get(key);\n \t}\n \treturn param;\n\t}", "private void getIntentValues() {\n\n// itemname= getIntent().getExtras().getString(IntentsConstants.item_name);\n// itemPrice = getIntent().getExtras().getDouble(IntentsConstants.item_price);\n Bundle bundle = getArguments();\n menusItem= (MenusItem) bundle.getSerializable(\"Item\");\n itemname=menusItem.getName();\n itemPrice=menusItem.getPrice();\n\n}", "public void getintent() {\n Intent intent = this.getIntent();\n acceptDetailsModel = (AcceptDetailsModel) intent.getSerializableExtra(\"menu_item\");\n }", "Map<String, Object> extras();", "void getData() {\n Intent intent = this.getIntent();\n /* Obtain String from Intent */\n Sname = intent.getExtras().getString(\"name\");\n Sbloodbank = intent.getExtras().getString(\"bloodbank\");\n Sbranch = intent.getExtras().getString(\"branch\");\n Sdate = intent.getExtras().getString(\"date\");\n Stime = intent.getExtras().getString(\"time\");\n Sphone = intent.getExtras().getString(\"phone\");\n Log.d(\"userDetails received\", Sname + \",\" + Sphone ); //Don't ignore errors!\n }", "private void getDataFromMainActivity(){\n Intent intent = getIntent();\n Bundle bundle = intent.getExtras();\n site = bundle.getString(\"site\");\n }", "public java.util.Map getExtra(int status) throws android.os.RemoteException;", "@Override\n protected void getFromIntent() {\n this.groupID = getIntent().getStringExtra(\"groupId\");\n this.groupName = getIntent().getStringExtra(\"groupName\");\n }", "private void extractDataFromBundle() {\n Intent intent = getIntent();\n Bundle bundle = intent.getBundleExtra(MainActivity.PRACTICE_GAME_BUNDLE_KEY);\n\n mDifficulty = (Difficulty) bundle.getSerializable(MainActivity.DIFFICULTY_KEY);\n mPlayerGamePiece = (GamePiece) bundle.getSerializable(MainActivity.GAME_PIECE_KEY);\n\n }", "private void showIntentInfo(Intent intent, TextView textView){\n StringBuilder infoBuilder = new StringBuilder();\n String action = intent.getAction();\n infoBuilder.append(\"Action=\");\n infoBuilder.append(action != null ? action : \"** NO Action **\");\n infoBuilder.append(\"\\n\");\n\n Bundle extras = intent.getExtras();\n if(extras == null){\n infoBuilder.append(\"** NO Extras **\");\n } else {\n infoBuilder.append(\"** Extras **\\n\");\n Set<String> keySet = extras.keySet();\n for(String key : keySet) {\n String value = extras.get(key).toString();\n infoBuilder.append(key);\n infoBuilder.append(\"=\");\n infoBuilder.append(value);\n infoBuilder.append(\"\\n\");\n }\n }\n textView.setText(infoBuilder.toString());\n }", "private void getDataFromIntent(Intent intent) {\n panAadharCardDetail = intent.getParcelableExtra(\"panAadharDetail\");\n card_type = intent.getIntExtra(\"card_type\", 0);\n imageFileUri = intent.getStringExtra(\"imageFile\");\n }", "public Object getExtraInformation() {\n\t\treturn extraInformation;\n\t}", "private void getDataFromIntent() {\n\t\tfinal Intent intent = getIntent();\n\t\tdata.setmUsername(intent.getStringExtra(Constants.PARAM_USERNAME));\n\t\tdata.setmPassword(intent.getStringExtra(Constants.PARAM_PASSWORD));\n\t\tdata.setmHost(intent.getStringExtra(Constants.PARAM_HOST));\n\t\tdata.setmPort(intent.getIntExtra(Constants.PARAM_PORT, 389));\n\t\tdata.setmEncryption(intent.getIntExtra(Constants.PARAM_ENCRYPTION, 0));\n\t\tdata.setmRequestNewAccount((data.getmUsername() == null));\n\t\tdata.setmConfirmCredentials(intent.getBooleanExtra(Constants.PARAM_CONFIRMCREDENTIALS, false));\n\t}", "public void getBundle (){\n idTemp = getIntent().getStringExtra(\"id\");\n }", "static long m43010a(Intent intent) {\n if (intent == null) {\n return -1;\n }\n return intent.getLongExtra(\"com.tonyodev.fetch.extra_id\", -1);\n }", "public static String getExtraString(Activity context, String key) {\n \tString param = \"\";\n \tBundle bundle = context.getIntent().getExtras();\n \tif(bundle!=null){\n \t\tparam = bundle.getString(key);\n \t}\n \treturn param;\n\t}", "public Bundle getExtras() {\n }", "private void getMoviesData() {\n movieId = getIntent().getIntExtra(MOVIE_ID, 0);\n }", "private void getDataFromIntent(){\n Bundle extras = getIntent().getExtras();\n //para recibir los datos de una manera segura, se hace una verificacion\n //para ver si los extras no son nulos\n if (extras!=null){\n //en caso de tener datos en el extra, se obtendran y guardaran en variables para su uso deseado\n String data = extras.getString(\"data\");\n boolean isTrue = extras.getBoolean(\"boolean\");\n if (isTrue){\n tvData.setText(data);\n Toast.makeText(this, \"Se recibio un booleano desde MainActivity.\", Toast.LENGTH_SHORT).show();\n }\n else{\n Toast.makeText(this, \"No se recibio nada :c\", Toast.LENGTH_LONG).show();\n }\n //en caso de no tener daos dentro dle extra, entrara a esta parte de la condicion\n }else{\n Toast.makeText(this, \"No hay datos extras\", Toast.LENGTH_SHORT).show();\n }\n\n }", "com.google.protobuf.ByteString getExtra();", "public com.google.protobuf.ByteString getExtra() {\n return extra_;\n }", "public com.google.protobuf.ByteString getExtra() {\n return extra_;\n }", "public Bundle extra() {\n if (mExtra == null)\n mExtra = new Bundle();\n return mExtra;\n }", "public String getExtra() {\n Object ref = extra_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n extra_ = s;\n return s;\n }\n }", "private void receiveData()\n {\n Intent i = getIntent();\n loginStatus = i.getIntExtra(\"Login_Status\", 0);\n deviceStatus = i.getIntExtra(\"Device_Status\", 0);\n }", "private void getIncomingContactData() {\n // create bundle object that refers to the bundle inside the intent\n Bundle extras = getIntent().getExtras();\n contact = getObjectFromJSONString( extras.getString(\"CONTACT\") );\n displayContactDetails();\n }", "public Intent getIntent() {\n return mIntent;\n }", "public String getExtra() {\n Object ref = extra_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n extra_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public static Bundle m3a(Intent intent) {\n return intent.getBundleExtra(\"al_applink_data\");\n }", "private Order getIntentData(Intent intent) {\n\t\treturn intent != null ? (Order) intent\n\t\t\t\t.getSerializableExtra(TarrifActivity.TICKET_CONTIANS_ORDER_SERIALIZABLE_KEY)\n\t\t\t\t: null;\n\t}", "public Intent getIntent() {\n return mIntent;\n }", "protected abstract Intent getIntent();", "private void addExtras(Intent intent)\n\t{\n\t\tBundle extras = getIntent().getExtras();\n\t\t\n\t\t// Load in the unused extras from the\n\t\t// previous Activity.\n\t\tintent.putExtras(extras);\n\t\t\n\t\t////////////////////////////////////////\n\t\t// Add optional standings categories. //\n\t\t////////////////////////////////////////\n\t\tif (_points.isChecked())\n\t\t{\n\t\t\tintent.putExtra(\"POINTS_ACTIVE\", true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tintent.putExtra(\"POINTS_ACTIVE\", false);\n\t\t}\n\t\t\n\t\tif (_score.isChecked())\n\t\t{\n\t\t\tintent.putExtra(\"SCORE_ACTIVE\", true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tintent.putExtra(\"SCORE_ACTIVE\", false);\n\t\t}\n\t\t/////////////////////////////////////////\n\t}", "private String getStringExtra(Bundle savedInstanceState, String strWhich) {\n String strRet = (savedInstanceState != null ? savedInstanceState.getString(strWhich) : \"\");\r\n \r\n if (strRet == \"\") {\r\n \tBundle extras = getIntent().getExtras(); \r\n \tstrRet = (extras != null ? extras.getString(strWhich) : \"\");\r\n }\r\n \r\n return strRet;\r\n\r\n\t}", "public void setExtraInfo (String info) {\n\tthis.extraInfo = info;\n }", "private void logPushExtras(Intent intent) {\n Set<String> keys = intent.getExtras().keySet();\n for (String key : keys) {\n\n // ignore standard C2DM extra keys\n List<String> ignoredKeys = (List<String>) Arrays.asList(\n \"collapse_key\",// c2dm collapse key\n \"from\",// c2dm sender\n PushManager.EXTRA_NOTIFICATION_ID,// int id of generated notification (ACTION_PUSH_RECEIVED only)\n PushManager.EXTRA_PUSH_ID,// internal UA push id\n PushManager.EXTRA_ALERT);// ignore alert\n if (ignoredKeys.contains(key)) {\n continue;\n }\n Log.i(logTag,\n \"Push Notification Extra: [\" + key + \" : \"\n + intent.getStringExtra(key) + \"]\"\n );\n }\n }", "@SuppressWarnings(\"unchecked\")\n protected <V extends Parcelable> V getParcelableExtra( final String name )\n {\n return (V) getIntent().getParcelableExtra( name );\n }", "String getAdditionalInfo();", "private void getAndSetIncomingIntent(){\n if (getIntent().hasExtra(\"asso\")) {\n Log.d(TAG, getIntent().getStringExtra(\"asso\"));\n edt_asso_name.setText(getIntent().getStringExtra(\"asso\"));\n }\n if (getIntent().hasExtra(\"school\")) {\n edt_school.setText(getIntent().getStringExtra(\"school\"));\n }\n if (getIntent().hasExtra(\"purpose\")) {\n edt_purpose.setText(getIntent().getStringExtra(\"purpose\"));\n }\n if (getIntent().hasExtra(\"link\")) {\n edt_link.setText(getIntent().getStringExtra(\"link\"));\n }\n if (getIntent().hasExtra(\"type\")) {\n selectedSpinnerType = getIntent().getStringExtra(\"type\");\n }\n\n }", "public Bundle getExtras() {\n return mBundle.getBundle(KEY_EXTRAS);\n }", "public void setExtraInfo(String[] extraInfo) {\n this.extraInfo = extraInfo;\n this.bextraInfo = true;\n }", "void mo21580A(Intent intent);", "private void BundleData(Intent intent) {\n bundle=new Bundle();\n bundle.putString(\"FNAME\",fname);\n bundle.putString(\"LNAME\",lname);\n bundle.putString(\"LOCALITY\",locality);\n bundle.putString(\"CITY\",city);\n bundle.putInt(\"PINCODE\",pincode);\n bundle.putString(\"TIME_TO_CALL\",timers);\n bundle.putString(\"PHONE\",phone);\n bundle.putString(\"ALTPHONE\",altphone);\n bundle.putString(\"EMAIL\",emailid);\n intent.putExtras(bundle);\n }", "@Override public java.util.Map getExtra(int status) throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\njava.util.Map _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\n_data.writeInt(status);\nmRemote.transact(Stub.TRANSACTION_getExtra, _data, _reply, 0);\n_reply.readException();\njava.lang.ClassLoader cl = (java.lang.ClassLoader)this.getClass().getClassLoader();\n_result = _reply.readHashMap(cl);\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}", "public Intent getActivityIntent() {\n Intent intent = new Intent(this.context, InterstitialActivity.class);\n intent.setFlags(268435456);\n intent.addFlags(67108864);\n intent.putExtra(\"id\", getPlacementID());\n if (this.setAutoPlay) {\n intent.putExtra(\"auto_play\", this.autoPlay);\n }\n if (this.setCanClose) {\n intent.putExtra(\"can_close\", isBackButtonCanClose());\n }\n if (this.setMute) {\n intent.putExtra(\"mute\", getMute());\n }\n intent.putExtra(\"cat\", getCategories());\n intent.putExtra(\"pbk\", getPostback());\n intent.putExtra(\"b_color\", getButtonColor());\n intent.putExtra(\"skip_title\", getSkipText());\n intent.putExtra(\"creative\", getCreative());\n return intent;\n }", "public String getAdditionalData() {\n return additionalData;\n }", "@Override\n\tprotected void obtainIntentValue() {\n\n\t}", "public ListaAttributi getExtra() {\r\n return this.extra;\r\n }", "public static Bundle getExtrasBundle(Bundle intentExtras) {\n if (!Constants.IS_AMAZON) {\n return intentExtras.getBundle(Constants.APPBOY_PUSH_EXTRAS_KEY);\n } else {\n return intentExtras;\n }\n }", "@Override\n \tpublic void onReceive(Context context, Intent intent)\n \t{\n \tMediaInfoArtist = intent.getStringExtra(\"artist\");\n \tMediaInfoAlbum = intent.getStringExtra(\"album\");\n \tMediaInfoTrack = intent.getStringExtra(\"track\");\n \tMediaInfoNeedsUpdate = true;\n \tLog.d(\"OLV Music\",\"Artist: \"+MediaInfoArtist+\", Album: \"+MediaInfoAlbum+\" and Track: \"+MediaInfoTrack);\n \t}", "public static String getStringIntent(Intent intent, String name) {\n\t\tString retval = null;\n\t\tif (intent != null) {\n\t\t\tif (intent.hasExtra(name))\n\t\t\t\tretval = intent.getStringExtra(name);\n\t\t}\n\t\treturn retval;\n\t}", "public void addExtraInfo(final ArrayList<PersonInfo> extra) {\n info.addAll(extra);\n hasExtra = true;\n }", "public String getAdditionalInfo() {\n return additionalInfo;\n }", "public String getAdditionalInfo() {\n return additionalInfo;\n }", "public String getAdditionalInfo() {\r\n return additionalInfo;\r\n }", "private void getIncomingData() {\n Bundle bundle = getIntent().getExtras();\n if (bundle.containsKey(\"DOCTOR_ID\")\n && bundle.containsKey(\"DOCTOR_NAME\")\n && bundle.containsKey(\"CLINIC_ID\")\n && bundle.containsKey(\"CLINIC_NAME\")\n && bundle.containsKey(\"CLINIC_LATITUDE\")\n && bundle.containsKey(\"CLINIC_LONGITUDE\")\n && bundle.containsKey(\"CLINIC_ADDRESS\")) {\n DOCTOR_ID = bundle.getString(\"DOCTOR_ID\");\n DOCTOR_NAME = bundle.getString(\"DOCTOR_NAME\");\n CLINIC_ID = bundle.getString(\"CLINIC_ID\");\n CLINIC_NAME = bundle.getString(\"CLINIC_NAME\");\n CLINIC_LATITUDE = bundle.getDouble(\"CLINIC_LATITUDE\");\n CLINIC_LONGITUDE = bundle.getDouble(\"CLINIC_LONGITUDE\");\n CLINIC_ADDRESS = bundle.getString(\"CLINIC_ADDRESS\");\n\n if (DOCTOR_NAME != null) {\n txtDoctorName.setText(DOCTOR_NAME);\n }\n\n if (CLINIC_NAME != null) {\n txtClinicName.setText(CLINIC_NAME);\n }\n\n if (CLINIC_ADDRESS != null) {\n txtClinicAddress.setText(CLINIC_ADDRESS);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Failed to get required info....\", Toast.LENGTH_SHORT).show();\n finish();\n }\n }", "boolean hasExtra();", "private void getIntentAndDisplayData(Intent i) {\n\t\t\tif (!isCancelled()) {\n\t\t\t\tforumTopicID = i.getStringExtra(\"topicID\");\n\t\t\t\tuserID = i.getStringExtra(\"userID\");\n\t\t\t\tgetDataFromServer(forumTopicID);\n\t\t\t}\n\t\t}", "public Intent getRequestIntent() {\n return requestIntent;\n }", "@Override\n public Bundle getExtras() {\n Bundle extras = contactsCursor == null ? new Bundle() : contactsCursor.getExtras();\n extras.putInt(FAVORITES_COUNT, favoritesCount);\n return extras;\n }", "@Override\n public void dataAvailable(Intent intent) {\n String uuid = BLEService.getmCharacteristicToPass().getUuid().toString();\n }", "public interface extras {\n\n Extras getExtras();\n\n}", "protected String getBundleData() {\n Bundle bundle = getIntent().getExtras();\n StringBuilder temp = new StringBuilder();\n SessionManager session = new SessionManager(getApplicationContext());\n\n temp.append(\"User: \").append(session.getUserName()).append(\"\\r\\n\");\n temp.append(\"Layout: \").append(getBundle(bundle, \"layout\")).append(\"\\r\\n\");\n temp.append(\"Orientation: \").append(getBundle(bundle, \"orientation\")).append(\"\\r\\n\");\n temp.append(\"Variation: \").append(getBundle(bundle, \"variation\")).append(\"\\r\\n\");\n temp.append(\"Hardwareaddons: \").append(getBundle(bundle, \"hardwareaddons\")).append(\"\\r\\n\");\n temp.append(\"Input: \").append(getBundle(bundle, \"input\")).append(\"\\r\\n\");\n temp.append(\"Posture: \").append(getBundle(bundle, \"posture\")).append(\"\\r\\n\");\n temp.append(\"Externalfactors: \").append(getBundle(bundle, \"externalfactors\")).append(\"\\r\\n\").append(\"\\r\\n\");\n //data = temp.toString();\n return temp.toString();\n }", "@SuppressWarnings(\"unused\")\npublic interface Constants {\n /**\n * Extra data key. Used with intent or some others.\n */\n class Extras {\n public static final String TAG = \"ext_tag\";\n public static final String FLAG = \"ext_flag\";\n public static final String DATA = \"ext_data0\";\n public static final String DATA_1 = \"ext_data1\";\n public static final String DATA_2 = \"ext_data2\";\n public static final String DATA_3 = \"ext_data3\";\n public static final String DATA_4 = \"ext_data4\";\n public static final String DATA_5 = \"ext_data5\";\n public static final String DATA_6 = \"ext_data6\";\n public static final String DATA_7 = \"ext_data7\";\n public static final String DATA_8 = \"ext_data8\";\n public static final String GRADE_INFO = \"ext_grade_info\";\n public static final String MEMBER_VP_INFO = \"ext_member_vp_info\";\n public static final String MEMBER_VP_POSITION = \"ext_member_vp_position\";\n }\n\n\n}", "@Override\n public void onNewIntent(Activity activity, Intent data) {\n }", "com.google.protobuf.ByteString\n getExtraBytes();", "@NonNull\n final public Map<String, Object> getExtras() {\n return new HashMap<String, Object>(mExtras);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tputExtra();\n\t\t\t\t\n\t\t\t}", "@Override\r\n public void onReceive(Context context, Intent intent) {\n Log.d(TAG, \"onReceive: -->\");\r\n String str = intent.getDataString();\r\n Toast.makeText(context, \"Got brocastcast\" + intent.getStringExtra(\"Extra\"), Toast.LENGTH_SHORT).show();\r\n }", "public String getExtraOptions() {\n return this.extraOptions;\n }", "@Override\r\n public void onClick(View v) {\n String robodata=\"robot data\";\r\n String stringdata = \"throwing\";\r\n Intent mysqlintent = new Intent(collect_Data.this,mysql.class); //defining the intent.\r\n mysqlintent.putExtra(robodata, stringdata); //putting the data into the intent\r\n startActivity(mysqlintent); //launching the mysql activity\r\n }", "private ArrayList<TodoData> getTodos() {\n Intent intent = (Intent) getIntent();\n return (ArrayList<TodoData>) intent.getSerializableExtra(\"todos\");\n }", "private void receiveData()\n {\n Intent i = getIntent();\n productSelected = Paper.book().read(Prevalent.currentProductKey);\n vendorID = i.getStringExtra(\"vendorID\");\n if (productSelected != null) {\n\n productName = i.getStringExtra(\"productName\");\n productImage = i.getStringExtra(\"imageUrl\");\n productLongDescription = i.getStringExtra(\"productLongDescription\");\n productCategory = i.getStringExtra(\"productCategory\");\n productPrice = i.getStringExtra(\"productPrice\");\n productSizesSmall = i.getStringExtra(\"productSizesSmall\");\n productSizesMedium = i.getStringExtra(\"productSizesMedium\");\n productSizesLarge = i.getStringExtra(\"productSizesLarge\");\n productSizesXL = i.getStringExtra(\"productSizesXL\");\n productSizesXXL = i.getStringExtra(\"productSizesXXL\");\n productSizesXXXL = i.getStringExtra(\"productSizesXXXL\");\n productQuantity = i.getStringExtra(\"productQuantity\");\n }\n }", "private String addExtra() {\n\t\t// One Parameter: ExtraName\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|extra:\" + parameters[0]);\n\t\treturn tag.toString();\n\t}", "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 String getExtra3() {\n return extra3;\n }", "public com.google.protobuf.ByteString\n getExtraBytes() {\n Object ref = extra_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n extra_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "static /* synthetic */ byte[] m10276k(Intent intent) {\n if (intent == null) {\n return null;\n }\n Parcel obtain = Parcel.obtain();\n obtain.setDataPosition(0);\n intent.writeToParcel(obtain, 0);\n byte[] marshall = obtain.marshall();\n obtain.recycle();\n return marshall;\n }", "public static Bundle getBundle(Activity c) {\n\t\treturn c.getIntent().getExtras();\n\t}", "abstract protected void addExtras();", "public String getExtra2() {\n return extra2;\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n Toast.makeText(context,\"静态广播:\"+intent.getAction()+\":\"+intent.getStringExtra(\"tv\"),\n Toast.LENGTH_LONG).show();\n System.out.println(intent.getStringExtra(\"tv\"));\n }", "public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n Intent intent = getIntent();\n if (intent != null) {\n this.Z = intent.getStringExtra(\"extra_deep_link_ots\");\n this.Y = intent.getStringExtra(\"extra_deep_link_email\");\n }\n }", "@Override\n\t public void onReceive(Context context, Intent intent) {\n\t Toast.makeText(appContext, intent.getStringExtra(\"cmd_value\"), Toast.LENGTH_SHORT).show();\n\t }", "protected List<Info> getInfo() {\n\n return (List<Info>) getExtraData().get(ProcessListener.EXTRA_DATA_INFO);\n }", "@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\n\t\tString activityName = \"com.sonyericsson.media.infinite.EXTRA_ACTIVITY_NAME\";\n\n\t\tif (intent.getStringExtra(activityName) != null && intent.getStringExtra(activityName).equals(MusicPreferenceActivity.class.getName())) {\n\n\t\t\tBundle extras = new Bundle();\n\n\t\t\t// Build a URI for the string resource for the description text\n\t\t\tString description = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE).authority(context.getPackageName()).appendPath(Integer.toString(R.string.description)).build()\n\t\t\t\t\t.toString();\n\n\t\t\t// And return it to the infinite framework as an extra\n\t\t\textras.putString(\"com.sonyericsson.media.infinite.EXTRA_DESCRIPTION\", description);\n\t\t\tsetResultExtras(extras);\n\n\t\t}\n\t}", "public com.google.protobuf.ByteString\n getExtraBytes() {\n Object ref = extra_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n extra_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static Bundle m4b(Intent intent) {\n Bundle a = m3a(intent);\n if (a == null) {\n return null;\n }\n return a.getBundle(AppLinkData.ARGUMENTS_EXTRAS_KEY);\n }", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (resultCode == RESULT_OK && requestCode == 1) {\n // Extract name value from result extras\n site = data.getExtras().getString(\"site\");\n color = data.getExtras().getString(\"color\");\n type = data.getExtras().getString(\"type\");\n size = data.getExtras().getString(\"size\");\n // Toast the name to display temporarily on screen\n\n }\n }", "public void getDetails() {\n presenter = new SkillPresenter(this, this);\n try {\n if (getIntent().getExtras().get(\"from\").toString().equalsIgnoreCase(\"notification\")) {\n presenter.getSkillsNotification(this, getIntent().getIntExtra(\"notification_id\", 0));\n } else if (getIntent().getExtras().get(\"from\").toString().equalsIgnoreCase(\"notificationAdapter\")) {\n presenter.getSkillsNotification(this, getIntent().getIntExtra(\"notification_id\", 0));\n } else {\n presenter.getSkills(this);\n }\n }catch (Exception e){\n e.printStackTrace();\n presenter.getSkills(this);\n }\n }", "public String getExtra1() {\n return extra1;\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 }" ]
[ "0.79771703", "0.7306866", "0.72960824", "0.7218317", "0.7154258", "0.7118799", "0.6927503", "0.68553144", "0.6653539", "0.6604859", "0.6603409", "0.6529914", "0.64611626", "0.6429498", "0.64109373", "0.64089173", "0.6393858", "0.63900703", "0.6353799", "0.63495857", "0.63381636", "0.6326978", "0.63264346", "0.6234671", "0.62311286", "0.62261933", "0.6179679", "0.6152244", "0.6138546", "0.6114199", "0.6108427", "0.60847306", "0.6072412", "0.60613286", "0.6045483", "0.6014976", "0.60110164", "0.6000493", "0.5972271", "0.596623", "0.5962179", "0.595599", "0.5935058", "0.59247136", "0.5894423", "0.588142", "0.5880212", "0.58500075", "0.5831327", "0.58158827", "0.58033115", "0.5796612", "0.57948005", "0.5732329", "0.57313937", "0.572797", "0.571315", "0.56940025", "0.56750363", "0.5673033", "0.56713176", "0.5652068", "0.5652068", "0.5648498", "0.56388706", "0.5631548", "0.5620988", "0.56006867", "0.5594962", "0.5590175", "0.5576198", "0.5570383", "0.5561604", "0.5559027", "0.55559635", "0.55541945", "0.5541181", "0.55261415", "0.5522163", "0.55182374", "0.55165744", "0.5512708", "0.55078256", "0.5504161", "0.54908144", "0.5486738", "0.5484884", "0.5481537", "0.5479192", "0.5478903", "0.54726774", "0.54547316", "0.54380316", "0.54227006", "0.5413412", "0.54047734", "0.53962994", "0.5378262", "0.5377352", "0.5376982", "0.53690195" ]
0.0
-1
Unregister since the activity is about to be closed.
@Override protected void onDestroy() { LocalBroadcastManager.getInstance(this).unregisterReceiver(mMessageReceiver); super.onDestroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void unregister()\n\t{\n\t\tcancelPrevRegisterTask();\n\n\t\tpushRegistrar.unregisterPW(mContext);\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tif (wt != null && !wt.isCancelled()) {\r\n\t\t\twt.cancel(true);\r\n\t\t}\r\n\t\t\r\n\t\tactivity.unregisterReceiver(receiver);\r\n\t}", "@Override\n protected void onUnregister() {\n Core.unregister(this);\n }", "public void onDestroy() {\n PackageManagerActivity.super.onDestroy();\n LocalBroadcastManager.getInstance(this).unregisterReceiver(this.h);\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tActivityCollector.removeActivity(this);\n\t}", "public void deactivate() {\n serviceTracker.close();\n listenerSR.unregister();\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n unregisterReceiver(broadcastReceiver);\n if(timer != null)\n timer.cancel();\n }", "protected void onDestroy(){\n super.onDestroy();\n LocalBroadcastManager.getInstance(this).unregisterReceiver(timeReceiver);\n }", "@Override\n protected void onDestroy() {\n \tsuper.onDestroy();\n \tmActivities.removeActivity(\"SetOrResetWifi\");\n \tunregisterReceiver(receiver);\n }", "@Override\n\tpublic void onDestroy(){\n\t\tmNotifMng.cancel(NOTIFICATION_ID);\n\t\tif(mConnectThread != null){\n\t\t\tmConnectThread.interrupt();\n\t\t\tmConnectThread.stopRunning();\n\t\t}\n\t\t//Unregister the phone receiver\n\t\tunregisterReceiver(mSmsListener);\n\t}", "public void unregister() {\n unregistered = true;\n }", "@Override\n public void onDestroy() {\n this.unregisterReceiver(mReceiver);\n }", "private void stop() {\n if (lifecycle != null) {\n lifecycle.removeObserver(this);\n return;\n }\n activity.getApplication().unregisterActivityLifecycleCallbacks(this);\n }", "@Override\n public void onDestroy() {\n LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(us);\n LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(ud);\n super.onDestroy();\n }", "public void stopTracking() {\n mContext.unregisterReceiver(this);\n }", "@Override\n protected void onDestroy() {\n LocalBroadcastManager.getInstance(this).unregisterReceiver(\n mMessageReceiver);\n super.onDestroy();\n }", "public void unregister() {\n this.dispatcher.context.unregisterReceiver(this);\n }", "@Override\n public void onDestroy() {\n notificationManager.cancel(AbstractTrackerActivity.NOTIFICATION_ID);\n locationManager.removeUpdates(this);\n super.onDestroy();\n }", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tthis.unregisterReceiver(receiver);\n\t}", "private void deregisterBroadcastReceiver(){\n activity.unregisterReceiver(hceNotificationsReceiver);\n }", "@Override\r\n protected void onDestroy() {\r\n GlobalBus.getBus().unregister(this);\r\n super.onDestroy();\r\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tunregisterReceiver(mReceiver);\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\ttry {\r\n\t\t\tunregisterReceiver(newReceiver);\r\n\t\t} catch (Exception e) {\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tunregisterReceiver(userReceiver);\r\n\t\t} catch (Exception e) {\r\n\t\t}\r\n\t\tBmobChat.getInstance(this).stopPollService();\r\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\t MainService.allActivity.remove(this);\n\t}", "@Override\n protected void onDestroy() {\n stopRepTask();\n LocalBroadcastManager.getInstance(this).unregisterReceiver(DayStartedMessageRec);\n LocalBroadcastManager.getInstance(this).unregisterReceiver(DayEndedMessageRec);\n LocalBroadcastManager.getInstance(this).unregisterReceiver(TermEndedMessageRec);\n LocalBroadcastManager.getInstance(this).unregisterReceiver(SoundAlteredRec);\n LocalBroadcastManager.getInstance(this).unregisterReceiver(SharesTransactionedRec);\n LocalBroadcastManager.getInstance(this).unregisterReceiver(SpecificElementUpdate);\n super.onDestroy();\n }", "@Override\n public void onDestroy() {\n sensorManager.unregisterListener(SensorService.this, accelerometerSensor);\n unregisterReceiver(powerConnectionReceiver);\n notificationManager.cancel(1);\n super.onDestroy();\n }", "protected void unregister() {\r\n\t\tif ((audioFile != null) && (audioFile instanceof AudioFileURL)) {\r\n\t\t\t((AudioFileURL) audioFile).removeListener(this);\r\n\t\t}\r\n\t}", "@Override\n protected void onStop() {\n unregisterReceiver(myReceiverActivity);\n super.onStop();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tunregisterReceiver(mReceiver);\n\t}", "private void unregister() {\n Intent regIntent = new Intent(REQUEST_UNREGISTRATION_INTENT);\n regIntent.setPackage(GSF_PACKAGE);\n regIntent.putExtra(\n EXTRA_APPLICATION_PENDING_INTENT, PendingIntent.getBroadcast(context, 0, new Intent(), 0));\n setUnregisteringInProcess(true);\n context.startService(regIntent);\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n\n unbindService(conn);\n unregisterReceiver(mbtBroadcastReceiver);\n }", "@Override\n\tpublic void onDestroy() {\n\t\tif (meichecked)\n\t\t\tmeil.stopLog();\n\t\twlock.release();\n\t\tdestroyNotification();\n\t\tsuper.onDestroy();\n\t}", "@Override\n public void onDestroy() {\n EventBusWraper.getInstance().unregister(mContext);\n super.onDestroy();\n // unRegister();\n }", "public void onDestroy() {\n super.onDestroy();\n BroadcastReceiver broadcastReceiver = this.mScreenReceiver;\n if (broadcastReceiver != null) {\n unregisterReceiver(broadcastReceiver);\n }\n }", "public void invalidateHandler() {\n mWeakActivity.clear();\n }", "public void destroy() {\n Logger.d(TAG, \"onDestroy() entry\");\n if (mActivity != null) {\n mActivity = null;\n }\n if (mListener != null) {\n mListener = null;\n }\n if (mData != null) {\n mData.clear();\n }\n Logger.d(TAG, \"onDestroy() exit\");\n }", "private void disconnect() {\n activityRunning = false;\n MRTClient.getInstance().doHangup();\n MRTClient.getInstance().removeClientListener(this);\n\n finish();\n }", "@Override\n protected void onDestroy() {\n EventBus.getDefault().unregister(this);\n\n super.onDestroy();\n }", "public void unregisterReceiver() {\n try {\n mContext.unregisterReceiver(mReceiver);\n } catch (IllegalArgumentException e) {\n }\n }", "@Override\n\tpublic void unregister() {\n\t\tEventBus.INSTANCE.removeListener(this);\n\t\tcompletedGameSound.dispose();\n\t\tlostGameSound.dispose();\n\t\tsucceededSound.dispose();\n\t\tfailSound.dispose();\n\t}", "public synchronized void deRegister()\n {\n // stop the thread running...\n logger.debug(\"deregister called - invalidating session\");\n\n // remove from registered listeners and then invalidate the ScriptSession\n clients.remove(wctx.getScriptSession().getId());\n wctx.getScriptSession().invalidate();\n\n if (clients.size() == 0)\n {\n // might as well stop thread since we have no registered listeners\n this.active = false;\n }\n\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n unregisterReceiver(broadcastReceiver);\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n EventBus.getDefault().unregister(this);\n }", "public void onDestroy() {\n\t\tif (activity != null)\r\n\t\t\tactivity.finish();\r\n\t\tmUpdateTools.onDestroy();\r\n\t\tmDBTools.close();\r\n\t\tmNM.cancel(NOTIFICATION_ID);\r\n\t}", "@Override\n\t\tpublic void finish() {\n\t\t\tunregisterReceiver(mBroadcastReceiver);\n\t\t\tsuper.finish();\n\t\t}", "public void onDestroy() {\n WhiteListActivity.super.onDestroy();\n try {\n getLoaderManager().destroyLoader(100);\n getContentResolver().unregisterContentObserver(this.j);\n } catch (Exception e2) {\n Log.e(\"WhiteListActivity\", e2.toString());\n }\n }", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t\tthis.unregisterReceiver(battInfoRec);\n\t\tthis.finish();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tthis.unregisterReceiver(notifyServiceReceiver);\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onDestroy();\n\t\ttry {\n\t\t\tunregisterReceiver(mHandleMessageReceiver);\n\t\t\tGCMRegistrar.onDestroy(this);\n\t\t} catch (Exception e) {\n\n\t\t\tLog.e(\"UnRegister Receiver Error\", \"> \" + e.getMessage());\n\t\t}\n\t}", "@Override\n public void onDestroy() {\n super.onDestroy();\n activity.unregisterReceiver(brocast);\n }", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tif (wt != null && !wt.isCancelled()) {\r\n\t\t\twt.cancel(true);\r\n\t\t}\r\n\t}", "public void onStop() {\n connectivityMonitor.unregister();\n requestTracker.pauseRequests();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\t\n\t\tif(mReceiver != null) unregisterReceiver(mReceiver);\n\t}", "private void unregisterForBatteryStatus()\n\t{\n\t\tif(isReceiverRegistered && statusResult == null && batteryView != null && !batteryView.isShown())\n\t\t{\n\t\t\tActivity activity = RhodesActivity.safeGetInstance();\n\t\t\tif(activity != null)\n\t\t\t{\n\t\t\t\tactivity.unregisterReceiver(this);\n\t\t\t\tisReceiverRegistered = false;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tpopupWindowDismiss();\n\t\tif(receiver!=null)\n\t\t\tunregisterReceiver(receiver);\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 unregisterCallback() {\n if (mLocalManager == null) {\n Log.e(TAG, \"unregisterCallback() Bluetooth is not supported on this device\");\n return;\n }\n mLocalManager.setForegroundActivity(null);\n mLocalManager.getEventManager().unregisterCallback(this);\n mLocalManager.getProfileManager().removeServiceListener(this);\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tunregisterReceiver(smsReceiver);\n\t}", "public void onDestroy() {\n BroadcastReceiver broadcastReceiver = this.mConnectionReceiver;\n if (broadcastReceiver != null) {\n unregisterReceiver(broadcastReceiver);\n }\n Handler handler = this.mHandler;\n if (handler != null) {\n handler.removeCallbacksAndMessages((Object) null);\n }\n NetworkDiagnosticsActivity.super.onDestroy();\n }", "@Override\r\n public void deactivate() {\n locationManager.removeUpdates(this);\r\n mContext = null;\r\n locationManager = null;\r\n locationRequest = null;\r\n mChangedListener = null;\r\n }", "@Override\n public void onDetach()\n {\n super.onDetach();\n mActivity = null;\n mTask.cancel(true);\n }", "@Override\n\tpublic void deactivate() {\n\t\tlocationManager.removeUpdates(this);\n\t\tmContext = null;\n\t\tlocationManager = null;\n\t\tlocationRequest = null;\n\t\tmChangedListener = null;\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tunregisterReceiver(mUIReceiver);\r\n\t}", "public void onDestroy() {\n WorkAsyncTask workAsyncTask = this.mWorkAsyncTask;\n if (workAsyncTask != null) {\n workAsyncTask.setClose();\n this.mWorkAsyncTask = null;\n }\n super.onDestroy();\n }", "public void onStop() {\n super.onStop();\n ApplicationStateMonitor.getInstance().activityStopped();\n }", "@Override\n protected void onDestroy() {\n unregisterReceiver(mReceiver);\n super.onDestroy();\n }", "void close() {\n if (VDBG) log(\"close()\");\n\n mAppRegistered = false;\n final IBluetoothDeviceGroup service = getService();\n if (service != null) {\n try {\n service.unregisterGroupClientApp(mAppId, mAttributionSource);\n } catch (RemoteException e) {\n Log.e(TAG, \"Stack:\" + Log.getStackTraceString(new Throwable()));\n }\n }\n\n mProfileConnector.disconnect();\n }", "boolean unregister(Counter counter);", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tif(otgReceiver!=null){\n\t\t\tunregisterReceiver(otgReceiver);\n\t\t}\n\t\tif(finishReceiver!=null){\n\t\t\tunregisterReceiver(finishReceiver);\n\t\t}\n\t}", "@Override\n protected void onDestroy() {\n stopService(trackerServiceIntent);\n Log.d(\"Service\", \"ondestroy of activity!\");\n super.onDestroy();\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n unregisterReceiver(receiver);\n }", "@Override\n public void onDestroy() {\n setStatusMessage(R.string.not_tracking);\n // Stop the persistent notification.\n mNotificationManager.cancel(NOTIFICATION_ID);\n // Release the wakelock\n if (mWakelock != null) {\n mWakelock.release();\n }\n super.onDestroy();\n }", "@Override\n protected void onStop() {\n super.onStop();\n sensorManager.unregisterListener(this);\n }", "void disconnect() {\n connector.disconnect();\n // Unregister from activity lifecycle tracking\n application.unregisterActivityLifecycleCallbacks(activityLifecycleTracker);\n getEcologyLooper().quit();\n }", "public void onActivityDestroyed() {\n\t\tmTaskDetailNavigator = null;\n\t}", "@Override\n public void onDestroy() {\n\n stopService(new Intent(this, LocationMonitoringService.class));\n mAlreadyStartedService = false;\n //Ends................................................\n\n\n super.onDestroy();\n }", "public abstract void unregister();", "@Override\n public void onDestroy() {\n LocalBroadcastManager.getInstance(getActivity()).unregisterReceiver(mMessageReceiver);\n super.onDestroy();\n }", "@Override\n protected void onDestroy() {\n mActivityGraph = null;\n super.onDestroy();\n }", "@Override\r\n public void onDestroy() {\n\tEventBus.getDefault().unregister(this);\r\n\tsuper.onDestroy();\r\n }", "private void unregisterConnectivityListener() {\r\n // Unregister the ConnectivityListener\r\n unregisterReceiver(mConnectivityListener);\r\n\r\n // Set the boolean to indicate that no ConnectivityListener has been registered\r\n connectivityRegistered = false;\r\n }", "@Override\n protected void onDestroy() {\n \tsuper.onDestroy();\n \tmActivities.removeActivity(\"AddCamera\");\n \tunregisterReceiver(receiver);\n }", "@Override\n public void onDestroy() {\n\t\tmNotificationManager.cancel(NOTIFICATION_ID);\n\t}", "@Override\n public void onDestroy() {\n BusProvider.getInstance().unregister(this);\n super.onDestroy();\n }", "@Override\n protected void onDestroy() {\n unregisterReceiver();\n super.onDestroy();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tmyhandler.removeCallbacks(mrunnable);\n\t\tsendWifiHandler.removeCallbacks(stopRunnable);\n\t\tmHelper.StopListen();\n\t\tif (!isSendWifiStop) {\n\t\t\tstopSendWifi();\n\t\t}\n\t\tif (!isTimerCancel) {\n\t\t\tcancleTimer();\n\t\t}\n\t\tlock.release();\n\t}", "public void m4567b() {\n try {\n LocalBroadcastManager.getInstance(this.f4212b).unregisterReceiver(this);\n } catch (Exception e) {\n }\n }", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t\tunregisterReceiver(broadcastReceiver);\n\t}", "void unRegister(NotificationListener<ObservableIntentServiceNotificationType> notificationStrategy);", "@Override\n protected void onDestroy() {\n super.onDestroy();\n unregisterReceiver(myReceiver);\n }", "@Override\n\tprotected void onDestroy() {\n\n\t\t// Force-stop the timer if required.\n\t\tif (timerUpdateThread != null) {\n\t\t\ttimerUpdateThread.interrupt();\n\t\t\ttimerUpdateThread = null;\n\t\t}\n\n\t\t// if we're in the middle of a session, stop it gracefully.\n\t\t// TODO Maybe refactor so we don't stop the session here.\n\t\tif (workoutService != null) {\n\t\t\tworkoutService.getService().setWorkoutServiceListener(null);\n\n\t\t\tif (workoutService.getService().getStatus().isMonitoring()) {\n\t\t\t\tworkoutService.getService().endWorkout();\n\t\t\t\tlogger.debug(\"onDestroy(): Stopped an in-progress session before quitting activity.\");\n\t\t\t}\n\t\t}\n\n\t\t// Unbind from, and stop, the workout service here.\n\t\t// TODO Maybe don't stop the service.\n\t\tif (workoutServiceIntent != null) {\n\t\t\tunbindService(workoutServiceConn);\n\t\t\tstopService(workoutServiceIntent);\n\t\t\tlogger.debug(\"onDestroy(): Unbound from Workout service.\");\n\t\t}\n\n\t\tsuper.onDestroy();\n\t}", "public void onDestroy() {\n \twifiLock.release();\n \tstopForeground(true);\n \tradio.stop();\n \tradio.release();\n \tradio = null;\n }", "@Override\n\tprotected void onDestroy() {\n\t\tthread.interrupt();\n\t\tsuper.onDestroy();\n\t}", "@Override\n public boolean onUnbind(Intent intent) {\n close();\n return super.onUnbind(intent);\n }", "private void unregisterListener() {\n\t\tif (!mHasStarted || mSensorManager == null) {\n\t\t\treturn;\n\t\t}\n\t\tmHasStarted = false;\n\t\tmSensorManager.unregisterListener(mAccListener);\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\trunActivity = 0;\r\n\t}", "private void unregister(final Intent intent) {\n\t\tLog.i(TAG, \"unregister(\" + intent.getAction() + \")\");\n\t\tsynchronized (this.pendingIOOps) {\n\t\t\tLog.d(TAG, \"currentIOOps=\" + this.pendingIOOps.size());\n\t\t\tfinal int l = this.pendingIOOps.size();\n\t\t\tif (l == 1) {\n\t\t\t\tthis.pendingIOOps.clear();\n\t\t\t} else {\n\t\t\t\tIntent oi;\n\t\t\t\tfor (int i = 0; i < l; i++) {\n\t\t\t\t\toi = this.pendingIOOps.get(i);\n\t\t\t\t\t// note that ConnectorSpec.equals will not work here because\n\t\t\t\t\t// not all intent types have ConnectorSpec bundle in them\n\t\t\t\t\tif (ConnectorCommand.equals(intent, oi)) {\n\t\t\t\t\t\tthis.pendingIOOps.remove(i);\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\tLog.d(TAG, \"currentIOOps=\" + this.pendingIOOps.size());\n\t\t\tif (this.pendingIOOps.size() == 0) {\n\t\t\t\t// set service to background\n\t\t\t\tif (this.mNM != null) {\n\t\t\t\t\tthis.mNM.cancel(NOTIFICATION_PENDING);\n\t\t\t\t}\n\t\t\t\tif (this.wakelock != null && this.wakelock.isHeld()) {\n\t\t\t\t\tthis.wakelock.release();\n\t\t\t\t}\n\t\t\t\t// stop unneeded service\n\t\t\t\t// this.stopSelf();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tmLocalBcMgr.unregisterReceiver(mMessageReceiver);\n\t\t//TruMobiTimerClass.userInteractedTrigger();\n\t\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tif (baseBroadcase != null) {\n\t\t\tgetActivity().unregisterReceiver(baseBroadcase);\n\t\t}\n\t}", "public void unregisterCrashWatcher() {\n mDevice.removeWatcher(\"GoogleCamera-crash-watcher\");\n }" ]
[ "0.7217402", "0.7125425", "0.70916736", "0.7064202", "0.6860367", "0.68240356", "0.6783008", "0.6780462", "0.67653275", "0.668459", "0.66663325", "0.6627609", "0.66210103", "0.66128397", "0.6587351", "0.6507484", "0.6500504", "0.64992726", "0.6493547", "0.6490803", "0.6489979", "0.64824843", "0.6478902", "0.6458056", "0.6452881", "0.6444", "0.6443351", "0.6442482", "0.6438645", "0.64009863", "0.6389173", "0.6379136", "0.63638496", "0.63603216", "0.6338591", "0.63341975", "0.6332443", "0.6329404", "0.6323891", "0.6322202", "0.63217586", "0.6305031", "0.6298579", "0.62976104", "0.6294741", "0.6291358", "0.62801814", "0.6279914", "0.6264964", "0.62627107", "0.62606156", "0.6260079", "0.62597644", "0.6259615", "0.62453514", "0.6238969", "0.6238338", "0.623429", "0.6231801", "0.6209879", "0.6202958", "0.6202877", "0.6199784", "0.619605", "0.61915433", "0.61914796", "0.6191191", "0.6190018", "0.61863464", "0.6178885", "0.6173927", "0.61728203", "0.6163879", "0.61616373", "0.6158008", "0.61559206", "0.6152563", "0.61490613", "0.61421394", "0.61417335", "0.61414766", "0.61409694", "0.6136664", "0.6135443", "0.61347425", "0.61298656", "0.612619", "0.6111135", "0.6106675", "0.6104367", "0.6100549", "0.60881925", "0.6085047", "0.6068775", "0.6067257", "0.60608", "0.6058783", "0.6058409", "0.60556483", "0.6053972" ]
0.65046155
16
To check whether the side menu is open or not
private boolean isDrawerOpen() { return mDrawerLayout != null && mDrawerLayout.isDrawerOpen(Gravity.LEFT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isOnMenu ();", "boolean isMenuShowing() {\n return game.r != null;\n }", "private void checkMenuItemStatus() {\n\t\tif (VozCache.instance().getCookies() == null) { // not logged in yet\n\t\t\tlogoutMenu.setVisible(false);\t\t\t\n\t\t\tloginMenu.setVisible(true);\n\t\t\tloginWithPresetMenu.setVisible(true);\n\t\t} else { // logged in\n\t\t\tlogoutMenu.setVisible(true);\t\t\t\n\t\t\tloginMenu.setVisible(false);\n\t\t\tloginWithPresetMenu.setVisible(false);\n\t\t}\t\t\n\t\tif (VozCache.instance().canShowReplyMenu()) {\n\t\t\tif(VozCache.instance().getCookies() != null) {// logged in\n\t\t\t\tquickRepMenu.setVisible(true);\n\t\t\t} else {\n\t\t\t\tquickRepMenu.setVisible(false);\n\t\t\t}\n\t\t} else {\n\t\t\tquickRepMenu.setVisible(false);\n\t\t}\n\t\t\n\t\tif (canShowPinnedMenu()) {\n\t\t\tpinMenu.setVisible(true);\n\t\t} else {\n\t\t\tpinMenu.setVisible(false);\n\t\t}\n\t\t\n\t\tif (canShowUnpinnedMenu()) {\n\t\t\tunpinMenu.setVisible(true);\n\t\t} else {\n\t\t\tunpinMenu.setVisible(false);\n\t\t}\n\t}", "public boolean isMenuVisible() {\n\t\treturn menuVisible;\n\t}", "@Test(priority = 8)\n public void leftSectionIsDisplayedTest() {\n assertTrue(driver.findElement(By.className(\"sidebar-menu\")).isDisplayed());\n }", "public boolean isVisible(){\n if(hideMenu) {\n hideMenu = false;\n return true;\n }\n\n return isMenuVisible;\n }", "public boolean isShowing() {\n return true; // Not supported for MenuComponents\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n //boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n //menu.findItem(<MENU_ITEMS>).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "public boolean onPrepareOptionsMenu(Menu menu) {\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n\n // menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "public void checkEnabled(Activity context) {\r\n if(menuShown)\r\n this.show(context,false);\r\n }", "public boolean shouldShowHamburgerMenu() {\n Ensighten.evaluateEvent(this, \"shouldShowHamburgerMenu\", null);\n return true;\n }", "@Override\n public boolean isMenuDisplayed(final String menu) {\n\n DriverConfig.setLogString(\"Menu \" + menu, true);\n boolean isdisplayed = false;\n final List<WebElement> menus = DriverConfig.getDriver().findElements(\n By.xpath(\"//*[@id='menu']/li/a\"));\n isdisplayed = checkMenu(menu, isdisplayed, menus);\n return isdisplayed;\n\n }", "public void ifWin() {\n WinMenu.setVisible(true);\n }", "@Test\n public void testToggle() {\n // collapse and check the status\n rootPage.menu().collapse();\n Assert.assertTrue(rootPage.menu().isCollapsed());\n // expand and check the status\n rootPage.menu().expand();\n Assert.assertFalse(rootPage.menu().isCollapsed());\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // mDrawerLayout.isDrawerOpen(mDrawerView);\n return super.onPrepareOptionsMenu(menu);\n }", "public void VerifyMainMenuItems() {\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Dashboard);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Initiatives);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_LiveMediaPlans);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_MediaPlans);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Audiences);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Offers);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_CreativeAssets);\n\t\t UserActions.VerifyElementIsDisplayed(Lnk_Reports);\n\t}", "public boolean getShowMenu() {\n\t\treturn showMenu;\n\t}", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerLeftList);\n //menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onPrepareOptionsMenu(Menu menu) {\n\t\tboolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n\t\treturn super.onPrepareOptionsMenu(menu);\n\t}", "boolean isOpen();", "boolean isOpen();", "public void ifLose() {\n LoseMenu.setVisible(true);\n }", "private boolean m4816l() {\n return this.f6594b.isDrawerOpen(this.f6609q);\n }", "public boolean isOpened(){\n return chestProgressLevel==1;\n }", "boolean isPopUpOpened();", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n /*boolean drawerOpen = myDrawerLayout.isDrawerOpen(myDrawerList);\n menu.findItem(R.string.action_websearch).setVisible(!drawerOpen);*/\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n\t\tpublic void openMenu() {\n\t\t}", "public void openMenu() {\r\n\t\tmenu.click();\r\n\t}", "@Override\n public boolean onPrepareOptionsMenu(Menu menu)\n {\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerRelativeLayout);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onContentTouchedWhenOpening() {\n\t\t// the content area is touched when sidebar opening, close sidebar\n\t\tLog.d(TAG, \"going to close sidebar\");\n\t\tmLayout.closeSidebar();\n\t\treturn true;\n\t}", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // if nav drawer is opened, hide the action items\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n menu.findItem(R.id.action_alert).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n //boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n //menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n// boolean drawerOpen = mDrawerLayout.isDrawerOpen();\n //menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n// boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerLeftLayout);\n// menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "public Menu getOpenMenu() {\n return openMenu;\n }", "public boolean isVehicleListSideBarPresent() {\r\n\t\treturn isElementPresent(groupListSideBar.replace(\"Group List\", \"Vehicle List\"), SHORTWAIT);\r\n\t}", "public boolean isGroupListSideBarPresent() {\r\n\t\treturn isElementPresent(groupListSideBar, SHORTWAIT);\r\n\t}", "public boolean isShowShareMenu(){\n if (mShareMenu != null\n && mShareMenu.getActionView() instanceof ActivityChooserView) {\n\t\t\tActivityChooserView chooserView = (ActivityChooserView) mShareMenu\n\t\t\t\t\t.getActionView();\n\t\t\tLog.v(TAG, \"isShowShareMenu() chooserView.isShowingPopup() = \"\n\t\t\t\t\t+ chooserView.isShowingPopup());\n\t\t\treturn chooserView.isShowingPopup();\n }else{\n\t\t\treturn false;\n }\n }", "@Override\n\tpublic void onSidebarOpened() {\n\t\tLog.d(TAG, \"opened\");\n\n\t}", "public static void click_menubar_when_visible() throws InterruptedException {\n\t\tif (AndroidLocators.findElements_With_Xpath(\"//*[@content-desc='Open drawer']\").size() > 0) {\n\t\t\tAndroidLocators.clickElementusingXPath(\"//*[@content-desc='Open drawer']\");\n\t\t\tCommonUtils.clickHomeInMenubar();\n\t\t} else if (AndroidLocators.findElements_With_Xpath(\"//*[@contentDescription='Open drawer']\")\n\t\t\t\t.size() > 0) {\n\t\t\tAndroidLocators.clickElementusingXPath(\"//*[@contentDescription='Open drawer']\");\n\t\t\tCommonUtils.clickHomeInMenubar();\n\t\t} else if (AndroidLocators.findElements_With_Xpath(\"//android.widget.ImageButton[@content-desc='Open drawer']\").size() > 0) {\n\t\t\tAndroidLocators.clickElementusingXPath(\"//android.widget.ImageButton[@content-desc='Open drawer']\");\n\t\t\tCommonUtils.clickHomeInMenubar();\n\t\t} else {\n\t\t\tSystem.out.println(\"*** Menubar is not displayed ***\");\n\t\t}\n\t}", "@Override\n public void onOpened() {\n menu.callOnResumeForUpdate();\n menu.showData();\n isMenuShowing = true;\n }", "public boolean getMain() {\r\n\t\treturn mainMenu;\r\n\t}", "public boolean open(){\n\t\tboolean allopen = true;\n\t\tfor (boolean element: open){\n\t\t\tif (element ==false)\n\t\t\t\tallopen = false;\n\t\t}\n\t\treturn allopen;\t\t\n\t}", "private boolean isInTwoPaneMode() {\n\t\t\n Log.i(TAG, \"DailySelfieMainActivity.isInTwoPaneMode entered\");\n\n\t\treturn findViewById(R.id.selfie_list) != null;\n\t}", "public boolean isOpen();", "public boolean isOpen();", "boolean hasActionBar();", "public boolean isSidePlayerOpen() {\n return this.sidePlayer;\n }", "private boolean isCurrent(){\n return (getPageTitle().size() > 0);\n }", "@Test(priority=2)\n\tpublic void verifyPresenceOfLinksinLeftsideMenu() throws Exception {\n\t\t\n\t\tOverviewTradusPROPage overviewObj=new OverviewTradusPROPage(driver);\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.overviewPageVerificationElement);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.overviewOptioninSiderBar),\n\t\t\t\t\"Overview option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.leadsOptioninSiderBar),\n\t\t\t\t\"Leads option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.myStockOptioninSiderBar),\n\t\t\t\t\"My stock option is not present in side bar\");\n\t\tclick(overviewObj.myStockOptioninSiderBar);\n\t\twaitTill(1000);\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.allMyStockOptioninSiderBar);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.createMyStockOptioninSiderBar),\n\t\t\t\t\"Create my stock option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.allMyStockOptioninSiderBar),\n\t\t\t\t\"All my stock option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.marketInsightOptioninSiderBar),\n\t\t\t\t\"Market insight option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.profileOptioninSiderBar),\n\t\t\t\t\"Profile option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.monthlyPackageOptioninSiderBar),\n\t\t\t\t\"Monthly package option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.contactOptioninSiderBar),\n\t\t\t\t\"Contact option is not present in side bar\");\n\t\tclick(overviewObj.contactOptioninSiderBar);\n\t\twaitTill(1000);\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.privacyOptionunderContactlinkSiderBar);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.termsOptionunderContactlinkSiderBar),\n\t\t\t\t\"Terms link under Contact option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.privacyOptionunderContactlinkSiderBar),\n\t\t\t\t\"Privacy link under Contact option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.contactOptionunderContactlinkSiderBar),\n\t\t\t\t\"Contact link under Contact option is not present in side bar\");\n\t}", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "public static boolean shouldShowMenuItem() {\n if (sShouldShowMenuItemForTesting != null) return sShouldShowMenuItemForTesting;\n return PageZoomMediator.shouldShowMenuItem();\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n boolean drawerOpen = myDrawerLayout.isDrawerOpen(myDrawerList);\n // Þetta getur falið icon þegar drawer er opin\n // menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onPrepareOptionsMenu(Menu menu) {\n\t\tboolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n\t\tmenu.findItem(R.id.search).setVisible(!drawerOpen);\n\t\treturn super.onPrepareOptionsMenu(menu);\n\t}", "boolean hasIsMainFrame();", "@Override\r\n protected void onScreenActivate() {\n if (Forge.isLandscapeMode() && displaySidebarForLandscapeMode()) {\r\n menu.hide();\r\n menu.show(getLeft(), 0, getWidth(), getHeight());\r\n }\r\n }", "boolean isOpened();", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // if nav drawer is opened, hide the action items\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n menu.findItem(R.id.action_settings).setVisible(!drawerOpen);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n super.onCreateOptionsMenu(menu);\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.settings, menu);\n MenuItem settings = menu.findItem(R.id.settings);\n if(currentScreenGameState == GameState.STOPPED ){\n settings.setVisible(true);\n }else{\n settings.setVisible(false);\n }\n return true;\n }", "@Test(priority = 7)\n public void rightSectionIsDisplayedTest() {\n assertTrue(driver.findElement(By.name(\"log-sidebar\")).isDisplayed());\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_home, menu);\n MenuItem item = menu.findItem(R.id.action_now_playing);\n item.setVisible(ServiceTools.isServiceRunning(this,StreamerService.class.getName()));\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_commonone, menu);\n MenuItem item3 = menu.findItem(R.id.messager);\n MenuItem item4 = menu.findItem(R.id.search);\n item3.setIcon(R.drawable.openmessage);\n item4.setIcon(R.drawable.search);\n try{\n if (loggedIn.equals(\"noValue\")) {\n\n\n item3.setVisible(false);\n\n } else {\n\n item3.setVisible(true);\n\n }}\n catch (Exception e){\n\n }\n return true;\n }", "public boolean isOpen() {\n if (this.open) {\n return false;\n } else {\n return true;\n }\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.side_menu, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_side, menu);\n return true;\n }", "@Override\r\n\tpublic boolean onPrepareOptionsMenu(Menu menu) {\n\t\tboolean drawerOpened = drawerLayout.isDrawerOpen(drawerList);\r\n\r\n\t\tmenu.findItem(R.id.settingsMenuItem).setVisible(!drawerOpened);\r\n\r\n\t\tif (drawerOpened)\r\n\t\t\tmenu.findItem(R.id.refreshMenuItem).setVisible(false);\r\n\t\telse {\r\n\t\t\tif (selectedItem == 0)\r\n\t\t\t\tmenu.findItem(R.id.refreshMenuItem).setVisible(true);\r\n\t\t\telse\r\n\t\t\t\tmenu.findItem(R.id.refreshMenuItem).setVisible(false);\r\n\t\t}\r\n\r\n\t\treturn super.onPrepareOptionsMenu(menu);\r\n\t}", "@Override\n public boolean getIncludeInMenusForClass() throws G2AccessException {\n java.lang.Object retnValue = getStaticAttributeValue (SystemAttributeSymbols.INCLUDE_IN_MENUS_);\n return ((Boolean)retnValue).booleanValue ();\n }", "public boolean IsOpen() {\r\n return GoodOpen;\r\n }", "@Override\n public boolean onMenuItemClick(MenuItem item) {\n return true;\n }", "private boolean isLocalMenuActive(JTextField field) {\n Window window = SwingUtilities.getWindowAncestor(field);\n if (window != null) {\n Component comp = window.getFocusOwner();\n return comp != null && (comp instanceof JMenuItem);\n }\n return false;\n }", "public void showMenu() {\n menuController.showMenuPanel();\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n // If the nav drawer is open, hide action items related to the content view\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n return super.onPrepareOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onPrepareOptionsMenu(Menu menu) {\n\t\tboolean drawerOpen = drawerLayout.isDrawerOpen(drawerList);\n\t\t// if (getSupportFragmentManager().findFragmentByTag(\"TaskList\") !=\n\t\t// null) {\n\t\tif (getSupportFragmentManager().getBackStackEntryCount() > 0) {\n\t\t\tif (getSupportFragmentManager().getBackStackEntryAt(\n\t\t\t\t\tgetSupportFragmentManager().getBackStackEntryCount() - 1)\n\t\t\t\t\t.getName() == \"TaskList\") {\n\t\t\t\tLog.d(TAG, \"made it in here!\");\n\t\t\t\tmenu.findItem(R.id.add).setVisible(!drawerOpen);\n\t\t\t} else if (getSupportFragmentManager().getBackStackEntryAt(\n\t\t\t\t\tgetSupportFragmentManager().getBackStackEntryCount() - 1)\n\t\t\t\t\t.getName() == \"DETAILTASK\") {\n\t\t\t\tmenu.findItem(R.id.deletedetailedtask).setVisible(!drawerOpen);\n\t\t\t}\n\t\t}\n\t\tmenu.findItem(R.id.settings).setVisible(!drawerOpen);\n\t\tmenu.findItem(R.id.about).setVisible(!drawerOpen);\n\t\treturn super.onPrepareOptionsMenu(menu);\n\t}", "private native static boolean is_open_in_window(int clientSite);", "@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n\n switch (item.getItemId()) {\n case R.id.action_dashboard:\n Toast.makeText(DashBoardActivity.this,\"dashboard\",Toast.LENGTH_SHORT).show();\n break;\n\n case R.id.action_search:\n Toast.makeText(DashBoardActivity.this,\"search\",Toast.LENGTH_SHORT).show();\n break;\n\n case R.id.action_collection:\n Toast.makeText(DashBoardActivity.this,\"collection\",Toast.LENGTH_SHORT).show();\n break;\n\n case R.id.action_message:\n Toast.makeText(DashBoardActivity.this,\"message\",Toast.LENGTH_SHORT).show();\n break;\n\n case R.id.action_sidemenu:\n Toast.makeText(DashBoardActivity.this,\"sidemenu\",Toast.LENGTH_SHORT).show();\n break;\n }\n return true;\n }", "@Override\n public boolean onPrepareOptionsMenu(Menu menu)\n {\n // If the nav drawer is open, hide action items related to the content view\n boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n return super.onPrepareOptionsMenu(menu);\n }", "public void clickOnMenu() {\n\t\tgetAndroidmenubtn().isPresent();\n\t\tgetAndroidmenubtn().click();\n\t\twaitForPageToLoad();\n\t}", "public boolean useInternalMenu() {\n return _use_internal_menu;\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_read_offline) {\n // Handle the camera action\n Toast.makeText(this, \"Chờ phiên bản tiếp nhé !\", Toast.LENGTH_SHORT).show();\n } else if (id == R.id.nav_like) {\n Toast.makeText(this, \"Đã bảo chờ phiên bản tiếp rồi !\", Toast.LENGTH_SHORT).show();\n } else if (id == R.id.nav_night_mode) {\n //mFrameLayoutSetting.setVisibility(View.VISIBLE);\n } else if (id == R.id.nav_setting) {\n Toast.makeText(this, \"Mệt em vl, chờ phiên bản sau nhé !\", Toast.LENGTH_SHORT).show();\n } else if (id == R.id.nav_version) {\n Toast.makeText(this, \"I am sorry ! Đừng gỡ app\", Toast.LENGTH_SHORT).show();\n } else if (id == R.id.nav_policy) {\n Toast.makeText(this, \"Dừng lại tại đây thôi !\", Toast.LENGTH_SHORT).show();\n } else if (id == R.id.nav_vote) {\n //SystemClock.sleep(1000);\n Toast.makeText(this, \"Em nhây vl !\", Toast.LENGTH_SHORT).show();\n } else if (id == R.id.nav_feedback) {\n Toast.makeText(this, \"Em gỡ mịa app đi !\", Toast.LENGTH_SHORT).show();\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public boolean isSubMenuDisplayed(final String subMenu) {\n\n DriverConfig.setLogString(\"SubMenu \" + subMenu, true);\n boolean isdisplayed = false;\n final List<WebElement> subMenus = DriverConfig.getDriver().findElements(\n By.xpath(\"//*[@id='submenu']/a\"));\n isdisplayed = checkMenu(subMenu, isdisplayed, subMenus);\n\n return isdisplayed;\n }", "public boolean isHiddenFromMenu()\n {\n return m_hideFromMenu;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.activity_refresh, menu);\n refereshMenu = menu.findItem(R.id.refresh_type);\n if (/*ispeding.equalsIgnoreCase(\"1\") && */containsImg == true)\n refereshMenu.setVisible(true);\n else\n refereshMenu.setVisible(false);\n return true;\n }", "@Override\n\tpublic boolean onPrepareOptionsMenu(Menu menu) {\n\t\t// if nav drawer is opened, hide the action items\n\t\tboolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);\n\t\t// menu.findItem(R.id.action_settings).setVisible(!drawerOpen);\n\t\treturn super.onPrepareOptionsMenu(menu);\n\t}", "public boolean isOpen() {\r\n\t\treturn false;\r\n\t}", "public boolean isManageVehiclesLinkPresent() {\r\n\t\treturn isElementPresent(manageVehiclesSideBar, SHORTWAIT);\r\n\t}", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_configuration) {\n\n Toast.makeText(getApplication(),\"Este es la configuración\",Toast.LENGTH_SHORT).show();\n\n } else if (id == R.id.nav_sign_off) {\n\n Toast.makeText(getApplication(),\"Esto es cerrar sesión\",Toast.LENGTH_SHORT).show();\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Test\n public void checkAddMenuButtonPresent() {\n onView(withId(R.id.menu_add)).check(matches(isDisplayed()));\n }", "@Override\n\tpublic boolean onMenuOpened(int featureId, Menu menu) {\n\t\tif (((BiosenseApplication) getApplication()).serviceIsRunning()) {\n\n\t\t\tmenu.findItem(R.id.itemToggleService).setTitle(\n\t\t\t\t\tR.string.titleItemStopService);\n\t\t\tmenu.findItem(R.id.itemToggleService).setIcon(\n\t\t\t\t\tandroid.R.drawable.ic_media_pause);\n\t\t} else {\n\n\t\t\tmenu.findItem(R.id.itemToggleService).setTitle(\n\t\t\t\t\tR.string.titleItemStartService);\n\n\t\t\tmenu.findItem(R.id.itemToggleService).setIcon(\n\t\t\t\t\tandroid.R.drawable.ic_media_play);\n\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isOpen() {\n\t\treturn true;\n\t}", "@Override\n public boolean isOpen() {\n return true;\n }", "public boolean isAddVehiclesSideBarPresent() {\r\n\t\treturn isElementPresent(groupListSideBar.replace(\"Group List\", \"Add Vehicle\"), SHORTWAIT);\r\n\t}", "public void verifyDemoPageisOpened(String strTitleofthepage) {\r\n\t\tWebElement demopage = driver.findElement(By.xpath(\"//h3[text()='\" + strTitleofthepage + \"']\"));\r\n\t\tif (demopage.isDisplayed()) {\r\n\t\t\tSystem.out.println(demopage.getText() + \"is opened\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Expected page is not opened\");\r\n\t\t}\r\n\t}", "private void showActionOverflowMenu() {\n try {\n ViewConfiguration config = ViewConfiguration.get(this);\n Field menuKeyField = ViewConfiguration.class.getDeclaredField(\"sHasPermanentMenuKey\");\n if (menuKeyField != null) {\n menuKeyField.setAccessible(true);\n menuKeyField.setBoolean(config, false);\n }\n } catch (Exception e) {\n Log.d(TAG, e.getLocalizedMessage());\n }\n }", "protected boolean openHelp() {\r\n\t\tboolean rc = false;\r\n\t\tMPart helpPart = getHelpPart();\r\n\t\tif (helpPart != null) {\r\n\t\t\trc = partService.isPartVisible(helpPart);\r\n\t\t\t\r\n\t\t\t// if part was not visible before: clear its history\r\n\t\t\tHelpPart obj = getHelpPartObject();\r\n\t\t\tif (obj != null) {\r\n\t\t\t\tobj.clearHistory();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// hide the part\r\n\t\t\tpartService.hidePart(helpPart);\r\n\r\n\t\t\t// required if initial not visible\r\n\t\t\thelpPart.setVisible(true);\r\n\r\n\t\t\t// show the part\r\n\t\t\tpartService.showPart(helpPart, PartState.VISIBLE); \r\n\t\t\t\r\n\t\t\t// Ensure the container visibility\r\n\t\t\tMElementContainer<?> container = helpPart.getParent();\r\n\t\t\trc &= container.isVisible() && container.isOnTop();\r\n\t\t\tcontainer.setVisible(false);\r\n\t\t\tcontainer.setVisible(true);\r\n\t\t\tcontainer.setOnTop(true);\r\n\t\t}\r\n\t\treturn rc;\r\n\t}", "@Override\n public void onMenuIsOpen(View view) {\n mMenu = (SlidingButtonView) view;\n }", "boolean hasSide();", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return (this.displayState != null &&\n this.displayState.properties.usesMenu() &&\n this.displayState.fragment.onOptionsItemSelected(item))\n || super.onOptionsItemSelected(item);\n }", "@Override\n public boolean isOpen(){\n boolean statement = isElementPresent(czDppButon); //TODO - zmena na pozdejsi stranku\n if(!statement){ DriverSettings.takeScreenshot(); }\n return statement;\n }" ]
[ "0.7686657", "0.70293343", "0.6810236", "0.67819303", "0.67661804", "0.6684287", "0.6651842", "0.6614019", "0.65893847", "0.6562337", "0.64763105", "0.64114213", "0.64035285", "0.63848877", "0.6382535", "0.63735354", "0.6348183", "0.632941", "0.63123196", "0.629843", "0.629843", "0.62893593", "0.62843", "0.62815845", "0.6269886", "0.6264471", "0.62573797", "0.6239994", "0.6198851", "0.6197031", "0.6169328", "0.61531013", "0.615006", "0.6149429", "0.61448085", "0.6117597", "0.6115892", "0.61149067", "0.60964864", "0.60955846", "0.60951835", "0.60929066", "0.6080633", "0.60772824", "0.60684144", "0.60684144", "0.6060932", "0.60605824", "0.6057111", "0.60529375", "0.603904", "0.603904", "0.603904", "0.60249245", "0.6017643", "0.6005977", "0.5995792", "0.597565", "0.59697044", "0.5969622", "0.596866", "0.5962576", "0.5960723", "0.59603196", "0.5960257", "0.5959927", "0.59509104", "0.5947228", "0.5943347", "0.59366167", "0.59344923", "0.5932145", "0.5927603", "0.5923554", "0.592142", "0.5910953", "0.5900476", "0.5895768", "0.58921325", "0.58857423", "0.58853316", "0.5877564", "0.5873434", "0.587332", "0.58686066", "0.58671016", "0.58650476", "0.58564675", "0.5855479", "0.585039", "0.5844035", "0.5837852", "0.58299005", "0.5818481", "0.5813837", "0.58042836", "0.5802412", "0.579939", "0.57928926", "0.5792575" ]
0.66689205
6
new location data has been received and can be accessed
public void onPositionChanged() { currentLat = location.getLatitude(); currentLng = location.getLongitude(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNewLocationRecieved(LocationWrapper locationWrapper, LocationType type);", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tmylat=location.getLatitude();\n\t\tmylong=location.getLongitude();\n\t\tgetData();\n\t\t\n\t}", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n StringBuffer sb = new StringBuffer(256);\n sb.append(\"time : \");\n /**\n * 时间也可以使用systemClock.elapsedRealtime()方法 获取的是自从开机以来,每次回调的时间;\n * location.getTime() 是指服务端出本次结果的时间,如果位置不发生变化,则时间不变\n */\n sb.append(location.getTime());\n sb.append(\"\\nlocType : \");// 定位类型\n sb.append(location.getLocType());\n sb.append(\"\\nlocType description : \");// *****对应的定位类型说明*****\n sb.append(location.getLocTypeDescription());\n sb.append(\"\\nlatitude : \");// 纬度\n sb.append(location.getLatitude());\n sb.append(\"\\nlontitude : \");// 经度\n sb.append(location.getLongitude());\n sb.append(\"\\nradius : \");// 半径\n sb.append(location.getRadius());\n sb.append(\"\\nCountryCode : \");// 国家码\n sb.append(location.getCountryCode());\n sb.append(\"\\nCountry : \");// 国家名称\n sb.append(location.getCountry());\n sb.append(\"\\ncitycode : \");// 城市编码\n sb.append(location.getCityCode());\n sb.append(\"\\ncity : \");// 城市\n sb.append(location.getCity());\n sb.append(\"\\nDistrict : \");// 区\n sb.append(location.getDistrict());\n sb.append(\"\\nStreet : \");// 街道\n sb.append(location.getStreet());\n sb.append(\"\\naddr : \");// 地址信息\n sb.append(location.getAddrStr());\n sb.append(\"\\nUserIndoorState: \");// *****返回用户室内外判断结果*****\n sb.append(location.getUserIndoorState());\n sb.append(\"\\nDirection(not all devices have value): \");\n sb.append(location.getDirection());// 方向\n sb.append(\"\\nlocationdescribe: \");\n sb.append(location.getLocationDescribe());// 位置语义化信息\n sb.append(\"\\nPoi: \");// POI信息\n if (location.getPoiList() != null && !location.getPoiList().isEmpty()) {\n for (int i = 0; i < location.getPoiList().size(); i++) {\n Poi poi = (Poi) location.getPoiList().get(i);\n sb.append(poi.getName() + \";\");\n }\n }\n if (location.getLocType() == BDLocation.TypeGpsLocation) {// GPS定位结果\n sb.append(\"\\nspeed : \");\n sb.append(location.getSpeed());// 速度 单位:km/h\n sb.append(\"\\nsatellite : \");\n sb.append(location.getSatelliteNumber());// 卫星数目\n sb.append(\"\\nheight : \");\n sb.append(location.getAltitude());// 海拔高度 单位:米\n sb.append(\"\\ngps status : \");\n sb.append(location.getGpsAccuracyStatus());// *****gps质量判断*****\n sb.append(\"\\ndescribe : \");\n sb.append(\"gps定位成功\");\n } else if (location.getLocType() == BDLocation.TypeNetWorkLocation) {// 网络定位结果\n // 运营商信息\n if (location.hasAltitude()) {// *****如果有海拔高度*****\n sb.append(\"\\nheight : \");\n sb.append(location.getAltitude());// 单位:米\n }\n sb.append(\"\\noperationers : \");// 运营商信息\n sb.append(location.getOperators());\n sb.append(\"\\ndescribe : \");\n sb.append(\"网络定位成功\");\n } else if (location.getLocType() == BDLocation.TypeOffLineLocation) {// 离线定位结果\n sb.append(\"\\ndescribe : \");\n sb.append(\"离线定位成功,离线定位结果也是有效的\");\n\n } else if (location.getLocType() == BDLocation.TypeServerError) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"服务端网络定位失败,可以反馈IMEI号和大体定位时间到loc-bugs@baidu.com,会有人追查原因\");\n } else if (location.getLocType() == BDLocation.TypeNetWorkException) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"网络不同导致定位失败,请检查网络是否通畅\");\n\n } else if (location.getLocType() == BDLocation.TypeCriteriaException) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机\");\n }\n// logMsg(sb.toString());\n slatitude = String.valueOf(location.getLatitude());\n Log.i(\"slatitude::::\", slatitude);\n slongitude = String.valueOf(location.getLongitude());\n Log.i(\"slongitude::::\", slongitude);\n sname = String.valueOf(location.getAddrStr());\n Log.i(\"sname::::\", sname);\n UserLocationInfo.myAddress = location.getAddrStr();\n UserLocationInfo.myLatitude = location.getLatitude();\n UserLocationInfo.myLongitude = location.getLongitude();\n UserLocationInfo.myCity = location.getCity();\n UserLocationInfo.cityCode = location.getCityCode();\n UserLocationInfo.altitude = location.getAltitude();\n }\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n }", "@Override\n public void onLocationChanged(Location location) {\n latitude=String.valueOf(location.getLatitude());\n longitude= String.valueOf(location.getLongitude());\n\n System.out.println(\"asdfgh==\"+latitude);\n\n\n /* Geocoder geocoder;\n List<Address> addresses;\n geocoder = new Geocoder(SafetyActivity.this, Locale.getDefault());\n\n try {\n addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n String address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n String city = addresses.get(0).getLocality();\n String state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n String postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName();\n\n System.out.println(\"addresses==\"+address);\n // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n StringBuffer sb = new StringBuffer(256);\n sb.append(location.getCity());\n logMsg(sb.toString());\n City = sb.toString();\n }\n }", "@Override\n public void onReceiveLocation(BDLocation dbLocation) {\n if (dbLocation == null || mapView == null) {\n return;\n }\n //得到定位数据\n MyLocationData myLoationData = new MyLocationData.Builder()\n .accuracy(dbLocation.getRadius()) //设置精度\n .direction(dbLocation.getDirection()) //定位数据的方向信息\n .latitude(dbLocation.getLatitude())\n .longitude(dbLocation.getLongitude())\n .build();\n baiduMap.setMyLocationData(myLoationData);\n //如果是第一次登陆\n if (isFirstLoc) {\n isFirstLoc = false;\n LatLng latLng = new LatLng(dbLocation.getLatitude(), dbLocation.getLongitude());\n MapStatusUpdate mapStatusUpdate = MapStatusUpdateFactory.newLatLng(latLng);\n baiduMap.animateMapStatus(mapStatusUpdate);\n }\n Log.i(\"aaa\", \"-----\");\n showInfo(dbLocation);\n Log.i(\"aaa\", \"-----\");\n }", "public void getLocationInfo() {\n startLocationService();\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n\n mCurSheng = location.getProvince() ;\n mCurShi = location.getCity() ;\n mCurQu = location.getDistrict() ;\n\n final String locationDesc ;\n List<Poi> poiList = location.getPoiList() ;\n if(poiList.size() > 0){\n locationDesc = poiList.get(0).getName() ;\n }else{\n locationDesc = location.getLocationDescribe() ;\n }\n\n LogUtils.showLog(\"testLocations\" ,\"sendCircle--\" + locationDesc) ;\n\n if(mCurSheng != null && mCurShi != null){\n mCurLon = location.getLongitude() +\"\" ;\n mCurLat = location.getLatitude() +\"\" ;\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mLocationTv.setText(null == locationDesc ? \"点击获取位置\" : locationDesc);\n }\n });\n\n mLocationService.unregisterListener(mListener); //注销掉监听\n mLocationService.stop(); //停止定位服务\n\n MyApplication.updateCurLocation(location) ;\n\n handler.sendEmptyMessage(MSG_LOCATION) ;\n }\n\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n\n clientlat = location.getLatitude();\n clientlon = location.getLongitude();\n System.out.println(\"latitude is \"+clientlat);\n System.out.println(\"longitude is \"+clientlon);\n }", "private void updateWithNewLocation(Location location)\n {\n\n float fLatitude = (float)0.0;\n float fLongitude = (float)0.0;\n float fHepe=(float)10000.0;\n byte ucNapUsed = 0;\n byte ucWiperErrorCode = 0;\n\n if (Config.LOGD) Log.d(TAG,\"Network Location callback\");\n\n if( location != null)\n {\n //read params from location structure return by WPS\n fLatitude = (float)(location.getLatitude());\n fLongitude = (float)(location.getLongitude());\n fHepe = location.getAccuracy();\n\n if(bScanCompleted == true)\n {\n ucNapUsed= (byte)aResults.size();\n }\n else\n {\n ucNapUsed = 50;\n }\n\n }\n else\n {\n ucWiperErrorCode = 99;\n }\n startWiperReport();\n native_notify_wiper_position(fLatitude,fLongitude,fHepe,ucNapUsed,ucWiperErrorCode);\n endWiperReport();\n\n }", "public void onLocationChanged(Location location) {\n lastKnownLocation = location;\n geofenceHelper(getContext());\n }", "private void getLocation() {\n\n }", "public void gotLocation(Location location){\r\n \tif(location!=null){\r\n\t \tConstants.gpslat = location.getLatitude()+\"\";\r\n\t Constants.gpslng = location.getLongitude()+\"\";\r\n\t Log.d(\"location changed: lattitue & longitude\",Constants.gpslat+\" & \"+Constants.gpslng);\r\n \t}\r\n }", "private void setLocationData(Location location){\r\n currentLat = location.getLatitude();\r\n currentLng = location.getLongitude();\r\n }", "@Override\r\n public void onLocationChanged(Location location) {\r\n // - Update local variables\r\n setLocationData(location);\r\n\r\n if (location != null) {\r\n Log.e(TAG, \"== location != null\");\r\n // - Send result through a broadcast\r\n sendBroadcastToActivity(currentLat, currentLng);\r\n }\r\n }", "@Override\n public void onLocationChanged(Location loc)\n {\n \t\n \tint lat = (int) (loc.getLatitude() * 1E6);\n\t\t\tint lng = (int) (loc.getLongitude() * 1E6);\n\t\t\t point = new GeoPoint(lat, lng);\n\t\t\t \n\t\t\t /** remove the previous overlay so the another\n\t\t\t can be added **/\n\t\t\t itemizedOverlay.removeOverlay(0);\n\t\t\t \n\t\t\n\t\t\t //this follows the same steps in the OnCreate function at start up.\n\t\t\t // //Initialize a normal MapOVerlay item with new point.\n\t\t\t OverlayItem overlayitem = new OverlayItem(point, \"kiddda!\", \"sasri kal!\");\n\t\t \n\t\t itemizedOverlay.addOverlay(overlayitem);\n\t\t mapOverlays.add(itemizedOverlay);\n\t\t // move to new point.\n\t\t\tcontroller.animateTo(point); \n\t\t\t \n\t\n\t\t\t//debug message to say the location has been read.\n\t\t\tLog.i(\"Listener\", \"location read\");\n\t\t\t \n\t\t\n\n\t\t \n // String Text = \"My current location is: \" +\n\t\t\tLog.i(\"service check\",\" Latitude = \" + loc.getLatitude() +\n \" Longitude = \" + loc.getLongitude());\n \n // Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_LONG).show();\n \n }", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\tcurrent_location=location;\n\t\t\tlatitude=current_location.getLatitude();\n\t\t\tlongitude=current_location.getLongitude();\n\t\t\t//Toast.makeText(AgentSectionActivity.this,\"LATITUDE IS : \"+latitude+\"\\n LONGITUDE IS :\"+longitude+\"\",4000).show();\n\t\t\tsenddata(logged_user,Double.toString(latitude),Double.toString(longitude));\n\t\t}", "@Override\n public void onLocationChanged(Location location) {\n if(!firstLocCheck){\n drive = new Drive(location.getLatitude(),location.getLongitude(),Car.carList.get(carIndex),startTime);\n firstLocCheck = true;\n } else {\n Drive.curLat = location.getLatitude();\n Drive.curLong = location.getLongitude();\n }\n System.out.println(\"Location has changed\");\n System.out.println(location.getLatitude() + \" | \" + location.getLongitude());\n\n //updateLoc(location);\n //locProvider = location.getProvider();\n }", "public void onLocationChanged(Location location) {\n sendResult(location);\n }", "private void _Setup_GetLocData() {\n\t\tString log_msg = \"CONS.LocData.LONGITUDE=\"\n\t\t\t\t\t+ String.valueOf(CONS.LocData.LONGITUDE);\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\t\n\t\tIntent i = this.getIntent();\n\t\t\n\t\tthis.longitude\t= i.getDoubleExtra(\n\t\t\t\t\t\t\tCONS.IntentData.iName_Showmap_Longitude,\n\t\t\t\t\t\t\tCONS.IntentData.Showmap_DefaultValue);\n\t\t\n\t\tthis.latitude\t= i.getDoubleExtra(\n\t\t\t\tCONS.IntentData.iName_Showmap_Latitude,\n\t\t\t\tCONS.IntentData.Showmap_DefaultValue);\n\t\t\n\t\t// Log\n\t\tlog_msg = \"this.latitude=\" + String.valueOf(this.latitude)\n\t\t\t\t\t\t+ \"/\"\n\t\t\t\t\t\t+ \"this.longitude=\" + String.valueOf(this.longitude);\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\t\n\t}", "public void sendData() {\r\n\t\t// HoverBot specific implementation of sendData method\r\n\t\tSystem.out.println(\"Sending location information...\");\r\n\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n lastLatitude = Double.toString(location.getLatitude());\n lastLongitude = Double.toString(location.getLongitude());\n //lastLocation = Double.toString(location.getLatitude()) + \",\" + Double.toString(location.getLongitude()) ;\n //String b = lastLocation;\n // Get into right format\n // Logic to handle location object\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n String myUrl = \"https://a.mapillary.com/v3/map_features?layers=trafficsigns\" +\n \"&radius=600\" +\n \"&client_id=YUNMM3lQRXRUR1Y0MDBwcEVLaFJsUTo2ZWFjY2Y0YWJhM2JmYmM5\" +\n \"&per_page=\" + numberOfResults +\n \"&closeto=\" + location.getLongitude() + \",\" + location.getLatitude();\n //String to place our result in\n String result = null;\n //Instantiate new instance of our class\n HttpGetRequest getRequest = new HttpGetRequest();\n //Perform the doInBackground method, passing in our url\n try {\n result = getRequest.execute(myUrl).get();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n try {\n JSONObject jObject = new JSONObject(result);\n JSONArray features = jObject.getJSONArray(\"features\");\n for (int i=0; i < numberOfResults; i++){\n try {\n JSONObject featuresObject = features.getJSONObject(i);\n // Pulling items from the array\n JSONObject properties = featuresObject.getJSONObject(\"properties\");\n nearbyRoadSigns[i] = properties.getString(\"value\");\n\n System.out.println(nearbyRoadSigns[i]);\n\n } catch (JSONException e) {\n // Oops\n }\n }\n locationManager.removeUpdates(this);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n wayLatitude = location.getLatitude();\n wayLongitude = location.getLongitude();\n SharedStore.getInstance().save(Double.toString(wayLatitude),\"CurrentLat\");\n SharedStore.getInstance().save(Double.toString(wayLongitude),\"CurrentLong\");\n Log.e(\"getLocation\", String.valueOf(wayLatitude));\n }\n }", "public void updateLocation();", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n // Logic to handle location object\n mLastLocation = location;\n Log.wtf(\"-GPS\", \"getLocation 169 : \" + mLastLocation.getLatitude() + \",\" + mLastLocation.getLongitude());\n\n } else {\n Log.wtf(\"-GPS\", \"getLocation 171 : \" + mLastLocation);\n\n }\n }", "private void loadData() {\n gps = new GPSTracker(LocationActivity.this);\n if (from.equals(\"home\")) {\n if (lat == 0 && lon == 0) {\n if (gps.canGetLocation()) {\n if (TextbookTakeoverApplication.isNetworkAvailable(LocationActivity.this)) {\n lat = gps.getLatitude();\n lon = gps.getLongitude();\n Log.v(\"lati\", \"lat\" + lat);\n Log.v(\"longi\", \"longi\" + lon);\n } else {\n // TextbookTakeoverApplication.dialog(LocationActivity.this, \"Error!\", \"Please check your connection and try again\");\n }\n } else {\n if (!alertDialog.isShowing()) {\n alertDialog.show();\n }\n got = true;\n }\n }\n } else if (from.equals(\"add\")) {\n if (AddProductDetail.lat == 0 && AddProductDetail.lon == 0) {\n if (gps.canGetLocation()) {\n if (TextbookTakeoverApplication.isNetworkAvailable(LocationActivity.this)) {\n Log.v(\"lati\", \"lat\" + AddProductDetail.lat);\n Log.v(\"longi\", \"longi\" + AddProductDetail.lat);\n } else {\n // TextbookTakeoverApplication.dialog(LocationActivity.this, \"Error!\", \"Please check your connection and try again\");\n }\n } else {\n if (!alertDialog.isShowing()) {\n alertDialog.show();\n }\n got = true;\n }\n }\n }\n\n }", "private void onDataSendBegin() {\n Observable<Location> observable = ObservableFactory.from(SmartLocation.with(this).location().oneFix());\n observable.timeout(8, TimeUnit.SECONDS)\n .subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Observer<Location>() {\n @Override\n public void onSubscribe(Disposable d) {\n currentLocation = null;\n }\n\n @Override\n public void onNext(Location loc) {\n currentLocation = loc;\n }\n\n @Override\n public void onError(Throwable e) {\n Log.e(\"onDataSendBegin\", \"onError: yes\", e);\n Toast.makeText(PanelActivity.this, \"Unable to fetch precise location, try in another way.\", Toast.LENGTH_SHORT).show();\n currentLocation = locationUtils.getLocation();\n if (currentLocation == null) {\n Log.e(\"TAG\", \"无法获取设备定位信息(包括最近一次成功定位)!\");\n }\n sendLocation();\n }\n\n @Override\n public void onComplete() {\n sendLocation();\n }\n });\n }", "@Override\n public void onLocationChanged(final Location location) {\n // Lay vi tri hien tai cua minh\n myLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (firstLocation == true) {\n // Neu day la lan dau co thong tin vi tri thi chuyen camera ve vi tri nay\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n firstLocation = false;\n }\n // Gui vi tri cua minh len server\n String myLocationMessage = String.format(\"{\\\"COMMAND\\\":\\\"MEMBER_CURRENT_LOCATION\\\", \\\"LATITUDE\\\": \\\"%s\\\", \\\"LONGITUDE\\\": \\\"%s\\\"}\", myLocation.latitude, myLocation.longitude);\n OnlineManager.getInstance().sendMessage(myLocationMessage);\n // Refresh danh sach timesheet\n if (tourTimesheetAdapter != null) {\n tourTimesheetAdapter.notifyDataSetChanged();\n }\n }", "private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }", "@Override \n public void onLocationChanged(Location location) { \n mostRecentLocation = location; \n }", "private void Location() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_ACCESS_FINE_LOCATION);\n }\n\n //Google Play Location stored in loc variable\n fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n fusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n\n\n @Override\n public void onSuccess(Location location) {\n\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n loc = location;\n getAddressFromLocation(loc.getLatitude(), loc.getLongitude());\n\n }\n }\n });\n }", "@Override\n\t\tpublic void onReceiveLocation(BDLocation arg0) {\n\t\t\tlat = \"\" + arg0.getLatitude();\n\t\t\tlon = \"\" + arg0.getLongitude();\n\t\t\tSystem.out.println(\"lat ---> \" + lat);\n\t\t\tSystem.out.println(\"lon ---> \" + lon);\n\t\t\tlocationService.unregisterListener(mListener); // 注销掉监听\n\t\t\tlocationService.stop(); // 停止定位服务\n\t\t\t// System.out.println(\"des ---> \" + describe);\n\t\t\t// System.out.println(\"error ---> \" + arg0.getLocType());\n\t\t\t// System.out.println(\"District ---> \" + arg0.getDistrict());\n\t\t\t// System.out.println(\"Street ---> \" + arg0.getStreet());\n\t\t\t// System.out.println(\"getStreetNumber ---> \" +\n\t\t\t// arg0.getStreetNumber());\n\t\t\t// System.out.println(\"address ---> \" +\n\t\t\t// arg0.getAddress().streetNumber);\n\t\t\t// System.out.println(\"addressStr ---> \" + arg0.getAddrStr());\n\t\t\t// System.out.println(\"getBuildingID ---> \" + arg0.getBuildingID());\n\t\t\t// System.out.println(\"getBuildingName ---> \" +\n\t\t\t// arg0.getBuildingName());\n\t\t\t// System.out.println(\"getFloor ---> \" + arg0.getFloor());\n\t\t}", "public void onLocationChanged(Location newlocation) {\n\t\t\t\t\n\t\t\t\tif (newlocation != null) \n\t\t\t\t{\n\t\t\t\t\tlocationManager.removeUpdates(this);\n\t\t\t\t\tpoint=getGeoPoint(newlocation);\n\t\t\t\t\t//String altitiude = \"Altitiude: \" + newlocation.getAltitude();\n\t\t\t\t\t//String accuracy = \"Accuracy: \" + newlocation.getAccuracy();\n\t\t\t\t\t//String time = \"Time: \" + newlocation.getTime();\n\t\t\t\t\tmapController.animateTo(point);\n\t\t\t\t\t\n\t\t\t\t\tlatitudes= String.valueOf(newlocation.getLatitude() * 1E6);\n\t\t\t\t\tlongitudes= String.valueOf (newlocation.getLongitude() * 1E6);\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"latd\",latitudes));\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"lotd\",longitudes));\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"id\",LoginId));\n\t\t\t\t\tArrayList<NameValuePair> result=db.getServerData(nameValuePairs,\"updatecoordinates.php\");\n\t\t\t\t\tnameValuePairs.clear();\n\t\t\t\t\tfor(int i=0;i<result.size();i++)\n\t\t\t\t\t{\n\t\t\t\t\t\ts=result.get(i).getName();\n\t\t\t\t\t\tif(s.equals(\"Error\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Co-Ords Updated\", 3000);\n\t\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\t\ttt.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Co-Ords Updated Error\", 3000);\n\t\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\t\ttt.show();break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresult.clear();\n\t\t\t\t\t\n\t\t\t\t\tmapView.invalidate();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Override\n public void onLocationChanged(final Location location) {\n\n if(mLastLocation==null || location.distanceTo(mLastLocation)>getResources().getInteger(R.integer.min_distance_listen))\n {\n new GetNearBy().executePreHeavy();\n }\n\n mLastLocation=location;\n\n android.util.Log.e(\"onLocationChanged\",mLastLocation.getLatitude()+\" - \"+mLastLocation.getLongitude());\n\n\n\n }", "private void getLocation() {\n //if you don't have permission for location services yet, ask\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n //have the app ask for location permission\n } else {\n fusedLocationClient.requestLocationUpdates\n (getLocationRequest(), mLocationCallback,\n null /* Looper */);\n //uses the type of request and the location callback to update the location\n /**fusedLocationClient.getLastLocation().addOnSuccessListener(\n new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n TextView error = findViewById(R.id.errorMsg);\n error.setVisibility(View.VISIBLE);\n\n if (location != null) {\n lastLocation = location;\n error.setText(\"location: \" + lastLocation.getLatitude());\n } else {\n error.setText(\"location not available\");\n }\n }\n });**/\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n setLocation(location);\n mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n mTime = new SimpleDateFormat(K.TIMESTAMP_FORMAT_STRING).format(Calendar\n .getInstance().getTime()).toString();\n androidLocationUI.updateUI();\n if (application.isLogging()) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n saveData();\n }\n }).start();\n }\n }", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n public void onLocationChanged(Location location) {\n if (ActivityCompat.checkSelfPermission(TourTabsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(TourTabsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n // Bat gps thi di chuyen camera den vi tri cua minh\n myLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (firstLocation == true) {\n // Neu day la lan dau co thong tin vi tri thi chuyen camera ve vi tri nay\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n firstLocation = false;\n }\n // Gui vi tri cua minh len server\n String myLocationMessage = String.format(\"{\\\"COMMAND\\\":\\\"MEMBER_CURRENT_LOCATION\\\", \\\"LATITUDE\\\": \\\"%s\\\", \\\"LONGITUDE\\\": \\\"%s\\\"}\", myLocation.latitude, myLocation.longitude);\n OnlineManager.getInstance().sendMessage(myLocationMessage);\n // Refresh danh sach timesheet\n if(tourTimesheetAdapter != null){\n tourTimesheetAdapter.notifyDataSetChanged();\n }\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "public void getLocation(){\n }", "public void startLocationUpdate() {\n if (locationCallback != null) {\n try {\n locationCallback = new LocationCallback() {//khoi tao dinh nghia (extent)\n\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }\n };\n fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, null);//dang ky voi he thong app lang nghe su thay doi cua location\n\n } catch (SecurityException e) {\n e.getMessage();\n\n }\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n\n MyLat = location.getLatitude();\n MyLong = location.getLongitude();\n\n Log.e(TAG, \"MyLat = \" + MyLat);\n Log.e(TAG, \"MyLong = \" + MyLong);\n\n\n LatLng latLng = (new LatLng(location.getLatitude(), location.getLongitude()));\n mMap.clear();\n\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 17.0f));\n\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.draggable(true);\n\n BitmapDescriptor markerIcon = vectorToBitmap(R.drawable.ic__fill_placeholder,\n ContextCompat.getColor(getApplicationContext(),\n R.color.rv_hader));\n\n markerOptions.icon(markerIcon);\n markerOptions.title(\"My Location\");\n if (session.getMobileNumber() != null) {\n markerOptions.snippet(session.getMobileNumber());\n }\n mMap.addMarker(markerOptions);\n\n String add = getAddress(location.getLatitude(), location.getLongitude());\n Log.e(getClass().getSimpleName(), \"getAddress : \" + add);\n currentAddress = add;\n if (add != null)\n tv_current_locName.setText(add);\n else\n tv_current_locName.setText(\"Not Find\");\n } else {\n Log.d(TAG, \"onComplete: current location is null\");\n TastyToast.makeText(getApplicationContext(), getString(R.string.unable_toget_current_location), TastyToast.LENGTH_LONG, TastyToast.ERROR);\n Intent mIntent = new Intent(getApplicationContext(), MetaDataList.class); // the activity that holds the fragment\n Bundle mBundle = new Bundle();\n\n mBundle.putSerializable(\"metaDataItem\", metaDataItem);\n mIntent.setAction(\"UpdateLatLong\");\n mIntent.putExtra(\"SelectedNameDetail\", mBundle);\n startActivity(mIntent);\n finish();\n }\n }", "@Override\n public void locationFetched(Location mLocation, Location oldLocation, String time, String locationProvider) {\n GetAccurateLocationApplication.mCurrentLocation = mLocation;\n GetAccurateLocationApplication.oldLocation = oldLocation;\n GetAccurateLocationApplication.locationProvider = locationProvider;\n GetAccurateLocationApplication.locationTime = time;\n }", "@Override\n public void onLocationChanged(Location location) {\n Location location1 = location;\n\n }", "@Override\n public void onLocationChanged(Location location) {\n currentLatitude = location.getLatitude();\n currentLongitude = location.getLongitude();\n\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onSuccess: Location : \" + locationResult);\n if (locationResult == null) {\n return;\n }\n for (Location location : locationResult.getLocations()) {\n // Update UI with location data\n Toast.makeText(MainActivity.this, \"Location : \" + location, Toast.LENGTH_SHORT).show();\n }\n }", "public void onLocationChanged(Location location) {\n btsLocation.one_time_refresh();\r\n serviceToken = btsLocation.getToken();\r\n verify(serviceToken, pollDatabases(serviceToken));\r\n \r\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n mLastLocation = location;\n Log.i(\"mLastLocation\", String.valueOf(mLastLocation.getLatitude()) + \" \" + String.valueOf(mLastLocation.getLongitude()));\n }\n }", "@Override\n \tpublic void onLocationChanged(Location location) {\n \t\tthis.location = location;\n \t}", "public org.afscme.enterprise.organization.LocationData getLocationData() {\n return locationData;\n }", "private void createLocationCallback() {\n mLocationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n\n mLastLocation = locationResult.getLastLocation();\n mRequestingLocationUpdate = false;\n\n startAddressLookupService();\n }\n };\n }", "void onLocationChanged( String newLocation ) {\n Uri uri = mUri;\n if (null != uri) {\n long date = WeatherContract.WeatherEntry.getDateFromUri(uri);\n Uri updatedUri = WeatherContract.WeatherEntry.buildWeatherLocationWithDate(newLocation, date);\n mUri = updatedUri;\n getLoaderManager().restartLoader(DETAILED_WEATHER_LOADER, null, this);\n }\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onLocationResult: got location result.\");\n Location location = locationResult.getLastLocation();\n if (location != null) {\n GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude());\n userInfoDoc.get().addOnCompleteListener(task -> {\n Boolean av = (Boolean) task.getResult().get(\"Availability\");\n saveUserLocation(geoPoint , av);\n });\n saveDistance(geoPoint);\n\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "@Override\n\t\tpublic void onReceiveLocation(BDLocation location) {\n\t\t\t\n\t\t Lng = (float) location.getLatitude();//经度\n\t\t\t Lat = (float) location.getLongitude();//维度\n\t\t\t Log.e(TAG, \"Lng: \" + Lng);\n\t\t\t Log.e(TAG, \"Lat: \" + Lat);\n\t\t\t LocationUtil.stopLocation();\n\t\t\tLocationUtil.startReverseGeoCode(Lng, Lat, getGeoCoderResultListener);\n\t\t\t\n\t\t}", "@Override\n public void onSuccess(Location loc) {\n if (loc != null && loc.getLatitude() != 0) {\n cLoc = loc;\n }\n }", "@Override\n public geo_location getLocation() {\n return location;\n }", "@Override\n\tpublic SystemStatusMessage updateCurrentLocation() {\n\t\t\n\t\tDataStore dataStore = getSystemComputer().getStorageDevice();\n\t\t\n\t\t// Look for subspace beacons in navigation archive\n\t\tMap<String,DataRecord> subspaceBeacons = dataStore.getData(CelestialObject.category(), SubspaceBeacon.type());\n\t\t\n\t\t\n\t\t\n\t\t\n\t\treturn null;\n\t}", "public void onLocationChanged(Location location) {\n\t\t\t\tupdatenewlocation(location);\n\t\t\t\t\n\t\t\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n\n\n Bundle bundle = intent.getExtras();\n Location nLocation = (Location) bundle.get(\"New location\");\n LatLng there = new LatLng(nLocation.getLatitude(), nLocation.getLongitude());\n mMap.addPolyline(new PolylineOptions().add(there).color(0));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(there));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(there.latitude, there.longitude), 12.0f));\n\n Log.v(TAG, \"RECEIVED A NEW LOCATION\");\n\n }", "private void setLastLocation() {\n\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n // Permission has already been granted\n mFusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n lastLatitude = Double.toString(location.getLatitude());\n lastLongitude = Double.toString(location.getLongitude());\n //lastLocation = Double.toString(location.getLatitude()) + \",\" + Double.toString(location.getLongitude()) ;\n //String b = lastLocation;\n // Get into right format\n // Logic to handle location object\n }\n }\n });\n }\n }", "@Override\n \t\t\tpublic void onLocationChanged(Location loc) {\n \t \n \t\t\t}", "@Override\n public void onLocationChanged(Location location) {\n }", "@Override\n\t\t\tpublic void onReceiveLocation(BDLocation location) {\n\t\t\t\tif(location == null){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t/*StringBuffer sb = new StringBuffer();\n\t\t\t\tsb.append(location.getLongitude()+\",\");\n\t\t\t\tsb.append(location.getLatitude());*/\n\t\t\t\tresult = location.getLongitude()+\",\"+location.getLatitude();\n\t\t\t\t\n\t\t\t}", "@SuppressWarnings(\"MissingPermission\")\n private void getLastLocation() {\n mFusedLocationClient.getLastLocation()\n .addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful() && task.getResult() != null) {\n mLastLocation = task.getResult();\n getWeather(mLastLocation);\n } else {\n Log.w(TAG, \"getLastLocation:exception\", task.getException());\n showSnackbar(getString(R.string.no_location_detected));\n }\n }\n });\n }", "private void getLastKnownLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n Task<Location> task = fusedLocationProviderClient.getLastLocation();\n task.addOnSuccessListener(new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n lastKnownLocation = location;\n lastKnownLatLng = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());\n riderMarker = mMap.addMarker(new MarkerOptions().position(lastKnownLatLng).title(\"Your Location\")); // adding marker to rider location\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(lastKnownLatLng, 18)); // focusing on rider location\n if (ActivityCompat.checkSelfPermission(RiderMapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(RiderMapsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n\n riderInfoHashMap.put(NodeNames.RIDERID,currentUserId);\n riderInfoHashMap.put(NodeNames.RIDERLATITUDE,lastKnownLocation.getLatitude());\n riderInfoHashMap.put(NodeNames.RIDERLONGITUDE,lastKnownLocation.getLongitude());\n\n nodeReference = NodeNames.RIDERS + \"/\" + currentUserId;\n referenceHashMap = new HashMap<>();\n referenceHashMap.put(nodeReference,riderInfoHashMap);\n databaseReference.updateChildren(referenceHashMap, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(@Nullable DatabaseError error, @NonNull DatabaseReference ref) {\n if(error==null){\n Toast.makeText(RiderMapsActivity.this,\"Request your Cab ride\",Toast.LENGTH_SHORT).show();\n }else {\n Toast.makeText(RiderMapsActivity.this,\"error: \" + error.getMessage(),Toast.LENGTH_LONG).show();\n }\n }\n });\n\n // searching for nearby available driver\n\n searchCab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n if(requestCancelled){\n rideEndedByRider(); // rider cancelled ride\n }else {\n requestCancelled = true;\n GeoFire geoFire = new GeoFire(riderRequestsDatabaseReference);\n geoFire.setLocation(currentUserId, new GeoLocation(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()));\n\n progressDialog.setTitle(\"Getting Your Driver\");\n progressDialog.setMessage(\"Please wait while we are looking for nearby drivers\");\n progressDialog.show();\n\n getClosestDriver();\n }\n }\n });\n }\n }\n });\n }", "public void onNewLocationFromGPS(Location location) {\n gpsLocationFound = true;\n currentLocation = location;\n this.setLocationText(getLocationForPrint(location.getLatitude(),\n location.getLongitude()));\n requestForValidationOfQibla();\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }", "@Override\n public void onConnected(Bundle bundle) {\n mLastLocation=LocationServices.FusedLocationApi.getLastLocation(mLocationClient);\n if(mLastLocation!=null){\n double latitude=mLastLocation.getLatitude();\n double longitude=mLastLocation.getLongitude();\n\n Geocoder geocoder=new Geocoder(this, Locale.ENGLISH);\n try{\n List<Address> addresses=geocoder.getFromLocation(latitude,longitude,1);\n if(addresses!=null){\n Address fetchedAddresses=addresses.get(0);\n label=\"Location: \"+fetchedAddresses.getFeatureName()+\", \"+fetchedAddresses.getSubLocality()+\", \"+fetchedAddresses.getLocality()+\", \"+fetchedAddresses.getPostalCode()+\", \"+fetchedAddresses.getAdminArea()+\", \"+fetchedAddresses.getCountryName();\n }\n else{\n tvLocationLabel.setText(\"Location Not Found\");\n Snackbar.make(findViewById(android.R.id.content),\"Location Not Found\",Snackbar.LENGTH_LONG).show();\n }\n }catch (Exception e){\n Snackbar.make(findViewById(android.R.id.content),\"Unable to Get Location\",Snackbar.LENGTH_SHORT).show();\n tvLocationLabel.setText(\"Location Not Found\");\n e.printStackTrace();\n }\n }\n }", "@Override\r\n\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\tLog.d(\"demo\", \"Lat:\" + location.getLatitude() + \" Long:\"+location.getLongitude());\r\n\t\t\t}", "public void sendLastLocation() {\n\t\tif (listeners.size() == 0)\n\t\t\treturn;\n\n\t\tLocation locationToSend = getLastKnownLocation();\n\n\t\tif (locationToSend != null) {\n\t\t\toldLocation = locationToSend;\n\t\t\tfor(Listener ls: listeners){\n\t\t\t\tls.newLocation(locationToSend);\n\t\t\t}\n\t\t\tlog.debug(\"LocationReceiver send last location\");\n\t\t}\n\t}", "public abstract Location[] retrieveLocation();", "private void handleActionGetLocation(final ResultReceiver res) {\n //Bundle up and send the data returned by the gps sensor.\n mGPSSensor = new LocationSensor(this);\n mGPSSensor.getCurrentLocation(new AndroidSensorCallback() {\n @Override\n public void onSensorCallback(Location location) {\n if (location == null) {\n return;\n }\n\n Bundle b = new Bundle();\n b.putDouble(\"lat\", location.getLatitude());\n b.putDouble(\"lng\", location.getLongitude());\n b.putDouble(\"alt\", location.getAltitude());\n res.send(0, b);\n return;\n }\n });\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n Location location = locationResult.getLastLocation();\n if (location != null) {\n onLocationChanged(location);\n }\n }", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tphysAddr = this.initLocationManager();\n\t}", "private void updateLocationToServer() {\n\n if (Utility.isConnectingToInternet(getActivity())) {\n\n if (mGpsTracker.canGetLocation()) {\n\n if (Utility.ischeckvalidLocation(mGpsTracker)) {\n\n Animation fade1 = AnimationUtils.loadAnimation(getActivity(), R.anim.flip);\n btnRefreshLocation.startAnimation(fade1);\n Map<String, String> params = new HashMap<String, String>();\n if (!AppConstants.isGestLogin(getActivity())) {\n params.put(\"iduser\", SharedPref.getInstance().getStringVlue(getActivity(), userId));\n } else {\n params.put(\"iduser\", \"0\");\n }\n\n params.put(\"latitude\", \"\" + mGpsTracker.getLatitude());\n params.put(\"longitude\", \"\" + mGpsTracker.getLongitude());\n RequestHandler.getInstance().stringRequestVolley(getActivity(), AppConstants.getBaseUrl(SharedPref.getInstance().getBooleanValue(getActivity(), isStaging)) + updatelocation, params, this, 5);\n fade1.cancel();\n } else {\n mGpsTracker.showInvalidLocationAlert();\n }\n } else {\n showSettingsAlert(5);\n }\n } else {\n Utility.showInternetError(getActivity());\n }\n\n }", "public void getLocation() {\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n } else {\n mFusedLocationClient.getLastLocation().addOnSuccessListener(\n location -> {\n if (location != null) {\n // Start the reverse geocode AsyncTask\n new FetchAddressTask(DetailsTextActivity.this,\n DetailsTextActivity.this).execute(location);\n txtLocation.setText(getString(R.string.loading));\n Log.d(\"myTag\", \"have location\");\n } else {\n txtLocation.setText(R.string.no_location);\n }\n }\n );\n }\n }", "public void onLocationChanged(Location location) {\r\n currentLocation = new GeoPoint(location);\r\n DatabaseInteractor.sendPosition(act, PreferenceData.getUserId(act), currentLocation.getLatitude(), currentLocation.getLongitude());\r\n\t\tguidoMap.showMyLocation();\r\n }", "@Override\n\t\tpublic void onReceivePoi(BDLocation location) {\n\t\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n loc = location;\n getAddressFromLocation(loc.getLatitude(), loc.getLongitude());\n\n }\n }", "private void getlocation() {\n\t\t\t\ttry {\n\n\t\t\t\t\tgps = new GPSTracker(RegisterActivity.this);\n\t\t\t\t\tLog.d(\"LOgggg\", \"inCurrentlocation\");\n\n\t\t\t\t\t// check if GPS enabled\n\t\t\t\t\tif (gps.canGetLocation()) {\n\n\t\t\t\t\t\tlatitude = gps.getLatitude();\n\t\t\t\t\t\tlongitude = gps.getLongitude();\n\n\t\t\t\t\t\tLog.i(\"latitude\", \"\" + latitude);\n\t\t\t\t\t\tLog.i(\"longitude\", \"\" + longitude);\n\n\t\t\t\t\t\tnew getLoc().execute(\"\");\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgps.showSettingsAlert();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n String message = intent.getStringExtra(\"Status\");\n Bundle b = intent.getBundleExtra(\"Location\");\n lastKnownLoc = (Location) b.getParcelable(\"Location\");\n if (lastKnownLoc != null) {\n latitude = String.valueOf(lastKnownLoc.getLatitude());\n longitude = String.valueOf(lastKnownLoc.getLongitude());\n\n }\n }", "public LocationData(Location loc)\n {\n update(loc);\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n Toast.makeText(MainActivity.this,\n location.toString(),Toast.LENGTH_LONG).show();\n }\n else{\n Toast.makeText(MainActivity.this,\n \"Location object not received\",Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n Toast.makeText(getContext(), \"location: \" + location, Toast.LENGTH_LONG).show();\n EventBus.getDefault().post(new LocationEvent(location));\n }\n }", "@Override\n public void onDataChanged(DataEventBuffer dataEventBuffer) {\n for (DataEvent event : dataEventBuffer) {\n if (event.getType() == DataEvent.TYPE_CHANGED) {\n // DataItem changed\n DataItem item = event.getDataItem();\n if (item.getUri().getPath().compareTo(\"/latlnglist\") == 0) {\n\n DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();\n\n Log.d(\"hudwear\", \"new data, sending message to handler\");\n\n Message m = new Message();\n Bundle b = new Bundle();\n b.putDouble(\"latitude\", dataMap.getDouble(\"latitude\"));\n b.putDouble(\"longitude\", dataMap.getDouble(\"longitude\"));\n m.setData(b);\n handler.sendMessage(m);\n }\n\n } else if (event.getType() == DataEvent.TYPE_DELETED) {\n // DataItem deleted\n }\n }\n }", "@Override\n public void Handle() {\n fusedLocationClient = LocationServices.getFusedLocationProviderClient(context);\n\n // Fetch the last location\n fusedLocationClient.getLastLocation()\n .addOnSuccessListener((Activity) context, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n // Logic to handle location object\n Map<String, Double> latlng = new HashMap<String, Double>();\n latlng.put(\"longitude\", location.getLongitude());\n latlng.put(\"latitude\", location.getLatitude());\n Log.d(\"Location\", \"Location retreived \" + latlng.toString());\n result.success(latlng);\n } else {\n Log.d(\"Location\", \"unable to retreive location\");\n result.success(null);\n }\n }\n });\n }", "@Override\n\tpublic void onLocationChanged(Location loc)\n\t{\n\t}", "public void onLocationChanged(Location location) {\n \n \t}", "public void onSuccess(Location location) {\n if (location != null) {\n //onLocationChanged(location);\n }\n }", "public byte[] getLocation() {\r\n return location;\r\n }", "public void onLocationChanged(Location location) {\n }", "@Override\n public void onConnected(Bundle arg0) {\n mLastLocation=locationHelper.getLocation();\n }", "public String getLocation(){\n return this.location;\n }" ]
[ "0.71324795", "0.7090135", "0.7090135", "0.7090129", "0.6920941", "0.690132", "0.689085", "0.68868077", "0.6839888", "0.6837929", "0.67416996", "0.67335063", "0.670364", "0.6653464", "0.66399324", "0.66298306", "0.6628944", "0.66187453", "0.661309", "0.6606783", "0.65901554", "0.6587172", "0.65734607", "0.65502167", "0.65367234", "0.6527533", "0.6486302", "0.6482294", "0.6459935", "0.64596814", "0.6455628", "0.64349115", "0.64290434", "0.6412674", "0.6411475", "0.6410881", "0.63838816", "0.6379329", "0.63675636", "0.63627183", "0.6361552", "0.6357727", "0.6357727", "0.6353272", "0.6346909", "0.6335836", "0.6330883", "0.6329646", "0.6327108", "0.6321626", "0.6319538", "0.63071597", "0.63057697", "0.6299384", "0.62948996", "0.629431", "0.62892616", "0.62858766", "0.6280154", "0.62773794", "0.6276723", "0.62762773", "0.6272029", "0.62706906", "0.6266766", "0.62640697", "0.62627596", "0.6261823", "0.62618124", "0.6261113", "0.6254831", "0.6253365", "0.6224158", "0.6221374", "0.62085193", "0.62079537", "0.6198376", "0.61983716", "0.61979955", "0.6187577", "0.6180939", "0.6178768", "0.6169871", "0.61662376", "0.61623096", "0.61577547", "0.6157525", "0.6157222", "0.6155069", "0.614833", "0.6144892", "0.61435485", "0.61424696", "0.61284566", "0.61281854", "0.6122692", "0.61171466", "0.6115951", "0.611254" ]
0.6114195
99
new location data has been received and can be accessed
public void onPositionChanged() { currentLat = location.getLatitude(); currentLng = location.getLongitude(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNewLocationRecieved(LocationWrapper locationWrapper, LocationType type);", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tmylat=location.getLatitude();\n\t\tmylong=location.getLongitude();\n\t\tgetData();\n\t\t\n\t}", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n StringBuffer sb = new StringBuffer(256);\n sb.append(\"time : \");\n /**\n * 时间也可以使用systemClock.elapsedRealtime()方法 获取的是自从开机以来,每次回调的时间;\n * location.getTime() 是指服务端出本次结果的时间,如果位置不发生变化,则时间不变\n */\n sb.append(location.getTime());\n sb.append(\"\\nlocType : \");// 定位类型\n sb.append(location.getLocType());\n sb.append(\"\\nlocType description : \");// *****对应的定位类型说明*****\n sb.append(location.getLocTypeDescription());\n sb.append(\"\\nlatitude : \");// 纬度\n sb.append(location.getLatitude());\n sb.append(\"\\nlontitude : \");// 经度\n sb.append(location.getLongitude());\n sb.append(\"\\nradius : \");// 半径\n sb.append(location.getRadius());\n sb.append(\"\\nCountryCode : \");// 国家码\n sb.append(location.getCountryCode());\n sb.append(\"\\nCountry : \");// 国家名称\n sb.append(location.getCountry());\n sb.append(\"\\ncitycode : \");// 城市编码\n sb.append(location.getCityCode());\n sb.append(\"\\ncity : \");// 城市\n sb.append(location.getCity());\n sb.append(\"\\nDistrict : \");// 区\n sb.append(location.getDistrict());\n sb.append(\"\\nStreet : \");// 街道\n sb.append(location.getStreet());\n sb.append(\"\\naddr : \");// 地址信息\n sb.append(location.getAddrStr());\n sb.append(\"\\nUserIndoorState: \");// *****返回用户室内外判断结果*****\n sb.append(location.getUserIndoorState());\n sb.append(\"\\nDirection(not all devices have value): \");\n sb.append(location.getDirection());// 方向\n sb.append(\"\\nlocationdescribe: \");\n sb.append(location.getLocationDescribe());// 位置语义化信息\n sb.append(\"\\nPoi: \");// POI信息\n if (location.getPoiList() != null && !location.getPoiList().isEmpty()) {\n for (int i = 0; i < location.getPoiList().size(); i++) {\n Poi poi = (Poi) location.getPoiList().get(i);\n sb.append(poi.getName() + \";\");\n }\n }\n if (location.getLocType() == BDLocation.TypeGpsLocation) {// GPS定位结果\n sb.append(\"\\nspeed : \");\n sb.append(location.getSpeed());// 速度 单位:km/h\n sb.append(\"\\nsatellite : \");\n sb.append(location.getSatelliteNumber());// 卫星数目\n sb.append(\"\\nheight : \");\n sb.append(location.getAltitude());// 海拔高度 单位:米\n sb.append(\"\\ngps status : \");\n sb.append(location.getGpsAccuracyStatus());// *****gps质量判断*****\n sb.append(\"\\ndescribe : \");\n sb.append(\"gps定位成功\");\n } else if (location.getLocType() == BDLocation.TypeNetWorkLocation) {// 网络定位结果\n // 运营商信息\n if (location.hasAltitude()) {// *****如果有海拔高度*****\n sb.append(\"\\nheight : \");\n sb.append(location.getAltitude());// 单位:米\n }\n sb.append(\"\\noperationers : \");// 运营商信息\n sb.append(location.getOperators());\n sb.append(\"\\ndescribe : \");\n sb.append(\"网络定位成功\");\n } else if (location.getLocType() == BDLocation.TypeOffLineLocation) {// 离线定位结果\n sb.append(\"\\ndescribe : \");\n sb.append(\"离线定位成功,离线定位结果也是有效的\");\n\n } else if (location.getLocType() == BDLocation.TypeServerError) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"服务端网络定位失败,可以反馈IMEI号和大体定位时间到loc-bugs@baidu.com,会有人追查原因\");\n } else if (location.getLocType() == BDLocation.TypeNetWorkException) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"网络不同导致定位失败,请检查网络是否通畅\");\n\n } else if (location.getLocType() == BDLocation.TypeCriteriaException) {\n sb.append(\"\\ndescribe : \");\n sb.append(\"无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机\");\n }\n// logMsg(sb.toString());\n slatitude = String.valueOf(location.getLatitude());\n Log.i(\"slatitude::::\", slatitude);\n slongitude = String.valueOf(location.getLongitude());\n Log.i(\"slongitude::::\", slongitude);\n sname = String.valueOf(location.getAddrStr());\n Log.i(\"sname::::\", sname);\n UserLocationInfo.myAddress = location.getAddrStr();\n UserLocationInfo.myLatitude = location.getLatitude();\n UserLocationInfo.myLongitude = location.getLongitude();\n UserLocationInfo.myCity = location.getCity();\n UserLocationInfo.cityCode = location.getCityCode();\n UserLocationInfo.altitude = location.getAltitude();\n }\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n }", "@Override\n public void onLocationChanged(Location location) {\n latitude=String.valueOf(location.getLatitude());\n longitude= String.valueOf(location.getLongitude());\n\n System.out.println(\"asdfgh==\"+latitude);\n\n\n /* Geocoder geocoder;\n List<Address> addresses;\n geocoder = new Geocoder(SafetyActivity.this, Locale.getDefault());\n\n try {\n addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n String address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n String city = addresses.get(0).getLocality();\n String state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n String postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName();\n\n System.out.println(\"addresses==\"+address);\n // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n StringBuffer sb = new StringBuffer(256);\n sb.append(location.getCity());\n logMsg(sb.toString());\n City = sb.toString();\n }\n }", "@Override\n public void onReceiveLocation(BDLocation dbLocation) {\n if (dbLocation == null || mapView == null) {\n return;\n }\n //得到定位数据\n MyLocationData myLoationData = new MyLocationData.Builder()\n .accuracy(dbLocation.getRadius()) //设置精度\n .direction(dbLocation.getDirection()) //定位数据的方向信息\n .latitude(dbLocation.getLatitude())\n .longitude(dbLocation.getLongitude())\n .build();\n baiduMap.setMyLocationData(myLoationData);\n //如果是第一次登陆\n if (isFirstLoc) {\n isFirstLoc = false;\n LatLng latLng = new LatLng(dbLocation.getLatitude(), dbLocation.getLongitude());\n MapStatusUpdate mapStatusUpdate = MapStatusUpdateFactory.newLatLng(latLng);\n baiduMap.animateMapStatus(mapStatusUpdate);\n }\n Log.i(\"aaa\", \"-----\");\n showInfo(dbLocation);\n Log.i(\"aaa\", \"-----\");\n }", "public void getLocationInfo() {\n startLocationService();\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n\n mCurSheng = location.getProvince() ;\n mCurShi = location.getCity() ;\n mCurQu = location.getDistrict() ;\n\n final String locationDesc ;\n List<Poi> poiList = location.getPoiList() ;\n if(poiList.size() > 0){\n locationDesc = poiList.get(0).getName() ;\n }else{\n locationDesc = location.getLocationDescribe() ;\n }\n\n LogUtils.showLog(\"testLocations\" ,\"sendCircle--\" + locationDesc) ;\n\n if(mCurSheng != null && mCurShi != null){\n mCurLon = location.getLongitude() +\"\" ;\n mCurLat = location.getLatitude() +\"\" ;\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mLocationTv.setText(null == locationDesc ? \"点击获取位置\" : locationDesc);\n }\n });\n\n mLocationService.unregisterListener(mListener); //注销掉监听\n mLocationService.stop(); //停止定位服务\n\n MyApplication.updateCurLocation(location) ;\n\n handler.sendEmptyMessage(MSG_LOCATION) ;\n }\n\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n\n clientlat = location.getLatitude();\n clientlon = location.getLongitude();\n System.out.println(\"latitude is \"+clientlat);\n System.out.println(\"longitude is \"+clientlon);\n }", "private void updateWithNewLocation(Location location)\n {\n\n float fLatitude = (float)0.0;\n float fLongitude = (float)0.0;\n float fHepe=(float)10000.0;\n byte ucNapUsed = 0;\n byte ucWiperErrorCode = 0;\n\n if (Config.LOGD) Log.d(TAG,\"Network Location callback\");\n\n if( location != null)\n {\n //read params from location structure return by WPS\n fLatitude = (float)(location.getLatitude());\n fLongitude = (float)(location.getLongitude());\n fHepe = location.getAccuracy();\n\n if(bScanCompleted == true)\n {\n ucNapUsed= (byte)aResults.size();\n }\n else\n {\n ucNapUsed = 50;\n }\n\n }\n else\n {\n ucWiperErrorCode = 99;\n }\n startWiperReport();\n native_notify_wiper_position(fLatitude,fLongitude,fHepe,ucNapUsed,ucWiperErrorCode);\n endWiperReport();\n\n }", "public void onLocationChanged(Location location) {\n lastKnownLocation = location;\n geofenceHelper(getContext());\n }", "private void getLocation() {\n\n }", "public void gotLocation(Location location){\r\n \tif(location!=null){\r\n\t \tConstants.gpslat = location.getLatitude()+\"\";\r\n\t Constants.gpslng = location.getLongitude()+\"\";\r\n\t Log.d(\"location changed: lattitue & longitude\",Constants.gpslat+\" & \"+Constants.gpslng);\r\n \t}\r\n }", "private void setLocationData(Location location){\r\n currentLat = location.getLatitude();\r\n currentLng = location.getLongitude();\r\n }", "@Override\r\n public void onLocationChanged(Location location) {\r\n // - Update local variables\r\n setLocationData(location);\r\n\r\n if (location != null) {\r\n Log.e(TAG, \"== location != null\");\r\n // - Send result through a broadcast\r\n sendBroadcastToActivity(currentLat, currentLng);\r\n }\r\n }", "@Override\n public void onLocationChanged(Location loc)\n {\n \t\n \tint lat = (int) (loc.getLatitude() * 1E6);\n\t\t\tint lng = (int) (loc.getLongitude() * 1E6);\n\t\t\t point = new GeoPoint(lat, lng);\n\t\t\t \n\t\t\t /** remove the previous overlay so the another\n\t\t\t can be added **/\n\t\t\t itemizedOverlay.removeOverlay(0);\n\t\t\t \n\t\t\n\t\t\t //this follows the same steps in the OnCreate function at start up.\n\t\t\t // //Initialize a normal MapOVerlay item with new point.\n\t\t\t OverlayItem overlayitem = new OverlayItem(point, \"kiddda!\", \"sasri kal!\");\n\t\t \n\t\t itemizedOverlay.addOverlay(overlayitem);\n\t\t mapOverlays.add(itemizedOverlay);\n\t\t // move to new point.\n\t\t\tcontroller.animateTo(point); \n\t\t\t \n\t\n\t\t\t//debug message to say the location has been read.\n\t\t\tLog.i(\"Listener\", \"location read\");\n\t\t\t \n\t\t\n\n\t\t \n // String Text = \"My current location is: \" +\n\t\t\tLog.i(\"service check\",\" Latitude = \" + loc.getLatitude() +\n \" Longitude = \" + loc.getLongitude());\n \n // Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_LONG).show();\n \n }", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\tcurrent_location=location;\n\t\t\tlatitude=current_location.getLatitude();\n\t\t\tlongitude=current_location.getLongitude();\n\t\t\t//Toast.makeText(AgentSectionActivity.this,\"LATITUDE IS : \"+latitude+\"\\n LONGITUDE IS :\"+longitude+\"\",4000).show();\n\t\t\tsenddata(logged_user,Double.toString(latitude),Double.toString(longitude));\n\t\t}", "@Override\n public void onLocationChanged(Location location) {\n if(!firstLocCheck){\n drive = new Drive(location.getLatitude(),location.getLongitude(),Car.carList.get(carIndex),startTime);\n firstLocCheck = true;\n } else {\n Drive.curLat = location.getLatitude();\n Drive.curLong = location.getLongitude();\n }\n System.out.println(\"Location has changed\");\n System.out.println(location.getLatitude() + \" | \" + location.getLongitude());\n\n //updateLoc(location);\n //locProvider = location.getProvider();\n }", "public void onLocationChanged(Location location) {\n sendResult(location);\n }", "private void _Setup_GetLocData() {\n\t\tString log_msg = \"CONS.LocData.LONGITUDE=\"\n\t\t\t\t\t+ String.valueOf(CONS.LocData.LONGITUDE);\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\t\n\t\tIntent i = this.getIntent();\n\t\t\n\t\tthis.longitude\t= i.getDoubleExtra(\n\t\t\t\t\t\t\tCONS.IntentData.iName_Showmap_Longitude,\n\t\t\t\t\t\t\tCONS.IntentData.Showmap_DefaultValue);\n\t\t\n\t\tthis.latitude\t= i.getDoubleExtra(\n\t\t\t\tCONS.IntentData.iName_Showmap_Latitude,\n\t\t\t\tCONS.IntentData.Showmap_DefaultValue);\n\t\t\n\t\t// Log\n\t\tlog_msg = \"this.latitude=\" + String.valueOf(this.latitude)\n\t\t\t\t\t\t+ \"/\"\n\t\t\t\t\t\t+ \"this.longitude=\" + String.valueOf(this.longitude);\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\t\n\t}", "public void sendData() {\r\n\t\t// HoverBot specific implementation of sendData method\r\n\t\tSystem.out.println(\"Sending location information...\");\r\n\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n lastLatitude = Double.toString(location.getLatitude());\n lastLongitude = Double.toString(location.getLongitude());\n //lastLocation = Double.toString(location.getLatitude()) + \",\" + Double.toString(location.getLongitude()) ;\n //String b = lastLocation;\n // Get into right format\n // Logic to handle location object\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n String myUrl = \"https://a.mapillary.com/v3/map_features?layers=trafficsigns\" +\n \"&radius=600\" +\n \"&client_id=YUNMM3lQRXRUR1Y0MDBwcEVLaFJsUTo2ZWFjY2Y0YWJhM2JmYmM5\" +\n \"&per_page=\" + numberOfResults +\n \"&closeto=\" + location.getLongitude() + \",\" + location.getLatitude();\n //String to place our result in\n String result = null;\n //Instantiate new instance of our class\n HttpGetRequest getRequest = new HttpGetRequest();\n //Perform the doInBackground method, passing in our url\n try {\n result = getRequest.execute(myUrl).get();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n try {\n JSONObject jObject = new JSONObject(result);\n JSONArray features = jObject.getJSONArray(\"features\");\n for (int i=0; i < numberOfResults; i++){\n try {\n JSONObject featuresObject = features.getJSONObject(i);\n // Pulling items from the array\n JSONObject properties = featuresObject.getJSONObject(\"properties\");\n nearbyRoadSigns[i] = properties.getString(\"value\");\n\n System.out.println(nearbyRoadSigns[i]);\n\n } catch (JSONException e) {\n // Oops\n }\n }\n locationManager.removeUpdates(this);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n wayLatitude = location.getLatitude();\n wayLongitude = location.getLongitude();\n SharedStore.getInstance().save(Double.toString(wayLatitude),\"CurrentLat\");\n SharedStore.getInstance().save(Double.toString(wayLongitude),\"CurrentLong\");\n Log.e(\"getLocation\", String.valueOf(wayLatitude));\n }\n }", "public void updateLocation();", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n // Logic to handle location object\n mLastLocation = location;\n Log.wtf(\"-GPS\", \"getLocation 169 : \" + mLastLocation.getLatitude() + \",\" + mLastLocation.getLongitude());\n\n } else {\n Log.wtf(\"-GPS\", \"getLocation 171 : \" + mLastLocation);\n\n }\n }", "private void loadData() {\n gps = new GPSTracker(LocationActivity.this);\n if (from.equals(\"home\")) {\n if (lat == 0 && lon == 0) {\n if (gps.canGetLocation()) {\n if (TextbookTakeoverApplication.isNetworkAvailable(LocationActivity.this)) {\n lat = gps.getLatitude();\n lon = gps.getLongitude();\n Log.v(\"lati\", \"lat\" + lat);\n Log.v(\"longi\", \"longi\" + lon);\n } else {\n // TextbookTakeoverApplication.dialog(LocationActivity.this, \"Error!\", \"Please check your connection and try again\");\n }\n } else {\n if (!alertDialog.isShowing()) {\n alertDialog.show();\n }\n got = true;\n }\n }\n } else if (from.equals(\"add\")) {\n if (AddProductDetail.lat == 0 && AddProductDetail.lon == 0) {\n if (gps.canGetLocation()) {\n if (TextbookTakeoverApplication.isNetworkAvailable(LocationActivity.this)) {\n Log.v(\"lati\", \"lat\" + AddProductDetail.lat);\n Log.v(\"longi\", \"longi\" + AddProductDetail.lat);\n } else {\n // TextbookTakeoverApplication.dialog(LocationActivity.this, \"Error!\", \"Please check your connection and try again\");\n }\n } else {\n if (!alertDialog.isShowing()) {\n alertDialog.show();\n }\n got = true;\n }\n }\n }\n\n }", "private void onDataSendBegin() {\n Observable<Location> observable = ObservableFactory.from(SmartLocation.with(this).location().oneFix());\n observable.timeout(8, TimeUnit.SECONDS)\n .subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Observer<Location>() {\n @Override\n public void onSubscribe(Disposable d) {\n currentLocation = null;\n }\n\n @Override\n public void onNext(Location loc) {\n currentLocation = loc;\n }\n\n @Override\n public void onError(Throwable e) {\n Log.e(\"onDataSendBegin\", \"onError: yes\", e);\n Toast.makeText(PanelActivity.this, \"Unable to fetch precise location, try in another way.\", Toast.LENGTH_SHORT).show();\n currentLocation = locationUtils.getLocation();\n if (currentLocation == null) {\n Log.e(\"TAG\", \"无法获取设备定位信息(包括最近一次成功定位)!\");\n }\n sendLocation();\n }\n\n @Override\n public void onComplete() {\n sendLocation();\n }\n });\n }", "@Override\n public void onLocationChanged(final Location location) {\n // Lay vi tri hien tai cua minh\n myLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (firstLocation == true) {\n // Neu day la lan dau co thong tin vi tri thi chuyen camera ve vi tri nay\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n firstLocation = false;\n }\n // Gui vi tri cua minh len server\n String myLocationMessage = String.format(\"{\\\"COMMAND\\\":\\\"MEMBER_CURRENT_LOCATION\\\", \\\"LATITUDE\\\": \\\"%s\\\", \\\"LONGITUDE\\\": \\\"%s\\\"}\", myLocation.latitude, myLocation.longitude);\n OnlineManager.getInstance().sendMessage(myLocationMessage);\n // Refresh danh sach timesheet\n if (tourTimesheetAdapter != null) {\n tourTimesheetAdapter.notifyDataSetChanged();\n }\n }", "private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }", "@Override \n public void onLocationChanged(Location location) { \n mostRecentLocation = location; \n }", "private void Location() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_ACCESS_FINE_LOCATION);\n }\n\n //Google Play Location stored in loc variable\n fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n fusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n\n\n @Override\n public void onSuccess(Location location) {\n\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n loc = location;\n getAddressFromLocation(loc.getLatitude(), loc.getLongitude());\n\n }\n }\n });\n }", "@Override\n\t\tpublic void onReceiveLocation(BDLocation arg0) {\n\t\t\tlat = \"\" + arg0.getLatitude();\n\t\t\tlon = \"\" + arg0.getLongitude();\n\t\t\tSystem.out.println(\"lat ---> \" + lat);\n\t\t\tSystem.out.println(\"lon ---> \" + lon);\n\t\t\tlocationService.unregisterListener(mListener); // 注销掉监听\n\t\t\tlocationService.stop(); // 停止定位服务\n\t\t\t// System.out.println(\"des ---> \" + describe);\n\t\t\t// System.out.println(\"error ---> \" + arg0.getLocType());\n\t\t\t// System.out.println(\"District ---> \" + arg0.getDistrict());\n\t\t\t// System.out.println(\"Street ---> \" + arg0.getStreet());\n\t\t\t// System.out.println(\"getStreetNumber ---> \" +\n\t\t\t// arg0.getStreetNumber());\n\t\t\t// System.out.println(\"address ---> \" +\n\t\t\t// arg0.getAddress().streetNumber);\n\t\t\t// System.out.println(\"addressStr ---> \" + arg0.getAddrStr());\n\t\t\t// System.out.println(\"getBuildingID ---> \" + arg0.getBuildingID());\n\t\t\t// System.out.println(\"getBuildingName ---> \" +\n\t\t\t// arg0.getBuildingName());\n\t\t\t// System.out.println(\"getFloor ---> \" + arg0.getFloor());\n\t\t}", "public void onLocationChanged(Location newlocation) {\n\t\t\t\t\n\t\t\t\tif (newlocation != null) \n\t\t\t\t{\n\t\t\t\t\tlocationManager.removeUpdates(this);\n\t\t\t\t\tpoint=getGeoPoint(newlocation);\n\t\t\t\t\t//String altitiude = \"Altitiude: \" + newlocation.getAltitude();\n\t\t\t\t\t//String accuracy = \"Accuracy: \" + newlocation.getAccuracy();\n\t\t\t\t\t//String time = \"Time: \" + newlocation.getTime();\n\t\t\t\t\tmapController.animateTo(point);\n\t\t\t\t\t\n\t\t\t\t\tlatitudes= String.valueOf(newlocation.getLatitude() * 1E6);\n\t\t\t\t\tlongitudes= String.valueOf (newlocation.getLongitude() * 1E6);\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"latd\",latitudes));\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"lotd\",longitudes));\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"id\",LoginId));\n\t\t\t\t\tArrayList<NameValuePair> result=db.getServerData(nameValuePairs,\"updatecoordinates.php\");\n\t\t\t\t\tnameValuePairs.clear();\n\t\t\t\t\tfor(int i=0;i<result.size();i++)\n\t\t\t\t\t{\n\t\t\t\t\t\ts=result.get(i).getName();\n\t\t\t\t\t\tif(s.equals(\"Error\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Co-Ords Updated\", 3000);\n\t\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\t\ttt.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Co-Ords Updated Error\", 3000);\n\t\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\t\ttt.show();break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresult.clear();\n\t\t\t\t\t\n\t\t\t\t\tmapView.invalidate();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Override\n public void onLocationChanged(final Location location) {\n\n if(mLastLocation==null || location.distanceTo(mLastLocation)>getResources().getInteger(R.integer.min_distance_listen))\n {\n new GetNearBy().executePreHeavy();\n }\n\n mLastLocation=location;\n\n android.util.Log.e(\"onLocationChanged\",mLastLocation.getLatitude()+\" - \"+mLastLocation.getLongitude());\n\n\n\n }", "@Override\n public void onLocationChanged(Location location) {\n setLocation(location);\n mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n mTime = new SimpleDateFormat(K.TIMESTAMP_FORMAT_STRING).format(Calendar\n .getInstance().getTime()).toString();\n androidLocationUI.updateUI();\n if (application.isLogging()) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n saveData();\n }\n }).start();\n }\n }", "private void getLocation() {\n //if you don't have permission for location services yet, ask\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n //have the app ask for location permission\n } else {\n fusedLocationClient.requestLocationUpdates\n (getLocationRequest(), mLocationCallback,\n null /* Looper */);\n //uses the type of request and the location callback to update the location\n /**fusedLocationClient.getLastLocation().addOnSuccessListener(\n new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n TextView error = findViewById(R.id.errorMsg);\n error.setVisibility(View.VISIBLE);\n\n if (location != null) {\n lastLocation = location;\n error.setText(\"location: \" + lastLocation.getLatitude());\n } else {\n error.setText(\"location not available\");\n }\n }\n });**/\n }\n }", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n public void onLocationChanged(Location location) {\n if (ActivityCompat.checkSelfPermission(TourTabsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(TourTabsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n // Bat gps thi di chuyen camera den vi tri cua minh\n myLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (firstLocation == true) {\n // Neu day la lan dau co thong tin vi tri thi chuyen camera ve vi tri nay\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n firstLocation = false;\n }\n // Gui vi tri cua minh len server\n String myLocationMessage = String.format(\"{\\\"COMMAND\\\":\\\"MEMBER_CURRENT_LOCATION\\\", \\\"LATITUDE\\\": \\\"%s\\\", \\\"LONGITUDE\\\": \\\"%s\\\"}\", myLocation.latitude, myLocation.longitude);\n OnlineManager.getInstance().sendMessage(myLocationMessage);\n // Refresh danh sach timesheet\n if(tourTimesheetAdapter != null){\n tourTimesheetAdapter.notifyDataSetChanged();\n }\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "public void getLocation(){\n }", "public void startLocationUpdate() {\n if (locationCallback != null) {\n try {\n locationCallback = new LocationCallback() {//khoi tao dinh nghia (extent)\n\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }\n };\n fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, null);//dang ky voi he thong app lang nghe su thay doi cua location\n\n } catch (SecurityException e) {\n e.getMessage();\n\n }\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n\n MyLat = location.getLatitude();\n MyLong = location.getLongitude();\n\n Log.e(TAG, \"MyLat = \" + MyLat);\n Log.e(TAG, \"MyLong = \" + MyLong);\n\n\n LatLng latLng = (new LatLng(location.getLatitude(), location.getLongitude()));\n mMap.clear();\n\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 17.0f));\n\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.draggable(true);\n\n BitmapDescriptor markerIcon = vectorToBitmap(R.drawable.ic__fill_placeholder,\n ContextCompat.getColor(getApplicationContext(),\n R.color.rv_hader));\n\n markerOptions.icon(markerIcon);\n markerOptions.title(\"My Location\");\n if (session.getMobileNumber() != null) {\n markerOptions.snippet(session.getMobileNumber());\n }\n mMap.addMarker(markerOptions);\n\n String add = getAddress(location.getLatitude(), location.getLongitude());\n Log.e(getClass().getSimpleName(), \"getAddress : \" + add);\n currentAddress = add;\n if (add != null)\n tv_current_locName.setText(add);\n else\n tv_current_locName.setText(\"Not Find\");\n } else {\n Log.d(TAG, \"onComplete: current location is null\");\n TastyToast.makeText(getApplicationContext(), getString(R.string.unable_toget_current_location), TastyToast.LENGTH_LONG, TastyToast.ERROR);\n Intent mIntent = new Intent(getApplicationContext(), MetaDataList.class); // the activity that holds the fragment\n Bundle mBundle = new Bundle();\n\n mBundle.putSerializable(\"metaDataItem\", metaDataItem);\n mIntent.setAction(\"UpdateLatLong\");\n mIntent.putExtra(\"SelectedNameDetail\", mBundle);\n startActivity(mIntent);\n finish();\n }\n }", "@Override\n public void locationFetched(Location mLocation, Location oldLocation, String time, String locationProvider) {\n GetAccurateLocationApplication.mCurrentLocation = mLocation;\n GetAccurateLocationApplication.oldLocation = oldLocation;\n GetAccurateLocationApplication.locationProvider = locationProvider;\n GetAccurateLocationApplication.locationTime = time;\n }", "@Override\n public void onLocationChanged(Location location) {\n Location location1 = location;\n\n }", "@Override\n public void onLocationChanged(Location location) {\n currentLatitude = location.getLatitude();\n currentLongitude = location.getLongitude();\n\n }", "public void onLocationChanged(Location location) {\n btsLocation.one_time_refresh();\r\n serviceToken = btsLocation.getToken();\r\n verify(serviceToken, pollDatabases(serviceToken));\r\n \r\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onSuccess: Location : \" + locationResult);\n if (locationResult == null) {\n return;\n }\n for (Location location : locationResult.getLocations()) {\n // Update UI with location data\n Toast.makeText(MainActivity.this, \"Location : \" + location, Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n mLastLocation = location;\n Log.i(\"mLastLocation\", String.valueOf(mLastLocation.getLatitude()) + \" \" + String.valueOf(mLastLocation.getLongitude()));\n }\n }", "@Override\n \tpublic void onLocationChanged(Location location) {\n \t\tthis.location = location;\n \t}", "public org.afscme.enterprise.organization.LocationData getLocationData() {\n return locationData;\n }", "private void createLocationCallback() {\n mLocationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n\n mLastLocation = locationResult.getLastLocation();\n mRequestingLocationUpdate = false;\n\n startAddressLookupService();\n }\n };\n }", "void onLocationChanged( String newLocation ) {\n Uri uri = mUri;\n if (null != uri) {\n long date = WeatherContract.WeatherEntry.getDateFromUri(uri);\n Uri updatedUri = WeatherContract.WeatherEntry.buildWeatherLocationWithDate(newLocation, date);\n mUri = updatedUri;\n getLoaderManager().restartLoader(DETAILED_WEATHER_LOADER, null, this);\n }\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onLocationResult: got location result.\");\n Location location = locationResult.getLastLocation();\n if (location != null) {\n GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude());\n userInfoDoc.get().addOnCompleteListener(task -> {\n Boolean av = (Boolean) task.getResult().get(\"Availability\");\n saveUserLocation(geoPoint , av);\n });\n saveDistance(geoPoint);\n\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "@Override\n public geo_location getLocation() {\n return location;\n }", "@Override\n public void onSuccess(Location loc) {\n if (loc != null && loc.getLatitude() != 0) {\n cLoc = loc;\n }\n }", "@Override\n\t\tpublic void onReceiveLocation(BDLocation location) {\n\t\t\t\n\t\t Lng = (float) location.getLatitude();//经度\n\t\t\t Lat = (float) location.getLongitude();//维度\n\t\t\t Log.e(TAG, \"Lng: \" + Lng);\n\t\t\t Log.e(TAG, \"Lat: \" + Lat);\n\t\t\t LocationUtil.stopLocation();\n\t\t\tLocationUtil.startReverseGeoCode(Lng, Lat, getGeoCoderResultListener);\n\t\t\t\n\t\t}", "public void onLocationChanged(Location location) {\n\t\t\t\tupdatenewlocation(location);\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic SystemStatusMessage updateCurrentLocation() {\n\t\t\n\t\tDataStore dataStore = getSystemComputer().getStorageDevice();\n\t\t\n\t\t// Look for subspace beacons in navigation archive\n\t\tMap<String,DataRecord> subspaceBeacons = dataStore.getData(CelestialObject.category(), SubspaceBeacon.type());\n\t\t\n\t\t\n\t\t\n\t\t\n\t\treturn null;\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n\n\n Bundle bundle = intent.getExtras();\n Location nLocation = (Location) bundle.get(\"New location\");\n LatLng there = new LatLng(nLocation.getLatitude(), nLocation.getLongitude());\n mMap.addPolyline(new PolylineOptions().add(there).color(0));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(there));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(there.latitude, there.longitude), 12.0f));\n\n Log.v(TAG, \"RECEIVED A NEW LOCATION\");\n\n }", "private void setLastLocation() {\n\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n // Permission has already been granted\n mFusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n lastLatitude = Double.toString(location.getLatitude());\n lastLongitude = Double.toString(location.getLongitude());\n //lastLocation = Double.toString(location.getLatitude()) + \",\" + Double.toString(location.getLongitude()) ;\n //String b = lastLocation;\n // Get into right format\n // Logic to handle location object\n }\n }\n });\n }\n }", "@Override\n \t\t\tpublic void onLocationChanged(Location loc) {\n \t \n \t\t\t}", "@Override\n public void onLocationChanged(Location location) {\n }", "@Override\n\t\t\tpublic void onReceiveLocation(BDLocation location) {\n\t\t\t\tif(location == null){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t/*StringBuffer sb = new StringBuffer();\n\t\t\t\tsb.append(location.getLongitude()+\",\");\n\t\t\t\tsb.append(location.getLatitude());*/\n\t\t\t\tresult = location.getLongitude()+\",\"+location.getLatitude();\n\t\t\t\t\n\t\t\t}", "@SuppressWarnings(\"MissingPermission\")\n private void getLastLocation() {\n mFusedLocationClient.getLastLocation()\n .addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful() && task.getResult() != null) {\n mLastLocation = task.getResult();\n getWeather(mLastLocation);\n } else {\n Log.w(TAG, \"getLastLocation:exception\", task.getException());\n showSnackbar(getString(R.string.no_location_detected));\n }\n }\n });\n }", "public void onNewLocationFromGPS(Location location) {\n gpsLocationFound = true;\n currentLocation = location;\n this.setLocationText(getLocationForPrint(location.getLatitude(),\n location.getLongitude()));\n requestForValidationOfQibla();\n }", "private void getLastKnownLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n Task<Location> task = fusedLocationProviderClient.getLastLocation();\n task.addOnSuccessListener(new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n lastKnownLocation = location;\n lastKnownLatLng = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());\n riderMarker = mMap.addMarker(new MarkerOptions().position(lastKnownLatLng).title(\"Your Location\")); // adding marker to rider location\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(lastKnownLatLng, 18)); // focusing on rider location\n if (ActivityCompat.checkSelfPermission(RiderMapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(RiderMapsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n\n riderInfoHashMap.put(NodeNames.RIDERID,currentUserId);\n riderInfoHashMap.put(NodeNames.RIDERLATITUDE,lastKnownLocation.getLatitude());\n riderInfoHashMap.put(NodeNames.RIDERLONGITUDE,lastKnownLocation.getLongitude());\n\n nodeReference = NodeNames.RIDERS + \"/\" + currentUserId;\n referenceHashMap = new HashMap<>();\n referenceHashMap.put(nodeReference,riderInfoHashMap);\n databaseReference.updateChildren(referenceHashMap, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(@Nullable DatabaseError error, @NonNull DatabaseReference ref) {\n if(error==null){\n Toast.makeText(RiderMapsActivity.this,\"Request your Cab ride\",Toast.LENGTH_SHORT).show();\n }else {\n Toast.makeText(RiderMapsActivity.this,\"error: \" + error.getMessage(),Toast.LENGTH_LONG).show();\n }\n }\n });\n\n // searching for nearby available driver\n\n searchCab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n if(requestCancelled){\n rideEndedByRider(); // rider cancelled ride\n }else {\n requestCancelled = true;\n GeoFire geoFire = new GeoFire(riderRequestsDatabaseReference);\n geoFire.setLocation(currentUserId, new GeoLocation(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()));\n\n progressDialog.setTitle(\"Getting Your Driver\");\n progressDialog.setMessage(\"Please wait while we are looking for nearby drivers\");\n progressDialog.show();\n\n getClosestDriver();\n }\n }\n });\n }\n }\n });\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }", "@Override\n public void onConnected(Bundle bundle) {\n mLastLocation=LocationServices.FusedLocationApi.getLastLocation(mLocationClient);\n if(mLastLocation!=null){\n double latitude=mLastLocation.getLatitude();\n double longitude=mLastLocation.getLongitude();\n\n Geocoder geocoder=new Geocoder(this, Locale.ENGLISH);\n try{\n List<Address> addresses=geocoder.getFromLocation(latitude,longitude,1);\n if(addresses!=null){\n Address fetchedAddresses=addresses.get(0);\n label=\"Location: \"+fetchedAddresses.getFeatureName()+\", \"+fetchedAddresses.getSubLocality()+\", \"+fetchedAddresses.getLocality()+\", \"+fetchedAddresses.getPostalCode()+\", \"+fetchedAddresses.getAdminArea()+\", \"+fetchedAddresses.getCountryName();\n }\n else{\n tvLocationLabel.setText(\"Location Not Found\");\n Snackbar.make(findViewById(android.R.id.content),\"Location Not Found\",Snackbar.LENGTH_LONG).show();\n }\n }catch (Exception e){\n Snackbar.make(findViewById(android.R.id.content),\"Unable to Get Location\",Snackbar.LENGTH_SHORT).show();\n tvLocationLabel.setText(\"Location Not Found\");\n e.printStackTrace();\n }\n }\n }", "@Override\r\n\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\tLog.d(\"demo\", \"Lat:\" + location.getLatitude() + \" Long:\"+location.getLongitude());\r\n\t\t\t}", "public void sendLastLocation() {\n\t\tif (listeners.size() == 0)\n\t\t\treturn;\n\n\t\tLocation locationToSend = getLastKnownLocation();\n\n\t\tif (locationToSend != null) {\n\t\t\toldLocation = locationToSend;\n\t\t\tfor(Listener ls: listeners){\n\t\t\t\tls.newLocation(locationToSend);\n\t\t\t}\n\t\t\tlog.debug(\"LocationReceiver send last location\");\n\t\t}\n\t}", "@Override\n public void onLocationResult(LocationResult locationResult) {\n Location location = locationResult.getLastLocation();\n if (location != null) {\n onLocationChanged(location);\n }\n }", "public abstract Location[] retrieveLocation();", "private void handleActionGetLocation(final ResultReceiver res) {\n //Bundle up and send the data returned by the gps sensor.\n mGPSSensor = new LocationSensor(this);\n mGPSSensor.getCurrentLocation(new AndroidSensorCallback() {\n @Override\n public void onSensorCallback(Location location) {\n if (location == null) {\n return;\n }\n\n Bundle b = new Bundle();\n b.putDouble(\"lat\", location.getLatitude());\n b.putDouble(\"lng\", location.getLongitude());\n b.putDouble(\"alt\", location.getAltitude());\n res.send(0, b);\n return;\n }\n });\n }", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tphysAddr = this.initLocationManager();\n\t}", "private void updateLocationToServer() {\n\n if (Utility.isConnectingToInternet(getActivity())) {\n\n if (mGpsTracker.canGetLocation()) {\n\n if (Utility.ischeckvalidLocation(mGpsTracker)) {\n\n Animation fade1 = AnimationUtils.loadAnimation(getActivity(), R.anim.flip);\n btnRefreshLocation.startAnimation(fade1);\n Map<String, String> params = new HashMap<String, String>();\n if (!AppConstants.isGestLogin(getActivity())) {\n params.put(\"iduser\", SharedPref.getInstance().getStringVlue(getActivity(), userId));\n } else {\n params.put(\"iduser\", \"0\");\n }\n\n params.put(\"latitude\", \"\" + mGpsTracker.getLatitude());\n params.put(\"longitude\", \"\" + mGpsTracker.getLongitude());\n RequestHandler.getInstance().stringRequestVolley(getActivity(), AppConstants.getBaseUrl(SharedPref.getInstance().getBooleanValue(getActivity(), isStaging)) + updatelocation, params, this, 5);\n fade1.cancel();\n } else {\n mGpsTracker.showInvalidLocationAlert();\n }\n } else {\n showSettingsAlert(5);\n }\n } else {\n Utility.showInternetError(getActivity());\n }\n\n }", "public void getLocation() {\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n } else {\n mFusedLocationClient.getLastLocation().addOnSuccessListener(\n location -> {\n if (location != null) {\n // Start the reverse geocode AsyncTask\n new FetchAddressTask(DetailsTextActivity.this,\n DetailsTextActivity.this).execute(location);\n txtLocation.setText(getString(R.string.loading));\n Log.d(\"myTag\", \"have location\");\n } else {\n txtLocation.setText(R.string.no_location);\n }\n }\n );\n }\n }", "public void onLocationChanged(Location location) {\r\n currentLocation = new GeoPoint(location);\r\n DatabaseInteractor.sendPosition(act, PreferenceData.getUserId(act), currentLocation.getLatitude(), currentLocation.getLongitude());\r\n\t\tguidoMap.showMyLocation();\r\n }", "@Override\n\t\tpublic void onReceivePoi(BDLocation location) {\n\t\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n loc = location;\n getAddressFromLocation(loc.getLatitude(), loc.getLongitude());\n\n }\n }", "public LocationData(Location loc)\n {\n update(loc);\n }", "private void getlocation() {\n\t\t\t\ttry {\n\n\t\t\t\t\tgps = new GPSTracker(RegisterActivity.this);\n\t\t\t\t\tLog.d(\"LOgggg\", \"inCurrentlocation\");\n\n\t\t\t\t\t// check if GPS enabled\n\t\t\t\t\tif (gps.canGetLocation()) {\n\n\t\t\t\t\t\tlatitude = gps.getLatitude();\n\t\t\t\t\t\tlongitude = gps.getLongitude();\n\n\t\t\t\t\t\tLog.i(\"latitude\", \"\" + latitude);\n\t\t\t\t\t\tLog.i(\"longitude\", \"\" + longitude);\n\n\t\t\t\t\t\tnew getLoc().execute(\"\");\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgps.showSettingsAlert();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n Toast.makeText(MainActivity.this,\n location.toString(),Toast.LENGTH_LONG).show();\n }\n else{\n Toast.makeText(MainActivity.this,\n \"Location object not received\",Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n String message = intent.getStringExtra(\"Status\");\n Bundle b = intent.getBundleExtra(\"Location\");\n lastKnownLoc = (Location) b.getParcelable(\"Location\");\n if (lastKnownLoc != null) {\n latitude = String.valueOf(lastKnownLoc.getLatitude());\n longitude = String.valueOf(lastKnownLoc.getLongitude());\n\n }\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n Toast.makeText(getContext(), \"location: \" + location, Toast.LENGTH_LONG).show();\n EventBus.getDefault().post(new LocationEvent(location));\n }\n }", "@Override\n\tpublic void onLocationChanged(Location loc)\n\t{\n\t}", "@Override\n public void onDataChanged(DataEventBuffer dataEventBuffer) {\n for (DataEvent event : dataEventBuffer) {\n if (event.getType() == DataEvent.TYPE_CHANGED) {\n // DataItem changed\n DataItem item = event.getDataItem();\n if (item.getUri().getPath().compareTo(\"/latlnglist\") == 0) {\n\n DataMap dataMap = DataMapItem.fromDataItem(item).getDataMap();\n\n Log.d(\"hudwear\", \"new data, sending message to handler\");\n\n Message m = new Message();\n Bundle b = new Bundle();\n b.putDouble(\"latitude\", dataMap.getDouble(\"latitude\"));\n b.putDouble(\"longitude\", dataMap.getDouble(\"longitude\"));\n m.setData(b);\n handler.sendMessage(m);\n }\n\n } else if (event.getType() == DataEvent.TYPE_DELETED) {\n // DataItem deleted\n }\n }\n }", "@Override\n public void Handle() {\n fusedLocationClient = LocationServices.getFusedLocationProviderClient(context);\n\n // Fetch the last location\n fusedLocationClient.getLastLocation()\n .addOnSuccessListener((Activity) context, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n // Logic to handle location object\n Map<String, Double> latlng = new HashMap<String, Double>();\n latlng.put(\"longitude\", location.getLongitude());\n latlng.put(\"latitude\", location.getLatitude());\n Log.d(\"Location\", \"Location retreived \" + latlng.toString());\n result.success(latlng);\n } else {\n Log.d(\"Location\", \"unable to retreive location\");\n result.success(null);\n }\n }\n });\n }", "public void onLocationChanged(Location location) {\n \n \t}", "public void onSuccess(Location location) {\n if (location != null) {\n //onLocationChanged(location);\n }\n }", "public byte[] getLocation() {\r\n return location;\r\n }", "public void onLocationChanged(Location location) {\n }", "@Override\n public void onConnected(Bundle arg0) {\n mLastLocation=locationHelper.getLocation();\n }", "public String getLocation(){\n return this.location;\n }" ]
[ "0.713382", "0.7093146", "0.70930594", "0.70930594", "0.6922424", "0.6901475", "0.68911076", "0.6887811", "0.68403774", "0.68376344", "0.6743193", "0.67335135", "0.67045635", "0.6656822", "0.6642936", "0.6632277", "0.66312045", "0.66230476", "0.66158974", "0.66088617", "0.6592221", "0.6589464", "0.6575568", "0.65496415", "0.6536986", "0.6529148", "0.6486269", "0.6483571", "0.64644486", "0.6460513", "0.6455669", "0.6434554", "0.6431765", "0.64147955", "0.641386", "0.6412962", "0.6383202", "0.6381928", "0.63687015", "0.63653743", "0.63643897", "0.6360585", "0.6360585", "0.6355864", "0.6349665", "0.6337803", "0.63325393", "0.633018", "0.63287383", "0.63239187", "0.6322403", "0.63086444", "0.6308612", "0.63005245", "0.6298728", "0.6295732", "0.62920177", "0.62885714", "0.62814325", "0.62783813", "0.6278019", "0.6277949", "0.6275331", "0.6271795", "0.6266749", "0.6266365", "0.6265092", "0.6264203", "0.6262499", "0.6262157", "0.6257238", "0.6255383", "0.6225382", "0.6220587", "0.6210382", "0.62094134", "0.6199935", "0.619978", "0.6197859", "0.6189794", "0.618233", "0.6179346", "0.61734134", "0.6166721", "0.6163748", "0.61616415", "0.6159146", "0.6156163", "0.6155787", "0.61503106", "0.61448765", "0.6143902", "0.6143092", "0.6131508", "0.61305034", "0.61241716", "0.6120054", "0.61163205", "0.61143726" ]
0.6115328
98
Load the proper sounds from the audiomanager
public Gun(AppStateManager stateManager) { super(stateManager); AudioManager am = stateManager.getState(GameManager.class).getUtilityManager().getAudioManager(); gunShot = am.getSound("Gunshot"); reload = am.getSound("Reloading"); gunControl = new GunControl(this, stateManager); addControl(gunControl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void loadSounds() {\n\t\ttry {\n\t\t\tSoundPlayer.load(\"bounce.wav\");\n\t\t\tSoundPlayer.load(\"laser1.wav\");\n\t\t\tSoundPlayer.load(\"hit1.wav\");\n\t\t\tSoundPlayer.load(\"speedup.wav\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "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 initSounds() {\n\n\n\t}", "public static void loadSounds()\n {\n combust = new SoundLoader(\"explosion.wav\");\n zWalk = new SoundLoader(\"zWalk.wav\");\n bite = new SoundLoader(\"zBite.wav\");\n hitObst = new SoundLoader(\"zHitObst.wav\");\n runSound = new SoundLoader(\"pRunSound.wav\");\n walkSound = new SoundLoader(\"pWalkSound.wav\");\n scream = new SoundLoader(\"pScream.wav\");\n\n zWalk.makeBalanceControlled();\n hitObst.makeBalanceControlled();\n\n }", "public void initializeSounds() {\r\n\t\ttry {\r\n\t\t\tsound a = new sound();\r\n\r\n\t\t\t// Fire sound effect\r\n\t\t\tclipFire = a.getSound();\r\n\t\t\tstreamFire = a.getStream();\r\n\r\n\t\t\t// Shooting sound effect\r\n\t\t\tclipShoot = a.getSound2();\r\n\t\t\tstreamShoot = a.getStream2();\r\n\r\n\t\t\t// Sound when an alien is destroyed\r\n\t\t\tclipAlienDestroyed = a.getSoundAlienDestroyed();\r\n\t\t\tstreamAlienDestroyed = a.getStreamAlienDestroyed();\r\n\r\n\t\t\t// Sound when a ship has been destroyed\r\n\t\t\tclipShip = a.getSoundShip();\r\n\t\t\tstreamShip = a.getStreamShip();\r\n\r\n\t\t\t// Sound when an asteroid has been destroyed\r\n\t\t\tclipAsteroid = a.getSoundAsteroid();\r\n\t\t\tstreamAsteroid = a.getStreamAsteroid();\r\n\r\n\t\t\t// Sound when AlienShip appears\r\n\t\t\tclipAlienShip = a.getClipAlienShip();\r\n\t\t\tstreamAlienShip = a.getStreamAlienShip();\r\n\r\n\t\t\t// Open the sound clips\r\n\t\t\tclipFire.open(streamFire);\r\n\t\t\tclipShoot.open(streamShoot);\r\n\t\t\tclipAlienDestroyed.open(streamAlienDestroyed);\r\n\t\t\tclipShip.open(streamShip);\r\n\t\t\tclipAsteroid.open(streamAsteroid);\r\n\t\t\tclipAlienShip.open(streamAlienShip);\r\n\t\t} catch (NullPointerException e) {\r\n\t\t} catch (LineUnavailableException f) {\r\n\t\t} catch (UnsupportedAudioFileException f) {\r\n\t\t} catch (IOException f) {\r\n\t\t}\r\n\r\n\t}", "public abstract SoundContainer loadSound( String filename ) throws IOException;", "void InitSound() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n //Use the newer SoundPool.Builder\n //Set the audio attributes, SONIFICATION is for interaction events\n //uses builder pattern\n AudioAttributes aa = new AudioAttributes.Builder()\n .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)\n .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)\n .build();\n\n //default max streams is 1\n //also uses builder pattern\n dice_sound= new SoundPool.Builder().setAudioAttributes(aa).build();\n\n } else {\n // Running on device earlier than Lollipop\n //Use the older SoundPool constructor\n dice_sound=PreLollipopSoundPool.NewSoundPool();\n }\n //Load the dice sound\n sound_id=dice_sound.load(this,R.raw.shake_dice,1);\n alarm_sound_id=dice_sound.load(this,R.raw.on_time,1);\n }", "public Sound loadSound(String file);", "public void initMusic() {\r\n mSoundPool = new SoundPool(3, AudioManager.STREAM_MUSIC, 0);\r\n mSoundClick = mSoundPool.load(getActivity(), R.raw.click, 1);\r\n mSoundCorrect = mSoundPool.load(getActivity(), R.raw.correct, 1);\r\n mSoundIncorrect = mSoundPool.load(getActivity(), R.raw.wrong, 1);\r\n }", "public void registerSounds()\n {\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}", "@Override\r\n public void loadPianoAudioStart() {\n }", "public abstract SoundContainer loadSound( InputStream in ) throws IOException;", "@SuppressWarnings(\"deprecation\")\n\tpublic static void load_sound() throws NoPlayerException, CannotRealizeException, IOException {\n\n\t\tFile clicFile = new File(\"sons/click.wav\");\n\t\tURL clicUrl = clicFile.toURL();\n\n\t\tFile portailFile = new File(\"sons/portail_low.wav\");\n\t\tURL portailUrl = portailFile.toURL();\n\n\t\tFile hitFile = new File(\"sons/hit_low.wav\");\n\t\tURL hitUrl = hitFile.toURL();\n\n\t\tFile chargeFile = new File(\"sons/charge.wav\");\n\t\tURL chargeUrl = chargeFile.toURL();\n\n\t\tFile popFile = new File(\"sons/pop.wav\");\n\t\tURL popUrl = popFile.toURL();\n\n\t\tFile gameFile = new File(\"sons/game_all.wav\");\n\t\tURL gameUrl = gameFile.toURL();\n\n\t\t// creation of the players\n\t\tm_player_game = Manager.createRealizedPlayer(gameUrl);\n\t\tm_player_pop = Manager.createRealizedPlayer(popUrl);\n\t\tm_player_charge = Manager.createRealizedPlayer(chargeUrl);\n\t\tm_player_hit = Manager.createRealizedPlayer(hitUrl);\n\t\tm_player_hit2 = Manager.createRealizedPlayer(hitUrl);\n\t\tm_player_hit3 = Manager.createRealizedPlayer(hitUrl);\n\t\tm_player_hit4 = Manager.createRealizedPlayer(hitUrl);\n\t\tm_player_hit5 = Manager.createRealizedPlayer(hitUrl);\n\t\tm_player_hit6 = Manager.createRealizedPlayer(hitUrl);\n\t\tm_player_clic = Manager.createRealizedPlayer(clicUrl);\n\t\tm_player_portail = Manager.createRealizedPlayer(portailUrl);\n\t}", "protected void muteSounds()\n {\n if(confused.isPlaying())\n confused.stop();\n }", "public abstract SoundContainer loadSound( URL url ) throws IOException;", "public void UpdateSounds(mobj_t listener);", "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 }", "private void playHintAudio() {\n AudioManager audioManager = (AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);\n int mode = audioManager.getRingerMode();\n Log.d(TAG,\"mode = \" + mode);\n\n if(mode != AudioManager.RINGER_MODE_SILENT && mode != AudioManager.RINGER_MODE_VIBRATE) {\n // prize modify for bug 44603 by zhaojian 20171205 start\n mMediaPlayer = MediaPlayer.create(getContext(),R.raw.hb_sound2);\n Log.d(\"debug\",\"isNotifySound = \" + getConfig().isNotifySound());\n if(getConfig().isNotifySound()) {\n mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n @Override\n public void onPrepared(MediaPlayer mp) {\n mp.start();\n }\n });\n mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n mp.release();\n }\n });\n mMediaPlayer.start();\n }\n // prize modify for bug 44603 by zhaojian 20171205 end\n }\n }", "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 }", "private void setUpSound() {\n\t\tAssetManager am = getActivity().getAssets();\n\t\t// activity only stuff\n\t\tgetActivity().setVolumeControlStream(AudioManager.STREAM_MUSIC);\n\n\t\tAudioManager audioManager = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);\n\t\tsp = new SPPlayer(am, audioManager);\n\t}", "static void soundsEZ() {\n\t\tapplauseSound = EZ.addSound(\"applause.wav\");\n\t\twallSound = EZ.addSound(\"stone1.wav\");\n\t\tdiamondSound = EZ.addSound(\"glass1.wav\");\n\t}", "PlaySound getSound();", "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 }", "public static void load() {\n\n\t\ttry {\n\t\t\t// Insert audio load ex:\n\t\t\tmusicMap.put(\"music\", new Music(\"res/menuMusic.wav\"));\n\t\t} catch (SlickException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void playAudio() {\r\n Play.au(audioFileName, false);\r\n }", "public void load () {\n hasSoundOn = preference.getBoolean(\"sound effect\", true);\n hasMusicOn = preference.getBoolean(\"background music\", true);\n soundVolume = MathUtils.clamp(preference.getFloat(\"sound volume\", 0.5f), 0.0f, 1.0f);\n musicVolume = MathUtils.clamp(preference.getFloat(\"music volume\", 0.5f), 0.0f, 1.0f);\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 foodSound(){\n if (enableSound){\r\n\t clip.play();\r\n }\r\n\t\t\r\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 }", "public String getSound();", "protected void playSounds()\n\t{\n\t\tint x;\n\t\ttry\n\t\t{\n\t\t\tswitch(MySurfaceView.vicCount)\n\t\t\t{\n\t\t\tcase 0:\n\t\t\t\tmBackgroundSound.execute();\n\t\t\t\tmBackgroundSound5.foo();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif(mega==false)\n\t\t\t\t{\n\t\t\t\t\tmega=true;\n\t\t\t\t\tlevelplayer = MediaPlayer.create(MainActivity.this, R.raw.levemega);\n\t\t\t\t\tlevelplayer.setLooping(false);\n\t\t\t\t\tlevelplayer.start();\n\t\t\t\t}\n\t\t\t\tx = mBackgroundSound.getTime();\n\t\t\t\tmBackgroundSound.foo();\n\t\t\t\tmBackgroundSound2.execute();\n\t\t\t\tmBackgroundSound2.fastF(x);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(superr==false)\n\t\t\t\t{\n\t\t\t\t\tsuperr=true;\n\t\t\t\t\tlevelplayer = MediaPlayer.create(MainActivity.this, R.raw.levelsuper);\n\t\t\t\t\tlevelplayer.setLooping(false);\n\t\t\t\t\tlevelplayer.start();\n\t\t\t\t}\n\t\t\t\tx = mBackgroundSound2.getTime();\n\t\t\t\tmBackgroundSound2.foo();\n\t\t\t\tmBackgroundSound3.execute();\n\t\t\t\tmBackgroundSound3.fastF(x);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif(ultra==false)\n\t\t\t\t{\n\t\t\t\t\tultra=true;\n\t\t\t\t\tlevelplayer = MediaPlayer.create(MainActivity.this, R.raw.levelultra);\n\t\t\t\t\tlevelplayer.setLooping(false);\n\t\t\t\t\tlevelplayer.start();\n\t\t\t\t}\n\t\t\t\tx = mBackgroundSound3.getTime();\n\t\t\t\tmBackgroundSound3.foo();\n\t\t\t\tmBackgroundSound4.execute();\n\t\t\t\tmBackgroundSound4.fastF(x);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tif(extra==false)\n\t\t\t\t{\n\t\t\t\t\textra=true;\n\t\t\t\t\tlevelplayer = MediaPlayer.create(MainActivity.this, R.raw.levelextra);\n\t\t\t\t\tlevelplayer.setLooping(false);\n\t\t\t\t\tlevelplayer.start();\n\t\t\t\t}\n\t\t\t\tx = mBackgroundSound4.getTime();\n\t\t\t\tmBackgroundSound4.foo();\n\t\t\t\tmBackgroundSound5.execute();\n\t\t\t\tmBackgroundSound5.fastF(x);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tcatch (IllegalStateException ise)\n\t\t{\n\n\t\t}\n\t}", "@Override\r\n public void loadPianoAudioFinish() {\n }", "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 }", "public void reloadSoundDevices();", "public abstract String play(SoundLibrary library, String... sound);", "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}", "protected void loadMockData() {\n\n int ctr;\n InputStream inputStream = getResources().openRawResource(R.raw.song_list);\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n\n try {\n ctr = inputStream.read();\n while (ctr != -1) {\n byteArrayOutputStream.write(ctr);\n ctr = inputStream.read();\n }\n inputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Parse the data.\n try {\n JSONObject jObject = new JSONObject(byteArrayOutputStream.toString());\n\n String status_code = jObject.getString(\"statusCode\");\n\n if (status_code.equalsIgnoreCase(\"200\")) {\n JSONArray jArray = jObject.getJSONArray(\"data\");\n\n audioList = new ArrayList<>();\n\n for (int i = 0; i < jArray.length(); i++) {\n JSONObject song = jArray.getJSONObject(i);\n\n String genre = song.getString(\"genre\");\n String album = song.getString(\"album\");\n String author = song.getString(\"author\");\n String title = song.getString(\"title\");\n String url = song.getString(\"url\");\n String imgUrl = song.getString(\"img\");\n\n Audio audio = new Audio(genre, album, author, title, url, imgUrl);\n\n // Save to audioList.\n audioList.add(audio);\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void playSound(int soundId) {\n\n }", "abstract public String getSoundResourcesDir();", "public static void Init() throws UnsupportedAudioFileException, IOException, LineUnavailableException {\n enemyHurt = new SoundEffect(\"/sounds/enemy_hurt.wav\");\n dragonShoot = new SoundEffect(\"/sounds/dragon_shoot.wav\");\n enemySpawn = new SoundEffect(\"/sounds/enemy_spawn.wav\");\n fireShoot = new SoundEffect(\"/sounds/fire_shoot.wav\");\n frostShoot = new SoundEffect(\"/sounds/frost_shoot.wav\");\n arcaneShoot = new SoundEffect(\"/sounds/arcane_shoot.wav\");\n winSFX = new SoundEffect(\"/sounds/win_sfx.wav\");\n oof = new SoundEffect(\"/sounds/oof.wav\");\n buttonPress = new SoundEffect(\"/sounds/button_press.wav\");\n }", "private void loadShutterSound(Context context) {\n // get system stream type using reflection\n int streamType;\n try {\n Class<?> audioSystemClass = Class.forName(\"android.media.AudioSystem\");\n Field sseField = audioSystemClass.getDeclaredField(\"STREAM_SYSTEM_ENFORCED\");\n streamType = sseField.getInt(null);\n } catch (Exception e) {\n streamType = AudioManager.STREAM_SYSTEM; // set appropriate according to your app policy\n }\n if (mSoundPool != null) {\n try {\n mSoundPool.release();\n } catch (Exception ignored) {\n }\n mSoundPool = null;\n }\n // load shutter sound from resource\n mSoundPool = new SoundPool(2, streamType, 0);\n mSoundId = mSoundPool.load(context, R.raw.camera_click, 1);\n }", "private void setSounds(Intent intent){\n\n\t\tsoundArray = new int[sounds.length];\n\t\tint i=0;\n\t\tfor (String sound : sounds) {\n\t\t\tString value = intent.getStringExtra(sound);\n\t\t\tint id = mContext.getResources().getIdentifier(value, \"raw\", mContext.getPackageName());\n\t\t\tsoundArray[i++] = soundPool.load(mContext, id, 1);\n\t\t}\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 stopAllSounds() {\n/* 218 */ if (this.loaded) {\n/* */ \n/* 220 */ for (String s : this.playingSounds.keySet())\n/* */ {\n/* 222 */ this.sndSystem.stop(s);\n/* */ }\n/* */ \n/* 225 */ this.playingSounds.clear();\n/* 226 */ this.delayedSounds.clear();\n/* 227 */ this.tickableSounds.clear();\n/* 228 */ this.categorySounds.clear();\n/* 229 */ this.playingSoundsStopTime.clear();\n/* */ } \n/* */ }", "public void playLocal(String audiofile);", "public void playSoundPoolSound(String name) {\r\n\t\tfor ( int i = 0 ; i < soundPoolSoundNames.size() ; i++ ) {\r\n\t\t\tif ( soundPoolSoundNames.get(i).equals( name ) ) {\r\n\t\t\t\tsoundPool.play( soundPoolSoundIds.get( i ), 1.0f, 1.0f, 1, 0, 1 );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tLog.d(TAG, \"playSoundPoolSound: loading \"+name);\r\n\t\t\r\n\t\t// check first if this is a raw resource\r\n\t\tint soundId = 0;\r\n\t\tif ( name.indexOf( \"res/raw/\" ) == 0 ) {\r\n\t\t\tString resourceName = name.substring( 4, name.length() - 4 );\r\n\t\t\tint id = getResources().getIdentifier( resourceName, \"raw\", getPackageName() );\r\n\t\t\tif ( id == 0 ) {\r\n\t\t\t\tLog.e( TAG, \"No resource named \" + resourceName );\r\n\t\t\t} else {\r\n\t\t\t\tAssetFileDescriptor afd = getResources().openRawResourceFd( id );\r\n\t\t\t\tsoundId = soundPool.load( afd, 1 );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tAssetFileDescriptor afd = getAssets().openFd( name );\r\n\t\t\t\tsoundId = soundPool.load( afd, 1 );\r\n\t\t\t} catch ( IOException t ) {\r\n\t\t\t\tLog.e( TAG, \"Couldn't open \" + name + \" because \" + t.getMessage() );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( soundId == 0 )\r\n\t\t{\r\n\t\t\t// Try to load the sound directly - works for absolute path - for wav files for sdcard for ex.\r\n\t\t\tsoundId = soundPool.load( name, 1 );\r\n\t\t}\r\n\r\n\t\tsoundPoolSoundNames.add( name );\r\n\t\tsoundPoolSoundIds.add( soundId );\r\n\t\t\r\n\t\tsoundPool.play( soundPoolSoundIds.get( soundPoolSoundNames.size() - 1 ), 1.0f, 1.0f, 1, 0, 1 );\r\n\t}", "private void playSound() {\n if (isFlashOn) {\n mp = MediaPlayer.create(this, R.raw.light_switch_off);\n } else {\n mp = MediaPlayer.create(this, R.raw.light_switch_on);\n }\n mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n\n @Override\n public void onCompletion(MediaPlayer mp) {\n // TODO Auto-generated method stub\n mp.release();\n }\n });\n mp.start();\n }", "public void getMedia() {\n\tif (sound != null && soundData == null) {\n\t soundData = parent.getAudioClip(sound);\n\t}\n\tif (soundData == null) {\n\t System.out.println(\"SoundArea: Unable to load data \"+sound);\n\t}\n\tisReady = true;\n }", "public DataSource getAudioSource();", "private void gameSound(int attack){\n switch (attack){\n case 1:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_lightattack);\n break;\n case 2:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_strongattack);\n break;\n case 3:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_brutalattack);\n break;\n }\n mediaPlayer.start();\n }", "abstract public void setSoundResourcesDir(String path);", "void setupSounds() {\n soundSwitch = new Switch(Switch.CHILD_NONE);\n soundSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);\n\n // Set up the sound media container\n java.net.URL soundURL = null;\n String soundFile = \"res/sounds/Get_up_on_your_feet_mixdown2.wav\";\n try {\n soundURL = new java.net.URL(codeBaseString + soundFile);\n } catch (java.net.MalformedURLException ex) {\n System.out.println(ex.getMessage());\n System.exit(1);\n }\n if (soundURL == null) { // application, try file URL\n try {\n soundURL = new java.net.URL(\"file:./\" + soundFile);\n } catch (java.net.MalformedURLException ex) {\n System.out.println(ex.getMessage());\n System.exit(1);\n }\n }\n //System.out.println(\"soundURL = \" + soundURL);\n MediaContainer soundMC = new MediaContainer(soundURL);\n\n // set up the Background Sound\n soundBackground = new BackgroundSound();\n soundBackground.setCapability(Sound.ALLOW_ENABLE_WRITE);\n soundBackground.setSoundData(soundMC);\n soundBackground.setSchedulingBounds(infiniteBounds);\n soundBackground.setEnable(false);\n soundBackground.setLoop(Sound.INFINITE_LOOPS);\n soundSwitch.addChild(soundBackground);\n\n // set up the point sound\n soundPoint = new PointSound();\n soundPoint.setCapability(Sound.ALLOW_ENABLE_WRITE);\n soundPoint.setSoundData(soundMC);\n soundPoint.setSchedulingBounds(infiniteBounds);\n soundPoint.setEnable(false);\n soundPoint.setLoop(Sound.INFINITE_LOOPS);\n soundPoint.setPosition(-5.0f, 5.0f, 0.0f);\n Point2f[] distGain = new Point2f[2];\n // set the attenuation to linearly decrease volume from max at\n // source to 0 at a distance of 15m\n distGain[0] = new Point2f(0.0f, 1.0f);\n distGain[1] = new Point2f(15.0f, 0.0f);\n soundPoint.setDistanceGain(distGain);\n soundSwitch.addChild(soundPoint);\n\n // Create the chooser GUI\n String[] soundNames = { \"None\", \"Background\", \"Point\", };\n\n soundChooser = new IntChooser(\"Sound:\", soundNames);\n soundChooser.addIntListener(new IntListener() {\n public void intChanged(IntEvent event) {\n int value = event.getValue();\n // Should just be able to use setWhichChild on\n // soundSwitch, have to explictly enable/disable due to\n // bug.\n switch (value) {\n case 0:\n soundSwitch.setWhichChild(Switch.CHILD_NONE);\n soundBackground.setEnable(false);\n soundPoint.setEnable(false);\n break;\n case 1:\n soundSwitch.setWhichChild(0);\n soundBackground.setEnable(true);\n soundPoint.setEnable(false);\n break;\n case 2:\n soundSwitch.setWhichChild(1);\n soundBackground.setEnable(false);\n soundPoint.setEnable(true);\n break;\n }\n }\n });\n soundChooser.setValue(Switch.CHILD_NONE);\n\n }", "private ArrayList<MediaPlayer> loadSoundClips(ArrayList<MediaPlayer> mediaPlayerList) {\n Field[] fields = R.raw.class.getFields();\n\n for (Field field : fields) {\n try {\n int rawResourceId = field.getInt(null);\n mediaPlayerList.add(MediaPlayer.create(MainActivity.this, rawResourceId));\n Log.d(\"DEBUG\", String.format(\"%s is %d\", field.getName(), rawResourceId));\n } catch(IllegalAccessException e) {\n Log.e(\"ERROR\", String.format(\"%s threw IllegalAccessException\", field.getName()));\n } catch(IllegalArgumentException e) {\n Log.e(\"ERROR\", String.format(\"%s threw IllegalArgumentException\", field.getName()));\n }\n }\n\n return mediaPlayerList;\n }", "private void playSound() {\n\t\tif (controllerVars.isLoaded() && !controllerVars.isPlays()) {\n\t\t\tcontrollerVars.getSoundPool().play(controllerVars.getSoundID(), controllerVars.getVolume(), controllerVars.getVolume(), 1, 0, 1f);\n\t\t\tcontrollerVars.COUNTER++;\n\t\t\t//Toast.makeText(act, \"Played sound\", Toast.LENGTH_SHORT).show();optional Playing message \n\t\t\tcontrollerVars.setPlays(true);\n\t\t\tonComplete(controllerVars.getMediaPlayer().getDuration());\n\t\t}\n\t\t//controllerVars.getMediaPlayer().start();\n\t\t//controllerVars.setPlays(true);\n\t}", "private static void playAudio(String musicFile) {\n }", "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 }", "public void playGoombaSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, GOOMBA);\n\t}", "@Override\n public void onClick(View v) {\n if(mMediaPlayer==null){\n mMediaPlayer=new MediaPlayer();\n mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n try {\n mMediaPlayer.setDataSource(getPath());\n mMediaPlayer.prepare();\n mMediaPlayer.start();\n } catch (IllegalArgumentException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (SecurityException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IllegalStateException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n } else {\n mMediaPlayer.release();\n mMediaPlayer = null;\n }\n }", "public interface Sounds {\n// void add();\n void setBackgroundSound(String filepath, LoadMode loadMode);\n void setSound(String key, String filepath, LoadMode loadMode);\n void play();\n void play(String key);\n void pause();\n void resume();\n void clearAll();\n}", "public GameSoundPlayer() {\r\n mainThemeSoundPlayer = new SoundPlayer(\"src/main/resources/sounds/menu.mp3\", 0.7, -1);\r\n newGameThemeSoundPlayer = new SoundPlayer(\"src/main/resources/sounds/newMenu.mp3\", 1, 1);\r\n\r\n playBack1 = new SoundPlayer(\"src/main/resources/sounds/play1.mp3\", 1, -1);\r\n playBack2 = new SoundPlayer(\"src/main/resources/sounds/play2.mp3\", 1, -1);\r\n playBack3 = new SoundPlayer(\"src/main/resources/sounds/play3.mp3\", 1, -1);\r\n playBack4 = new SoundPlayer(\"src/main/resources/sounds/play4.mp3\", 1, -1);\r\n playBack5 = new SoundPlayer(\"src/main/resources/sounds/play5.mp3\", 1, -1);\r\n endGame = new SoundPlayer(\"src/main/resources/sounds/endGame.mp3\", 1, 1);\r\n\r\n for (BONUSES_SOUNDS sound : BONUSES_SOUNDS.values()) {\r\n switch (sound) {\r\n case ALLDIE:\r\n allDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case EXTRASPEED:\r\n extraSpeedPlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case MAKESLOWER:\r\n makeSlowerPlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONUSFIRE:\r\n bonusFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONUSJUMP:\r\n bonusJumpPlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONUSJUMPSTART:\r\n jumpStartPlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n }\r\n }\r\n for (FIRE_SOUNDS sound : FIRE_SOUNDS.values()) {\r\n switch (sound) {\r\n case DARK:\r\n darkFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case FENIX:\r\n fenixFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONE:\r\n boneFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case GHOST:\r\n ghostFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case ARCHANGEL:\r\n archFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BEHEMOTH:\r\n begemFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case CHAMPION:\r\n champFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case PEGASUS:\r\n pegasFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case THUNDERBIRD:\r\n thunderFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case TROGLODYTE:\r\n troglFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n }\r\n }\r\n for (DIE_SOUNDS sound : DIE_SOUNDS.values()) {\r\n switch (sound) {\r\n case DARK:\r\n darkDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case FENIX:\r\n fenixDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONE:\r\n boneDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case GHOST:\r\n ghostDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case ARCHANGEL:\r\n archDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BEHEMOTH:\r\n begemDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case CHAMPION:\r\n champDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case PEGASUS:\r\n pegasDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case THUNDERBIRD:\r\n thunderDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case TROGLODYTE:\r\n troglDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n }\r\n }\r\n }", "void play(final Context context, final int soundId, final OnCompletionPlayNextListener playNextListener);", "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 }", "abstract String getSound();", "public void load(int soundID) {\n System.out.println(\"LoadSound: \" + soundID);\n String aFilename = getSoundName(soundID);\n if (aFilename == null) \n {\n return;\n }\n \n Player player = null;\n try {\n // Create the player.\n if (mSoundData[soundID] == null) {\n InputStream is = getClass().getResourceAsStream(\"/sounds/\" + aFilename);\n\n if (is == null) {\n int kk = 0;\n }\n mSoundData[soundID] = new byte[is.available()];\n\n\n is.read(mSoundData[soundID]);\n is.close();\n }\n } catch (Throwable e) {\n e.printStackTrace();\n }\n }", "public static void InitLoadAudioCtl() {\n LoadCurAudioVolume();\r\n // Get Current Audio Balance\r\n LoadCurAudioBalance();\r\n\r\n // Get Current Supper Bass Switch\r\n LoadCurAudioSupperBassSwitch();\r\n // Get Current Supper Bass Volume\r\n LoadCurAudioSupperBassVolume();\r\n\r\n SetAudioMainVolume();\r\n\r\n // Get Current SRSSurround\r\n LoadCurAudioSrsSurround();\r\n\r\n // Get Current SRS DialogClarity\r\n LoadCurAudioSrsDialogClarity();\r\n\r\n // Get Current SRS TruBass\r\n LoadCurAudioSrsTruBass();\r\n\r\n // Get Current Audio Sound Mode\r\n LoadCurAudioSoundMode();\r\n LoadCurAudioWallEffect();\r\n // Get Custom Audio Bass and Treble\r\n LoadCustomBassVolume();\r\n LoadCustomTrebleVolume();\r\n if (disableEQ) {\r\n SetSpecialModeBTVolume(GetCurAudioSoundMode());\r\n } else {\r\n // Load Custom EQ Gain Values\r\n LoadCustomEQGain(GetEQMinGainVal(), GetEQMaxGainVal());\r\n SetSpecialModeEQGain(GetCurAudioSoundMode());\r\n SetCurAudioBassVolume(mCurAudioBassVolume);\r\n SetCurAudioTrebleVolume(mCurAudioTrebleVolume);\r\n }\r\n\r\n // Get Current EQ mode\r\n // LoadCurAudioEQMode();\r\n // SetSpecialModeEQGain(GetCurAudioEQMode());\r\n }", "public int createSound(final String path)\n\t{\n\t\tint id=Fs_AudioPlayer.ERR_SOUND_ID;\n\t\n\t\t/* load from absolute path */\n\t\tif(path.startsWith(\"/\"))\n\t\t{\n\t\t\tLog.v(Fs_AudioPlayer.TAG,\"Loading: load sound from Absoulte Path: \"+path);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFile file=new File(path);\n\t\t\t\tif(file.exists())\n\t\t\t\t{\n\t\t\t\t\tid=this.m_soundPool.load(path,1);\n\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tLog.v(Fs_AudioPlayer.TAG,\"Exception:can't load sound from Absoulte Path: \"+path);\n\t\t\t\t/* do nothing */\n\t\t\t}\n\t\t}\n\t\t/* load from external path */\n\t\tdo\n\t\t{\n\t\t\tLog.v(Fs_AudioPlayer.TAG,\"Loading: load sound from External Path: \"+path);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFile file=new File(Fs_Application.getExternalDir()+path);\n\t\t\t\tif(file.exists())\n\t\t\t\t{\n\t\t\t\t\tid=this.m_soundPool.load(Fs_Application.getExternalDir()+path,1);\n\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tLog.v(Fs_AudioPlayer.TAG,\"Exception:can't load sound from External Path: \"+path);\n\t\t\t\t/* do nothing */\n\t\t\t}\n\t\t\t\n\t\t}while(false);\n\t\t\n\t\tdo \n\t\t{\n\t\t\tLog.v(Fs_AudioPlayer.TAG,\"Loading: load sound from Assets Path: \"+path);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tAssetFileDescriptor fd=this.m_context.getAssets().openFd(path);\n\t\t\t\tid=this.m_soundPool.load(fd,1);\n\t\t\t\treturn id;\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tLog.v(Fs_AudioPlayer.TAG,\"Exception:can't load sound from Assets Path: \"+path);\n\t\t\t\t/* do nothing */\n\t\t\t}\n\t\t}while(false);\n\t\t\n\t\tLog.v(Fs_AudioPlayer.TAG,\"Can't Load Sound From Path:\"+path);\n\t\t\n\t\treturn Fs_AudioPlayer.ERR_SOUND_ID;\n\n\t}", "public static void setSounds() {\r\n\t\tString temp = \"\";\r\n\t\tString[] sa;\r\n\t\tString prefix = \"\";\r\n\t\tString suffix = \"\";\r\n\t\t\r\n\t\tclearSounds();\r\n\t\t\t\t\r\n\t\t//Loop through the entire sounds array list to find all the settings.\r\n\t\tfor (int i = 0; i < sounds.size(); i++) {\r\n\t\t\t//When found, set the variable in main to that string..\r\n\t\t\ttemp = (String) sounds.get(i);\r\n\t\t\tsa = splitString('=', temp);\r\n\r\n\t\t\t//Set the variables to empty if the setting is empty.\r\n\t\t\tif (temp.endsWith(\"=\")) {\r\n\t\t\t\tprefix = sa[0];\r\n\r\n\t\t\t\tif (prefix.equalsIgnoreCase(\"start\")) {\r\n\t\t\t\t\tMain.soundGameStart = \"\";\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"bags\")){\r\n\t\t\t\t\tMain.soundBags = \"\";\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"set\")){\r\n\t\t\t\t\tMain.soundSet = \"\";\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"win\")){\r\n\t\t\t\t\tMain.soundWin = \"\";\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"lose\")){\r\n\t\t\t\t\tMain.soundLose = \"\";\r\n\t\t\t\t}\r\n\t\t\t//Find the properties and set them to the desired values.\r\n\t\t\t} else {\r\n\t\t\t\tprefix = sa[0];\r\n\t\t\t\tsuffix = sa[1];\r\n\t\t\t\r\n\t\t\t\tif (prefix.equalsIgnoreCase(\"start\")) {\r\n\t\t\t\t\tMain.soundGameStart = suffix;\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"bags\")){\r\n\t\t\t\t\tMain.soundBags = suffix;\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"set\")){\r\n\t\t\t\t\tMain.soundSet = suffix;\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"win\")){\r\n\t\t\t\t\tMain.soundWin = suffix;\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"lose\")){\r\n\t\t\t\t\tMain.soundLose = suffix;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void playSound(String sound) {\n\t\t \n\t\t // open the sound file as a Java input stream\n\t\tString soundFile = null;\n\t\tswitch (sound) {\n\t\tcase \"opening\":\n\t\t\tsoundFile = \"ConfigFiles\\\\opening.wav\";\n\t\t\tbreak;\n\t\tcase \"ending\":\n\t\t\tsoundFile = \"ConfigFiles\\\\ending.wav\";\n\t\t\tbreak;\n\t\tcase \"shop\":\n\t\t\tsoundFile = \"ConfigFiles\\\\shop.wav\";\n\t\t\tbreak;\n\t\tcase \"monsterbattle\":\n\t\t\tsoundFile = \"ConfigFiles\\\\monsterbattle.wav\";\n\t\t\tbreak;\n\t\tcase \"battlewin\":\n\t\t\tsoundFile = \"ConfigFiles\\\\monstervictory.wav\";\n\t\t\tbreak;\n\t\tcase \"trainerbattle\":\n\t\t\tsoundFile = \"ConfigFiles\\\\trainerBattle.wav\";\n\t\t\tbreak;\n\t\tcase \"trainerbattlewin\":\n\t\t\tsoundFile = \"ConfigFiles\\\\trainerVictory.wav\";\n\t\t\tbreak;\n\t\tcase \"map\":\n\t\t\tsoundFile = \"ConfigFiles\\\\map.wav\";\n\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\t \n\t\t InputStream in = null;\n\t\t\ttry {\n\t\t\t\tin = new FileInputStream(soundFile);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t \n\t\t\tif(audioStream != null ) {\n\t\t\t\tAudioPlayer.player.stop(audioStream);\n\t\t\t}\n\t\t\t // create an audiostream from the inputstream\n\t\t\ttry {\n\t\t\t\taudioStream = new AudioStream(in);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t // play the audio clip with the audioplayer class\n\t\t\t\n\t\t AudioPlayer.player.start(audioStream);\n\t\t \n\t}", "public void allocate(AssetManager manager, String filename) {\n\t\tSound sound = manager.get(filename, Sound.class);\n\t}", "public void diskAddedsound()\n {\n InputStream pathSoundFile = getClass().getResourceAsStream(\"diskplacement.wav\");\n playSound(pathSoundFile);\n }", "public void playDeadSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, DEAD);\n\t}", "public Sound load(String path)\n\t{\n\t//\tSystem.out.println(\"Loading sound: \" + path);\n\t\t\t\n\t\tSound newSound;\n\t\t\n\t\tif(sounds.containsKey(path))\n\t\t{\n\t\t\tnewSound = sounds.get(path);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnewSound = new Sound(path);\n\t\t\tsounds.put(path,newSound);\n\t\t}\n\t\treturn newSound;\n\t}", "private void play() {\n /** Memanggil File MP3 \"indonesiaraya.mp3\" */\n try {\n mp.prepare();\n } catch (IllegalStateException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n /** Menjalankan Audio */\n mp.start();\n\n /** Penanganan Ketika Suara Berakhir */\n mp.setOnCompletionListener(new OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n stateAwal();\n }\n });\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\t\n\t\tAudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE);\n\t\tfloat actualVolume = (float) audioManager\n\t\t\t\t.getStreamVolume(AudioManager.STREAM_MUSIC);\n\t\tfloat maxVolume = (float) audioManager\n\t\t\t\t.getStreamMaxVolume(AudioManager.STREAM_MUSIC);\n\t\tfloat volume = actualVolume / maxVolume;\n\t\t\n\t\tLog.e(\"Test\", \"isloaded: \" + loaded);\n\t\tif (loaded && (sound == R.id.radioButton_on) && fromAlarm) {\n\t\t\tsoundPool.play(soundID, volume, volume, 1, 0, 1f);\n\t\t\tLog.e(\"Test\", \"Played sound\");\n\t\t}\n\t}", "private synchronized void loadSoundSystem() {\n/* 118 */ if (!this.loaded) {\n/* */ \n/* */ try {\n/* */ \n/* 122 */ (new Thread(new Runnable()\n/* */ {\n/* */ public void run()\n/* */ {\n/* 126 */ SoundSystemConfig.setLogger(new SoundSystemLogger()\n/* */ {\n/* */ public void message(String p_message_1_, int p_message_2_)\n/* */ {\n/* 130 */ if (!p_message_1_.isEmpty())\n/* */ {\n/* 132 */ SoundManager.LOGGER.info(p_message_1_);\n/* */ }\n/* */ }\n/* */ \n/* */ public void importantMessage(String p_importantMessage_1_, int p_importantMessage_2_) {\n/* 137 */ if (!p_importantMessage_1_.isEmpty())\n/* */ {\n/* 139 */ SoundManager.LOGGER.warn(p_importantMessage_1_);\n/* */ }\n/* */ }\n/* */ \n/* */ public void errorMessage(String p_errorMessage_1_, String p_errorMessage_2_, int p_errorMessage_3_) {\n/* 144 */ if (!p_errorMessage_2_.isEmpty()) {\n/* */ \n/* 146 */ SoundManager.LOGGER.error(\"Error in class '{}'\", p_errorMessage_1_);\n/* 147 */ SoundManager.LOGGER.error(p_errorMessage_2_);\n/* */ } \n/* */ }\n/* */ });\n/* 151 */ SoundManager.this.getClass(); SoundManager.this.sndSystem = new SoundManager.SoundSystemStarterThread(null);\n/* 152 */ SoundManager.this.loaded = true;\n/* 153 */ SoundManager.this.sndSystem.setMasterVolume(SoundManager.this.options.getSoundLevel(SoundCategory.MASTER));\n/* 154 */ SoundManager.LOGGER.info(SoundManager.LOG_MARKER, \"Sound engine started\");\n/* */ }\n/* 156 */ }\"Sound Library Loader\")).start();\n/* */ }\n/* 158 */ catch (RuntimeException runtimeexception) {\n/* */ \n/* 160 */ LOGGER.error(LOG_MARKER, \"Error starting SoundSystem. Turning off sounds & music\", runtimeexception);\n/* 161 */ this.options.setSoundLevel(SoundCategory.MASTER, 0.0F);\n/* 162 */ this.options.saveOptions();\n/* */ } \n/* */ }\n/* */ }", "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 static void createSoundsArrList() {\r\n\t\t//Clears the sounds array list.\r\n\t\tsounds.clear();\r\n\t\t\r\n\t\t//Adds all the sound files to the sounds array list.\r\n\t\tsounds.add(\"Start=\" + Main.soundGameStart);\r\n\t\tsounds.add(\"Bags=\" + Main.soundBags);\r\n\t\tsounds.add(\"Set=\" + Main.soundSet);\r\n\t\tsounds.add(\"Win=\" + Main.soundWin);\r\n\t\tsounds.add(\"Lose=\" + Main.soundLose);\r\n\t}", "public Music loadMusic(String fileName);", "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 playAudio() {\n\n }", "@Override\n public void makeSound() {\n\n }", "@Override\n public void makeSound() {\n\n }", "public String getSoundPath();", "public void playSound(File soundFile);", "public Sound createSound(String file);", "public SoundClip chooseSound(Sound sound){\n SoundClip audio = null;\n\n switch(sound){\n case CREDIT:\n audio = createStream(CREDIT_URL);\n break;\n case DEATH:\n audio = createStream(DEATH_URL);\n break;\n case EAT_FRUIT:\n audio = createStream(EAT_FRUIT_URL);\n break;\n case EAT_GHOST:\n audio = createStream(EAT_GHOST_URL);\n break;\n case PAUSE_SOUND:\n audio = createStream(PAUSE_SOUND_URL);\n break;\n case GAME_START:\n audio = createStream(GAME_START_URL);\n break;\n case MUNCH_1:\n audio = createStream(MUNCH_1_URL);\n break;\n case MUNCH_2:\n audio = createStream(MUNCH_2_URL);\n break;\n case FRIGHT_SOUND:\n audio = createStream(FRIGHT_SOUND_URL);\n break;\n case EATEN_SOUND:\n audio = createStream(EATEN_SOUND_URL);\n break;\n case SIREN_1:\n audio = createStream(SIREN_1_URL);\n break;\n case SIREN_2:\n audio = createStream(SIREN_2_URL);\n break;\n case SIREN_3:\n audio = createStream(SIREN_3_URL);\n break;\n case SIREN_4:\n audio = createStream(SIREN_4_URL);\n break;\n case SIREN_5:\n audio = createStream(SIREN_5_URL);\n break;\n case STARTUP:\n audio = createStream(STARTUP_URL);\n break;\n case BLUE_PORTAL_SOUND:\n audio = createStream(BLUE_PORTAL_SOUND_URL);\n break;\n case RED_PORTAL_SOUND:\n audio = createStream(RED_PORTAL_SOUND_URL);\n break;\n }\n audio.setName(sound);\n return audio;\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 void playThemeSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, THEME);\n\t}", "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 void setUpSound() {\n try {\n generateTone();\n setFrequencyLabel();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "private void startPlaying() {\n try {\n mPlayer = new MediaPlayer();\n try {\n mPlayer.setDataSource(audioFile.getAbsolutePath());\n mPlayer.prepare();\n mPlayer.start();\n } catch (IOException e) {\n Log.e(LOG_TAG, \"prepare() failed\");\n }\n showTimer(false);\n } catch (Exception e) {\n logException(e, \"MicManualFragment_startPlaying()\");\n }\n\n }", "public void StartSound(ISoundOrigin origin, int sound_id);", "public void preloadSound(String name) throws ResourceNotFound {\n\t\tif (!m_samples.containsKey(name)) {\n\n\t\t\tint ident = m_context.getResources().getIdentifier(name, \"raw\",\n\t\t\t\t\tm_context.getPackageName());\n\t\t\tif (ident == 0) {\n\t\t\t\tthrow new ResourceNotFound(\"sound \" + name);\n\t\t\t}\n\n\t\t\tint sndId = m_soundPool.load(m_context, ident, 1);\n\t\t\tSample sp = new Sample(sndId);\n\n\t\t\tm_samples.put(name, sp);\n\n\t\t\tJavaLog.info(TAG, \"Sample with name \" + name\n\t\t\t\t\t+ \" has been preloaded\");\n\t\t}\n\t}", "public void playSound(int soundResId, final boolean isLooping, float rightVolume, float leftVolume) {\n try {\n MediaPlayer mp = null;\n if(arrSpFiles != null && arrSpFiles.size() > 0) {\n for(SoundPlayerFile spPlayerFile : arrSpFiles) {\n if(spPlayerFile.soundResId == soundResId) {\n mp = spPlayerFile.mp;\n }\n }\n }\n if(mp == null) {\n mp = MediaPlayer.create(ctx, soundResId);\n mp.setLooping(isLooping);\n mp.setVolume(rightVolume, leftVolume);\n arrSpFiles.add(new SoundPlayerFile(mp, soundResId));\n setMediaPlayerListener(mp, true);\n }\n if(mp.isPlaying()) {\n mp.stop();\n mp.start();\n } else {\n mp.start();\n }\n } catch (Exception e) {\n LogMe.e(TAG, \"playSound ERROR \" + e.toString());\n }\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}", "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}", "private void playSound(@NonNull final String path, @Nullable AssetFileDescriptor assetFileDescriptor) {\n\t\tif (mMode == PLAY_SINGLE) {\n\t\t\tstopAll();\n\t\t}\n\n\t\t// sound already playing\n\t\tif (mMediaMap.containsKey(path)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// stop all currently playing sounds\n\t\tif (mMode == PLAY_SINGLE_CONTINUE) {\n\t\t\tstopAll();\n\t\t}\n\n\t\t// init media player\n\t\tMediaPlayer mediaPlayer;\n\t\ttry {\n\t\t\tmediaPlayer = new MediaPlayer();\n\t\t\tmMediaMap.put(path, mediaPlayer);\n\n\t\t\t// data source\n\t\t\tif (assetFileDescriptor != null) {\n\t\t\t\tmediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor(), assetFileDescriptor.getStartOffset(), assetFileDescriptor.getLength());\n\t\t\t} else {\n\t\t\t\tmediaPlayer.setDataSource(path);\n\t\t\t}\n\n\t\t\tmediaPlayer.prepareAsync();\n\t\t} catch (@NonNull IllegalArgumentException | IllegalStateException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\n\t\t// play sound\n\t\tmediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n\t\t\t@Override\n\t\t\tpublic void onPrepared(@NonNull MediaPlayer mediaPlayer) {\n\t\t\t\tmediaPlayer.start();\n\t\t\t}\n\t\t});\n\n\t\t// release media player\n\t\tmediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n\t\t\t@Override\n\t\t\tpublic void onCompletion(@Nullable MediaPlayer mediaPlayer) {\n\t\t\t\tmMediaMap.remove(path);\n\t\t\t\tif (mediaPlayer != null) {\n\t\t\t\t\tmediaPlayer.release();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void playCameraShootSound()\n {\n AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);\n int volume = audioManager.getStreamVolume( AudioManager.STREAM_NOTIFICATION);\n if (volume > 0) {\n if (mCameraShootPlayer == null) {\n mCameraShootPlayer = MediaPlayer.create(this, Uri.parse(CAMERA_SOUND_FILE));\n }\n if (mCameraShootPlayer != null) {\n mCameraShootPlayer.start();\n }\n }\n }", "public void StartSound(ISoundOrigin origin, sfxenum_t sound_id);", "public void playBeep() {\n // Cách 1: Sử dụng audio có sẵn của android\n// ToneGenerator toneGenerator = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, 500);\n// toneGenerator.startTone(ToneGenerator.TONE_PROP_PROMPT);\n\n // Cách 2: Sử dụng audio của mình\n Uri beepSound = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + File.pathSeparator\n + File.separator + getPackageName() + \"/raw/notifications.mp3\");\n Ringtone ringtone = RingtoneManager.getRingtone(this, beepSound);\n ringtone.play();\n }" ]
[ "0.7982309", "0.76572955", "0.74626523", "0.7420866", "0.73922163", "0.7200148", "0.7199041", "0.7053843", "0.70274734", "0.6825017", "0.67969525", "0.67750543", "0.6771904", "0.6741896", "0.6631146", "0.66281575", "0.6590812", "0.6566668", "0.65542144", "0.6545849", "0.6500405", "0.64934283", "0.6488337", "0.64880073", "0.6477649", "0.6473891", "0.64538467", "0.645092", "0.64467496", "0.642308", "0.64199734", "0.641852", "0.6411488", "0.64039475", "0.6401769", "0.63709486", "0.63550687", "0.63448125", "0.63282406", "0.63233197", "0.6318689", "0.630688", "0.6295467", "0.62884265", "0.6287517", "0.6279984", "0.6274291", "0.6270092", "0.62650573", "0.62579167", "0.6237661", "0.6236032", "0.62341267", "0.6231596", "0.62270206", "0.6224677", "0.62243176", "0.6220122", "0.6215349", "0.6194226", "0.6192537", "0.6189789", "0.61881745", "0.61724865", "0.61627805", "0.6162774", "0.6158611", "0.61483234", "0.6136798", "0.6127646", "0.6123596", "0.61185503", "0.61181307", "0.6115296", "0.61117744", "0.61062324", "0.6102577", "0.61002445", "0.6096254", "0.60898954", "0.6083289", "0.6074182", "0.6074182", "0.6068266", "0.60678166", "0.60639626", "0.6063233", "0.6061444", "0.60548836", "0.60453624", "0.60426736", "0.60406226", "0.602667", "0.60213894", "0.60169786", "0.6004285", "0.5991889", "0.59854484", "0.597569", "0.5975124", "0.5973467" ]
0.0
-1
Initiates the Smoke Particles
public void initModel() { gunControl.initSmoke(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setup() {\n\t\ttestUpdateParticle();\n\t\ttestRemoveOldParticles();\n\t\t\n\t\tif (testUpdateParticle() == true || testRemoveOldParticles() == true) {\n\t\t\tSystem.out.println(\"FAILED\");\n\t\t}\n\t\t\n\t\t// Build a new random field.\n\t\trandGen = new Random();\n\n\t\tpositionX = 400; // middle of the screen (left to right): 400\n\t\tpositionY = 300; // middle of the screen (top to bottom): 300\n\t\tstartColor = Utility.color(23, 141, 235); // blue: Utility.color(23,141,235)\n\t\tendColor = Utility.color(23, 200, 255); // lighter blue: Utility.color(23,200,255)\n\t\t\n\t\t// This array can store 800 particles\n\t\tparticles = new Particle[800];\n\n\t}", "private void spawnStart() {\n\t\tswitch (gameType) {\n\t\t\n\t\t}\n\t\tspawnCloud(10,1,0,0); //spawns base cloud\n\t\tspawnCloud(rng(7,10),6,rng(1,2),rng(2,3)); //spawns first clouds\n\t\tspawnCloud(rng(9,12),6,rng(1,2),rng(2,3));\n\t\t//spawnCloud(10,6,16,0);\n\t}", "Particles particles();", "void setupSpheres() {\n\n // create a Switch for the spheres, allow switch changes\n spheresSwitch = new Switch(Switch.CHILD_ALL);\n spheresSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);\n\n // Set up an appearance to make the Sphere with objColor ambient,\n // black emmissive, objColor diffuse and white specular coloring\n Material material = new Material(objColor, black, objColor, white, 32);\n Appearance appearance = new Appearance();\n appearance.setMaterial(material);\n\n // create a sphere and put it into a shared group\n Sphere sphere = new Sphere(0.5f, appearance);\n SharedGroup sphereSG = new SharedGroup();\n sphereSG.addChild(sphere);\n\n // create a grid of spheres in the z=0 plane\n // each has a TransformGroup to position the sphere which contains\n // a link to the shared group for the sphere\n for (int y = -2; y <= 2; y++) {\n for (int x = -2; x <= 2; x++) {\n TransformGroup tg = new TransformGroup();\n tmpVector.set(x * 1.2f, y * 1.2f, -0.1f);\n tmpTrans.set(tmpVector);\n tg.setTransform(tmpTrans);\n tg.addChild(new Link(sphereSG));\n spheresSwitch.addChild(tg);\n }\n }\n }", "public abstract void placeSmoke(ShortPoint2D position, boolean smokeOn);", "public void setParticles(int particles) {\r\n\t\tthis.particles = particles;\r\n\t}", "@Override\n protected void initScene() {\n setupCamera(0xff888888);\n\n /*\n * Create a Cube and display next to the cube\n * */\n setupCube();\n\n\n /*\n * Create a Sphere and place it initially 4 meters next to the cube\n * */\n setupSphere();\n\n\n /*\n * Create a Plane and place it initially 2 meters next to the cube\n * */\n setupPlane();\n setupImage();\n setupText();\n\n }", "private void initStressTest() {\n\n createChannels();\n\n engine.getDatabasePlatform().getDdlBuilder().setDelimitedIdentifierModeOn(false);\n\n createStressTestControlTable();\n if (!engine.getTriggerRouterService().doesTriggerExistForTable(STRESS_TEST_CONTROL)) {\n addStressTestControlTriggers();\n }\n\n createStressTestStatusTable();\n if (!engine.getTriggerRouterService().doesTriggerExistForTable(STRESS_TEST_STATUS)) {\n addStressTestStatusTriggers();\n }\n\n engine.syncTriggers();\n\n initialized = true;\n }", "public void secrete() {\n\t\t/* Instantiate a new virus particle */\n\t\tSim.lps.add(new Lambda_phage(prob_surface, prob_enzymes));\n\t}", "private void setup() {\n\t\tpopulateEntitiesLists();\n\t\t// rayHandler.setCombinedMatrix(batch.getProjectionMatrix());\n\t\tambientColor = Color.CLEAR;\n\t\tsetAmbientAlpha(.3f);\n\t\tfpsLogger = new FPSLogger();\n\t\tdynamicEntities = new ArrayList<DynamicEntity>();\n\t\tfont.getData().setScale(DEBUG_FONT_SCALE);\n\t}", "protected void initialize() {\n finished = false;\n Robot.shooter.Spin();//Spin up wheels\n Timer.delay(3);\n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n //Robot.shooter.Stop();\n Robot.shooter.TriggerExtend();//Reset Trigger\n \n Robot.driveTrain.DriveBack();//Drives backwards from pyramid\n Timer.delay(1.5);\n Robot.driveTrain.TurnAround();//Turns Bob around\n Timer.delay(1);\n Robot.driveTrain.Stop();//Stops Bob\n \n Robot.pneumatics.CompressorOn();//Turns compressor on\n }", "public void setup() {\n\t\taddBehaviour(new TickerBehaviour(this, 1000L) {\n\n\t\t\t@Override\n\t\t\tprotected void onTick() {\n\t\t\t\tint extinguishedFires = 0;\n\t\t\t\t\n\t\t\t\tfor(int i = 0; i < worldAgent.getAircraftAgents().length; i++) {\n\t\t\t\t\textinguishedFires+=worldAgent.getAircraftAgents()[i].getAircraftMetricsStats().getNumTotalFiresExtinguishedByThisAircraft();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tworldAgent.getWorldMetricsStats().setNumTotalFiresExtinguishedByAllAircrafts(extinguishedFires);\n\t\t\t\t\n\t\t\t\tif(extinguishedFires >= 3) {\t\t\t\t\t\n\t\t\t\t\tlong end_time = System.currentTimeMillis();\n\t\t\t\t\tlong execution_time = end_time - init_time;\n\t\t\t\t\t\n\t\t\t\t\tAircraftAgent[] aircrafts = worldAgent.getAircraftAgents();\n\t\t\t\t\t\n\t\t\t\t\tfor(int i = 0; i < aircrafts.length; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(Thread sleepingThread : aircrafts[i].getSleepingThreads().values()) {\n\t\t\t\t\t\t\tSystem.err.println(\"Interrupting thread = \\\"\" + sleepingThread.getName() + \"!\");\n\t\t\t\t\t\t\tsleepingThread.interrupt();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tkillContainer();\n\t\t\t\t\t\n\t\t\t\t\tLogger.appendConfigValues(execution_time);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Run no. \" + JADELauncher.NUMBER_OF_RUNS + \" finished.\");\n\n\t\t\t\t\tif(JADELauncher.NUMBER_OF_RUNS == 0) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tLogger.closeStream();\n\t\t\t\t\t\t} catch (IOException 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\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tJADELauncher.NUMBER_OF_RUNS--;\n\t\t\t\t\t\tinstanceRun();\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t});\n\t\t\n\t\tinstanceRun();\n\t}", "public void setup()\n {\n // we use a separate ArrayList to keep track of each animal. \n // our room is 50 x 50.\n creatures = new ArrayList<Creature>();\n for (int i = 0; i < 55; i++) {\n if (i < 5) {\n creatures.add(new Fox((int)(Math.random()*48)+1, 1, (int)(Math.random()*48)+1)); \n } else {\n creatures.add(new Tux((int)(Math.random()*48)+1, 1, (int)(Math.random()*48)+1));\n }\n }\n \n env.setRoom(new Room());\n \n // Add all the animals into to the environment for display\n for (Creature c : creatures) {\n env.addObject(c);\n }\n \n // Sets up the camera\n env.setCameraXYZ(25, 50, 55);\n env.setCameraPitch(-63);\n \n // Turn off the default controls\n env.setDefaultControl(false);\n env.setShowController(false);\n \n }", "private void setUp9SpheresScene() {\n camera = new Camera(\n new Point3D(0, 0, 9),\n new Point3D(0,0,0),\n new Point3D(0,1,0),\n Math.PI * 0.5, width, height\n );\n camera.moveForward(1.0);\n\n exposure = 1.0;\n ambientLight = new LightIntensity();\n ambientLight.red = 0.2;\n ambientLight.green = 0.2;\n ambientLight.blue = 0.2;\n\n lightSources.add(\n new LightSource(\n new LightIntensity(.7, .7, .7),\n new RectFace(\n new Point3D(-1.1, 9.99, -5.0),\n new Point3D(1.1, 9.99, -5.0),\n new Point3D(-1.1, 9.99, -6.0)\n )\n ));\n\n Material reflective = new Material();\n reflective.diffuseReflectivity.red = 0.2;\n reflective.diffuseReflectivity.green = 0.2;\n reflective.diffuseReflectivity.blue = 0.2;\n reflective.directReflectivity = LightIntensity.makeUniformRGB(0.5);\n\n Material glass = new Material();\n glass.diffuseReflectivity.red = 0.0;\n glass.diffuseReflectivity.green = 0.0;\n glass.diffuseReflectivity.blue = 0.0;\n glass.passthroughIntensity.red = 0.9;\n glass.passthroughIntensity.green = 0.9;\n glass.passthroughIntensity.blue = 0.9;\n glass.directReflectivity = LightIntensity.makeUniformRGB(0.1);\n glass.refractionIndex = 1.33;\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-9,0), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-9,0), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-9,0), 1), reflective));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-9,2), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-9,2), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-9,2), 1), glass));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-9,4), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-9,4), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-9,4), 1), reflective));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-6,0), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-6,0), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-6,0), 1), glass));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-6,2), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-6,2), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-6,2), 1), reflective));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-6,4), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-6,4), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-6,4), 1), glass));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-3,0), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-3,0), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-3,0), 1), reflective));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-3,2), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-3,2), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-3,2), 1), glass));\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(0,-3,4), 1), reflective));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-2,-3,4), 1), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-4,-3,4), 1), reflective));\n\n Box boundingBox = new Box(\n new Point3D(-10,10, 10),\n new Point3D(-10,10, -10),\n new Point3D(10,10, 10),\n new Point3D(-10,-10, 10)\n );\n\n Material leftWallMaterial = new Material();\n leftWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, 0.3);\n leftWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material rightWallMaterial = new Material();\n rightWallMaterial.diffuseReflectivity = new LightIntensity(.7,0.3, .7);\n rightWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material frontWallMaterial = new Material();\n frontWallMaterial.diffuseReflectivity = new LightIntensity(0.3,0.3, 0.3);\n frontWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material backWallMaterial = new Material();\n backWallMaterial.diffuseReflectivity = new LightIntensity(.7,0.3, 0.3);\n backWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material topWallMaterial = new Material();\n topWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, .7);\n topWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n Material bottomWallMaterial = new Material();\n bottomWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, .7);\n bottomWallMaterial.directReflectivity = LightIntensity.makeUniformRGB(.3);\n\n try {\n bottomWallMaterial.texture = ImageIO.read(new File(\"C:\\\\Class_work\\\\checkerboard.png\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n solids.add(new RectFace.FaceSolid(boundingBox.left, leftWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.right, rightWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.front, frontWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.back, backWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.top, topWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.bottom, bottomWallMaterial));\n }", "@Override\n public void initialize() {\n System.out.print(\"shooter out starting\");\n isDone = false;\n shooter.shooterRaise();\n shooter.shooterMotorShootOut();\n hopper.hopperShootOut();\n }", "void setup() {\n size(2048, 2048); //sets size of canvas\n \n //names entities and their position\n player = new Sprite(tankURL, 100, 400, 100, 100);\n smbulletbase = new Sprite(tankbulletURL, 100, 400, 100, 100);\n enemyBase = new Sprite(enemytankURL, 100, 400, 100, 100);\n medkit = new Sprite(healthURL, 100, 400, 100, 100);\n kaboomBase = new Sprite(explosionURL, 100, 400, 100, 100);\n minigun = new Sprite(minigunURL, 100, 400, 100, 100);\n coilgun = new Sprite(coilgunURL, 100, 400, 100, 100);\n \n \n //sets size of some pictures\n smbulletbase.setSize(50, 50);\n minigun.setSize(150,150);\n coilgun.setSize(150,150);\n \n //initialization of scene switcher library\n scsw = new SceneSwitcher();\n scsw.addScene(\"Title\", new Scene(() -> drawTitle()));\n scsw.addScene(\"Game\", new Scene(() -> drawGame()));\n scsw.addScene(\"Death\", new Scene(() -> drawDeath()));\n \n \n //sets players front angle\n player.frontAngle(90);\n \n //sets up audio library\n ktAudio = new KTAudioController(this);\n clickEffect = new KTSound(this, gunshotURL);\n ktAudio.add(clickEffect);\n \n\n}", "private void setUp2SpheresScene() {\n camera = new Camera(\n new Point3D(0, 0, 9),\n new Point3D(0,0,0),\n new Point3D(0,1,0),\n Math.PI * 0.5, width, height\n );\n camera.moveForward(1.0);\n\n exposure = 1.0;\n ambientLight = new LightIntensity();\n ambientLight.red = 0.2;\n ambientLight.green = 0.2;\n ambientLight.blue = 0.2;\n\n lightSources.add(\n new LightSource(\n new LightIntensity(.7, .7, .3),\n new RectFace(\n new Point3D(-1.1, 9.99, -5.0),\n new Point3D(1.1, 9.99, -5.0),\n new Point3D(-1.1, 9.99, -6.1)\n )\n ));\n\n lightSources.add(\n new LightSource(\n new LightIntensity(.4, .3, .7),\n new RectFace(\n new Point3D(-4.1, 2.99, -5.0),\n new Point3D(-2.9, 2.99, -5.0),\n new Point3D(-4.1, 2.99, -6.1)\n )\n ));\n\n Material reflective = new Material();\n reflective.diffuseReflectivity.red = 0.2;\n reflective.diffuseReflectivity.green = 0.2;\n reflective.diffuseReflectivity.blue = 0.2;\n reflective.directReflectivity = LightIntensity.makeUniformRGB(0.5);\n\n Material glass = new Material();\n glass.diffuseReflectivity.red = 0.0;\n glass.diffuseReflectivity.green = 0.0;\n glass.diffuseReflectivity.blue = 0.0;\n glass.passthroughIntensity.red = 0.9;\n glass.passthroughIntensity.green = 0.9;\n glass.passthroughIntensity.blue = 0.9;\n glass.directReflectivity = LightIntensity.makeUniformRGB(0.1);\n glass.refractionIndex = 1.33;\n\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(-5, -3, -5), 2.5), glass));\n solids.add(new Sphere.SphereSolid(new Sphere(new Point3D(5, -3, -5), 2.5), new Material()));\n\n Box boundingBox = new Box(\n new Point3D(-10,10, 10),\n new Point3D(-10,10, -10),\n new Point3D(10,10, 10),\n new Point3D(-10,-10, 10)\n );\n\n Material leftWallMaterial = new Material();\n leftWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, 0.3);\n\n Material rightWallMaterial = new Material();\n rightWallMaterial.diffuseReflectivity = new LightIntensity(.7,0.3, .7);\n\n Material frontWallMaterial = new Material();\n frontWallMaterial.diffuseReflectivity = new LightIntensity(0.3,0.3, 0.3);\n\n Material backWallMaterial = new Material();\n backWallMaterial.diffuseReflectivity = new LightIntensity(.7,0.3, 0.3);\n\n Material topWallMaterial = new Material();\n topWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, .7);\n\n Material bottomWallMaterial = new Material();\n bottomWallMaterial.diffuseReflectivity = new LightIntensity(.7,.7, .7);\n\n try {\n bottomWallMaterial.texture = ImageIO.read(new File(\"C:\\\\Class_work\\\\checkerboard.png\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n solids.add(new RectFace.FaceSolid(boundingBox.left, leftWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.right, rightWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.front, frontWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.back, backWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.top, topWallMaterial));\n solids.add(new RectFace.FaceSolid(boundingBox.bottom, bottomWallMaterial));\n }", "public void initializeObliqueLaunch(){\r\n world = new Environment();\r\n cannon = new Thrower();\r\n ball = new Projectile();\r\n this.setInitialValues();\r\n }", "public StormCloud() {\n moveStop = true;\n stormCloud = new Sprite();\n cloudRectangle = new Rectangle(0,0,1280,384);\n stormCloud.setPosition(0, -stormCloud.getHeight() * 2);\n }", "public void launch(){\n try{\n System.out.println(\"Main: Creando agentes\");\n \tmap = visualizer.getMapToLoad();\n \tsatelite = new Satelite(id_satelite, map, visualizer);\n \tdrone = new Drone(new AgentID(\"Drone\"), map.getWidth(), map.getHeigh(), id_satelite);\n \tSystem.out.println(\"MAIN : Iniciando agentes...\");\n \tvisualizer.setSatelite(satelite);\n satelite.start();\n drone.start();\n }catch(Exception e){\n \tSystem.err.println(\"Main: Error al crear los agentes\");\n System.exit(-1);\n }\n\t}", "@Override\n\tprotected void setup() {\n\t\tcarImg();\n\t\tsetResolution(Resolution.MSX);\n\t\tsetFramesPerSecond(100);\n\t\t\n\t\tbola = new Bola();\n\n\t\tbotoes();\n\n\t\tcriaBlocos();\n\n\t\tpaddle = new Paddle();\n\n\t\t\n\n\t}", "public void initServos() throws InterruptedException{\r\n servoKickstandRight.setPosition(posKickstandRight);\r\n servoKickstandLeft.setPosition(posKickstandLeft);\r\n servoBucket.setPosition(posBucket);\r\n }", "@Override\n public void init() {\n swerveDebug(500, \"SwerveAutoTEST::init\", \"STARTing init for TETS\");\n\n // Run initialization of other parts of the class\n // Note that the class will connect to all of our motors and servos\n super.init();\n\n crater = Boolean.TRUE;\n\n\n // Robot and autonomous settings are read in from files in the core class init()\n // Report the autonomous settings\n showAutonomousGoals();\n\n swerveLog( \"X S6\", ourSwerve.getOrientLog());\n\n swerveDebug(500, \"SwerveAutoTEST::init\", \"DONE\");\n }", "protected void firstInitializeImpl(@NotNull final ParticleData particleData) {\n }", "public void setup()\n {\n this.p = Player.getInstance();\n\n this.imageStore = new ImageStore(\n createImageColored(TILE_WIDTH, TILE_HEIGHT, DEFAULT_IMAGE_COLOR));\n this.world = new WorldModel(WORLD_ROWS, WORLD_COLS,\n createDefaultBackground(imageStore));\n this.view = new WorldView(VIEW_ROWS, VIEW_COLS, this, world,\n TILE_WIDTH, TILE_HEIGHT);\n this.scheduler = new EventScheduler(timeScale);\n\n background = loadImage(\"images\\\\farm2.jpg\");\n background.resize(VIEW_WIDTH, VIEW_HEIGHT);\n\n loadImages(IMAGE_LIST_FILE_NAME, imageStore, this);\n loadWorld(world, LOAD_FILE_NAME, imageStore);\n\n scheduleActions(world, scheduler, imageStore);\n\n next_time = System.currentTimeMillis() + TIMER_ACTION_PERIOD;\n }", "@Override\n\tvoid initialize() {\n\t\tSystem.out.println(\"Initialized sweat shirt\");\n\t}", "protected void initialize() {\n\t\t//System.out.println(\"Cube collector is spitting\");\n\t}", "public StoneSummon() {\n// ArrayList<BufferedImage> images = SprssssssaasssssaddddddddwiteUtils.loadImages(\"\"\n createStones();\n\n }", "@Override\n public void simpleInitApp() {\n this.viewPort.setBackgroundColor(ColorRGBA.LightGray);\n im = new InteractionManager();\n setEdgeFilter();\n initEnemies();\n initCamera();\n initScene();\n initPlayer();\n initCrossHairs();\n }", "@Before\n public void setUp() throws Exception {\n cut = new LightScheduler();\n// spyLedController = new SpyLedController();\n// fakeTimeService = new FakeTimeService();\n }", "public void drawParticles() {}", "private void initShooter() {\n m_task = new ShooterThread(this);\n m_task.start();\n }", "public void setup() {\n statsTable();\n spawnsTable();\n }", "public void setup(){\n\t\t gl.glEnable(GL.GL_BLEND);\n\t\t gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);\n\t\t for (int i = 0; i< cubes.length; i++){\n\t\t cubes[i] = this.s.new Cube(\n\t\t \t\tMath.round(p.random(-100, 100)), \n\t\t \t\tMath.round(p.random(-100, 100)), \n\t\t \t\t5,//Math.round(random(-100, 100)),\n\t\t \t\tMath.round(p.random(-10, 10)), \n\t\t \t\t\tMath.round(p.random(-10, 10)), \n\t\t\t\t\tMath.round( p.random(-10, 10))\n\t\t );\n\t\t cubRotation[i]=new Vector3D();\n\t\t cubRotationFactor[i]=new Vector3D();\n\t\t cubRotationFactor[i].x = (float)Math.random()/2f;\n\t\t cubRotationFactor[i].y = (float)Math.random()/2f;\n\t\t cubRotationFactor[i].z = (float)Math.random()/2f;\n\t\t \n\t\t cubColor[i]=new Vector3D();\n\t\t cubColor[i].x = (float)Math.random();\n\t\t cubColor[i].y = (float)Math.random();\n\t\t cubColor[i].z = (float)Math.random();\n\t\t }\n\t\t \n\t\t try {\n\t\t\togl.makeProgram(\n\t\t\t\t\t\t\"glass\",\n\t\t\t\t\t\tnew String[] {},\n\t\t\t\t\t\tnew String[] {\"SpecularColor1\",\"SpecularColor2\",\"SpecularFactor1\",\"SpecularFactor2\",\"LightPosition\"}, //\"GlassColor\",\n\t\t\t\t\t\togl.loadGLSLShaderVObject(\t\"resources/robmunro/perform/ol5/glass_c.vert\" ), \n\t\t\t\t\t\togl.loadGLSLShaderFObject(\t\"resources/robmunro/perform/ol5/glass_c.frag\"\t)\n\t\t\t\t);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t}", "@Override\n public void start() {\n robot.shooterPower(1);\n runtime.reset();\n }", "protected void playParticle(){\n\t\teffectData.getPlayParticles().playParticles(effectData, effectData.getDisplayAt());\n\t}", "@Override\n\tpublic void start()\n\t{\n\t\tarena = \"scenarios/boxpushing/arena/pioneer.controller.arena.txt\"; \n\n\t\t\n\t\tschedule.reset();\n\n\t\tsuper.start();\n\n\t\tresetBehavior();\n\n\t}", "protected void setup() {\n\t\t\n\n\n\t\tif(PropertiesLoaderImpl.IS_MAIN_SIMULATION_NODE)addBehaviour(new HandleClockBehaviour(this, TimeRateControl));\n\t\telse addBehaviour(new SlaveNodeClockBehaviour(this, TimeRateControl));\n\t\t\n\t\tif(PropertiesLoaderImpl.DEBUG) System.out.println(this.getName() +\" alive!!!!!!!!!!\\nStarting the simulation time\");\n\t\t\n\t\n\t\t\tSimulationClock.getInstance().setSimulationStarted(true);\n\t\n\t}", "public void OnStart(){\n\t\t//create the random space background and put its priority behind everything else\n\t\tswitch ((int) (Math.random() * 3)){\n\t\t\tcase 0:\n\t\t\t\tbackground = new Background(R.drawable.spaceback_med,new Point(0,0),-1);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tbackground = new Background(R.drawable.spaceback_asteroids,new Point(0,0),-1);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tbackground = new Background(R.drawable.spaceback_nebula,new Point(0,0),-1);\n\t\t\t\tbreak;\n\t\t}\n\t\t//generate asteroids\n\t\tinitAsteroids((int)(Math.random()*3));\n\t\t//create a border for the background (draw on top)\n\t\tnew Border(background,1000);\n\t\t//create the player\n\t\tplayer = new Player(new Point(-300,300), 1);\n\t\t//create a target reticule for the player\n\t\ttarget = new Target(player);\n\t\t\n\t\t//load sounds\n\t\tGameState.State().LoadSound(R.raw.shoot, \"shoot\");\n\t\tGameState.State().LoadSound(R.raw.accelerate, \"accelerate\");\n\t\tGameState.State().LoadSound(R.raw.engine, \"engine\");\n\t\tGameState.State().LoadSound(R.raw.explosion, \"explosion\");\n\t\tGameState.State().LoadSound(R.raw.death, \"death\");\n\t\t\n\t\thasStarted = true;\n\t\t\n\t\trespawnCount = 0.0f;\n\t\trespawnTime = 4f;\n\t}", "private void createParticle(double par1, double par3, double par5, double par7, double par9, double par11, int[] par13ArrayOfInteger, int[] par14ArrayOfInteger, boolean par15, boolean par16)\n {\n EntityFireworkSparkFX entityfireworksparkfx = new EntityFireworkSparkFX(this.worldObj, par1, par3, par5, par7, par9, par11, this.theEffectRenderer);\n entityfireworksparkfx.setTrail(par15);\n entityfireworksparkfx.setTwinkle(par16);\n int i = this.rand.nextInt(par13ArrayOfInteger.length);\n entityfireworksparkfx.setColour(par13ArrayOfInteger[i]);\n\n if (par14ArrayOfInteger != null && par14ArrayOfInteger.length > 0)\n {\n entityfireworksparkfx.setFadeColour(par14ArrayOfInteger[this.rand.nextInt(par14ArrayOfInteger.length)]);\n }\n\n this.theEffectRenderer.addEffect(entityfireworksparkfx);\n }", "@FXML\n void startEvent(ActionEvent event) throws EnvironmentException, EmitterException {\n \t// Hide the start button and show the stop button\n \tstartButton.setVisible(false);\n \tstopButton.setVisible(true);\n \t//Create a new particle manager\n\t\tmanager = new ParticleManager(windSpeed, angle);\n\t\tstartTime = System.currentTimeMillis() / 1000.0;\n\t\tmanager.start(0);\n\n\t\t//Create a frame that runs the drawFireworks() to display the updated launch value.\n\t\tKeyFrame frame = new KeyFrame(Duration.ZERO, actionEvent ->\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tdrawFireworks();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t//Create a timeline and run it.\n\t\ttimeline = new Timeline( frame,\n\t\t\t\tnew KeyFrame(Duration.millis(1000 / 60)));\n\t\ttimeline.setCycleCount(Timeline.INDEFINITE);\n\t\ttimeline.playFromStart();\n }", "@Override\r\n public void setup() {\r\n crash = new SoundFile(this, \"sounds\\\\crash.wav\");\r\n eat = new SoundFile(this, \"sounds\\\\eat.wav\");\r\n Cell.HEIGHT=CELL_HEIGHT;\r\n Cell.WIDTH=CELL_WIDTH;\r\n System.out.println(interval);\r\n\r\n initGame();\r\n }", "protected void initializeServos() {\n servoJewelArm.setPosition(JEWEL_ARM_IN);\n servoJewelFlicker.setPosition(JEWEL_FLICKER_START);\n servoGlyphSingleTop.setPosition(GLYPH_GRIPPER_SINGLE_TOP_OPEN);\n servoGlyphSingleBot.setPosition(GLYPH_GRIPPER_SINGLE_BOT_OPEN);\n servoRelicHand.setPosition(RELIC_HAND_CLOSED);\n servoRelicArm.setPosition(RELIC_ARM_START);\n servoGlyphSpinner.setPosition(SPINNER_SINGLE_TOP);\n servoJewelGate.setPosition(JEWEL_GATE_CLOSED);\n }", "abstract public void initSpawn();", "public void setupGame() {\n\t\t// Re-spawn the appropriate number of sheep\n\t\tint numSheep = 31;\n\t\t\n\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\tnumSheep = 1;\n\t\t}\n\t\t\n\t\t// It takes half the sheep to win.\n\t\t_scoreToWin = numSheep / 2;\n\t\tp(\"It takes \" + _scoreToWin + \" sheep to win.\");\n\t\t\n\t\t_hasBeenWon = false;\n\t\t\n\t\t// Non-infrastructural entities.\n\t\t//////////////////////////\n\t\t\n\t\t// Don't create this stuff if I'm replaying.\n\t\tint mod = 1;\n\t\tfor (int i = 0; i < numSheep; i++) {\n\t\t\t//int x = _generator.nextInt(40) - 20;\n\t\t\t//int z = _generator.nextInt(80) - 40;\n\t\t\tmod *= -1;\n\t\t\tint x = i/2 * mod;\n\t\t\tint z = 0;\n\n\t\t\tSheep s = new Sheep(\"sheep-\" + i + \"[\" + _sheepID + \"]\", x, 2, z);\n\t\t\t\n\t\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\t\ts.setBehaviorActive(false);\n\t\t\t}\n\t\t\t\n\t\t\t_sheepID++;\n\t\t}\n\t\t\n\t\t// Add a wubble for testing.\n\t\tif (!_isJimboSpawned && !SheepPhysicsState.PRODUCTION) {\n\t\t\tSystem.out.println(\"Adding Jimbo.\");\n\t\t\t_isJimboSpawned = true;\n\t\t\taddWubble(\"Jimbo\", (short)100, (Integer)1);\n\t\t\taddSidekick(\"Jimbo\");\n\t\t\t//addWubble(\"Bimbo\", (short)101, (Integer)0);\n\t\t}\n\t\t\n\t\t//////////////////////////\n\n\t\t// Add some wrenches in the appropriate spots.\n\t\tnew Wrench(\"blueWrench1\", -8, 5, -20);\n\t\tnew Wrench(\"blueWrench2\", 8, 5, -20);\n\t\tnew Wrench(\"redWrench1\", -8, 5, 20);\n\t\tnew Wrench(\"redWrench2\", 8, 5, 20);\n\t\t\n\t\t// Save the start of the me.\n\t\t_gameStart = System.currentTimeMillis();\n\t\tSystem.out.println(\"Started game at \" + _gameStart);\n\t\t\n\t\t// Make some predicates.\n\t\t//Predicate p = new Predicate(\"baseClassPred\");\n\t\t//GoPred g = new GoPred(\"derivedGoClass\", 1);\n\t\t\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.SPEEDY, new Vector3f(0, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpE\", -1, PowerUpInfo.PowerUpType.EATER, new Vector3f(2, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.STICKY, new Vector3f(2, 0.4f, 2));\n\t}", "private void initializeStartup()\n {\n /* Turn off Limelight LED when first started up so it doesn't blind drive team. */\n m_limelight.turnOffLED();\n\n /* Start ultrasonics. */\n m_chamber.startUltrasonics();\n }", "private static void createNewParticles(int number) {\n\t\t// The following declarations are to initialize the random range for the \n\t\t// particle's feature\n\t\tint maxX = Fountain.positionX + 3;\n\t\tint minX = Fountain.positionX - 3;\n\t\tint boundX = maxX - minX;\n\t\tint maxY = Fountain.positionY + 3;\n\t\tint minY = Fountain.positionY - 3;\n\t\tint boundY = maxY - minY;\n\t\t\n\t\tint particleCount = 0; // For counting the new particles' amount\n\n\t\t\n\t\t\tfor (int i = 0; i < particles.length; i++) {\n\t\t\t\tif (particles[i] == null) {\n\t\t\t\t\t++particleCount;\n\t\t\t\t\t\n\t\t\t\t\t// Following codes are to prepare the setting for the particle\n\t\t\t\t\tint positionX = randGen.nextInt(boundX + 1) + maxX;\n\t\t\t\t\tint positionY = randGen.nextInt(boundY + 1) + maxY;\n\t\t\t\t\tfloat xVelocity = -1 + randGen.nextFloat() * (2);\n\t\t\t\t\tfloat yVelocity = -10 + randGen.nextFloat() * (5);\n\t\t\t\t\tfloat amount = randGen.nextFloat() * 1;\n\t\t\t\t\tint color = Utility.lerpColor(Fountain.startColor, Fountain.endColor, amount);\n\t\t\t\t\tfloat size = randGen.nextFloat() * (11 - 4);\n\t\t\t\t\tint age = randGen.nextInt(40 + 1);\n\t\t\t\t\tint transparency = randGen.nextInt((96)) + 32;\n\t\t\t\t\t\n\t\t\t\t\t// TO set the new particle with random feature\n\t\t\t\t\tparticles[i] = new Particle();\n\t\t\t\t\tparticles[i].setPositionX(positionX);\n\t\t\t\t\tparticles[i].setPositionY(positionY);\n\t\t\t\t\tparticles[i].setVelocityX(xVelocity);\n\t\t\t\t\tparticles[i].setVelocityY(yVelocity);\n\t\t\t\t\tparticles[i].setSize(size);\n\t\t\t\t\tparticles[i].setColor(color);\n\t\t\t\t\tparticles[i].setAge(age);\n\t\t\t\t\tparticles[i].setTransparency(transparency);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Once after creating 10 new particles, ends this method\n\t\t\t\tif (particleCount >= number) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected void initialize() {\n Robot.limelight.setPipeline(0.0);\n }", "public SmokeDetectorTest(String name) {\n\t\tsuper(name);\n\t}", "@Override\n\tprotected void setup() {\n\t\tObject[] args = getArguments();\n\t\tif (args != null && args.length == 3) {\n\t\t\tnumAttempts = Integer.parseInt((String) args[0]);\n\t\t\tinitLaps = Integer.parseInt((String) args[1]);\n\t\t\tstep = Integer.parseInt((String) args[2]);\n\t\t\tlogger.info(\"Init experiment (a:\" + numAttempts + \", i:\" + initLaps + \", s:\" + step);\n\t\t} else {\n\t\t\tlogger.log(Logger.SEVERE, \"Agent \" + getLocalName() + \" - Incorrect number of arguments\");\n\t\t\tdoDelete();\n\t\t}\n\t\t// Init experiment\n\t\taddBehaviour(new ExperimentBehaviour(numAttempts, initLaps, step));\n\t}", "public void setup() {\n doors = new ArrayList<>();\n doors.add(new Door(Contains.GOAT));\n doors.add(new Door(Contains.GOAT));\n doors.add(new Door(Contains.CAR));\n Collections.shuffle(doors);\n stage = Stage.BEGINNING;\n }", "public static void main(String[] args) {\r\n\t\tPistol m9 = new Pistol(15, \"M9\", \"Black\", 9);\r\n\t\tPistol desertEagle = new Pistol(7, \"Desert Eagle\", \"Black/Silver\", 50);\r\n\t\t// m9 object created from pistol \"class\" object constructor.\r\n\t\tm9.shoot();\r\n\r\n\t\tdesertEagle.shoot();\r\n\r\n\t}", "@Before\r\n\tpublic void setup()\r\n\t{\n\t\tgame = factory.makeHantoGame(HantoGameID.EPSILON_HANTO, BLUE);\r\n\t}", "public void setup()\n{\n noiseDetail(6);\n noiseScale = 0.01f;\n c1 = new Car(250, 250);\n}", "protected void initializeImpl(@NotNull final ParticleData particleData) {\n }", "public void setup()\n {\n this.imageStore = new ImageStore(\n createImageColored(TILE_WIDTH, TILE_HEIGHT, DEFAULT_IMAGE_COLOR));\n this.world = new WorldModel(WORLD_ROWS, WORLD_COLS,\n createDefaultBackground(imageStore));\n this.view = new WorldView(VIEW_ROWS, VIEW_COLS, this, world,\n TILE_WIDTH, TILE_HEIGHT);\n this.scheduler = new EventScheduler(timeScale);\n\n loadImages(IMAGE_LIST_FILE_NAME, imageStore, this);\n loadWorld(world, LOAD_FILE_NAME, imageStore);\n\n scheduleActions(world, scheduler, imageStore);\n\n next_time = System.currentTimeMillis() + TIMER_ACTION_PERIOD;\n click = false;\n }", "public void startSensors() {\n // Register listeners for each sensor\n sensorManager.registerListener(sensorEventListener, accelerometer, SensorManager.SENSOR_DELAY_GAME);\n }", "public void setUpScene() {\r\n\r\n\t\tif (forecasts == null) {\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tDateFormatter.formatDates(forecasts);\r\n\r\n\t\tsetLabels(forecasts);\r\n \r\n\t\tWeatherDAO weatherDAO = new WeatherDAO();\r\n\r\n\t\tweatherDAO.saveForecasts(forecasts, getSceneNumber());\r\n\t\t\r\n\t\tsetGif(forecasts[0].getDayPhrase());\r\n\t}", "protected void initialize() {\n \tRobot.intake.runIntake(this.m_speed, this.m_speed);\n }", "void start() throws TestFailed\n {\n this.startSkeletons();\n }", "private void initGame() {\r\n \t//body of snake 3\r\n \t\tdots = 3;\r\n \t\t//position the body of snake behind each other initially\r\n \t\tfor(int i = 0; i < dots; i++) {\r\n \t\t\tx[i] = 50 - i * 10;\r\n \t\t\ty[i] = 50;\r\n \t\t}\r\n \t\t//call random apple\r\n \t\trandomApple();\r\n \t\t//start the timer class\r\n \t\ttimer = new Timer(DELAY, this);\r\n \t\ttimer.start();\r\n }", "@Override\n protected void initialize() { \n\n \n SmartDashboard.putNumber(\"Side Velocity\", sideVelocity);\n SmartDashboard.putNumber(\"Belt velocity\", beltVelocity);\n\n }", "@BeforeClass\n public static void setUp() throws Exception {\n game = ((StonePits) Gdx.app.getApplicationListener());\n soundMan = game.getSoundManager();\n assetMan = game.getAssetManager();\n }", "public void earlyStartup() {\r\n //To initialize the sensor.\r\n try {\r\n EclipseSensor.getInstance();\r\n }\r\n catch (SensorShellException e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Before\r\n public void setup()\r\n {\r\n board = new Board();\r\n piece = new Pawn(WHITE);\r\n board.putPiece(piece, 0, 0);\r\n }", "public static void init() {\n\t\tdrive = Drive.getInstance();\n\t\toi = OI.getInstance();\n\t\tshooter = Shooter.getInstance();\n\t\tarmservo = ArmServo.getInstance();\n\t\t//pneumatic = Pneumatic.getInstance();\n\t\tarmMotor = ArmMotor.getInstance();\n\t\tramp = RampMotor.getInstance();\n\t\tif(shooter == null) {\n\t\t\tSystem.out.println(\"Shooter in NULL in init\");\n\t\t}\n\t\t\n\t}", "void setupLights() {\n\n lightGroup = new Group();\n\n // Set up the ambient light\n lightAmbient = new AmbientLight(darkGrey);\n lightAmbient.setInfluencingBounds(infiniteBounds);\n lightAmbient.setCapability(Light.ALLOW_STATE_WRITE);\n lightAmbient.setEnable(true);\n lightGroup.addChild(lightAmbient);\n\n // Set up the directional light\n Vector3f lightDirection = new Vector3f(0.65f, -0.65f, -0.40f);\n lightDirectional = new DirectionalLight(white, lightDirection);\n lightDirectional.setInfluencingBounds(infiniteBounds);\n lightDirectional.setEnable(true);\n lightDirectional.setCapability(Light.ALLOW_STATE_WRITE);\n lightGroup.addChild(lightDirectional);\n\n // Set up the point light\n Point3f lightPosition = new Point3f(-1.0f, 1.0f, 0.6f);\n lightPoint = new PointLight(white, lightPosition, attenuation);\n lightPoint.setInfluencingBounds(infiniteBounds);\n lightPoint.setEnable(false);\n lightPoint.setCapability(Light.ALLOW_STATE_WRITE);\n lightPoint.setCapability(PointLight.ALLOW_ATTENUATION_WRITE);\n lightGroup.addChild(lightPoint);\n\n // Set up the spot light\n // Point the light back at the origin\n lightSpot = new SpotLight(white, lightPosition, attenuation,\n lightDirection, (float) Math.toRadians(spotSpreadAngle),\n spotConcentration);\n lightSpot.setInfluencingBounds(infiniteBounds);\n lightSpot.setEnable(false);\n lightSpot.setCapability(Light.ALLOW_STATE_WRITE);\n lightSpot.setCapability(PointLight.ALLOW_ATTENUATION_WRITE);\n lightSpot.setCapability(SpotLight.ALLOW_CONCENTRATION_WRITE);\n lightSpot.setCapability(SpotLight.ALLOW_SPREAD_ANGLE_WRITE);\n lightGroup.addChild(lightSpot);\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 startSpawning()\n {\n MAUtils.setSpawnFlags(plugin, world, 1, allowMonsters, allowAnimals);\n \n // Start the spawnThread.\n spawnThread = new MASpawnThread(plugin, this);\n spawnTaskId = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, spawnThread, waveDelay, (!waveClear) ? waveInterval : 60);\n }", "public void setup(){\r\n\r\n\t\t\tlogger.info(\"begin setting up the patches\");\r\n\r\n\t\t\t//Initialize the patches in the world.\r\n\t\t\tpatches = new Patch[numOfPathes][numOfPathes];\r\n\t\t\tfor(int i = 0; i < patches.length; i ++){\r\n\t\t\t\tfor(int j = 0; j < patches[i].length; j ++){\r\n\t\t\t\t\tpatches[i][j] = new Patch(i,j);\r\n\t\t\t\t\t//logger.info(\"generated x = \" + i + \"y = \" + j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlogger.info(\"begin setting up the agents\");\r\n\r\n\t\t\t//Generate agents and cops.\r\n\t\t\tagents = new Agent[numOfAgents];\r\n\t\t\tfor(int k = 0; k < numOfAgents; k ++){\r\n\t\t\t\tagents[k] = generateAgent();\r\n\t\t\t}\r\n\r\n\t\t\tlogger.info(\"finished setting up the agents\");\r\n\r\n\t\t\tlogger.info(\"begin setting up the cops\");\r\n\t\t\tcops = new Cop[numOfCops];\r\n\t\t\tfor(int k = 0; k < numOfCops; k ++){\r\n\t\t\t\tcops[k] = generateCop();\r\n\t\t\t}\r\n\r\n\t\t\tlogger.info(\"finished setting up the cops\");\r\n\r\n\t\t}", "private void init(int numberOfParticles, int dimensions) {\n MersenneTwisterFast mt = Utils.getMTInstance();\n double pos;\n double vel;\n \n Particle p = null;\n for (int i = 0; i < numberOfParticles; i++) {\n\n\n List<Double> tempPosition = new ArrayList<Double>(dimensions);\n List<Double> tempVelocity = new ArrayList<Double>(dimensions);\n for (int j = 0; j < dimensions; j++) {\n pos = this.getLowerBound().get(j) + (mt.nextDouble() * (this.getUpperBound().get(j) - this.getLowerBound().get(j)));\n vel = (this.getLowerBound().get(j) - this.getUpperBound().get(j)) / 2 + (mt.nextDouble() * (((this.getUpperBound().get(j)\n - this.getLowerBound().get(j)) / 2 - (this.getLowerBound().get(j) - this.getUpperBound().get(j)) / 2) + 1));\n tempPosition.add(pos);\n tempVelocity.add(vel);\n }\n if (this.phi == 0) {\n p = new Particle(this, tempPosition, this.informantsPerParticle);\n } else {\n p = new Particle(this, tempPosition, this.informantsPerParticle, this.phi);\n }\n\n p.setBestPosition(Utils.doubleListDeepCopy(tempPosition));\n p.setVelocity(tempVelocity);\n p.evaluate(getCostFunction());\n this.getPopulation().add(p);\n\n }\n \n }", "public void setup() {\n //our playing field size\n int theGroundWidth = 800;\n int theGroundHeight = 800;\n\n //our pouplation of rabbits\n entitiesOfRabbits = new Entities();\n //our grass population\n entitiesOfGrass = new Entities();\n //array of dead rabbits\n entitiesOfDeadRabbits = new Entities();\n //Array of foxes\n entitiesOfFoxes = new Entities();\n\n //creating an interactive object that is able to open the graph by the push of a button\n openGraph = new InteractiveObject();\n openGraph.createInteractiveObject(this, 875, 100, 50, 50, \"Square\",true);\n\n //Instantiating the object that allow us to start the program\n startTheProgram = new InteractiveObject();\n startTheProgram.createInteractiveObject(this,400,400,50,50,\"Square\", true);\n\n //instatiating the environment, with the sizes from above\n theEnvironment = new Environment(this, theGroundWidth, theGroundHeight);\n\n //createPopulation comes from the entities (population) class, and holds all the rabbits in an arraylist\n entitiesOfRabbits.createEntities(this, 20, Rabbit.class);\n entitiesOfGrass.createEntities(this, 35, Grass.class);\n entitiesOfFoxes.createEntities(this,3,Fox.class);\n\n //AllEntities list, which holds all the different population lists\n allEntities = new ArrayList<>();\n allDeadEntities = new ArrayList<>();\n\n //putting all the rabbits into the AllEntities list, in the main class\n //keeps all the moving parts together, making it easier to compare objects fx rabbits finding food or other rabbits\n allEntities.add(0,entitiesOfRabbits);\n allEntities.add(1,entitiesOfGrass);\n allEntities.add(2,entitiesOfFoxes);\n allDeadEntities.add(entitiesOfDeadRabbits);\n }", "@PostConstruct\r\n\tpublic void doMyStartUpStuff() {\r\n\t\t\r\n\t\tSystem.out.println(\"TennisCoach : -> Inside of doMyStartUpStuff()\");\r\n\t}", "@Override\r\n public void runSimulation(){\r\n initialize();\r\n initialRun();\r\n initialize(\"square\");\r\n initialRun();\r\n initialize(\"circle\");\r\n initialRun();\r\n initialize(\"crack\");\r\n initialRun(); \r\n initialize(\"cross\");\r\n initialRun();\r\n }", "@Override\r\n public void simpleInitApp() {\r\n PhysicsRigidBody.logger2.setLevel(Level.WARNING);\r\n\r\n cam.setLocation(new Vector3f(39f, 64f, 172f));\r\n cam.setRotation(new Quaternion(-0.013f, 0.98608f, -0.1254f, -0.1084f));\r\n flyCam.setMoveSpeed(100f);\r\n\r\n Material hiMat = MyAsset\r\n .createWireframeMaterial(assetManager, ColorRGBA.Red, 3f);\r\n Material loMat = MyAsset\r\n .createWireframeMaterial(assetManager, ColorRGBA.Green, 3f);\r\n\r\n // Add axes\r\n float axisLength = 30f;\r\n AxesVisualizer axes = new AxesVisualizer(assetManager, axisLength);\r\n axes.setLineWidth(AxesVisualizer.widthForSolid);\r\n rootNode.addControl(axes);\r\n axes.setEnabled(true);\r\n\r\n for (int i = 0; i < 1000; ++i) {\r\n float x = -50f + 100f * random.nextFloat();\r\n float z = -50f + 100f * random.nextFloat();\r\n float vz = test(x, z);\r\n\r\n PointMesh pointMesh = new PointMesh();\r\n pointMesh.setLocation(new Vector3f(x, 5f * vz, z));\r\n Geometry geometry = new Geometry(\"result\", pointMesh);\r\n if (vz > 1f) {\r\n geometry.setMaterial(hiMat);\r\n } else {\r\n geometry.setMaterial(loMat);\r\n }\r\n rootNode.attachChild(geometry);\r\n }\r\n }", "protected void initialize() {\n \ttime.start();\n \tRobot.camera.setExposureManual(20);\n \tzach();\n\t\tSystem.out.println(\"josh\");\n\t\t\n }", "public static void init(){\r\n CommandBase.magazine.setSpeed(0.0);\r\n CommandBase.loader.setSpeed(0.0);\r\n Init.manualTankDrive.start(); \r\n Init.runCompressor.start();\r\n Init.stopGyroDrift.start();\r\n \r\n }", "private void setupPhase() {\n ClickObserver.getInstance().setTerrainFlag(\"Setup: SelectStartTerrain\");\n for (final Player p : playerList) {\n \t\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n // Cover all terrains, uncover starting pos ones\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getRackGui().setOwner(player);\n \tBoard.applyCovers();\n \tfor (Coord spot : startingPos) {\n \t\tif (!Board.getTerrainWithCoord(spot).isOccupied())\n \t\t\tBoard.getTerrainWithCoord(spot).uncover();\n \t}\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select a valid hex to start your kingdom.\");\n }\n });\n while( isPaused ){\n int num = p.getHexesOwned().size();\n if( num == 1 ){\n unPause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tPlayerBoard.getInstance().updateGold(player);\n }\n });\n System.out.println(\"done\");\n }\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n pause();\n \n // Now that all players have selected starting spots, flip over all terrains\n // *Note: Not sure I understand the rules with regards to this, but I think this is right\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t Board.showTerrains();\n Board.removeBadWaters();\n }\n });\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n \n // Check if player has at least two land hexes around starting spot\n for( final Player p : playerList ) {\n this.player = p;\n\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getHelpText().setText(p.getName() \n + \", select a water hex to replace with from deck\");\n Board.removeBadAdjWaters();\n }\n });\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n\n player.flipAllDown();\n }\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\t\tTileDeck.getInstance().slideOut();\n }\n });\n\n \n // next prompt each player to select an adjacent hex\n ClickObserver.getInstance().setTerrainFlag(\"Setup: SelectTerrain\");\n // loop 2 times so each player adds 2 more hexes\n for( int i=0; i<2; i++ ){\n for( final Player p : playerList ) {\n this.player = p;\n\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n final ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n }\n });\n \tfor (Terrain t1 : ownedHexes) {\n \t\tIterator<Coord> keySetIterator = Board.getTerrains().keySet().iterator();\n \twhile(keySetIterator.hasNext()) {\n \t\tCoord key = keySetIterator.next();\n \t\tfinal Terrain t2 = Board.getTerrains().get(key);\n \t\tif (t2.compareTo(t1) == 1 && !t2.isOccupied() && !t2.getType().equals(\"SEA\")) {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\t\tt2.uncover();\n }\n });\n \t\t}\n \t}\n \t}\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select an adjacent hex to add to your kingdom.\");\n }\n });\n // forces the GameLoop thread to wait until unpaused\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n }\n // prompt each player to place their first tower\n ClickObserver.getInstance().setTerrainFlag(\"Construction: ConstructFort\");\n for( final Player p : playerList ) {\n this.player = p;\n \n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select one of your tiles to place a tower.\");\n }\n });\n \n // sleeps to avoid null pointer (runLater is called before player.getHexesOwned() below)\n try { Thread.sleep(50); } catch( Exception e ){ return; }\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n \n for (final Terrain t : ownedHexes) {\n \t\n \tif (t.getOwner().getName().equals(player.getName())) { \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\tt.uncover();\n }\n });\n \t}\n }\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n // allow players to add some or all things to their tiles.\n ClickObserver.getInstance().setTerrainFlag(\"RecruitingThings: PlaceThings\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(false);\n }\n });\n for (final Player p : playerList) {\n this.player = p;\n player.flipAllUp();\n doneClicked = false;\n ClickObserver.getInstance().setClickedTerrain(p.getHexesOwned().get(2));\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tClickObserver.getInstance().whenTerrainClicked();\n GUI.getRackGui().setOwner(player);\n Board.applyCovers();\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName()\n + \", place some or all of your things on a tile you own.\");\n }\n });\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n for (final Terrain t : ownedHexes) {\n \tif (t.getOwner().getName().equals(player.getName())) {\n\t Platform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tt.uncover();\n\t }\n\t });\n \t}\n }\n \n while (isPaused) {\n try { Thread.sleep(100); } catch(Exception e) { return; }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setTerrainFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.removeCovers();\n }\n });\n }", "public void startSnake() {\n createBoard();\n generateFirstSnake();\n generateEnemy();\n spawnApples();\n printBoard();\n keepMoving();\n }", "public void start() {\n ArrayList<String> names = new ArrayList<>();\n game.initialize(names);\n //game.play(this.mainPkmn, this.attack);\n\n }", "@BeforeClass\n public void setup()\n throws Exception {\n startZk();\n startController();\n startBroker();\n startKafka();\n }", "public void start() {\n System.out.println(\"This vehicle starts\");\n }", "@Before\n\tpublic void setup(){\n\t\tuuid = UUID.randomUUID();\n\t\ttitle = \"The Dark Knight\";\n\t\tdescription = \"Nanananana Batmaaaaan!\";\n\t\tstartDate = new Date(2008, 01, 01);\n\t\ttagLabel = \"Test-Tag\"; \n\t}", "private void init() \n\t{\n\t\tgoalReached = false;\n\t\tGdx.input.setInputProcessor(this);\n\t\tcameraHelper = new CameraHelper();\n\t\tlives = Constants.LIVES_START;\n\t\tlivesVisual = lives;\n\t\ttimeLeftGameOverDelay = 0;\n\t\tinitLevel();\n\n\t}", "protected void initialize() {\n \tshooterWheel.shooterWheelSpeedControllerAft.reset();\n \tshooterWheel.shooterWheelSpeedControllerAft.Enable();\n }", "public void setup() {\n\t\t//size(0,0,PApplet.P3D);\n\t}", "public void setup() {\n this.imageStore = new ImageStore(\n createImageColored(TILE_WIDTH, TILE_HEIGHT,\n DEFAULT_IMAGE_COLOR));\n this.world = new WorldModel(WORLD_ROWS, WORLD_COLS,\n createDefaultBackground(imageStore));\n this.view = new WorldView(VIEW_ROWS, VIEW_COLS, this, world, TILE_WIDTH,\n TILE_HEIGHT);\n this.scheduler = new EventScheduler(timeScale);\n\n loadImages(IMAGE_LIST_FILE_NAME, imageStore, this);\n loadWorld(world, LOAD_FILE_NAME, imageStore);\n\n scheduleActions(world, scheduler, imageStore);\n\n nextTime = System.currentTimeMillis() + TIMER_ACTION_PERIOD;\n }", "public void setup() \n { \n \tsize(400,400);\n \tbac = new Bacteria[15];\n \tfor (int i = 0; i<bac.length; i++)\n \t{\n \t\tbac[i]= new Bacteria(200,200);\n \t\tbac[i].c();\n \t} //initialize bacteria variables here \n }", "public void spawnCloud( LogicEngine in_logicEngine, int in_cloudNumber,float in_x)\r\n\t{\r\n\t}", "public void setup()\n\t\t{\n\t\tsize(800, 600, P3D);\n\t\tsmooth();\n\t\tgfx = new ToxiclibsSupport(this);\n\t\tvoronoi = new Voronoi();\n\t\t// focus x positions around horizontal center (w/ 33% standard deviation)\n\t\txPos = new BiasedFloatRange(0, width, width / 2, 0.333f);\n\t\t// focus y positions around bottom (w/ 50% standard deviation)\n\t\tyPos = new BiasedFloatRange(0, height, height, 0.5f);\n\t\tclipper = new SutherlandHodgemanClipper(new Rect(0, 0, width, height));\n\t\tpos = new ArrayList<Vec2D>();\n\t\theights = new ArrayList<Vec3D>();\n\t\tdoShowPoint = true;\n\t\tdoShowPolygon = true;\n\t\tdoTriangle = true;\n\t\tdoTerrain = false;\n\t\tdoInteract = true;\n\t\t//addGridSites();\n\t\t}", "private void initBackground() {\n\t\tfor (int i = numOfParticles - World.getObjects().size() - 1; i >= 0; i--) {\n\t\t\tfloat x = (float) (Math.random()\n\t\t\t\t\t* (Screen.getWidth() + LEDLogo.WIDTH * 2) - LEDLogo.WIDTH), y = (float) (Math\n\t\t\t\t\t.random() * (Screen.getHeight() + LEDLogo.HEIGHT * 2) - LEDLogo.HEIGHT);\n\t\t\tWorld.add(new LEDLogo(x, y, (float) Math.random() * 0.8f + 0.2f));\n\t\t}\n\t}", "@Override\n\tpublic void start() {\n\t\t\tSystem.out.println(\"BMW --- strart\");\n\t}", "private void setup()\n {\n // TO STUDENTS: Add, revise, or remove methods as needed to define your own game's world\n //addLeftGround();\n //addFences();\n //addMetalPlateSteps();\n addClouds();\n addEnemy();\n addCoin();\n //addRightGround();\n // add a metal plate\n for(int i=0; i<=3; i+=1)\n {\n //location\n int x = 10 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=3; i+=1)\n {\n //location\n int x = 11 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=4; i+=1)\n {\n //location\n int x = 10 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=4; i+=1)\n {\n //location\n int x = 11 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 17 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 18 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=7; i+=1)\n {\n //location\n int x = 17 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 7 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=7; i+=1)\n {\n //location\n int x = 18 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 7 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=3; i+=1)\n {\n //location\n int x = 24 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=3; i+=1)\n {\n //location\n int x = 25 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=5; i+=1)\n {\n //location\n int x = 24 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=5; i+=1)\n {\n //location\n int x = 25 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 31 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n }\n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 32 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n }\n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 31 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 13 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 32 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 13 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 42 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 43 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 42 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 8 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 43 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 8 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=4; i+=1)\n {\n //location\n int x = 47 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=4; i+=1)\n {\n //location\n int x = 48 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=5; i+=1)\n {\n //location\n int x = 47 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=5; i+=1)\n {\n //location\n int x = 48 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=2; i+=1)\n {\n //location\n int x = 52 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=2; i+=1)\n {\n //location\n int x = 53 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 52 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 8 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 53 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 8 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n addHero();\n }", "private void initialize() {\n\n // \n // 1) Driver to run Seed Tracker.\n //\n if (!strategyResource.startsWith(\"/\")) {\n strategyResource = \"/org/hps/recon/tracking/strategies/\" + strategyResource;\n }\n List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(this.getClass().getResourceAsStream(strategyResource));\n StraightTracker stFinal = new StraightTracker(sFinallist, this._useHPSMaterialManager, this.includeMS);\n// stFinal.setApplySectorBinning(_applySectorBinning);\n stFinal.setUseDefaultXPlane(false);\n stFinal.setDebug(this.debug);\n stFinal.setIterativeConfirmed(_iterativeConfirmed);\n stFinal.setMaterialManagerTransform(CoordinateTransformations.getTransform());\n stFinal.setInputCollectionName(stInputCollectionName);\n stFinal.setTrkCollectionName(trackCollectionName);\n stFinal.setBField(bfield);\n stFinal.setTrackFittingAlgorithm(new StraightTrackAxialFitter());\n if (debug) {\n stFinal.setDiagnostics(new SeedTrackerDiagnostics());\n }\n // stFinal.setSectorParams(false); //this doesn't actually seem to do anything\n stFinal.setSectorParams(1, 10000);\n add(stFinal);\n//\n// if (rmsTimeCut > 0) {\n// stFinal.setTrackCheck(new HitTimeTrackCheck(rmsTimeCut));\n// }\n }", "public void setUp() {\r\n\t\tsynchronized(phys) {\r\n\t\t\r\n\t\tReactionSystem reactions = new ReactionSystem();\r\n\t\tphys.getParticles().clear();\r\n\t\tphys.compounds.clear();\r\n\t\tphys.particlecount.clear();\r\n\t\t\r\n\t\t//Add new compounds\r\n\t\t\r\n\t\tfor (Compound c: rm.compounds) {\r\n\t\t\tphys.addCompound(c);\r\n\t\t}\r\n\t\t\r\n\t\t//Add new reactions\r\n\t\t\r\n\t\tfor (CompoundReaction rx: rm.reactions) {\r\n\t\t\trx.convertToReactions(reactions.getReactions());\r\n\t\t}\r\n\t\t\r\n\t\tphys.reactions = reactions;\r\n\t\tphys.calculateAvgMass();\r\n\t\tphys.calculateAvgRadius();\r\n\t\r\n\t\t\r\n\t\tfor (Reaction r: phys.reactions.getReactions()) {\r\n\r\n\t\t\tSystem.out.println(r);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//Add graphs\r\n\t\tscale.reset();\r\n\t\tphys.graphs.clear();\r\n\t\tfor (Compound c: phys.compounds) {\r\n\t\t\tphys.graphs.add(new ConcentrationDataCollector(300, c, scale));\t\r\n\t\t}\r\n\t\t\r\n\t\tphys.time = 0;\r\n\t\tphys.nextcollection = phys.collectioninterval;\r\n\t\tphys.bondenergy = 0;\r\n\t\t}\r\n\t}", "@Override\n public SpriteParticleSystem build(Engine engine, float fontX, float fontY)\n {\n\t final float particlesXSpawn = fontX;\n\t final float particlesYSpawn = fontY;\n\n\t //Max & min rate are the maximum particles per second and the minimum particles per second.\n\t final float maxRate = 100;\n\t final float minRate = 80;\n\n\t //This variable determines the maximum particles in the particle system.\n\t final int maxParticles = 30;\n\n\t //Particle emitter which will set all of the particles at a ertain point when they are initialized.\n\t final PointParticleEmitter pointParticleEmtitter = new PointParticleEmitter(particlesXSpawn, particlesYSpawn);\n\n\t //Creating the particle system.\n\t\tparticleSystem = new SpriteParticleSystem (pointParticleEmtitter, maxRate, minRate, maxParticles, ResourcesManager.getInstance().waterDrop, vbom);\n\n\t //And now, lets create the initiallizers and modifiers.\n\t //Velocity initiallizer - will pick a random velocity from -20 to 20 on the x & y axes. Play around with this value.\n\t particleSystem.addParticleInitializer(new VelocityParticleInitializer<Sprite>(-25, 25, 0, 150));\n\n\t //Acceleration initializer - gives all the particles the earth gravity (so they accelerate down).\n\t particleSystem.addParticleInitializer(new GravityParticleInitializer<Sprite>());\n\n\t //And now, adding an alpha modifier, so particles slowly fade out. This makes a particle go from alpha = 1 to alpha = 0 in 3 seconds, starting exactly when the particle is spawned.\n\t //particleSystem.addParticleModifier(new AlphaParticleModifier<Sprite>(1, 0, 0, 0));\n\n\t //Lastly, expire modifier. Make particles die after 3 seconds - their alpha reached 0.\n\t particleSystem.addParticleInitializer(new ExpireParticleInitializer<Sprite>(3)); \n\n\t return particleSystem;\n}", "@BeforeClass\n\tpublic static void setup() {\n\t\tbaseWorld = new BaseWorld(1000 ,1500);\n \tGameManager.get().setWorld(new BaseWorld(1000, 1500));\n\t}", "@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n // robot.leftBumper.setPosition(.5);\n // robot.leftStageTwo.setPosition(1);\n // robot.rightStageTwo.setPosition(0.1);\n robot.colorDrop.setPosition(0.45);\n robot.align.setPosition(0.95);\n\n // robot.rightBumper.setPosition(.7);\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }", "protected void initialize() {\n Timer.delay(7);\n ballIntake.turnOnHorizontalConveyor();\n ballIntake.verticalConveyor.set(-.3);\n }", "public void startScene()\r\n\t{\r\n\t\tthis.start();\r\n\t}" ]
[ "0.6801799", "0.6199531", "0.6153909", "0.6148029", "0.608671", "0.60800683", "0.60112906", "0.5906025", "0.58836323", "0.5881474", "0.58694285", "0.5846197", "0.5841729", "0.58132696", "0.57776994", "0.57731855", "0.57634693", "0.5694092", "0.563845", "0.5626715", "0.5609441", "0.5601664", "0.5596911", "0.5593517", "0.558767", "0.5562693", "0.55573696", "0.5555619", "0.554813", "0.55352277", "0.5512582", "0.55041516", "0.5494923", "0.5484486", "0.54778343", "0.54765284", "0.5476162", "0.54743946", "0.54649776", "0.5447264", "0.5445073", "0.5442677", "0.5438556", "0.5437177", "0.5432104", "0.5428824", "0.5419697", "0.5409391", "0.5402123", "0.5400731", "0.53979313", "0.53959185", "0.53953755", "0.53939563", "0.53882974", "0.53845596", "0.5376444", "0.5373349", "0.5371943", "0.5364577", "0.5361417", "0.5357597", "0.5343362", "0.5342875", "0.53382254", "0.5337413", "0.5335417", "0.53353137", "0.5329836", "0.53282857", "0.53267986", "0.532592", "0.5321544", "0.53138804", "0.5311507", "0.5311154", "0.5308697", "0.52985024", "0.5296433", "0.52896845", "0.52875656", "0.52814734", "0.52683765", "0.5267075", "0.5262648", "0.526057", "0.5254959", "0.5252886", "0.525262", "0.5249704", "0.5249042", "0.5246997", "0.52231157", "0.5221955", "0.522084", "0.5220446", "0.5212758", "0.52037364", "0.51992416", "0.5197016" ]
0.6085912
5
Starts the reloading of the weapon and plays the sound
public void startReloading() { reload.setTimeOffset(1); reload.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void reloadWeapon() {\r\n Timer timer = new Timer();\r\n Colt.playReloadSound();\r\n timer.schedule(new FinishReload(), 2000);\r\n }", "public void startShower(){\n Log.d(LOGTAG,\"Shower is on.\");\n playSound();\n\n\n }", "public static void playerRun()\n {\n runSound.playLooped();\n }", "@Override\n\tpublic void playLivingSound() {\n\t\tgetSoundManager().playLivingSound();\n\t}", "private void play() {\n\t\tlog.finest(\"Playing sound\");\n\t\ttone.trigger();\n\t}", "public void play() {\n\t\tplay(true, true);\n\t}", "public static void game_sound() {\n\t\tm_player_game.start();\n\t\tm_player_game.setMediaTime(new Time(0));\n\t}", "public void play() {\n\t\t\r\n\t}", "public void play() {\n if (audio != null) {\n audio.play(sfxVolume);\n }\n }", "public void foodSound(){\n if (enableSound){\r\n\t clip.play();\r\n }\r\n\t\t\r\n\t}", "@Override\n\tpublic void OnGameStart() {\n\t\tsuper.OnGameStart();\n\t\tMusicManage.setLoopingMusic(tumMusic, true);\n\t\tMusicManage.playMusic(tumMusic);\n\t}", "private void playSound() {\n\t\tif (controllerVars.isLoaded() && !controllerVars.isPlays()) {\n\t\t\tcontrollerVars.getSoundPool().play(controllerVars.getSoundID(), controllerVars.getVolume(), controllerVars.getVolume(), 1, 0, 1f);\n\t\t\tcontrollerVars.COUNTER++;\n\t\t\t//Toast.makeText(act, \"Played sound\", Toast.LENGTH_SHORT).show();optional Playing message \n\t\t\tcontrollerVars.setPlays(true);\n\t\t\tonComplete(controllerVars.getMediaPlayer().getDuration());\n\t\t}\n\t\t//controllerVars.getMediaPlayer().start();\n\t\t//controllerVars.setPlays(true);\n\t}", "@Override\n\tpublic void OnAttackCommand() {\n\t\tsuper.OnAttackCommand();\n\t\tSoundManage.playSound(atkSound1);\n\t}", "public void launch() {\n if (volume == 0f) {\n return;\n }\n MediaPlayer launch = MediaPlayer.create(context, R.raw.fire);\n launch.setVolume(volume, volume);\n launch.start();\n launch.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n mediaPlayer.reset();\n mediaPlayer.release();\n }\n });\n }", "public void playSound() {\n if (this.mIsSupportVibrator) {\n this.mVibratorEx.setHwVibrator(\"haptic.control.time_scroll\");\n }\n if (this.mSoundPool == null || this.mSoundId == 0 || !this.mSoundLoadFinished) {\n Log.w(TAG, \"SoundPool is not initialized properly!\");\n } else {\n this.mSoundPool.play(this.mSoundId, 1.0f, 1.0f, 0, 0, 1.0f);\n }\n }", "@Override\n\tpublic void loadSounds() {\n\t\ttry {\n\t\t\tSoundPlayer.load(\"bounce.wav\");\n\t\t\tSoundPlayer.load(\"laser1.wav\");\n\t\t\tSoundPlayer.load(\"hit1.wav\");\n\t\t\tSoundPlayer.load(\"speedup.wav\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void playHitWall() {\r\n hitWall.play(soundFxVol);\r\n }", "public void play(){\n\t\t\n\t}", "public static void enableSound() {\n\t\tvelocity = 127;\n\t}", "public void shoot() {\n\t\tgetWeapon().triggerMain();\n\t\tsetShooting(true);\n\t}", "private void playSound() {\n if (isFlashOn) {\n mp = MediaPlayer.create(this, R.raw.light_switch_off);\n } else {\n mp = MediaPlayer.create(this, R.raw.light_switch_on);\n }\n mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n\n @Override\n public void onCompletion(MediaPlayer mp) {\n // TODO Auto-generated method stub\n mp.release();\n }\n });\n mp.start();\n }", "@Override\n\tpublic void run() {\n\t\t\n\t\t\n\t\ttry {\n\t\t\tMusiikki.rajahdysaani = new Sound(\"res/shell1.ogg\");\n\t\t\tMusiikki.tykkiaani = new Sound(\"res/gun.ogg\");\n\t\t\tMusiikki.musiikki = new Music(\"res/sendme.ogg\");\n\t\t} catch (SlickException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tMusiikki.musiikki.setVolume(1/2);\n\t\tMusiikki.musiikki.loop();\n\t\t\n\t}", "public void Play() {\n superPlaneGodMode = false;\r\n if (!musicPlaying)\r\n backgroundMusic.pause();\r\n if (musicPlaying)\r\n backgroundMusic.start();\r\n paused = false;\r\n }", "@Override\n\t\tpublic void run() {\n\t\t\tgenTone();\n\t\t\tplaySound();\n\t\t}", "protected void playS()\n\t\t{\n\t\t\tplayer.start();\n\t\t}", "@Override\n public void init() {\n GetSprite(\"/images/bullet.png\");\n MusicUtils.StopASounds(\"/music/Laser_Shoot.wav\");\n Level().play(\"/music/Laser_Shoot.wav\");\n }", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public final void play() {\n\t\tinitialize();\n\t\tstartPlay();\n\t\tendPlay();\n\t}", "public static void charge_sound() {\n\t\tm_player_charge.start();\n\t\tm_player_charge.setMediaTime(new Time(0));\n\t}", "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 playSoundGameLost() {\n\t\tlostGameSound.play();\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 }", "public void StartSound(ISoundOrigin origin, sfxenum_t sound_id);", "public void playSoundGameWon() {\n\t\tcompletedGameSound.play();\n\t}", "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 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 static void playerWalk()\n {\n walkSound.playLooped();\n }", "public void playDeadSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, DEAD);\n\t}", "public static void pop_sound() {\n\t\tm_player_pop.start();\n\t\tm_player_pop.setMediaTime(new Time(0));\n\t}", "public void game(){\n gameMusic.loop(pitch, volume);\n }", "public void playMusic() {\n\t\tthis.music.start();\n\t}", "public static void playScream()\n {\n scream.play();\n }", "private void gameSound(int attack){\n switch (attack){\n case 1:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_lightattack);\n break;\n case 2:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_strongattack);\n break;\n case 3:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_brutalattack);\n break;\n }\n mediaPlayer.start();\n }", "public void playSound() {\n\t\tmediaPlayer.play();\n\t}", "public static void loadSounds()\n {\n combust = new SoundLoader(\"explosion.wav\");\n zWalk = new SoundLoader(\"zWalk.wav\");\n bite = new SoundLoader(\"zBite.wav\");\n hitObst = new SoundLoader(\"zHitObst.wav\");\n runSound = new SoundLoader(\"pRunSound.wav\");\n walkSound = new SoundLoader(\"pWalkSound.wav\");\n scream = new SoundLoader(\"pScream.wav\");\n\n zWalk.makeBalanceControlled();\n hitObst.makeBalanceControlled();\n\n }", "@Override\n\tpublic void play() {\n\t\tGuitar.super.play();\n\t\tPiano.super.play();\n\t}", "public void play() {\n\t\tif (happiness + 10 > 100) {\n\t\t\thappiness = 100;\n\t\t} else {\n\t\t\thappiness += 10;\n\t\t}\n\t}", "public void Play();", "public void play() {\n\t\tif(hasAudioLoaded()) {\n\t\t\tcurrentClip.start();\n\t\t\tisPlaying = true;\n\t\t}\n\t}", "public void continueSound() {\n\t\tclip.start();\n\t}", "protected void playDispenseSound(IBlockSource p_82485_1_)\n {\n p_82485_1_.getWorld().playAuxSFX(1000, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0);\n }", "public void start() {\n ArrayList<String> names = new ArrayList<>();\n game.initialize(names);\n //game.play(this.mainPkmn, this.attack);\n\n }", "public void reloadSoundDevices();", "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}", "@Override\n\tpublic void run()\n\t{\n\t\tlong startTime = System.currentTimeMillis();\n\t\tlong startTimeGun = startTime;\n\t\tlong startTimeEnemyGun = startTime;\n\t\tlong startTimeClouds = startTime;\n\t\tlong startTimeBoss = startTime;\n\t\tlong startTimeBossBullet = startTime;\n\t\t\n\t\t//start player gun sound, this will run till player dies\n\t\tif (GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER) && GameState._weapons.get(0).getDestroyedFlag() == false)\n\t\t{\n\t\t\tAudioPlayer.resumePlayerGun();\n\t\t}\n\t\t\n\t\t//main game loop\n\t\twhile(GameState.mIsRunning == true)\n\t\t{\t\n\t\t\tlong currentTime = System.currentTimeMillis();\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t//create clouds \n\t\t\t\tint cloudCount = GameUtils.getTypeCount(Constants.CLOUD); \n\t\t\t\tlong currentTimeClouds = currentTime;\n\t\t\t\tif (currentTimeClouds - startTimeClouds > 1000 && cloudCount < 6)\n\t\t\t\t{\n\t\t\t\t\tstartTimeClouds = currentTimeClouds;\n\t\t\t\t\tEnvBuilder.generateCloud(GameState._weapons.get(0).getX(), GameState._weapons.get(0).getY(), GameState._weapons.get(0).getCurrentDirection());\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t \t//generate a new ship. \t\n\t\t \tint enemyCount = GameUtils.getTypeCount(Constants.ENEMY_FIGHTER); \n\t\t \t// System.out.println(\"enemyCount: \" + enemyCount);\n\t\t\t\tif (GameState.mWaitTimeBetweenLevels == false && (currentTime - startTime) > 300 && enemyCount < 4)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t \tEnvBuilder.generateEnemy(GameState._weapons.get(0).getX()\n\t\t\t \t\t\t, GameState._weapons.get(0).getY());\t\t\n\t\t\t \tstartTime = currentTime;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//generate a boss ship\t\t\t\t\n\t\t\t\tif (GameState.mWaitTimeBetweenLevels == false && (currentTime - startTimeBoss) > 6000)\n\t\t\t\t{\n\t\t\t\t\tEnvBuilder.generateEnemyBoss(GameState._weapons.get(0).getX()\n\t\t\t\t\t \t\t, GameState._weapons.get(0).getY());\n\t\t\t\t\tstartTimeBoss = currentTime;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// fire enemy guns constantly\t\n\t\t\t\tlong currentTimeEnemyGun = System.currentTimeMillis();\n\t\t\t\tif (currentTimeEnemyGun - startTimeEnemyGun > 850 && GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER) == true && GameState.sFireEnemyGuns == true)\n\t\t\t\t{\n\t\t\t\t\tfor(int i = 0; i < GameState._weapons.size(); i ++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tif (currentTime - startTimeBossBullet > 500)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName() == (Constants.ENEMY_BOSS))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\t\n\t\t\t\t\t\t\t\tMovementEngine bossBullet = new BossBullet(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX() \n\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t, 3, 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t, Constants.GUN_ENEMY, GameState._weapons.get(i), 50, 1); \n\t\t\t\t\t\t\t\tGameState._weapons.add(bossBullet);\n\t\t\t\t\t\t\t\tstartTimeBossBullet = currentTime;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((int)(Math.random() * 100) > 98)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (Math.random() * 100 > 20)\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName()==(Constants.ENEMY_FIGHTER) && GameUtils.getRange(GameState._weapons.get(i), GameState._weapons.get(0)) > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstartTimeEnemyGun = currentTimeEnemyGun;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// get player track\n\t\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tMovementEngine bullet = new Bullet(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX() \n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t\t, 3, 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t\t, Constants.GUN_ENEMY, GameState._weapons.get(i), 100, 1); \n\t\t\t\t\t\t\t\t\tGameState._weapons.add(bullet);\n\t\t\t\t\t\t\t\t\tif (GameState._muted == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tAudioPlayer.playEnemyGun();\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\telse\n\t\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName()==(Constants.ENEMY_FIGHTER) && GameUtils.getRange(GameState._weapons.get(i), GameState._weapons.get(0)) > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstartTimeEnemyGun = currentTimeEnemyGun;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// get player track\n\t\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tMovementEngine missile = new Missile(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX()\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t\t, GameState._weapons.get(i).getCurrentSpeed(), 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t\t, Constants.MISSILE_ENEMY, GameState._weapons.get(0), GameState._weapons.get(i), 200); \n\t\t\t\t\t\t\t\t\tGameState._weapons.add(missile);\n\t\t\t\t\t\t\t\t\tif (GameState._muted == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tAudioPlayer.playMissileSound();\n\t\t\t\t\t\t\t\t\t}\n\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\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t// fire gun constantly\n\t\t\t\t// System.out.println(\"gunModifier:\" + _gunModifier);\n\t\t\t\tif (GameState._weapons.get(0).getDestroyedFlag() == false && (GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER)))\n\t\t\t\t{\n\t\t\t\t\tlong currentTimeGun = currentTime;\n\t\t\t\t\tif (currentTimeGun - startTimeGun > 40)\n\t\t\t\t\t{\n\t\t\t\t\t\tstartTimeGun = currentTimeGun;\n\t\t\t\t\t\tMovementEngine bullet = new Bullet(GameState._weapons.get(0).getCurrentDirection() + _gunModifier, GameState._weapons.get(0).getCurrentDirection() + _gunModifier\n\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(0).getX()\n\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(0).getY(),10, 10, 1, 1, Constants.GUN_PLAYER, GameState._weapons.get(0), 200, 1); \n\t\t\t\t\t\tGameState._weapons.add(bullet);\n\t\t\t\t\t\tgunModifier();\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t// move the ships around, check for collisions.\n\t\t\t\tfor(int i = 0; i < GameState._weapons.size(); i ++)\n\t\t \t{\t\t \t\t\n\t\t \t\tMovementEngine ship = GameState._weapons.get(i);\n\t\t \t\tif(ship.getWeaponName()==(Constants.MISSILE_PLAYER) || ship.getWeaponName()==(Constants.MISSILE_ENEMY))\n\t\t\t\t\t{\n\t\t \t\t\t// make smoke trail\n\t\t \t\t\tMovementEngine missileSmokeTrail = new ExplosionParticle(ship.getCurrentDirection(), ship.getCurrentDirection()\n\t\t\t\t\t\t\t\t, (int)ship.getX()\n\t\t\t\t\t\t\t\t, (int)ship.getY(),0, 0, 0, 0, Constants.MISSILE_SMOKE, null, 5, 1); \t\t \t\t\t\n\t\t \t\t\tGameState._weapons.add(missileSmokeTrail);\n\t\t\t\t\t}\n\n\t\t \t\t// make boss damage smoke trail\n\t\t \t\tif (ship.getWeaponName()==(Constants.ENEMY_BOSS))\n\t\t \t\t{\n\t\t\t \t\tif (ship.getHitpoints() < 10 )\n\t\t\t \t\t{\t\t\t \t\t\n\t\t\t\t\t\t\tint particleDirection = (int)(Math.random() * 360);\n\t\t\t\t\t\t\tint particleSpeed = (int)(Math.random() * 10);\n\t\t\t\t\t\t\tint particleEndurance = (int)(Math.random() * 50);\n\t\t\t\t\t\t\tMovementEngine explosionParticle = new ExplosionParticle(particleDirection, particleDirection\n\t\t\t\t\t\t\t\t\t, ship.getX(), ship.getY(), particleSpeed, 1, 1, 1, Constants.BOSS_SMOKE\n\t\t\t\t\t\t\t\t\t, null, particleEndurance, 1); \n\t\t\t\t\t\t\tGameState._weapons.add(explosionParticle);\n\t\t\t \t\t}\n\t\t \t\t}\n\t\t \t\tship.run();\t\n\t\t \t\t\n\t\t \t\t//TODO O(n^2) function unfortunately, any other way to make this faster? \n\t\t \t\tcheckCollisions(ship);\n\t\t \t}\n\t\t\t\t\n\t\t\t\t//check destroyed and remove from list if so, remove all objects that are over 450 units away from the player\n\t\t\t\tfor(int i = 1; i < GameState._weapons.size(); i ++)\n\t\t \t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((i > 0 && GameUtils.getRange(GameState._weapons.get(0), GameState._weapons.get(i)) > 450) \n\t\t\t\t\t\t\t\t|| (GameState._weapons.get(i).getDestroyedFlag() == true))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGameState._weapons.remove(i);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\tcatch(ArrayIndexOutOfBoundsException e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// ignore and continue\n\t\t\t\t\t}\n\t\t \t}\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tlong singleLoopTime = System.currentTimeMillis() - currentTime;\n\t\t\t\tif (singleLoopTime < 16)\n\t\t\t\t{\n\t\t\t\t\tsleep(16 - singleLoopTime);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(InterruptedException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void gameComplete() {\n if (soundToggle == true) {\n gameComplete.start();\n } // if\n }", "@Override\r\n\t\tpublic void run()\r\n\t\t{\r\n\t\t\tLayeredSound.getInstance().add( sound );\r\n\t\t}", "public synchronized void start() {\n if(!running) {\n this.soundThread = new Thread(this, \"TankGameSound\");\n this.soundThread.start();\n this.running = true;\n }\n }", "public void playWinSound()\n {\n InputStream pathSoundFile = getClass().getResourceAsStream(\"bellringing.wav\");\n playSound(pathSoundFile);\n }", "@Test\n void reload() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setTurn(true);\n WeaponFactory wf = new WeaponFactory(\"machine gun\");\n Weapon w = new Weapon(\"machine gun\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n w.setLoaded(false);\n p.getPh().getWeaponDeck().addWeapon(w);\n p.reload(w);\n assertTrue(p.getPh().getWeaponDeck().getWeapon(w.getName()).getLoaded());\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(3000);\n\t\t\t\t\tdetachChild(anim);\n\n\t\t\t\t\tanim = null;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcache.get(position).getSound().play();\n\t\t\t\t\t\t// disable clicks on these first\n\t\t\t\t\t\tdetachChild(greenTick);\t\n\t\t\t\t\t\tdetachChild(redx);\n\t\t\t\t\t\tif(sprite1 != null)\n\t\t\t\t\t\t\tregisterTouchArea(sprite1);\n\t\t\t\t\t\tif(sprite2 != null)\n\t\t\t\t\t\t\tregisterTouchArea(sprite2);\n\t\t\t\t\t\tif(sprite3 != null)\n\t\t\t\t\t\t\tregisterTouchArea(sprite3);\n\t\t\t\t\t\tif(sprite4 != null)\n\t\t\t\t\t\t\tregisterTouchArea(sprite4);\n\t\t\t\t\t} catch (IndexOutOfBoundsException e) {\n\t\t\t\t\t\tshowToast(\"Line 277\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }", "public void startCommand() {\r\n _playing = true;\r\n }", "public void play() {\n if (!isHungry()) {\n hunger += 2;\n mood += 2;\n fatigue += 3;\n\n if (!muted) {\n System.out.println(\"play\\t|\\tPlaying is fun!\");\n }\n }\n }", "public void playGameOverSound() {\n\t\ttry {\n\t\t\tAudioInputStream audioStream = AudioSystem.getAudioInputStream(new File(\"Musik/DeadSound.wav\"));\n\t\t\t\n\t\t\tClip clip = AudioSystem.getClip(); \n\t\t\tclip.open(audioStream);\n\t\t\t\n\t\t\tboolean oldStatus = settings.isPlaying(); \n\t\t\t\n\t\t\tstopMusik();\n\t\t\t\n\t\t\t\n\t\t\tthis.settings.setPlaying(oldStatus);\n\t\t\tclip.start();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\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 static void portail_sound() {\n\t\tm_player_portail.start();\n\t\tm_player_portail.setMediaTime(new Time(0));\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 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 }", "@Override\n\tpublic void play() {\n\n\t}", "public void PlaySound(Context context) {\r\n\t\tif (!this.mp.isPlaying()) {\r\n\t\t\tmp.start();\r\n\t\t}\r\n\t}", "@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 void startWave() {\n\n audio.playSound(LDSound.SMALL_CLICK);\n if (canStartWave()) {\n Logger.info(\"HUD Presenter: starting wave\");\n levelStateManager.setState(LevelState.WAVE_IN_PROGRESS);\n uiStateManager.setState(GameUIState.WAVE_IN_PROGRESS);\n }\n }", "@Override\n\tpublic void play() {\n\t\t\n\t}", "void play();", "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 run() {\n\t\tif (timeToStart > 0 && timeToStart <= 3) {\n\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\tonline.sendMessage(Main.prefix() + \"UHC is starting in §6\" + String.valueOf(timeToStart) + \"§7.\");\n\t\t\t\tonline.playSound(online.getLocation(), Sound.SUCCESSFUL_HIT, 1, 0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (timeToStart == 1) {\n\t\t\tMain.stopCountdown();\n\t\t\tBukkit.getServer().getScheduler().scheduleSyncDelayedTask(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.SUCCESSFUL_HIT, 1, 1);\n\t\t\t\t\t\tif (ArrayUtil.spectating.contains(online.getName())) {\n\t\t\t\t\t\t\tSpectator.getManager().set(online, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.setAllowFlight(false);\n\t\t\t\t\t\tonline.setFlying(false);\n\t\t\t\t\t\tonline.setHealth(20.0);\n\t\t\t\t\t\tonline.setFireTicks(0);\n\t\t\t\t\t\tonline.setSaturation(20);\n\t\t\t\t\t\tonline.setLevel(0);\n\t\t\t\t\t\tonline.setExp(0);\n\t\t\t\t\t\tif (!ArrayUtil.spectating.contains(online.getName())) {\n\t\t\t\t\t\t\tonline.showPlayer(online);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.awardAchievement(Achievement.OPEN_INVENTORY);\n\t\t\t\t\t\tonline.setFoodLevel(20);\n\t\t\t\t\t\tonline.getInventory().clear();\n\t\t\t\t\t\tonline.getInventory().setArmorContents(null);\n\t\t\t\t\t\tonline.setItemOnCursor(new ItemStack (Material.AIR));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (online.getGameMode() != GameMode.SURVIVAL) {\n\t\t\t\t\t\t\tonline.setGameMode(GameMode.SURVIVAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (PotionEffect effect : online.getActivePotionEffects()) {\n\t\t\t\t\t\t\tonline.removePotionEffect(effect.getType());\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 250, 100));\n\t\t\t\t\t\tonline.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 6000, 100));\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"UHC has now started, Good luck!\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"PvP will be enabled in §6\" + Settings.getInstance().getData().getInt(\"game.pvp\") + \" §7mins in.\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"Meetup at §6\" + Settings.getInstance().getData().getInt(\"game.meetup\") + \" §7mins in.\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"Remember to read the match post: \" + Settings.getInstance().getData().getString(\"match.post\"));\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"/helpop questions.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tGameState.setState(GameState.INGAME);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§a§lPvE\", 1);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§a§lPvE\", 0);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lMeetup\", Integer.parseInt(\"-\" + Settings.getInstance().getData().getInt(\"game.meetup\")));\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lPvP\", Integer.parseInt(\"-\" + Settings.getInstance().getData().getInt(\"game.pvp\")));\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lFinal heal\", -1);\n\t\t\t\t\t\n\t\t\t\t\tfor (World world : Bukkit.getWorlds()) {\n\t\t\t\t\t\tworld.setTime(0);\n\t\t\t\t\t\tworld.setDifficulty(Difficulty.HARD);\n\t\t\t\t\t\tworld.setPVP(false);\n\t\t\t\t\t\tfor (Entity mobs : world.getEntities()) {\n\t\t\t\t\t\t\tif (mobs.getType() == EntityType.BLAZE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.CAVE_SPIDER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.CREEPER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.ENDERMAN ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.ZOMBIE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.WITCH ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.WITHER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.DROPPED_ITEM ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.GHAST ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.GIANT ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.MAGMA_CUBE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.DROPPED_ITEM ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SKELETON ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SPIDER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SLIME ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SILVERFISH ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SKELETON || \n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.EXPERIENCE_ORB) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tmobs.remove();\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}, 20);\n\t\t\t\n\t\t\tBukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lFinal heal\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lFinal heal\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"§6§lFinal heal!\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\tonline.setHealth(20.0);\n\t\t\t\t\t\t\t\tonline.setFireTicks(0);\n\t\t\t\t\t\t\t\tonline.setFoodLevel(20);\n\t\t\t\t\t\t\t\tonline.setSaturation(20);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lFinal heal\", Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1);\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\t\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lPvP\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lPvP\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lPvP\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"PvP is now enabled, Good luck everyone.\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (World world : Bukkit.getWorlds()) {\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lPvP\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lPvP\", Scoreboards.getManager().getScore(\"§b§lPvP\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lPvP\") == -5) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"5 minutes to pvp, do §6/stalk §7if you think you're being stalked.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\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 (Scoreboards.getManager().getScore(\"§b§lPvP\") == -1) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"1 minute to pvp, do §6/stalk §7if you think you're being stalked.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\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\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lMeetup\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lMeetup\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.DARK_GRAY + \"==============================================\");\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.GREEN + \" Meetup has started, start headding to 0,0.\");\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.GREEN + \" Only stop for a fight, nothing else.\");\n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.DARK_GRAY + \"==============================================\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.WITHER_DEATH, 1, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lMeetup\", Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lMeetup\") == -1) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"1 minute to meetup, Pack your stuff and get ready to head to 0,0.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\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}, 1200, 1200);\n\t\t\t\n\t\t\tBukkit.getServer().getScheduler().runTaskLater(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tBukkit.getPlayer(Settings.getInstance().getData().getString(\"game.host\")).chat(\"/gamerule doMobSpawning true\");\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t}\n\t\t\t}, 3600);\n\t\t}\n\t\ttimeToStart -=1;\n\t}", "private void play()\n {\n if(AudioDetector.getInstance().isNoAudio())\n {\n return;\n }\n\n stop();\n musicPlayer.play();\n }", "@Override\n public void playStart() {\n }", "public void start() {\n background.playMusic();\n createTimer();\n timer.start();\n }", "@Override\r\n protected void playGameStartAudio() {\n\taudio.playClip();\r\n }", "@Override\n public void playSound(int soundId) {\n\n }", "public void keepLooping() {\n\t\tif(!clip.isActive()) {\n\t\t\tstartSound();\n\t\t}\n\t}", "public void start(){\n\t\tif (host.getGameSettings().isMusicOn()) {\r\n\t\t\tspr_btnMute.setFrame(0);\r\n\t\t}else{\r\n\t\t\tspr_btnMute.setFrame(1);\r\n\t\t}\r\n\t}", "public static void startMusic()\n\t{\n\t\tmusic.loop();\n\t}", "public void startWaves()\n\t{\n\t\tif(!this.active)\n\t\t{\n\t\t\tthis.spawnTimer = new CooldownTimer(0);\n\t\t\tthis.waveTimer = new CooldownTimer(0);\n\t\t\tthis.timeUntilNextWaveTimer = new CooldownTimer(0);\n\t\t\tthis.active = true;\t\n\t\t\tthis.totalWaves = waveList.size();\n\t\t\tthis.currentWave = waveList.peek();\n\t\t}\t\n\t}", "public void play()\n\t{\n\t\tif (canPlay)\n\t\t{\n\t\t\tsong.play();\n\t\t\tsong.rewind();\n\t\t\tif (theSong == \"SG1\" || theSong == \"SG2\")\n\t\t\t\tcanPlay = false;\n\t\t}\n\t}", "@Override\n public void run(){\n Initialize();\n // Load game files (images, sounds, ...)\n LoadContent();\n \n Framework.gameState = Framework.GameState.PLAYING;\n }", "@Override\n public void run(){\n Initialize();\n // Load game files (images, sounds, ...)\n LoadContent();\n \n Framework.gameState = Framework.GameState.PLAYING;\n }", "public void switchWeapon() {\n\t\tif (type == 0) {\n\t\t\ttype = 1;\n\t\t\tthis.setImage(getFilename(type, held));\n\t\t\tsetFocus();\n\t\t} else {\n\t\t\ttype = 0;\n\t\t\tthis.setImage(getFilename(type, held));\n\t\t\tsetFocus();\n\t\t} // end else\n\t}", "private void startPlay() {\n isPlaying = true;\n isPaused = false;\n playMusic();\n }", "public static void Init() throws UnsupportedAudioFileException, IOException, LineUnavailableException {\n enemyHurt = new SoundEffect(\"/sounds/enemy_hurt.wav\");\n dragonShoot = new SoundEffect(\"/sounds/dragon_shoot.wav\");\n enemySpawn = new SoundEffect(\"/sounds/enemy_spawn.wav\");\n fireShoot = new SoundEffect(\"/sounds/fire_shoot.wav\");\n frostShoot = new SoundEffect(\"/sounds/frost_shoot.wav\");\n arcaneShoot = new SoundEffect(\"/sounds/arcane_shoot.wav\");\n winSFX = new SoundEffect(\"/sounds/win_sfx.wav\");\n oof = new SoundEffect(\"/sounds/oof.wav\");\n buttonPress = new SoundEffect(\"/sounds/button_press.wav\");\n }", "public static void soundJump(){\n\t\ttry {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t int randomNum = rand.nextInt((4 - 1) + 1) + 1;\r\n\t\t\t\r\n\t\t\t if(randomNum == 1){\r\n\t\t\t\t soundJump = new Sound(\"res/soundLiabary/Jump_00.wav\");\r\n\t\t\t\t soundJump.play(1f, 0.15f);\r\n\t\t\t\t \r\n\t\t\t } else if(randomNum == 2){\r\n\t\t\t\t soundJump = new Sound(\"res/soundLiabary/Jump_01.wav\");\r\n\t\t\t\t soundJump.play(1f, 0.15f);\r\n\t\t\t\t \r\n\t\t\t }else if(randomNum == 3){\r\n\t\t\t\t soundJump = new Sound(\"res/soundLiabary/Jump_02.wav\");\r\n\t\t\t\t soundJump.play(1f, 0.15f);\r\n\t\t\t\t \r\n\t\t\t }else if(randomNum == 4){\r\n\t\t\t\t soundJump = new Sound(\"res/soundLiabary/Jump_03.wav\");\r\n\t\t\t\t soundJump.play(1f, 0.15f);\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t} catch (SlickException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void play() {\n\t\tmusic.play();\n\t\tsyncPosition();\n\t}", "private void runBlueEssencePurchase2(String championName) {\r\n if (championName.equals(\"Blitzcrank\")) {\r\n playSound(\"./data/Blitzcrank.wav\");\r\n } else if (championName.equals(\"Darius\")) {\r\n playSound(\"./data/Darius.wav\");\r\n } else if (championName.equals(\"Syndra\")) {\r\n playSound(\"./data/Syndra.wav\");\r\n } else if (championName.equals(\"Lucian\")) {\r\n playSound(\"./data/Lucian.wav\");\r\n } else if (championName.equals(\"Akali\")) {\r\n playSound(\"./data/Akali.wav\");\r\n } else if (championName.equals(\"Sejuani\")) {\r\n playSound(\"./data/Sejuani.wav\");\r\n } else if (championName.equals(\"Fiddlesticks\")) {\r\n playSound(\"./data/Fiddlesticks.wav\");\r\n }\r\n }", "public void playSound(SoundType type) {\n if (!gameController.getGameStatPanel().getUserData().isSoundDisabled()) soundMap.get(type).play();\n }", "public static void playExplosion()\n {\n combust.play();\n if (combust.audioClip.getFramePosition() ==\n combust.audioClip.getFrameLength())\n {\n combust.audioClip.setFramePosition(0);\n combust.audioClip.stop();\n }\n }", "public void run() \r\n\t\t{\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tsourcedata.play();\r\n\t\t\t\t//sourcedata.load();\r\n\t\t\t}\r\n\t\t\tcatch ( Exception e )\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}//end catch\r\n\t\t}", "public void playGoombaSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, GOOMBA);\n\t}", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"打击乐器奏乐~~!\");\n\t}", "public void play() { player.resume();}" ]
[ "0.7843109", "0.70015854", "0.68341565", "0.6815458", "0.6773917", "0.6750238", "0.6705467", "0.6687442", "0.6647111", "0.66166043", "0.6616393", "0.661072", "0.6580112", "0.64729476", "0.64620125", "0.64528114", "0.6448786", "0.64340717", "0.64259684", "0.6421794", "0.64152336", "0.64127284", "0.6380288", "0.6379951", "0.63665056", "0.63598853", "0.6354149", "0.6337895", "0.6327405", "0.6319228", "0.6314018", "0.6303796", "0.6300467", "0.6297827", "0.62778956", "0.6247572", "0.62318003", "0.623082", "0.6229848", "0.6216558", "0.62163466", "0.62162554", "0.6214086", "0.62131304", "0.6195799", "0.6185481", "0.6182805", "0.61813074", "0.6176184", "0.61753494", "0.61741704", "0.6167699", "0.61610824", "0.61605644", "0.6160303", "0.6149732", "0.6149327", "0.614359", "0.61388934", "0.6137773", "0.61363226", "0.6135217", "0.61337215", "0.6133407", "0.6126755", "0.6122201", "0.61115557", "0.6111148", "0.61042875", "0.61032254", "0.6094502", "0.6094395", "0.6093876", "0.60936856", "0.6088074", "0.6080169", "0.60744935", "0.6059118", "0.6057441", "0.60531557", "0.6041777", "0.6032496", "0.6027742", "0.60197914", "0.60191065", "0.6009689", "0.600914", "0.600914", "0.60031545", "0.6002917", "0.6002246", "0.6001946", "0.6001064", "0.59969413", "0.5992494", "0.599176", "0.598221", "0.597911", "0.5976767", "0.59767395" ]
0.673655
6
Returns the Gun Control Haha Gun Control
public GunControl getGunControl() { return gunControl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CSugangsincung getsugangsincung() {\n\t\tCSugangsincung sugangsincung = new CSugangsincung();\r\n\t\tsugangsincung.setMoklok(\"123\");\r\n//\t\tgangjwa.setGyosuID(gyosuID);\r\n\t\treturn sugangsincung;\r\n\t}", "public final int getG() {\n\t\treturn green;\n\t}", "int getG();", "public int getG() {\r\n\t\treturn g;\r\n\t}", "public String getGh() {\n return gh;\n }", "public String getGg() {\n return gg;\n }", "public int getG();", "java.lang.String getBunho();", "java.lang.String getBunho();", "int getGunType();", "public int getGunType() {\n return gunType_;\n }", "public String getNo_hp_pelanggan(){\r\n \r\n return no_hp_pelanggan;\r\n }", "public Ghoul() {\n super();\n this.setName(\"Default Ghoul\");\n this.addAttack(-1);\n this.addDefense(2);\n this.addToughness(2);\n }", "public int getGunType() {\n return gunType_;\n }", "public String gettCggthid() {\n return tCggthid;\n }", "public final int mo5743ZU() {\n return C42466ag.CTRL_INDEX;\n }", "java.lang.String getHangmogCode();", "public C1697ap mo7098g() {\n return C1698a.f5333a;\n }", "public String getIfhot() {\n return ifhot;\n }", "public String getGunName() {\n\t\treturn gunName;\n\t}", "@AutoEscape\n\tpublic String getNguoiThamDu();", "public String mo9504h() {\n return this.f1518g;\n }", "public byte[] getG() {\n return g;\n }", "java.lang.String getHangmogName();", "public String getCHUNGCHI_KHAC()\n {\n return this.CHUNGCHI_KHAC;\n }", "public static int haveGun() {\n\t\treturn 108;\n\t}", "@Override\n\tpublic int getIdNguoiDong() {\n\t\treturn _keHoachKiemDemNuoc.getIdNguoiDong();\n\t}", "public abstract java.lang.Short getHabilitado();", "public String getZhxgr() {\n return zhxgr;\n }", "public String getGodClass()\r\n {\r\n return mGodClass;\r\n }", "public char group_mlx_GET()\n { return (char)((char) get_bytes(data, 8, 1)); }", "public char group_mlx_GET()\n { return (char)((char) get_bytes(data, 8, 1)); }", "public int getTahunLahir() {\r\n return tahunLahir;\r\n }", "public int mo36g() {\n return 8;\n }", "public String getName() {\n return \"GA binary individual\";\n }", "public String mo81396g() {\n return this.f58076h;\n }", "public C0673p mo863h() {\n return this.f2277g;\n }", "@Override\n\tpublic String getGiangVien() {\n\t\treturn giangVien.getTenGiangVien();\n\t}", "public int getCxcleunik() {\r\r\r\r\r\r\r\n return cxcleunik;\r\r\r\r\r\r\r\n }", "public int mo31256G() {\n return C8003l4.m38367c(this);\n }", "public UGen getGUGen() {\r\n\t\tif (isGStatic) {\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\treturn gUGen;\r\n\t\t}\r\n\t}", "public int getGusta() {\r\n\t\treturn gusta;\r\n\t}", "private int getvalueofUTRANorGSM(int index){\n\t\t\tint value = 0;\n\t\t\tif(strUorG[index] == \"G\"){\n\t\t\t\tvalue = 1;\n\t\t\t}\n\t\t\treturn value;\n\t}", "public String getShenhezhuangtai() {\n return shenhezhuangtai;\n }", "public int aiR() {\n return this.cGS;\n }", "public String mo15791hq() {\n return this.f3880Mw.mo15799hq();\n }", "public java.lang.String getHangmogCode() {\n java.lang.Object ref = hangmogCode_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n hangmogCode_ = s;\n }\n return s;\n }\n }", "public String getGloHeaderStr() {\n return gloHeaderStr;\n }", "public int getHunger() {\n\t\treturn this.hunger;\n\t}", "public String getGameCommands(){return \"\";}", "public int getHandicap() {\n return handicap;\n }", "public static Guns getByCode(int code) {\n switch (code){\n case 0:\n return RIFLE;\n case 1:\n return SHOTGUN;\n case 2:\n return REVOLVER;\n default:\n throw new IllegalArgumentException(\"Invalid gun code\");\n }\n }", "public C1680ab mo7065b() {\n return this.f4965g;\n }", "public int m2706g() {\n return ((Integer) this.f2439a.m2666a(ea.bs)).intValue();\n }", "public String getTUNGAY()\n {\n return this.TUNGAY;\n }", "public String getXghsbmc() {\n return xghsbmc;\n }", "public Gamygdala getGamygdala() {\n return this.gamygdala;\n }", "public Jugador ganador(){\n return partida.ganador();\n }", "public Gun() {\n\t\tgunName = \"pistol\";\n\t\tammo = 7;\n\t\taccuracy = 7;\n\t}", "public Image getUnicorn() {\r\n \treturn unicorn;\r\n }", "C0058i mo68a();", "public int mo36g() {\n return 2;\n }", "int getHat();", "public java.lang.String getHangmogCode() {\n java.lang.Object ref = hangmogCode_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n hangmogCode_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public double getG();", "public String getNGAYSINH()\n {\n return this.NGAYSINH;\n }", "public String getHeimo() {\n return this.heimo;\n }", "public int mo36g() {\n return 4;\n }", "protected String getCommand() {\n\treturn \"GAME\";\n }", "public int mo80c() {\n return 7;\n }", "public String getAgcProRewdPunish() {\n\t\treturn agcProRewdPunish;\n\t}", "public String getMA_KHOA()\n {\n return this.MA_KHOA;\n }", "public java.lang.String getMu_zhh() {\r\n return localMu_zhh;\r\n }", "public java.lang.String getMu_zhh() {\r\n return localMu_zhh;\r\n }", "public final int mo9382ZU() {\n return C26998a.CTRL_INDEX;\n }", "public int getBulanLahir() {\r\n return bulanLahir;\r\n }", "private double hitungLuas(){\r\n return super.getLuas() + PHI*super.getRadius()*this.hitungG_pelukis();\r\n }", "public String getMA_CHUYENNGANH()\n {\n return this.MA_CHUYENNGANH;\n }", "private static String m11g() {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"sh\");\n stringBuilder.append(\"el\");\n stringBuilder.append(\"la\");\n stringBuilder.append(\"_ve\");\n stringBuilder.append(\"rs\");\n stringBuilder.append(\"i\");\n stringBuilder.append(\"on\");\n return stringBuilder.toString();\n }", "public int getG_number() {\n\t\treturn g_number;\n\t}", "protected int getGripperState() { return gripperState; }", "public float getG() {\r\n\t\treturn g;\r\n\t}", "public String konus() {\n\t\treturn this.getIsim()+\" havliyor\";\n\t}", "public int mo9232aG() {\n return 0;\n }", "static int getGoalKey1() {\n return GOAL_KEY1;\n }", "public void Ganhou() {\n\t\tString[] g = new String[10]; \n\t\tg[0] = m[0][0] + m[0][1] + m[0][2];\n\t\tg[1] = m[1][0] + m[1][1] + m[1][2];\n\t\tg[2] = m[2][0] + m[2][1] + m[2][2];\n\t\t\n\t\tg[3] = m[0][0] + m[1][0] + m[2][0];\n\t\tg[4] = m[0][1] + m[1][1] + m[2][1];\n\t\tg[5] = m[0][2] + m[1][2] + m[2][2];\n\t\t\n\t\tg[6] = m[0][0] + m[1][1] + m[2][2];\n\t\tg[7] = m[2][0] + m[1][1] + m[0][2];\n\t\tg[8] = \"0\";\n\t\tg[9] = \"0\";\n\t\t\n\t\tfor(int i= 0; i<10; i++) {\n\t\t\tif(g[i].equals(\"XXX\")){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"X GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\temp = 0; \n\t\t\t\tbreak;\n\t\t\t} else if (g[i].equals(\"OOO\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\"O GANHOU\");\n\t\t\t\tacabou = true;\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t\t\n\t\tif (emp == 9) {\n\t\t\tJOptionPane.showMessageDialog(null,\"EMPATOU\");\t\n\t\t\tacabou = true;\n\t\t}\n\t}", "public int mo23298ga() {\n return ((Integer) this.f13965a.mo23249a(C7196pb.f13914zb)).intValue();\n }", "public String getHinban() {\r\n return hinban;\r\n }", "String m6857a() {\n return this.f5237h;\n }", "public BasicChar getBasicChar() {\n return this.wotCharacter;\n }", "public com.besixplus.sii.objects.Cgg_jur_anticipo getCgg_jur_anticipo(){\n\t\treturn this.myCgg_jur_anticipo;\n\t}", "@Override\n\tpublic int xuatLuong() {\n\t\treturn 3000;\n\t}", "public String mo862g() {\n return this.f2278h;\n }", "@Override\n\tpublic int getIdNguoiXuatBan() {\n\t\treturn _keHoachKiemDemNuoc.getIdNguoiXuatBan();\n\t}", "public char getUserGuessedLetter() {\n return userGuessedLetter;\n }", "public short mo5075h() {\n return this.f3707a;\n }", "public int getNumeroGiocatori() {\n return 0;\r\n }", "public int getGi() {\n\n\t\treturn gi;\n\t}", "public String getGigName() {\n return gigName;\n }", "public int getHat() {\n return hat_;\n }" ]
[ "0.6191904", "0.60288477", "0.6005204", "0.5989148", "0.59399974", "0.59396815", "0.59278834", "0.5909971", "0.5909971", "0.59039843", "0.5840216", "0.57775885", "0.577634", "0.5770829", "0.57467276", "0.57463914", "0.571744", "0.5690696", "0.56876475", "0.56870264", "0.56769353", "0.5636276", "0.56321084", "0.56144327", "0.55903506", "0.55806255", "0.55778056", "0.55670565", "0.55507267", "0.55482125", "0.553923", "0.553923", "0.5531122", "0.5527816", "0.5517479", "0.5511501", "0.55098546", "0.5509691", "0.5499124", "0.54798007", "0.54779637", "0.5472544", "0.54631144", "0.5440505", "0.54364914", "0.5430376", "0.5429804", "0.54286397", "0.5425605", "0.54222614", "0.54214746", "0.54103917", "0.54022515", "0.5397431", "0.53899556", "0.5387139", "0.53787297", "0.5374152", "0.5367879", "0.53648555", "0.53619957", "0.53570575", "0.53566724", "0.5354616", "0.5353681", "0.534884", "0.534627", "0.53357756", "0.53352034", "0.53330976", "0.5329422", "0.5323887", "0.53089607", "0.53089607", "0.5303722", "0.53030217", "0.53019184", "0.5296212", "0.5292003", "0.52907723", "0.5288141", "0.5287678", "0.528373", "0.52743447", "0.5268848", "0.52639955", "0.52574515", "0.52559555", "0.52536696", "0.5250389", "0.5250242", "0.5249882", "0.52484953", "0.52462053", "0.5242919", "0.5242362", "0.5240656", "0.52387923", "0.5232612", "0.5232565" ]
0.7097452
0
Gets the Entity out of a Node. For Shooting an Entity
private Entity findEntity(Node node) { if (node instanceof Entity) { return (Entity) node; } else if (node != ((SimpleApplication) stateManager.getApplication()).getRootNode()){ return findEntity(node.getParent()); } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Entity> retrieve(Entity entity){\n int index = this.getIndex(entity);\n if (index != -1){\n // Recursiveley find its real node\n return this.getNodes().get(index).retrieve(entity);\n }else{\n // It is part of the current node\n ArrayList<Entity> collision = (ArrayList<Entity>) entities.clone();\n collision.remove(entity); //We dont want to return the entity itself as part of the collision\n return collision;\n }\n\n }", "Entity getShooter();", "@Override\n\tpublic Entity getEntity() {\n\t\treturn entity;\n\t}", "public Entity getEntity() {\n if (entity != null) {\n return entity;\n }\n return entity = NMSUtils.getEntityById(this.entityID);\n }", "public Entity getEntity() {\n\t\treturn entity;\n\t}", "public Entity getEntity() {\n if (entity != null) {\n return entity;\n }\n return entity = NMSUtils.getEntityById(this.entityID);\n }", "public Entity getEntity() {\n if (entity != null) {\n return entity;\n }\n return entity = NMSUtils.getEntityById(this.entityID);\n }", "public Entity getEntity() {\n if (entity != null) {\n return entity;\n }\n return entity = NMSUtils.getEntityById(this.entityID);\n }", "public Entity getEntity() {\n\t\treturn DodgeBlawk.getDataManager().getEntity(getId());\n\t}", "public E getEntity() {\n return this.entity;\n }", "public E getEntity();", "public AbstractEntity getEntity() {\n if (entityClass == null) {\n return null;\n }\n try {\n AbstractEntity ent = entityClass.newInstance();\n if (value > -1) {\n ent.setSpriteValue(value);\n }\n return ent;\n } catch (InstantiationException | IllegalAccessException ex) {\n Logger.getLogger(CursorInfo.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "protected T getEntity() {\r\n\t\treturn entity;\r\n\t}", "@Override\n public Entity getEntity() {\n return super.getEntity();\n }", "public Entity getEntity(Position position) {\n Entity entity = board.getElement(position);\n if (entity != null) {\n return entity.clone();\n }\n return null;\n }", "public EntityBase getEntity() {\n return entity;\n }", "public ZEntity getEntity() {\r\n return entity;\r\n }", "public MapEntity getEntity() {\n\t\treturn _entity;\n\t}", "public IEntity getLeashedEntity() {\n return getEntity(source.getLeashedEntity());\n }", "public Entity returnEntityHere() {\n \n return entityHere_;\n \n }", "public Entity get_entity(String uid) {\n for (int layer_id: layer_ent_list.keySet()){\n Entity ent = get_entity(uid, layer_id);\n if (ent!=null){\n return ent;\n }\n }\n return null;\n }", "EntityType getEntity();", "private Entity ce() {\n return clientgui.getClient().getGame().getEntity(cen);\n }", "public Entity getEntityOn(int x, int y) {\n\t\tfor (int s = 0; s < entities.size(); s++) {\n\t\t\tEntity i = entities.get(s);\n\t\t\tif (i.getX() >> 4 == x >> 4 && i.getY() >> 4 == y >> 4)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn null;\n\n\t}", "public Entity getShoulderEntityLeft ( ) {\n\t\treturn extract ( handle -> handle.getShoulderEntityLeft ( ) );\n\t}", "Object get(Node node);", "public abstract V getEntity();", "public final String getEntity() {\n\t\treturn entity;\n\t}", "@Override\n public Object unwrap() {\n return node;\n }", "public Entity getShoulderEntityRight ( ) {\n\t\treturn extract ( handle -> handle.getShoulderEntityRight ( ) );\n\t}", "Node getNode();", "public Entity clone() {\n try {\n return (Entity) super.clone();\n } catch (CloneNotSupportedException e) {\n e.printStackTrace();\n return null;\n }\n }", "void visit(Entity node);", "public BE getBukkitEntity() {\n if (!bukkitEntity.isValid()) {\n final BE foundEntity = (BE) EntityUtils.findBy(getKey(), chunk);\n if (foundEntity != null) {\n this.bukkitEntity = foundEntity;\n }\n }\n return bukkitEntity;\n }", "@Override\n\tpublic void detach(Object entity) {\n\t\t\n\t}", "String getEntity();", "String getEntity();", "public Entity getEntity(String name) {\r\n\r\n for (int i = 0; i < entities.size(); i++) {\r\n if (name.equals(entities.get(i).nume)) {\r\n\r\n return entities.get(i);\r\n }\r\n }\r\n return null;\r\n }", "public Entity getLeafEntity() {\n Entity e = root;\n if (e == null) {\n if (parent != null) {\n e = parent.get(ContentType.EntityType, null);\n }\n }\n return e;\n }", "entities.Torrent.NodeId getNode();", "entities.Torrent.NodeId getNode();", "public String getEntity()\n\t\t{\n\t\t\treturn userElement.getAttribute(ENTITY_ATTR_NAME);\n\t\t}", "public INamedReference<IEntity> getEntityRef();", "public Node getNode();", "public interface Entity\n\textends Node\n{\n\n\tpublic abstract String getPublicId();\n\n\tpublic abstract String getSystemId();\n\n\tpublic abstract String getNotationName();\n}", "public EntityPlayerMP getEntity()\n\t{\n\t\tif(isOnline())\n\t\t{\n\t\t\tentity = PlayerManager.getPlayer(name);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tItemInWorldManager itemInWorldManager = new ItemInWorldManager(Server.getServer().worldServerForDimension(0));\n\t\t\tentity = new EntityPlayerMP(Server.getServer(), Server.getServer().worldServerForDimension(0), name, itemInWorldManager);\n\t\t\tServer.getConfigurationManager().readPlayerDataFromFile(entity);\n\t\t}\n\t\treturn entity;\n\t}", "public String getEntity()\n\t\t{\n\t\t\treturn endpointElement.getAttribute(ENTITY_ATTR_NAME);\n\t\t}", "public ClassName entity() {\n return ClassName.get(this.getEntityPack(), this.getClassName());\n }", "public Entity getmTarget() {\n return mTarget;\n }", "public Node getChild();", "public com.unitedtote.schema.totelink._2008._06.result.PriceEntity getPriceEntity()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.unitedtote.schema.totelink._2008._06.result.PriceEntity target = null;\n target = (com.unitedtote.schema.totelink._2008._06.result.PriceEntity)get_store().find_element_user(PRICEENTITY$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "OperationNode getNode();", "public Ent getParent(){\n\t\treturn (Ent)bound.getParent();\n\t}", "public Entity getEntity(int index)\n\t{\n\t\treturn this.entities.get(index);\n\t}", "public default E onFind(E entity) {\n\t\treturn entity;\n\t}", "public LivingEntity getLivingEntity() {\n return eliteMob;\n }", "public Node getNode() {\n\t\treturn null;\n\t}", "public Entity getLeashHolder ( ) throws IllegalStateException {\n\t\treturn extract ( handle -> handle.getLeashHolder ( ) );\n\t}", "RenderedOp getNode(Long id) throws RemoteException;", "public Node<?> getNode() {\n return observedNode;\n }", "public GameObject getObstacle() {\n \tif (selection != null) {\n \tjava.lang.Object data = selection.getBody().getUserData();\n \ttry {\n \t\treturn (GameObject)data;\n \t} catch (Exception e) {\n \t}\n }\n return null;\n }", "public Entity getEntity(int index){\n return entityList.get(index);\n }", "public org.openejb.config.ejb11.Entity getEntity() {\n return this._entity;\n }", "public static void despawnEntity(Player p, Entity entity){\n despawnEntity(p, entity.getId());\n }", "@Override\r\n public Hit getHit() {\n return null;\r\n }", "public Entity.Spigot spigot() {\n/* 1087 */ return this.spigot;\n/* */ }", "@SuppressWarnings(\"rawtypes\")\n \tpublic static Class getEntityClass() {\n \t\treturn getMinecraftClass(\"Entity\");\n \t}", "@Override\n\tpublic Class<E> getEntityClass() {\n\t\treturn null;\n\t}", "public static Object getBukkitEntity(final Object nmsObject) {\n \t\tif (nmsObject == null) {\n \t\t\treturn null;\n \t\t}\n \n \t\t// We will have to do this dynamically, unfortunately\n \t\ttry {\n \t\t\treturn nmsObject.getClass().getMethod(\"getBukkitEntity\")\n \t\t\t\t\t.invoke(nmsObject);\n \t\t} catch (final Exception e) {\n \t\t\tthrow new RuntimeException(\"Cannot get Bukkit entity from \"\n \t\t\t\t\t+ nmsObject, e);\n \t\t}\n \t}", "@Override\n public <T> T getEntity(Key<T> key)\n {\n // Check the session first in case we've loaded the entity in another query or 'get' then fall back to the query cache\n return session.getCache().get(key)\n .map(entity -> {\n if (logger.isTraceEnabled())\n {\n logger.trace(\"Session cache hit {0}[{1}]\", key.getType().getSimpleName(), key.getId());\n }\n\n session.getStats().cacheHit();\n stats().incHits();\n return entity;\n })\n .orElseGet(() -> queryCache.getEntity(key));\n }", "@Override\n public Cluster.Node getNode() {\n return node;\n }", "@Override\n public Node getNode() throws ItemNotFoundException, ValueFormatException,\n RepositoryException {\n return null;\n }", "public T hent(int pos);", "Entity getSuperType();", "public Entity getComponent() {\n return component;\n }", "FK findFrom(ENTITY entity);", "void removeNode(Entity entity) {\n\t\tProcessing.nodeSet.remove(entity);\n\t\tProcessing.friendMap.remove(entity);\n\n\t\tSystem.out.println(\"the person was successfully removed from the network.\");\n\t}", "HNode getFirstChild();", "com.google.cloud.videointelligence.v1p2beta1.Entity getEntity();", "@Override\n\tpublic Class<Object> getEntityClass() {\n\t\treturn null;\n\t}", "public N getInternalizedNode(N node)\n\t{\n\t\tif (node == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tif (nodeEdgeMap.containsKey(node))\n\t\t{\n\t\t\t// Node already in this Graph\n\t\t\t/*\n\t\t\t * This is using a slow method (array search) when it would be nice\n\t\t\t * to be able to get the reference from the Map. However, that would\n\t\t\t * require the use of Jakarta Common Collections and extending their\n\t\t\t * HashMap in order to do that... because it's normally impossible\n\t\t\t * to get a Key back out of a Map without iterating over the Entries\n\t\t\t * :/\n\t\t\t */\n\t\t\treturn nodeList.get(nodeList.indexOf(node));\n\t\t}\n\t\t// TODO Consider whether to return null or v... ?\n\t\treturn null;\n\t}", "public Node<E> getNodeFromCache() {\n if (this.cacheSize == 0) {\n return null;\n }\n Node<E> node = this.firstCachedNode;\n this.firstCachedNode = node.next;\n node.next = null;\n this.cacheSize--;\n return node;\n }", "public EntityObject getEntityObject(String prefix) {\n\t\tEntityObject r = null;\n\t\tfor (EntityObject eo: entities) {\n\t\t\tif (eo.getInternalValuePrefix().equals(prefix)) {\n\t\t\t\tr = eo;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}", "@Override\n\tpublic Serializable getEntity() {\n\t\treturn this.studentcard;\n\t}", "public void interact(Entity other) { }", "public abstract Node getNode();", "public Enemy summon() {\n\t\treturn null;\n\t}", "public void cutNode ()\n {\n copyNode();\n deleteNode();\n }", "@SuppressWarnings(\"unused\")\n void spawn(Entity entity);", "public static org.bukkit.entity.Entity getEntity(org.bukkit.World world, UUID uid) {\n\t\tfor (org.bukkit.entity.Entity entity : WorldUtil.getEntities(world)) {\n\t\t\tif (entity.getUniqueId().equals(uid)) {\n\t\t\t\treturn entity;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Node getNode() {\n return node;\n }", "public Node getNode() {\n return node;\n }", "@Override\r\n\tpublic Iterable<Entity> getNodes()\r\n\t{\n\t\treturn null;\r\n\t}", "public Entity getVehicle ( ) {\n\t\treturn extract ( handle -> handle.getVehicle ( ) );\n\t}", "public int removeEntity(Entity e) {\n Entity removed = this.entity_list_.remove(e.name_);\n if (removed != null) {\n System.out.println(removed.name_ + \" has been removed from the map\");\n } else {\n System.err.println(\"The entity to be removed does not exist in the list of entities\");\n }\n if (this.map_grid_[e.getMapRelation().getMyYCoordinate()][e.getMapRelation().getMyXCoordinate()].getEntity() == e) {\n this.map_grid_[e.getMapRelation().getMyYCoordinate()][e.getMapRelation().getMyXCoordinate()].removeEntity();\n //e.setMapRelation(null);\n //System.gc();\n return 0;\n } else {\n System.err.println(\"The avatar to be removed cannot be found on the map.\");\n System.exit(-88);\n return -1;\n }\n }", "public Entity getDatasetEntity()\n{\n // Get parent and parent entity (just return null, if null)\n RMShape parent = getParent(); if(parent==null) return null;\n Entity parentEntity = parent.getDatasetEntity(); if(parentEntity==null) return null;\n \n // Get Property/RelationEntity for Shape.DatasetKey\n Property prop = getDatasetKey()!=null? parentEntity.getKeyPathProperty(getDatasetKey()) : null;\n Entity entity = prop!=null && prop.isRelation()? prop.getRelationEntity() : null;\n return entity!=null? entity : parentEntity;\n}", "public GameObject peek();", "public abstract Node getBoundingNode();", "N getNode(int id);", "public boolean shootoutEntity(Entity ent, boolean simulate);" ]
[ "0.6396164", "0.6380235", "0.6353628", "0.61790925", "0.6154075", "0.61325246", "0.61325246", "0.61325246", "0.6105485", "0.6094486", "0.60743266", "0.6051207", "0.6035036", "0.6002966", "0.5953867", "0.59475183", "0.59419614", "0.58763874", "0.5720055", "0.5696102", "0.5581782", "0.5539492", "0.5536709", "0.5536384", "0.5527673", "0.5523024", "0.5490853", "0.54362077", "0.5419161", "0.54039156", "0.5399019", "0.53588986", "0.535102", "0.5343736", "0.5328028", "0.52857447", "0.52857447", "0.528569", "0.5278648", "0.5276323", "0.5276323", "0.52680147", "0.5251618", "0.5243438", "0.5234762", "0.52290434", "0.52203107", "0.52185977", "0.52181584", "0.51963913", "0.51844364", "0.51795715", "0.51758784", "0.51740783", "0.5171473", "0.5161128", "0.51518875", "0.5130114", "0.51231074", "0.51181054", "0.5115986", "0.510539", "0.5102063", "0.50919986", "0.5055713", "0.5029092", "0.50169253", "0.5005939", "0.5003234", "0.50015765", "0.4995949", "0.49828005", "0.4976444", "0.49739015", "0.4970465", "0.49683246", "0.49609274", "0.49517873", "0.49481475", "0.49421328", "0.4936018", "0.49314347", "0.49138257", "0.4911853", "0.49089143", "0.49044478", "0.49027026", "0.4901151", "0.4898728", "0.48960978", "0.48958942", "0.48958942", "0.48947805", "0.48911414", "0.48868445", "0.48865986", "0.4882836", "0.4881103", "0.48757035", "0.48685062" ]
0.6307821
3
TODO Autogenerated method stub
@Override protected Dialog onCreateDialog(int id) { if (id == 999) { return new DatePickerDialog(this, myDateListener, year, month, day); } return null; }
{ "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 arg1 = year arg2 = month arg3 = day
@Override public void onDateSet(DatePicker arg0, int arg1, int arg2, int arg3) { showDate(arg1, arg2+1, arg3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDate(int day,int month,int year){\n this.day=day;\n this.month=month;\n this.year=year;\n }", "public DateIn(int day, int month, int year){\n\tthis.day = day;\n\tthis.month = month;\n\tthis.year = year;\n\t}", "public Date(int day, int month, int year) {\r\n this.day = day;\r\n this.month = month;\r\n this.year = year;\r\n\r\n }", "public Date(int year, int month, int day) {\n this.year = year;\n this.day = day;\n this.month = month;\n }", "public void setDate(int day, int month, int year, int hour, int minute) // Maybe\n\n {\n this.day = day;\n this.month = month;\n this.year = year;\n this.hour = hour;\n this.minute = minute;\n }", "public DateCustom(int __day, int __month, int __year) {\n this._day = __day;\n this._month = __month;\n this._year = __year;\n }", "public Date(int day, Month month, int year){\n\tif (day > 0 && day <= month.nbJours(year)){\n\t this.day = day;\n\t}\t\n\tthis.month = month;\n\tif (year > 0){\n\t this.year = year;\n\t}\n }", "public MyDate(int inYear, int inDay, int inMonth)\n {\n year = inYear;\n day = inDay;\n month = inMonth;\n }", "public Date(int month, int day) {\r\n this.month = month;\r\n this.day = day;\r\n }", "@Test public void Day_1__month__year()\t\t\t\t\t\t\t{tst_date_(\"03-31-02\"\t\t\t\t, \"2002-03-31\");}", "public Group3Date(int month, int day, int year) {\n\t\t\tif (!isValid(month, day, year)) throw new Error(\"Invalid date\");\n\t\t\tthis.month = month;\n\t\t\tthis.day = day;\n\t\t\tthis.year = year;\n\t\t}", "void updateChangedDate(int year, int month, int day);", "public void updateChangedDate(int year, int month, int day);", "public void setDate(int month, int day) {\r\n this.month = month;\r\n this.day = day;\r\n }", "public Date(int month, int day, int year) {\n if (!isValid(month, day, year)) throw new IllegalArgumentException(\"Invalid date\");\n this.month = month;\n this.day = day;\n this.year = year;\n }", "public MyDate(int month, int day, int year) {\n\t\tsetDate(month, day, year);\n\t}", "@Test public void Year_2__month__day()\t\t\t\t\t\t\t{tst_date_(\"03/31/2001\"\t\t\t\t, \"2001-03-31\");}", "@Test public void Year_0__month__day()\t\t\t\t\t\t\t{tst_date_(\"2001-03-31\"\t\t\t\t, \"2001-03-31\");}", "public date2(int theYear, int theMonth, int theDay) {\n\t\tmonth = checkMonth(theMonth); // validate month\n\t\tyear = checkYear(theYear); // validate year\n\t\tday = checkDay(theDay); // validate day\n\t}", "public Value(int year, int month, int day) {\n\n // Construct the Calendar\n _calendar = Calendar.getInstance();\n _calendar.set(year, month - 1, day);\n }", "public Date(int y, int m, int d){\n\t\tif((y<2015 || m<=0 || m>12 || d<=0 || d>31)){\n\t\t\tyear=0;\n\t\t\tmonth=0;\n\t\t\tday=0;\n\t\t}else{\n\t\t\tyear=y;\n\t\t\tmonth=m;\n\t\t\tday=d;\n\t\t}\n\t\t\n\t}", "public DateUtil (int yyyy, int mm, int dd)\n {\n set(yyyy, mm, dd, CHECK);\n }", "public Date(int month, int day, int year) {\r\n\t\t// check if month in range\r\n\t\tif (month <= 0 || month > 12)\r\n\t\t\tthrow new IllegalArgumentException(\"month (\" + month + \") must be 1-12\");\r\n\r\n\t\t// check if day in range for month\r\n\t\tif (day <= 0 || (day > daysPerMonth[month] && !(month == 2 && day == 29)))\r\n\t\t\tthrow new IllegalArgumentException(\"day (\" + day + \") out-of-range for the specified month and year\");\r\n\r\n\t\t// check for leap year if month is 2 and day is 29\r\n\t\tif (month == 2 && day == 29 && !(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)))\r\n\t\t\tthrow new IllegalArgumentException(\"day (\" + day + \") out-of-range for the specified month and year\");\r\n\r\n\t\tthis.month = month;\r\n\t\tthis.day = day;\r\n\t\tthis.year = year;\r\n\r\n\t\tSystem.out.printf(\"Date object constructor for date %s%n\", this);\r\n\t}", "public void setDate(int m, int d, int y){\n\t\tday = d;\n\t\tyear =y;\n\t\tmonth = m;\n\t}", "@Test public void Month_name_1__year__day()\t\t\t\t\t{tst_date_(\"2001 Mar 02\"\t\t\t, \"2001-03-02\");}", "public void setDate(int month, int day) {\r\n\t\tString dayString = \"\";\r\n\t\tif(day < 10)\r\n\t\t{\r\n\t\t\tfor(int i = 0; i < 10; i++)\r\n\t\t\t{\r\n\t\t\t\tif(day == i)\r\n\t\t\t\t{\r\n\t\t\t\t\tdayString = \"0\" + i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.date = month + \"-\" + dayString;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.date = month + \"-\" + day;\r\n\t\t}\r\n\t}", "public SimpleDate(final int year, final int month, final int day) {\n\t\tthis.year = year;\n\t\tthis.month = month;\n\t\tthis.day = day;\n\t}", "public DateNextDateExceptionTest(int year, int month, int day) {\n\t\tthis.year = year;\n\t\tthis.month = month;\n\t\tthis.day = day;\n\t}", "public void setDate(int year, int month, int dayOfMonth)\n {\n this.date = new GregorianCalendar(year, month-1, dayOfMonth);\n }", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "public void setDay(int year, int month, int day)\n\t{\n\t\t m_calendar.set(year,month-1,day);\n\n\t}", "@Test public void Month_name_1__day__year()\t\t\t\t\t{tst_date_(\"2 Mar 2001\"\t\t\t\t, \"2001-03-02\");}", "public Date(int day, int month, int year) throws DateException{\n\t\tthis.year = year;\n\t\tif (month < 1 || month > 12) {\n\t\t\tthrow new DateException(\"Mes \" + month + \" no valido\" +\n\t\t\t\t\t\" Valores posibles entre 1 y 12.\");\n\t\t} else {\n\t\t\tthis.month = month;\n\t\t}\n\t\t\n\t\tswitch (this.month){\n\t\t\tcase 1:\n\t\t\tcase 3:\n\t\t\tcase 5:\n\t\t\tcase 7:\n\t\t\tcase 8:\n\t\t\tcase 10:\n\t\t\tcase 12:\n\t\t\t\tif(day<1 || day>31){\n\t\t\t\t\tthrow new DateException(\"Error. Fecha no valida. Dia \"+day+\" no valido en el mes \"+month+\".\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\tthis.day=day;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\tcase 6:\n\t\t\tcase 9:\n\t\t\tcase 11:\n\t\t\t\tif(day<1 || day>30){\n\t\t\t\t\tthrow new DateException(\"Error. Fecha no valida. Dia \"+day+\" no valido en el mes \"+month+\".\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\tthis.day=day;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(day<1 || day>28){\n\t\t\t\t\tthrow new DateException(\"Error. Fecha no valida. Dia \"+day+\" no valido en el mes \"+month+\".\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\tthis.day=day;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "public Date(int m, int d, int y) {\n\t\t\n\t\tmonth = m;\n\t\tday = d;\n\t\tyear = y;\n\t\t\n\t}", "public void setDay(int year, int month, int day) {\n cal = Calendar.getInstance();\n cal.set(year, month, day);\n }", "public final void set( int yyyy, int mm, int dd)\n {\n set (yyyy, mm, dd, CHECK);\n }", "public Date(int m, int d, int y) {\r\n\t\tif (!isValid(m, d, y))\r\n\t\t\tthrow new RuntimeException(\"Invalid date\");\r\n\t\tmonth = m;\r\n\t\tday = d;\r\n\t\tyear = y;\r\n\t}", "public void onDateSet(DatePicker view, int year, int month, int day) {\n }", "public Date(String month, int year) {\n\t\t\tthis.weekday = 0;\n\t\t\tthis.day = 0;\n\t\t\tthis.month = notEmpty(month);\n\t\t\tthis.year = zeroOrMore(year);\n\t\t}", "public void onDateSet(DatePicker view, int year, int month, int day) {\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n public void setSelectedDate(int year, int month, int day)\n {\n setSelectedDay(day);\n setSelectedMonth(month);\n setSelectedYear(year);\n TextView dateText = (TextView) findViewById(R.id.selectedDateTxt);\n dateText.setText(String.valueOf(selectedDay)+\"-\"+String.valueOf(selectedMonth)+\"-\"+String.valueOf(selectedYear));\n\n showLoading();\n\n //Formatting the date\n String selectedDate=getSelectedDate()+\"T00:00:00\";\n\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n connectionManager.getPitchSchedule(pitch.getVenueID(),pitch.getPitchName(),selectedDate,this);\n }\n\n //Discard any selected slots\n reservationStartsOn=null;\n reservationEndsOn=null;\n }", "@Test public void Month_name_1__day__year__guess()\t\t\t\t{tst_date_(\"02 Mar 01\"\t\t\t\t, \"2001-03-02\");}", "public Date(int d, int m, int a) {\n\t\tthis.dia = d;\n\t\tthis.mes = m;\n\t\tthis.ano = a;\n\t}", "public void onDateSet(DatePicker view, int year, int month, int day) {\n\t\t}", "public DateUtil (int yyyy, int mm, int dd, int how)\n {\n // save yyyy, mm, dd, and compete the ordinal equivalent\n set(yyyy, mm, dd, how);\n }", "public void onDateSet(DatePicker view, int year, int month, int day) {\n\n if (getTag().equals(\"begin\")) {\n\n String y = Integer.toString(year);\n String m = Integer.toString(month + 1);\n String d = Integer.toString(day);\n\n if (d.length() == 1) {\n d = \"0\" + d;\n }\n if (m.length() == 1) {\n m = \"0\" + m;\n }\n\n SearchActivity.setBeginDate(d + \"/\" + m + \"/\" + y);\n }\n\n if (getTag().equals(\"end\")) {\n String y = Integer.toString(year);\n String m = Integer.toString(month + 1);\n String d = Integer.toString(day);\n if (d.length() == 1) {\n d = \"0\" + d;\n }\n if (m.length() == 1) {\n m = \"0\" + m;\n }\n SearchActivity.setEndDate(d + \"/\" + m + \"/\" + y);\n }\n }", "public static void main(String[] args) {\n\t\tMonthDay month=MonthDay.now();\n\t\tLocalDate d=month.atYear(2015);\n\t\tSystem.out.println(d);\n\t\tMonthDay m=MonthDay.parse(\"--02-29\");\n\t\tboolean b=m.isValidYear(2019);\n\t\tSystem.out.println(b);\n\t\tlong n= month.get(ChronoField.MONTH_OF_YEAR);\n\t\tSystem.out.println(\"month of the year is:\"+n);\n\t\tValueRange r1=month.range(ChronoField.MONTH_OF_YEAR);\n\t\tSystem.out.println(r1);\n\t\tValueRange r2=month.range(ChronoField.DAY_OF_MONTH);\n\t\tSystem.out.println(r2);\n\n\t}", "public Date (final Integer d, final Integer m, final Integer y) throws CGException {\n\n try {\n setSentinel();\n }\n catch (Exception e){\n\n e.printStackTrace(System.out);\n System.out.println(e.getMessage());\n }\n if (!this.pre_Date(d, m, y).booleanValue()) \n UTIL.RunTime(\"Run-Time Error:Precondition failure in Date\");\n {\n\n day = UTIL.NumberToInt(UTIL.clone(d));\n month = UTIL.NumberToInt(UTIL.clone(m));\n year = UTIL.NumberToInt(UTIL.clone(y));\n }\n }", "void setDate(Date data);", "public void handleOnDateSet(int year, int month, int day) {\n Date date = new GregorianCalendar(year, month, day).getTime();\n String formatedDate = dateFormatter.format(date);\n\n switch (callerId) {\n case R.id.tvToDate:\n tvToDate.setText(formatedDate);\n break;\n case R.id.tvFromDate:\n tvFromDate.setText(formatedDate);\n break;\n }\n }", "private void setFields(int year, int month, int day, double hour) {\n\t\t// Get year, month, day of jdCO and compare to given date to\n\t\t// find out about the calendar system:\n\t\tIDate dt = swe_revjul(jdCO, SE_GREG_CAL);\n\t\tboolean calType = SE_GREG_CAL;\n\t\tif (dt.year > year || (dt.year == year && dt.month > month)\n\t\t\t\t|| (dt.year == year && dt.month == month && dt.day > day)) {\n\t\t\tcalType = SE_JUL_CAL;\n\t\t}\n\t\tsetFields(year, month, day, hour, calType);\n\t}", "public void setDateAndTime(int d,int m,int y,int h,int n,int s);", "@Override\n public void date_()\n {\n }", "@Override\n public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {\n }", "public void setDate(int day, String month, int year) {\n\t\telement(titleButton).waitUntilVisible();\n\t\ttitleButton.click();\n\t\twaitABit(2000);\n\t\ttitleButton.click();\n\t\twaitABit(2000);\n\t\t\n\n\t\t// select year\n\t\tfor (WebElementFacade i : datePickerYearList)\n\t\t\tif (i.getText().contentEquals(Integer.toString(year))) {\n\t\t\t\ti.click();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t// select month\n\t\tfor (WebElementFacade i : datePickerMonthList)\n\t\t\tif (i.getText().contentEquals(month)) {\n\t\t\t\ti.click();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t// select day\n\t\tfor (WebElementFacade i : datePickerDayList)\n\t\t\tif (i.getText().contentEquals(Integer.toString(day))) {\n\t\t\t\ti.click();\n\t\t\t\tbreak;\n\t\t\t}\n\t\twaitABit(2000);\n\t}", "public Date(int m, int y) {\r\n\r\n\t\tif (!isValid(m, DAYS[m], y))\r\n\t\t\tthrow new RuntimeException(\"Invalid date; correct input\");\r\n\t\tmonth = m;\r\n\t\tday = DAYS[m];\r\n\t\tyear = y;\r\n\t}", "void setBoardStart(int month, int day, int year) throws IllegalDateException;", "public final void set( int yyyy, int mm, int dd, int how)\n {\n if ( this.yyyy == yyyy && this.mm == mm && this.dd == dd ) return;\n this.yyyy = yyyy;\n this.mm = mm;\n this.dd = dd;\n switch ( how )\n {\n case CHECK:\n if ( !isValid(yyyy,mm,dd) )\n throw new IllegalArgumentException(\"invalid date: \"\n + yyyy + \"/\" + mm + \"/\" + dd);\n break;\n\n case NORMALISE:\n normalise();\n break;\n\n case BYPASSCHECK:\n break;\n } // end switch\n\n toOrdinal();\n }", "public DateTime(int year, int month, int date) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tthis.timeString = YYYY_MM_DD_FORMATTER.format(calendar.getTime());\r\n\t}", "@Override\n\tpublic void initDate() {\n\n\t}", "@Override\n public void updateDate(int year, int month, int day) {\n calendar = new GregorianCalendar();\n calendar.set(year, month, day);\n // set the textview\n SimpleDateFormat sdf = new SimpleDateFormat(\"MMMM dd, yyyy\");\n sdf.setCalendar(calendar);\n expiration.setText(sdf.format(calendar.getTime()));\n }", "public int MagicDate(){\n return month = day = year = 1;\n \n }", "@Override\n public void onDateSet(DatePicker view, int year, int month, int day) {\n date.setText(year+\"/\"+(month+1)+ \"/\"+ day);\n hDate = year+\"/\"+(month+1)+ \"/\"+ day;\n check(hDate, status);\n }", "private String getDate(int year, int month, int day) {\n return new StringBuilder().append(month).append(\"/\")\n .append(day).append(\"/\").append(year).toString();\n }", "public void setDate(int dt) {\n date = dt;\n }", "@Test public void Month_name_0__day__year__bad_day()\t\t\t{tst_date_(\"Mar 32 2001\"\t\t\t, \"Invalid day: 32\");}", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear,\n int dayOfMonth) {\n }", "public DateValidator(Integer Day,Integer Month,Integer Year) throws InvalidDateException\n\t{\n\t\t\n\t\t\tiDay = Day;\n\t\t\tiMonth = Month;\n\t\t\tiYear = Year;\n\t\t\t//create Calendar object for current date\n\t\t\tCalendar now = Calendar.getInstance ( );\n\t\t\t//create Calendar Object to test\n\t\t\tCalendar test = Calendar.getInstance( );\n\t\t\t//set the attributes of test Calendar\n\t\t\ttest.set (iYear,iMonth,iDay);\n\t\t\t\n\t\t\tboolean leap = true;//holds the boolean value of leap year \n\t\t\t\n\t\t\t/* test year for proper input*/\n\t\t\tif (iYear + 120 < now.get (Calendar.YEAR) || now.before (test))\n\t\t\t{\t\n\t\t\t\tthrow new InvalidDateException(\"year\");\n\t\t\t}\n\t\t\t/* Test the month for proper input*/\n\t\t\tif (iMonth < 0 || iMonth > 12)\n\t\t\t{\t\n\t\t\t\tthrow new InvalidDateException(\"month\");\n\t\t\t}\n\t\t\t\n\t\t\t//algorithm to determine if it is a leap year\n\t\t\tif (iYear % 400 == 0)\n\t\t\t\tleap = true;\n\t\t\telse if (iYear % 100 == 0)\n\t\t\t\tleap = false;\n\t\t\telse if (iYear % 4 == 0)\n\t\t\t\tleap = true;\n\t\t\telse\n\t\t\t\tleap = false;\n\t\t\t\n\t\t\t/*Test to see if user has entered a\n\t\t\t * valid day for that particular month\n\t\t\t */\n\t\t\t\n\t\t\t//if the day entered for February is greater then 29 in a leap year it is invalid\n\t\t\tif ( leap == true && iMonth == 2)\n\t\t\t{\n\t\t\t\tif ( iDay < 0 || iDay > 29 )\n\t\t\t\t{\t\n\t\t\t\t\tthrow new InvalidDateException(\"day\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//if the day entered for February is greater then 28 in a non leap year it is invalid\n\t\t\tif ( leap == false && iMonth == 2)\n\t\t\t{\n\t\t\t\tif ( iDay < 0 || iDay > 28)\n\t\t\t\t{\t\n\t\t\t\t\tthrow new InvalidDateException(\"day\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//in the months of Apr, Jun, Sep, or Nov a day greater then 30 is invalid\n\t\t\tif( iMonth == 4 ||\n\t\t\t\tiMonth == 6 ||\n\t\t\t\tiMonth == 9 ||\n\t\t\t\tiMonth == 11 )\n\t\t\t{\n\t\t\t\tif( iDay < 0 || iDay > 30)\n\t\t\t\t{\t\n\t\t\t\t\tthrow new InvalidDateException(\"day\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//in the remaining months a day greater than 31 is invalid\n\t\t\tif (iDay < 0 || iDay > 31)\n\t\t\t{\t\n\t\t\t\tthrow new InvalidDateException(\"day\");\n\t\t\t}\n\t}", "public ExpirationDate(final int month, final int year) {\n\t\tthis.expiredAfter = createExpiredAfter(month, year);\n\t}", "private static int day(int month, int day, int year) {\n int y = year - (14 - month) / 12;\n int x = y + y / 4 - y / 100 + y / 400;\n int m = month + 12 * ((14 - month) / 12) - 2;\n int d = (day + x + (31 * m) / 12) % 7;\n return d;\n }", "@Override \n\t\t\tpublic void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {\n\n\t\t\t\tString date = year + \"-\" + df.format(monthOfYear+1);\n\t\t\t\t\n\t\t\t\ttv.setText(date); \n\t\t\t\t\n//\t\t\t\thandler.sendEmptyMessage(CHANGE_YEAR);\n\t\t\t\t\n\t\t\t}", "public Date(String dateType, int year, int month, int day)\r\n\t\t\tthrows BogusDataException\r\n\t{\r\n\t\tsuper(dateType, \"\");\r\n\r\n\t\tthis.year = year;\r\n\t\tthis.month = month;\r\n\t\tthis.day = day;\r\n\t\tthis.hour = this.minute = this.second = 0;\r\n\t\tthis.dateOnly = true;\r\n\r\n\t\tString yearStr, monthStr, dayStr;\r\n\r\n\t\tyearStr = \"\" + year;\r\n\t\tmonthStr = \"\" + month;\r\n\t\tdayStr = \"\" + day;\r\n\t\twhile (yearStr.length() < 4)\r\n\t\t\tyearStr = '0' + yearStr;\r\n\t\tif (monthStr.length() < 2)\r\n\t\t\tmonthStr = '0' + monthStr;\r\n\t\tif (dayStr.length() < 2)\r\n\t\t\tdayStr = '0' + dayStr;\r\n\t\tvalue = yearStr + monthStr + dayStr;\r\n\r\n\t\t// Add attribute that says date-only\r\n\t\taddAttribute(\"VALUE\", \"DATE\");\r\n\t}", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {\n date = new StringBuilder();\n date.append(year).append(\"-\");\n if((monthOfYear+1) < 10) date.append(\"0\");\n date.append(monthOfYear+1).append(\"-\");\n if(dayOfMonth < 10) date.append(\"0\");\n date.append(dayOfMonth);\n\n //LLamamos al método que establece su callback\n apodServiceEnqueue(apodService);\n }", "public void onDateSet(DatePicker view, int year, int month, int day)\t{\n\t\tDate d = null;\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.set(year, month, day);\n\t\td = cal.getTime();\n\n\t\tString strFecha = Convertir_de_date_a_string(d);\n\t\tTextView labelFecha = (TextView) getActivity().findViewById(this.idLabelFecha);\n\t\tif(labelFecha!=null){\n\t\t\tlabelFecha.setText(strFecha);\n\t\t}\n\n\t\tactivity.calculateNextPeriod(strFecha);\n\t}", "public void setDay(int r1) throws java.lang.IllegalArgumentException {\n /*\n // Can't load method instructions: Load method exception: null in method: gov.nist.javax.sip.header.SIPDate.setDay(int):void, dex: in method: gov.nist.javax.sip.header.SIPDate.setDay(int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: gov.nist.javax.sip.header.SIPDate.setDay(int):void\");\n }", "public String AssignVariables(int month,int day,int year,String LongDate){\n String g;\n if(month<10){\n if(day<10)\n g=\"\"+year+\"0\"+month+\"0\"+day;\n\n else {\n g=\"\"+year+\"0\"+month+\"\"+day;\n }\n }\n else{\n if(day<10)\n g=\"\"+year+month+\"0\"+day;\n\n else {\n g=\"\"+year+month+\"\"+day;\n }\n }\n CheckedDate=g;\n String MonthOfYear=LongDate.substring(4,8).trim();\n setTitle(getMonth(MonthOfYear)+\" \"+CheckedDate.substring(0,4));\n return g;\n }", "public static native JsDate create(int year, int month, int dayOfMonth) /*-{\n return new Date(year, month, dayOfMonth);\n }-*/;", "public DateFilter(int smonth, int sday, int emonth, int eday) {\n\t\t//TODO you will need to implement this method\n\t}", "public void setFechaFacturado(java.util.Calendar param){\n \n this.localFechaFacturado=param;\n \n\n }", "public MonthDay() {\n setMonth(1);\n setDay(1);\n }", "@Override\n\tprotected void setDate() {\n\n\t}", "@Override\n\t\tpublic void onDateSet(DatePicker view, int selectedYear,\n\t\t\t\tint selectedMonth, int selectedDay) {\n\n\t\t\tyear = selectedYear;\n\t\t\tmonth = selectedMonth;\n\t\t\tday = selectedDay;\n\n\t\t\tcreate_srart_date.setText(new StringBuilder().append(year)\n\t\t\t\t\t.append(\"-\").append(month + 1).append(\"-\").append(day));\n\n\t\t}", "public SweDate(int year, int month, int day, double hour) {\n\t\tsetFields(year, month, day, hour);\n\t}", "public static Date newDate(final int year, final int month, final int day)\r\n\t{\r\n\t\treturn newDate(year, month, day, 0, 0, 0);\r\n\t}", "public IssueBuilderAbstract dueDateString(int year, int month, int day){\n calendarString = new StringBuilder()\n .append(year)\n .append(\"-\")\n .append(month)\n .append(\"-\")\n .append(day)\n .toString();\n return this;\n }", "public Date(int y) {\r\n\r\n\t\tmonth = LAST_MONTH;\r\n\t\tday = DAYS[LAST_MONTH];\r\n\t\tyear = y;\r\n\t}", "@Override\n public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {\n mDay = dayOfMonth;\n mMonth = monthOfYear + 1;\n mYear = year;\n String d, m, y;\n d = Integer.toString(mDay);\n m = Integer.toString(mMonth);\n y = Integer.toString(mYear);\n\n if (mDay < 10) {\n d = \"0\" + d;\n }\n if (mMonth < 10) {\n m = \"0\" + m;\n }\n\n MonthInt = d + \"/\" + m + \"/\" + y;\n addStudentScreenBinding.dateOfBirthEdt.setText(MonthInt);\n }", "void setBoardEnd(int month, int day, int year) throws IllegalDateException;", "@Override\n public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {\n\n date2 = (monthOfYear+ 1) + \" / \" +dayOfMonth + \" / \" + year;\n\n\n Log.d(\"Hello\", \"time = \" + date2);\n\n }", "@Override\n public void onDateSet(DatePicker arg0, int year_n, int month_n, int day_n) {\n year = year_n;\n month = month_n;\n day = day_n;\n cal.set(year, month, day);\n week = getWeekDay(cal);\n date.setText(year+\"年\"+(month+1)+\"月\"+day+\"日\" +\" \"+week); //将选择的日期显示到TextView中,因为之前获取month直接使用,所以不需要+1,这个地方需要显示,所以+1\n }", "private void setFields(int year, int month, int day, double hour, boolean calType) {\n\t\tthis.year = year;\n\t\tthis.month = month;\n\t\tthis.day = day;\n\t\tthis.hour = hour;\n\t\tthis.calType = calType;\n\t\tthis.jd = swe_julday(year, month, day, hour, calType);\n\t}", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear,\n int dayOfMonth) {\n device_year.setContent(String.format(\"%d-%d-%d\", year, monthOfYear + 1, dayOfMonth));\n }", "@Override\n public void onDateSet(DatePicker arg0,\n int arg1, int arg2, int arg3) {\n String monthstr = String.valueOf(arg2+1);\n monthstr = StringUtils.leftPad(monthstr,2,'0');\n String dt = StringUtils.leftPad(String.valueOf(arg3),2,'0');\n StringBuilder sb = new StringBuilder().append(arg1).append(\"-\")\n .append(monthstr).append(\"-\").append(dt);\n frmDateTextView.setText(sb.toString());\n }", "@Override\n public void onDateSet(DatePicker view, int year,\n int monthOfYear, int dayOfMonth) {\n try{\n int month = monthOfYear + 1;\n String formattedMonth = \"\" + month;\n String formattedDayOfMonth = \"\" + dayOfMonth;\n\n if(month < 10){\n\n formattedMonth = \"0\" + month;\n }\n if(dayOfMonth < 10){\n\n formattedDayOfMonth = \"0\" + dayOfMonth;\n }\n stnkDate.setText(year + \"-\" + formattedMonth + \"-\" + formattedDayOfMonth);\n }catch (ParseException e1){\n e1.printStackTrace();\n }\n\n }", "public void setDay(int day)\r\n {\n \tif (!(day <= daysInMonth(month) || (day < 1)))\r\n\t\t{\r\n \t\tthrow new IllegalArgumentException(\"Bad day: \" + day);\r\n\t\t}\r\n this.day = day;\r\n }", "public static String createDate(String day, String month, String year) {\n\n if (day == null || month == null || year == null) {\n log.error(\"In createDate method is at least one argument NULL\");\n throw new NullPointerException(\"createDate util\");\n }\n\n if (year.trim().isEmpty()) {\n return \"\";\n } else {\n switch (year.length()) {\n case 1:\n year = \"0\" + year;\n case 2:\n year = \"0\" + year;\n case 3:\n year = \"0\" + year;\n }\n }\n return year + (month.isEmpty() ? \"00\" : month.length() == 1 ? \"0\" + month : month) + (day.isEmpty() ? \"00\" : day.length() == 1 ? \"0\" + day : day);\n }", "@Override\r\n public void onDateSet(DatePicker view, int year, int monthOfYear,\r\n int dayOfMonth) {\n myCalendar.set(Calendar.YEAR, year);\r\n myCalendar.set(Calendar.MONTH, monthOfYear);\r\n myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);\r\n\r\n int s=monthOfYear+1;\r\n txt_date.setText(dayOfMonth+\"-\"+s+\"-\"+year);\r\n\r\n\r\n\r\n\r\n }", "@Override\n public void onDateSet(DatePicker arg0,\n int arg1, int arg2, int arg3) {\n String monthstr = String.valueOf(arg2+1);\n monthstr = StringUtils.leftPad(monthstr,2,'0');\n String dt = StringUtils.leftPad(String.valueOf(arg3),2,'0');\n StringBuilder sb = new StringBuilder().append(arg1).append(\"-\")\n .append(monthstr).append(\"-\").append(dt);\n toDateTextView.setText(sb.toString());\n }", "public void setDay(int day) {\n if(day < 1 || day > 31) {\n this.day = 1;\n } else {\n this.day = day;\n }\n\n if(month == 2 && this.day > 29) {\n this.day = 29;\n } else if((month==4 || month==6 || month==8 || month==11) && this.day > 30) {\n this.day = 30;\n }\n }", "public static void main(String[] args) {\n\n Calendar calendar = Calendar.getInstance();\n calendar.set(2003,7,31);\n calendar.set(Calendar.MONTH,8);\n// Date time1 = calendar.getTime();\n calendar.set(Calendar.DATE,5);\n Date time = calendar.getTime();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n String format = simpleDateFormat.format(time);\n System.out.println(format);\n }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }" ]
[ "0.72876316", "0.7029987", "0.6991329", "0.691297", "0.6876343", "0.6872958", "0.6864731", "0.67960936", "0.67881924", "0.66840476", "0.6677789", "0.66685945", "0.66605824", "0.6573567", "0.65725625", "0.6564439", "0.6536562", "0.64900434", "0.64361215", "0.6425609", "0.6420716", "0.6416748", "0.6385044", "0.6384693", "0.6267251", "0.6217236", "0.62105435", "0.6207647", "0.61985403", "0.6182668", "0.6166198", "0.6152364", "0.6112743", "0.61089057", "0.6030734", "0.5999067", "0.5974563", "0.59641856", "0.59619814", "0.5954911", "0.59529936", "0.5950837", "0.5948796", "0.5941487", "0.592757", "0.5915979", "0.5910459", "0.5894845", "0.5890152", "0.5890016", "0.5886009", "0.58858836", "0.5879362", "0.58687806", "0.58327395", "0.58199114", "0.5816494", "0.58115995", "0.5776413", "0.57654667", "0.5757612", "0.5755619", "0.5751607", "0.5748871", "0.5746266", "0.5737145", "0.57368505", "0.5727342", "0.5716449", "0.571124", "0.57086605", "0.5707591", "0.5691819", "0.56753397", "0.5670799", "0.56602037", "0.56588084", "0.5658799", "0.5658124", "0.5652934", "0.5644015", "0.5643339", "0.5639738", "0.5636198", "0.5631279", "0.5628956", "0.5624555", "0.56223524", "0.56198925", "0.56124914", "0.5602393", "0.55995286", "0.55967927", "0.5595455", "0.55924827", "0.5587834", "0.55857456", "0.5584784", "0.5579584", "0.55756176", "0.5571385" ]
0.0
-1
this function initiates the switch between two candies when it is valid
public void ValidSwitch(int x, int y) { SaveState(); int temp = pictures[x][y - 1]; pictures[x][y - 1] = pictures[previousX][previousY - 1]; pictures[previousX][previousY - 1] = temp; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { pictures2[i][j] = pictures[i][j]; } } combinationValid = 0; LabelingCandiesToDestroy(); if (combinationValid == 0) { //if there's no combination from the switch, it resets it to the original state ResetState(); } else { if (InsideMovesRemainingExists == 0) {//checks if there is a playable move left combinationValid = 0; MovesRemainingExists(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void Check()\r\n {\r\n if (c1.getId() == c2.getId())\r\n {\r\n c1.setEnabled(false); \r\n c2.setEnabled(false);\r\n \r\n c1.setMatched(true); \r\n c2.setMatched(true);\r\n \r\n if(Converter(SecondInput)==1 && label.getText().equals(\"Player 2\") && t1.getState()==TERMINATED)\r\n {\r\n t1 = new Thread(new AI(\"Player 2\", cards));\r\n t1.start(); \r\n }\r\n \r\n if(Converter(SecondInput)==2 && t1.getState()==TERMINATED && t2.getState()==TERMINATED && (label.getText().equals(\"Player 2\") || label.getText().equals(\"Player 3\")))\r\n {\r\n t1 = new Thread(new AI(\"Player 2\", cards));\r\n \r\n t1.start();\r\n \r\n t2 = new Thread(new AI(\"Player 3\", cards));\r\n \r\n t2.start();\r\n }\r\n \r\n if(Converter(SecondInput)==3 && t1.getState()==TERMINATED && t2.getState()==TERMINATED && t3.getState()==TERMINATED && (label.getText().equals(\"Player 2\") || label.getText().equals(\"Player 3\") || label.getText().equals(\"Player 4\")))\r\n {\r\n t1 = new Thread(new AI(\"Player 2\", cards));\r\n \r\n t1.start();\r\n \r\n t2 = new Thread(new AI(\"Player 3\", cards));\r\n \r\n t2.start();\r\n \r\n t3 = new Thread(new AI(\"Player 3\", cards));\r\n \r\n t3.start();\r\n }\r\n \r\n if (this.isGameWon())\r\n {\r\n JOptionPane.showMessageDialog(this, \"Great! Game is over in \" + count + \" moves!\");\r\n System.exit(0);\r\n } \r\n }\r\n\r\n else\r\n {\r\n c1.setIcon(new ImageIcon(getClass().getResource(\"cardBack2.jpg\")));\r\n c2.setIcon(new ImageIcon(getClass().getResource(\"cardBack2.jpg\")));\r\n \r\n setLabel();\r\n \r\n \r\n if(Converter(SecondInput)!=0)\r\n {\r\n if(Converter(SecondInput)==1 && label.getText().equals(\"Player 2\"))\r\n {\r\n t1 = new Thread(new AI(\"Player 2\", cards));\r\n \r\n t1.start();\r\n }\r\n \r\n if(Converter(SecondInput)==2 && (label.getText().equals(\"Player 2\") || label.getText().equals(\"Player 3\")))\r\n {\r\n t1 = new Thread(new AI(\"Player 2\", cards));\r\n \r\n t1.start();\r\n \r\n t2 = new Thread(new AI(\"Player 3\", cards));\r\n \r\n t2.start();\r\n }\r\n \r\n if(Converter(SecondInput)==3 && (label.getText().equals(\"Player 2\") || label.getText().equals(\"Player 3\") || label.getText().equals(\"Player 4\")))\r\n {\r\n t1 = new Thread(new AI(\"Player 2\", cards));\r\n \r\n t1.start();\r\n \r\n t2 = new Thread(new AI(\"Player 3\", cards));\r\n \r\n t2.start();\r\n \r\n t3 = new Thread(new AI(\"Player 3\", cards));\r\n \r\n t3.start();\r\n }\r\n }\r\n \r\n }\r\n c1 = null;\r\n c2 = null;\r\n }", "public static void set_checks2(){\n\t\t\n\t\t//Check if difficulty\n\t\n\t\t\t//Check if user is batting\n\t\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\t\tif(PlayArena2.usershot2==PlayArena2.compshot2){\n\t\t\t\t\t\n\t\t\t\t\tcheck_if_factor2=true;}\n\t\t\t\telse if(PlayArena2.usershot2==6 && (PlayArena2.compshot2==2 || PlayArena2.compshot2==3))\n\t\t\t\t\tcheck_if_factor2=true;\n\t\t\t\telse if(PlayArena2.usershot2==4 && (PlayArena2.compshot2==2 ))\n\t\t\t\t\tcheck_if_factor2=true;\n\t\t\t\telse\n\t\t\t\t\tcheck_if_factor2=false;\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(PlayArena2.usershot2==PlayArena2.compshot2){\n\t\t\t\t\t\n\t\t\t\t\tcheck_if_factor2=true;}\n\t\t\t\telse\n\t\t\t\tcheck_if_factor2=false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t//Wicket?\nif(check_if_factor2){\n\t\t\t\t\n\t\t\t\tcheck_if_wicket2=true;\n\t\t\t\tint temp_wickets=0;\n\t\t\t\t\n\t\t\t\tif(wicket_2==2){\n\t\t\t\t\t\t temp_wickets=3;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Check Striker while wicket fell\n\t\t\tif(temp_wickets!=3)\n\t\t\t{\n\t\t\t\tif(Striker.equals(bat1))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\t\t\t\t\tStriker=PlayBrain1.myteam[++list_pointer];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\tStriker=PlayBrain1.oppteam[++list_pointer];\n\t\t\t\t\t\t\t}\n\t\t\t\t\tbat1=Striker;\n\t\t\t\t\t\n\t\t\t\t//\tSystem.out.println(Striker);\n\t\t\t\t\t//System.out.println(NonStriker);\n\t\t\t\t\t//System.out.println(wicket_1);\n\t\t\t\t}\n\t\t\t\t//Else of Striker\n\t\t\t\telse{\n\t\t\t\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\t\t\t\tStriker=PlayBrain1.myteam[++list_pointer];\n\t\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\tStriker=PlayBrain1.oppteam[++list_pointer];\n\t\t\t\t\t\t}\n\t\t\t\tbat2=Striker;\n\t\t\t\t//System.out.println(Striker);\n\t\t\t\t//System.out.println(NonStriker);\n\t\t\t\t}\n\t\t\t\tif(over_ball_2!=5)\t\n\t\t\t\tcheck_if_strike_change2=false;\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"over strike change\");\n\t\t\t\t\tcheck_if_strike_change2=true;}\n\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\t//System.out.println(\"no wicket zone\");\n\t\t\t\tcheck_if_wicket2=false;\n\t\t\t\t\n\t\t\t\t//Strike Change?\n\t\t\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\t\t\tif(PlayArena2.usershot2%2!=0 && over_ball_2!=5){\n\t\t\t\t\t\tcheck_if_strike_change2=true;\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(PlayArena2.usershot2%2==0 && over_ball_2==5){\n\t\t\t\t\t\tcheck_if_strike_change2=true;\n\t\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tcheck_if_strike_change2=false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(PlayArena2.compshot2%2!=0 && over_ball_2!=5){\n\t\t\t\t\t\tcheck_if_strike_change2=true;\n\t\t\t\t\t}\n\t\t\t\t\telse if(PlayArena2.compshot2%2==0 && over_ball_2==5){\n\t\t\t\t\t\tcheck_if_strike_change2=true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tcheck_if_strike_change2=false;\n\t\t\t\t}\n\t\t\t}\n\n\t}", "public void Switch()\n {\n if(getCurrentPokemon().equals(Pokemon1))\n {\n // Change to pokemon2\n setCurrentPokemon(Pokemon2);\n }\n // if my current pokemon is the same as pokemon2\n else if(getCurrentPokemon().equals(Pokemon2))\n {\n // swap to pokemon1\n setCurrentPokemon(Pokemon1);\n }\n }", "void askLeaderCardActivation();", "public void switchDoors() {\n if (stage != Stage.DOOR_CHOSEN) {\n throw new RuntimeException(\"Invalid Stage\");\n\n }\n chosen_door = switch_door;\n stage = stage.END;\n for (Door door : doors) {\n if (door.getState() == State.CLOSED) {\n door.open();\n }\n continue;\n }\n total_switched++;\n if (chosen_door.getContains() == Contains.CAR) {\n won_switched++;\n }\n }", "public void checkCards(){\r\n if (Card1.getSource().equals(Card2.getSource())){\r\n Card1.setEnabled(false); \r\n Card2.setEnabled(false);\r\n Card1.setBackground(new Color(190, 190, 255));\r\n Card2.setBackground(new Color(190, 190, 255));\r\n Card1.setFace(true); \r\n Card2.setFace(true);\r\n if (this.isGameWon()){\r\n \t_s.stopThread();\r\n \tint[] x = _s.getTime();\r\n \tString s = \"\" + x[0] + \":\" + x[1] + \":\" + x[2] + \":\" + x[3];\r\n \tUIManager.put(\"OptionPane.background\",new ColorUIResource(0,255,0));\r\n UIManager.put(\"Panel.background\",new ColorUIResource(250,0,150));\r\n UIManager.put(\"OptionPane.messageFont\", new FontUIResource(new Font( \r\n \"Times New Roman\", Font.BOLD, 18)));\r\n JOptionPane.showMessageDialog(this, \"You win!\\n\"\r\n \t\t+ \"Your time is: \" + s +\"\\n\"\r\n \t\t\t\t+ \"You're (probably) getting better...\", \"\", -1, null);\r\n JOptionPane.showMessageDialog(this, \"Thanks for playing!\\n\"\r\n \t\t+ \"(Rhythm Heaven is a property of Nintendo and Tsunku.)\", \"\", -1, null);\r\n System.exit(0);\r\n }\r\n }\r\n\r\n else{\r\n Card1.setIcon(null); \r\n Card2.setIcon(null);\r\n }\r\n Card1 = null; \r\n Card2 = null;\r\n }", "private void decidesActivateBoard(Piece turn){\n\t\tif(multiview()){\n\t\t\tif(this.LOCAL_PIECE.equals(turn))activateBoard();\n\t\t\telse deActivateBoard();\n\t\t}\n\t\telse activateBoard();\n\t}", "public void readyNextAttackers() {\n if(battleAlly == null && battleEnemy == null){\n //if(battleAlly == null && battleEnemy == null && !isBattleOver()){\n battleAlly = battleAllies.get(0);\n battleEnemy = battleEnemies.get(0);\n }\n }", "public void activate() {\n // PROGRAM 1: Student must complete this method\n if (control == 0) { // run and()\n \t\tand();\n \t} else if (control == 1) { //run or()\n \t\tor();\n \t} else if (control == 2) { //run add()\n \t\tadd();\n \t} else if (control == 6) { //run sub()\n \t\tsub();\n \t} else if (control == 7) { //run passB()\n \t\tpassB();\n \t} else {\n \t\tthrow new RuntimeException(\"invalid control\"); //otherwise, there was an invalid control\n \t}\n }", "public void switchTurns()\n\t{\n\t\tif(current.equals(playerA))\n\t\t\tcurrent = playerB;\n\t\telse\n\t\t\tcurrent = playerA;\n\t}", "public static void main(String[] args) {\n Deck<CardSwitch> deck = new Deck<CardSwitch>();\n PlaySwitch.init_deck(deck);\n \n BoardSwitch<CardSwitch> myBoard = new BoardSwitch<CardSwitch>(deck);\n Player<CardSwitch> player1 = new Player<CardSwitch>(\"Tom\");\n Player<CardSwitch> player2 = new Player<CardSwitch>(\"Jerry\");\n\n myBoard.addPlayer(player1);\n \n if (myBoard.getNumPlayers() ==1 && myBoard.getCurrentPlayer() == player1\n && player1.getNext() == player1){\n System.out.println(\"Yay 1\");\n }\n\n myBoard.addPlayer(player2);\n if (myBoard.getNumPlayers() ==2 && myBoard.getCurrentPlayer() == player1\n && (myBoard.changeTurn()==true) && myBoard.getCurrentPlayer() == player2){\n System.out.println(\"Yay 2\");\n }\n \n player1.receiveCard(new CardSwitch(Card.Rank.ACE, Card.Suit.SPADES));\n player1.receiveCard(new CardSwitch(Card.Rank.JACK, Card.Suit.CLUBS));\n player2.receiveCard(new CardSwitch(Card.Rank.NINE, Card.Suit.HEARTS));\n player2.receiveCard(new CardSwitch(Card.Rank.THREE, Card.Suit.SPADES));\n\n if (player1.getNext() == player2 && player2.getNext() == player1\n && myBoard.findWinner() == player2){\n System.out.println(\"Yay 3\");\n }\n \n \n }", "public void MovesRemainingExists() {\n InsideMovesRemainingExists = 1;\n NoMovesRemaining = 1;\n Beginning:\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n previousX = i;\n previousY = j + 1;\n if ((i + 1) < 9) {\n ValidSwitch(i + 1, j + 1);\n if (NoMovesRemaining == 0) { //checks the candies to the right\n ResetState();\n break Beginning; //breaks the loop\n }\n }\n\n if ((i - 1) >= 0) {\n ValidSwitch(i - 1, j + 1);\n if (NoMovesRemaining == 0) { //checks the candies to the left\n ResetState();\n break Beginning;\n }\n }\n\n if ((j + 1) < 9) {\n ValidSwitch(i, j + 2);\n if (NoMovesRemaining == 0) { //checks the candies on the bottom\n ResetState();\n break Beginning;\n }\n }\n\n if ((j - 1) >= 0) {\n ValidSwitch(i, j);\n if (NoMovesRemaining == 0) { //checks the candies at the top\n ResetState();\n break Beginning;\n }\n }\n }\n\n }\n InsideMovesRemainingExists = 0;\n\n}", "public void switchPlayer() {\n \tisWhitesTurn = !isWhitesTurn;\n }", "public void setPickAnotherCard(List<ClientTowerFloor> clientTowerFloors)\n {\n this.pickAnotherCard = clientTowerFloors;\n this.currentState = ClientStateName.CHOOSE_NEW_CARD;\n setChanged();\n notifyObservers(currentState);\n }", "private void cp2turn(){\n\t\tboolean attacked = false;\n\t\twhile(!attacked){\n\t\t\tranX = ranNum.nextInt(30);\n\t\t\tranY = ranNum.nextInt(30);\n\n\t\t\tif(cp2Attacks[ranX][ranY] == false){\n\t\t\t\tcp2Shots.add(new Shot(ranX * 20,ranY * 20));\n\t\t\t\tboardOne.add(cp2Shots.get(cp2ShotCount));\n\n\t\t\t\tboardOne.setComponentZOrder(cp2Shots.get(cp2ShotCount), 0);\n\n\t\t\t\tfor(int x = 0; x < ships.length; x++){\n\t\t\t\t\tif(ships[x].getPlayer() == 1){\n\t\t\t\t\t\tif(ships[x].checkBounds(ranX * 20 + 5, ranY * 20 + 5)){\n\t\t\t\t\t\t\tcp2Shots.get(cp2ShotCount).hit();\n\t\t\t\t\t\t\tships[x].hit();\n\t\t\t\t\t\t\tif(ships[x].sunk()){\n\t\t\t\t\t\t\t\tcp1BoatsSunk++;\n\t\t\t\t\t\t\t\tcp1shipLabel.setText(\"Computer Player 1 ships sunk: \" + cp1BoatsSunk);\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\tcp2ShotCount++;\n\t\t\t\tattacked = true;\n\t\t\t\tcp2Attacks[ranX][ranY] = true;\n\t\t\t}\n\t\t}\n\t\trepaint();\n\t}", "public void newRound()\n\t{\n\t\tif(player1.getDeck().isEmpty())\n\t\t{\n\t\t\treshufflePlayer1();\n\t\t}\n\t\tif(player2.getDeck().isEmpty())\n\t\t{\n\t\t\treshufflePlayer2();\n\t\t}\n\t\t\n\t\tactivePlayerOneCard = player1.draw();\n\t\tactivePlayerTwoCard = player2.draw();\n\t}", "public void establishDealOffer() {\n DealOffer offer = new DealOffer();\n \n int moneyToOffer = (Integer)this.playersMoneyMap.get(currentPlayer).getValue();\n offer.offerCash(moneyToOffer);\n \n Map<JCheckBox, Space> thisPlayerMap = playersCheckBoxes.get(currentPlayer);\n if (thisPlayerMap != null) {\n for (JCheckBox checkBox : thisPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToOffer(thisPlayerMap.get(checkBox));\n }\n }\n }\n \n int moneyToRequest = (Integer)this.playersMoneyMap.get(playerToOfferTo).getValue();\n offer.requestCash(moneyToRequest);\n \n Map<JCheckBox, Space> otherPlayerMap = playersCheckBoxes.get(playerToOfferTo);\n if (otherPlayerMap != null) {\n for (JCheckBox checkBox : otherPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToRequest(otherPlayerMap.get(checkBox));\n }\n }\n }\n this.dealOffer = offer;\n \n }", "public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }", "public void doTurn(Card c){\r\n if (Card1 == null && Card2 == null){\r\n Card1 = c;\r\n Card1.setIcon(c.getPic());\r\n }\r\n\r\n if (Card1 != null && Card1 != c && Card2 == null){\r\n Card2 = c;\r\n Card2.setIcon(c.getPic());\r\n t.start();\r\n\r\n }\r\n }", "public void tryAct() {\n\n List<Player> onCardPlayers = new ArrayList<Player>();\n List<Player> offCardPlayers = new ArrayList<Player>();\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n onCardPlayers = findPlayers(currentPlayer.getLocation().getOnCardRoles());\n offCardPlayers = findPlayers(currentPlayer.getLocation().getOffCardRoles());\n currentPlayer.act(onCardPlayers, offCardPlayers);\n refreshPlayerPanel();\n }\n else{\n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can act.\");\n }\n view.updateSidePanel(playerArray);\n }", "public void initialDeck()\t{\n\t\tdeck1 = new Deck();\n\t\tdeck2 = new Deck();\n\t\tdeck1.shuffle();\n\t\tdeck2.shuffle();\n\t\tdeck1 = deck1.combine(deck2);\n\t\tdeck1.shuffle();\n\t}", "state ask(state statea, state stateb) {\n\n //display options with the gamepad buttons to press\n telemetry.addData(\"A\", statea.name);\n telemetry.addData(\"B\", stateb.name);\n //show what was already added\n displayStates();\n telemetry.update();\n\n //check to make sure it is still in init\n while (!isStopRequested() && !opModeIsActive()) {\n if (gamepad1.a) {\n //loop while held to avoid double press\n while (gamepad1.a)\n idle();\n //return state to add to runList\n return statea;\n } else if (gamepad1.b) {\n //loop while held to avoid double press\n while (gamepad1.b)\n idle();\n //return state to add to runList\n return stateb;\n }\n }\n\n //return state if program was stopped to allow a quick restart\n return statea;\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\n\t\t\tif(count % 2 == 0){\n\t\t\t\tcp1turn();\n\t\t\t\tif(cp2BoatsSunk == 5){\n\t\t\t\t\tgameTimer.stop();\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"Game Over\\nComputer Player 1 has won\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tcp2turn();\n\t\t\t\tif(cp1BoatsSunk == 5){\n\t\t\t\t\tgameTimer.stop();\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"Game Over\\nComputer Player 2 has won\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcount++;\n\t\t}", "private void SecondStateFiringChecks()\n {\n List<Player> AffectedPlayers = game.GetAffectedPlayers(geoTarget, game.GetConfig().GetBlastRadius(missileType));\n\n if(AffectedPlayers.size() == 1)\n {\n final Player affectedPlayer = AffectedPlayers.get(0);\n\n if(lLastWarnedID != affectedPlayer.GetID() && affectedPlayer.GetRespawnProtected())\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_respawn_protected, affectedPlayer.GetName(), TextUtilities.GetTimeAmount(affectedPlayer.GetStateTimeRemaining())));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else if(lLastWarnedID != affectedPlayer.GetID() && game.GetNetWorthMultiplier(game.GetOurPlayer(), affectedPlayer) < Defs.NOOB_WARNING)\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_noob, affectedPlayer.GetName()));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else if(lLastWarnedID != affectedPlayer.GetID() && game.GetNetWorthMultiplier(game.GetOurPlayer(), affectedPlayer) > Defs.ELITE_WARNING)\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_elite, affectedPlayer.GetName()));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else\n {\n Launch();\n }\n }\n else\n {\n Launch();\n }\n }", "public void handleActivateLeader(ActionEvent event){\n\n Button activateButton = (Button) event.getSource();\n\n if(activateButton== activate0){\n sender.sendInput(\"activate leader card 0\");\n activatedLeader = activate0;\n discardedLeader = burn0;\n }\n\n if(activateButton== activate1){\n sender.sendInput(\"activate leader card 1\");\n activatedLeader = activate1;\n discardedLeader = burn1;\n\n }\n\n if(activateButton== activate2){\n sender.sendInput(\"activate leader card 2\");\n activatedLeader = activate2;\n discardedLeader = burn2;\n\n }\n\n if(activateButton== activate3){\n sender.sendInput(\"activate leader card 3\");\n activatedLeader = activate3;\n discardedLeader = burn3;\n\n }\n\n activateButton.setDisable(true);\n\n }", "@Test\n //checks for state switching (on/off)\n void SwitchStates() {\n Assertions.assertFalse(machine.isTurnedOn());\n\n //then, switch on and check if on\n machine.setTurnedOn(true);\n Assertions.assertTrue(machine.isTurnedOn());\n\n //switch off to see if turned off correctly\n machine.setTurnedOn(false);\n Assertions.assertFalse(machine.isTurnedOn());\n\n //and now check the inversion\n machine.flipSwitch();\n\n Assertions.assertTrue(machine.isTurnedOn());\n }", "void finishSwitching();", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "public void switchPlayer() {\r\n\t\tif (player == player1) {\r\n\t\t\tplayer = player2;\r\n\t\t} else {\r\n\t\t\tplayer = player1;\r\n\t\t}\r\n\t}", "@Override\n public void playWithTwoPlayers(Player player1, Player player2) {\n int[] combinationPlayer;\n int counter = config.getMaxTries();\n config.getMsgInfo().choiceGameBonus();\n config.getMsgInfo().counter(counter);\n\n // initialize a random number that both players will try to find\n IAPlayer ia = new IAPlayer(config);\n int[] defenseCombination = ia.initialiseCombination();\n if (config.isDevMode())\n config.getMsgCombination().devMode(defenseCombination);\n config.getMsgInfo().computer();\n\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clues);\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clews);\n\n counter--;\n config.getMsgInfo().counterLess(counter);\n\n do {\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(clues);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clues);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(clews);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clews);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n counter--;\n if (counter >= 1)\n config.getMsgInfo().counterLess(counter);\n else {\n config.getMsgInfo().endGameDuel();\n config.getMsgCombination().finallyRevealSecretCombination(defenseCombination);\n break;\n }\n } while (true);\n }", "public void ActivateRobber(Player player, HexBoard board, boolean isKnight) {\n CurrentPlayer=player;\n this.board=board;\n if(!isKnight)\n\t\tSevenResourceCheck();\n checkHex(this.getCurrentHex()); \n\t}", "public boolean whatNow (String action, player friday, player you){ // Method which will allow the ia to choose his action\n\t\tString testAction = \"Tank\"; // Create a String we will use a lot to test other string\n\t\tint actionIa; // If the ia is a Tank, forbid him to use his special attack. The purpose is to prevent him from useless turns\n\t\tif (friday.getName().equals(testAction)){ // If the name of the ia's class is Tank\n\t\t\t actionIa = (int)(Math.random() * 2); // His random will be between 0 or 1\n\t\t}\n\t\t\n\t\telse {\n\t\t\t actionIa = (int)(Math.random() * 3); // Else, his random will be between 0, 1 and 2\n\t\t}\n\t\t\n\t\ttestAction = \"attack\"; // Will be use to test if you attacked\n\t\t\n\t\t\n\t\tswitch (actionIa){ // Test ia's action\n\t\t\tcase 0: // 0, the enemy attack\n\t\t\t\tfriday.setSprite(\"attack\");\n\t\t\t\tSystem.out.println(\"The enemy attack\\n\"); // Warns the user\n\t\t\t\ttestAction = \"block\"; // Will be use to test if you block\n\t\t\t\tif (action.equals(testAction)){ // If you block\n\t\t\t\t\tSystem.out.println(\"You blocked the enemy's attack.\"); // Warns the user\n\t\t\t\t\tyou.setHp(you.getHp() - you.getDp()); // You loose as much hp as your dp\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tyou.setHp(you.getHp() - friday.getAp()); // Else, you loose as much hp as your enemy's ap\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1: // 1, the enemy block\n\t\t\t\tfriday.setSprite(\"block\");\n\t\t\t\tif (action.equals(testAction)){ // If you attacked\n\t\t\t\t\tfriday.setHp(friday.getHp() - friday.getDp()); // The enemy loose as much hp as his dp\n\t\t\t\t\taction = \"\"; // Prevent you from attack a second time\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"The enemy blocked your attack\\n\"); // Warns the user\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2: // 2, the enemy use his special power if he isn't a tank\n\t\t\t\tfriday.setSprite(\"special\");\n\t\t\t\tSystem.out.println(\"The enemy uses his special power.\"); // Warns the user\n\t\t\t\tfriday.special(); // Execute ia's special attack\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n\t\ttestAction = \"attack\"; // Reset testAction\n\t\t\n\t\tif (action.equals(testAction)){ // If you attacked\n\t\t\tfriday.setHp(friday.getHp() - you.getAp()); // The enemy loose as much hp as your ap\n\t\t} // Nota Bene : if the enemy blocked your attack, this won't be executed because 'action = \"\";'\n\t\t\n\t\tSystem.out.println(\"You have \" + you.getHp() + \" HP left.\"); // Warns the user\n\t\tSystem.out.println(\"The ennemy have \" + friday.getHp() + \" HP left.\\n\"); // Warns the user\n\t\t\n\t\tif(you.getHp() <= 0){ // If you or the ia has no hp left, warn the system that the fight is over by setting 'end' on true and tell who died\n\t\t\tend = true;\n\t\t\tSystem.out.println(\"You died!\");\n\t\t\tyou.setSprite(\"dead\");\n\t\t}\n\t\t\n\t\telse if(friday.getHp() <= 0){\n\t\t\tend = true;\n\t\t\tSystem.out.println(\"You killed the ennemy!\");\n\t\t\tfriday.setSprite(\"dead\");\n\t\t}\n\t\t\n\t\telse { // Else, it just asks you what you want to do\n\t\t\tSystem.out.println(\"What do you want to do, attack, block or use your special power ?\"); // Asks what you want to do\n\t\t}\n\t\treturn end;\n\t}", "private static void borrow() {\n\t\tnew BorrowBookUI(new borrowBookControl()()).run();\t// method changes BorrowBookControl to borrowBookControl()\t\r\n\t}", "public void aceChanger() {\n\t\t// Two aces in hand before move has been made\n\t\tif (hand.numOfCards() == 2 && isBusted()) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\tCard c = hand.getCards().get(0);\n\t\t\tCard newAce = new Card(1, \"A\", c.getCardSuit());\n\t\t\thand.addCard(newAce);\n\t\t\thand.remove(c);\n\t\t// Ace in hand and set to 11, and hand has busted\n\t\t} else if (checkForAce() && isBusted() && hand.numOfCards() > 2) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\twhile (handIterator.hasNext()) {\n\t\t\t\tCard c = (Card) handIterator.next();\n\t\t\t\tif (c.getCardValue() == 11) {\n\t\t\t\t\thand.addCard(new Card(1, \"A\", c.getCardSuit()));\n\t\t\t\t\thand.remove(c);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t// Ace in hand and total hand value is < 21\n//\t\t} else if (checkForAce() && !isBusted()) {\n//\t\t\tprintHand();\n//\t\t\tif (hand.numOfAces() == 1) {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have an Ace card in your hand. Do you \"\n//\t\t\t\t\t\t+ \"want to set the value to 1 or 11?\");\n//\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\")) {\n//\t\t\t\t\t\twhile (ans != 1 && ans != 11) {\n//\t\t\t\t\t\t\tSystem.out.println(\"Invalid input. Try again.\");\n//\t\t\t\t\t\t\tans = scan.nextInt();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t} else {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have multiple Ace cards in your hand.\"\n//\t\t\t\t\t\t+ \" Which card do you want to set the value for?\"\n//\t\t\t\t\t\t+ \" (Select by appropriate card suit.) Type exit to\"\n//\t\t\t\t\t\t+ \" make no changes.\");\n//\t\t\t\tString suit = scan.next();\n//\t\t\t\tif (suit.equalsIgnoreCase(\"exit\")) {\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\") && \n//\t\t\t\t\t\t\tc.getCardSuit().equalsIgnoreCase(suit)) {\n//\t\t\t\t\t\tSystem.out.println(\"Do you want to set the value to 1\"\n//\t\t\t\t\t\t\t\t+ \" or 11?\");\n//\t\t\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t}", "protected void setPlateauBlocked() {\r\n\t\tint idx = 0;\r\n\t\tfor (int i = 0; i < plateau4par4.getPlateau().length; i++) {\r\n\t\t\tfor (int j = 0; j < plateau4par4.getPlateau()[i].length; j++) {\r\n\t\t\t\tplateau4par4.getPlateau()[i][j] = new Case(new CaseContent(++idx));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void doComputerTurn() {\n Random rand = new Random();\n int randInt;\n\n if (!currentPlayer.isEmployed()) { // player not employed\n // moves (but suppresses popups) at random and update of player panel\n tryMove();\n\n if (!(currentPlayer.getLocation().getName() == \"trailer\")) {\n if (currentPlayer.getLocation().getName() == \"office\") { // in office\n // upgrade (but suppresses popups) at random and update of player panel\n tryUpgrade();\n \n } else { // in regular set\n // take role (but suppresses popups) at random and update of player panel\n tryTakeRole();\n }\n }\n endTurn();\n } else { // player is employed\n randInt = rand.nextInt(2); // get either 0 or 1\n if (randInt == 0) {\n // rehearse\n tryRehearse(); \n } else {\n // act\n tryAct();\n }\n\n endTurn();\n }\n }", "public void newHand() {\n if(player.getSecondHand().size() > 0){\n player.emptySecondHand(deck);\n shuffle();\n }\n player.resetBet();\n dealer.resetBet();\n errorFlag = false;\n userMessage = \"Place your Bet\";\n againDisabled = true;\n dealDisabled = false;\n hitDisabled = true;\n splitDisabled = true;\n standDisabled = true;\n doubleDisabled = true;\n bettingDisabled = false;\n emptyHands();\n }", "public void switchOn();", "@Override\n public void chooseAction(){\n healthDecay = getHealth() - 5;\n //now scan for Nazguls\n\n if(healthDecay == 0){\n death(this);\n }\n int scan_result = scan();\n\n if(scan_result == 1){\n move();\n }\n\n if(scan_result == 0 && healthDecay < 75){\n stay();\n }\n\n if(scan_result == 0 && hobbitCounter == 15){\n replicate();\n hobbitCounter = 0;\n }\n\n else{\n move();\n \n }\n hobbitCounter = hobbitCounter + 1;\n }", "private void setComputerChoice() {\n\t\tcomputerChoice = POSSIBLE_CHOICE[randomNumber];\n\t}", "private void checkin() {\r\n\t\tif (admittedinterns < 20) {\r\n\t\t\tDoctorManage();\r\n\t\t\taddinterns(1);\r\n\t\t\tScreentocharge();\r\n\t\t} else {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Por el dia no se admiten mas pacientes\");\r\n\t\t\t\r\n\t\t}\r\n\t}", "private void initBeginOfTurn()\n\t{\n\t\tfor(Action action : this.getCurrentPlayer().getPersonalityCard().getActions())\n\t\t{\n\t\t\taction.execute(this);\n\t\t}\n\t\t\n\t\tcanPlayPlayerCard = true;\n\t\tthis.getCurrentPlayer().getDataInput().printMessage(this.getEntireGameStatus());\n\t\tthis.getCurrentPlayer().getDataInput().printMessage(this.getCurrentPlayerGameStatus());\n\t\tthis.showSaveGame = true;\n\t\t\n\t\tfor(Card card : this.getCurrentPlayer().getCityAreaCardDeck())\n\t\t{\n\t\t\tcard.setActiveState(true);\n\t\t}\n\t}", "private synchronized void teamVictory() {\n \t\tif (state == MatchState.ONVICTORY || state == MatchState.ONCOMPLETE || state == MatchState.ONCANCEL) \n \t\t\treturn;\n \t\tstate = MatchState.ONVICTORY;\n \t\t/// Call the rest after a 2 tick wait to ensure the calling transitionMethods complete before the\n \t\t/// victory conditions start rolling in\n \t\tBukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MatchVictory(this),2L);\n \t}", "void rndSwapTwo() {\r\n\t\t// index 0 has the start city and doesn't change\r\n\t\t// hence the random#s are from 1 onwards\r\n\t\trndSwapTwo(1, this.length());\r\n\t}", "private void menu2Switch(int choice) {\r\n\t\tswitch(choice) {\r\n\t\tcase 1:\r\n\t\t\tthis.myMaze.movePlayer('n');\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tthis.myMaze.movePlayer('e');\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tthis.myMaze.movePlayer('s');\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tthis.myMaze.movePlayer('w');\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "public void abilityTwo() {\n if(map.getCurrentTurnHero().getAbilities().size() < 2){\n return;\n }\n ability(map.getCurrentTurnHero().getAbilities().get(1));\n }", "public void reinforce() {\r\n\r\n\t\tmch.clicked = false;\r\n\t\t\r\n\t\tif (phaseInit == 0) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tattackSlide.setVisible(false);\r\n\t\t\tattacker.setVisible(false);\r\n\t\t\treinforced = false;\r\n\t\t\t// If run out of cards, fill the cards array with the usedCards\r\n\t\t\tif (Cards.size() == 0) {\r\n\t\t\t\tCards = usedCards;\r\n\t\t\t\tusedCards = new ArrayList<Card>();\r\n\t\t\t\tCollections.shuffle(Cards);\r\n\t\t\t}\r\n\t\t\t// Dehighlight all countries that were previously highlighted\r\n\t\t\t\r\n\t\t\tfor (Player pa : players) {\r\n\t\t\t\tfor (Country ca : pa.getCountries()){\r\n\t\t\t\t\tif (ca.isHighlighted()) {\r\n\t\t\t\t\t\tnew threadz(ca, pa.getColor(), false);\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\r\n\t\t\t// If a player has attacked that turn and won at least one battle it will win a\r\n\t\t\t// card\r\n\t\t\tif (hasAttacked == true && hasWon == true) {\r\n\t\t\t\t// Give that player a card.\r\n\t\t\t\tplayers.get(turnCounter).addCard(Cards.get(0));\r\n\t\t\t\tCards.remove(0);\r\n\t\t\t\thasAttacked = false;\r\n\t\t\t\thasWon = false;\r\n\r\n\t\t\t\t// Refresh the cards\r\n\t\t\t\tfor (int x = 0; x < 5; x++) {\r\n\t\t\t\t\tcardPics[x].setIcon(null);\r\n\t\t\t\t\tif (cardPics[x].getMouseListeners() != null)\r\n\t\t\t\t\t\tcardPics[x].removeMouseListener(mch);\r\n\t\t\t\t\tcardSelectedPics[x].setVisible(false);\r\n\t\t\t\t\tcardSelectedPics[x].setBackground(players.get(turnCounter).getColor());\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Draw the player's cards\r\n\t\t\t\tg.setColor(Color.WHITE);\r\n\t\t\t\tg.setFont(new Font(\"Impact\", Font.BOLD, 20));\r\n\t\t\t\tg.drawString(\"Player \" + (turnCounter + 1) + \"'s Cards\", 105, 750);\r\n\t\t\t\tBufferedImage img = null;\r\n\t\t\t\tfor (int y = 0; y < players.get(turnCounter).getCards().size(); y++) {\r\n\t\t\t\t\tcardPics[y].addMouseListener(mch);\r\n\t\t\t\t\tcardPics[y].setEnabled(true);\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\timg = ImageIO.read(\r\n\t\t\t\t\t\t\t\t// Read in the image from a separate file\r\n\t\t\t\t\t\t\t\tnew File (\"Ressources/\" +\"Cards/\" + players.get(turnCounter).getCards().get(y).getCountry()\r\n\t\t\t\t\t\t\t\t\t\t+ \"Card.png\"));\r\n\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\t// Catch\r\n\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcardPics[y].setIcon(new ImageIcon(recolorCard(img, y)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString s = \"\";\r\n\t\tfor (Player p : Board.players) {\r\n\t\t\t// get the name of the country that has been clicked\r\n\t\t\tfor (Country c : p.getCountries()) {\r\n\t\t\t\tif (hoveredColor.equals(c.getDetectionColor())) {\r\n\t\t\t\t\ts = c.getName();\r\n\t\t\t\t}\r\n\t\t\t\t// Ensure this country is one the current player owns and the country has more\r\n\t\t\t\t// than one troop\r\n\t\t\t\tif (hoveredColor.equals(c.getDetectionColor()) && players.get(turnCounter).checkOwn(s)&& c.getTroops() > 1 && c.isHighlighted() == false && reinforced == false) {\r\n\t\t\t\t\t// Dehighlight any countries that were previously selected\r\n\t\t\t\t\tfor (Player player : players) {\r\n\t\t\t\t\t\tfor (Country ca : player.getCountries()) {\r\n\t\t\t\t\t\t\tif (ca.isHighlighted()) {\r\n\t\t\t\t\t\t\t\tnew threadz(ca, player.getColor(), false);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Highlight the new selected country, and its neighboring countries\r\n\t\t\t\t\tnew threadz(c, players.get(turnCounter).getColor().brighter().brighter().brighter(), true);\r\n\t\t\t\t\tc.highlightOwned();\r\n\t\t\t\t\tattackingCountry = c;\r\n\t\t\t\t\treinforced = true;\r\n\t\t\t\t} else if (hoveredColor.equals(c.getDetectionColor()) && c.isHighlighted()\r\n\t\t\t\t\t\t&& c.getName().equals(attackingCountry.getName()) \r\n\t\t\t\t\t\t== false && checkO(c) == true\r\n\t\t\t\t\t\t&& attackingCountry.getTroops() > 1) {\r\n\r\n\t\r\n\t\t\t\t\tdefendingCountry = c;\r\n\r\n\t\t\t\t\tattackingCountry.setTroops(attackingCountry.getTroops() - 1);\r\n\t\t\t\t\tdefendingCountry.setTroops(defendingCountry.getTroops() + 1);\r\n\r\n\t\t\t\t\t// new threadz(attackingCountry,\r\n\t\t\t\t\t// players.get(turnCounter).getColor().brighter().brighter().brighter(), false);\r\n\r\n\t\t\t\t\tif (attackingCountry.getTroops() == 1) {\r\n\t\t\t\t\t\tattackingCountry.unHighlightNeighbours();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tphaseInit++;\r\n\t}", "public GameBoard jump(APlayer opponent, Piece piece, int x, int y) {\n GameBoard newBoard = new GameBoard();\n newBoard.getPlayer2().getCheckers().clear();\n newBoard.getPlayer1().getCheckers().clear();\n newBoard.getPlayer1().getCheckers().addAll(this.getCheckers());\n newBoard.getPlayer2().getCheckers().addAll(opponent.getCheckers());\n newBoard.setCurrentTurn(1);\n int row = piece.getRow();\n int column = piece.getColumn();\n Piece piece1 = new Piece(row+2,getColumn(column-2),piece.isKing());\n Piece piece2 = new Piece(row+2,getColumn(column+2),piece.isKing());\n if(piece.isKing() && x < row) {\n Piece piece3 = new Piece(row-2, getColumn(column-2), true);\n Piece piece4 = new Piece(row-2, getColumn(column+2), true);\n if(newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece3,x,y,4) || x==row-2 && y==getColumn(column-2) && hasPlayers(opponent, row-1, getColumn(column-1)) &&\n isEmpty(opponent, row-2, getColumn(column-2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row-1,getColumn(column-1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n newBoard.getPlayer1().getCheckers().add(piece3);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece3, x, y);\n }\n if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece4,x,y,4) || x==row-2 && y==getColumn(column+2) && hasPlayers(opponent, row-1,getColumn(column+1)) &&\n isEmpty(opponent, row-2, getColumn(column+2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row-1, getColumn(column+1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n newBoard.getPlayer1().getCheckers().add(piece4);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece4, x, y);\n }\n } else if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece1,x,y,4) || x==row+2 && y== getColumn(column-2) && hasPlayers(opponent, row +1, getColumn(column -1)) &&\n isEmpty(opponent, row +2, getColumn(column -2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row+1, getColumn(column-1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece1.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(piece1);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece1, x, y);\n } else if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece2,x,y,4) || x==row+2 && y== getColumn(column+2) && hasPlayers(opponent, row +1, getColumn(column +1)) &&\n isEmpty(opponent, row +2, getColumn(column +2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row+1, getColumn(column+1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece2.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(piece2);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece2, x, y);\n }\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(new Piece(x,y,piece.isKing()));\n return newBoard;\n }", "@Test\n public void testTripCircuit() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n metrics.markSuccess(1000);\n metrics.markSuccess(1000);\n metrics.markSuccess(1000);\n metrics.markSuccess(1000);\n\n // this should still allow requests as everything has been successful\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // fail\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n\n // everything has failed in the test window so we should return false now\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "public void sbbActivate() {\n\t}", "public static void ChangeCustomerChoice(Boolean tConnection) {\r\n\t\tboolean connection = tConnection; \r\n\r\n \tScanner scnr = new Scanner(System.in);\r\n\t\tint changechoice, newservice, cycled;\r\n\t\tcycled = 0;\r\n\t\tchangechoice = 0;\r\n\t\tnewservice = 0;\r\n\t\t\r\n\t\tif(connection == true) {\r\n\t\t\tclientListUpdater();\r\n\t\t}\r\n\t\t\r\n\t\tDisplayInfo(connection);\r\n\t\t\r\n\t\tSystem.out.println(\"\\r\\nEnter the number of the client that you wish to change\");\r\n\t\t\r\n\t\tdo {\r\n \t\tif( (changechoice < 1 || changechoice > clientList.size()) && cycled != 0) {\r\n \t\t\tSystem.out.println(\"That client does not exist. Try again.\");\r\n \t\t}\r\n\t\t while(!scnr.hasNextInt()) {\r\n\t\t \tSystem.out.println(\"Client change options are integers only\");\r\n\t\t \tscnr.next();\t\r\n\t\t }\r\n \t\tcycled = 1;\r\n \t\tchangechoice = scnr.nextInt();\r\n\t\t} while(changechoice < 1 || changechoice > clientList.size());\r\n\t\t\r\n\t\tSystem.out.println(\"\\r\\nEnter the client's new service choice (1 = Brokerage, 2 = Retirement)\");\r\n\t\t\r\n\t\tcycled = 0;\r\n\t\t\r\n\t\tdo {\r\n\t\t\tif((newservice < 1 || newservice > 2) && cycled != 0) {\r\n\t\t\t\tSystem.out.println(\"Client choice can only be 1 or 2 (1 = Brokerage, 2 = Retirement)\\r\\nTry again.\");\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(!scnr.hasNextInt()) {\r\n\t\t\t\tSystem.out.println(\"Client choice are integer only, Try again.\");\r\n\t\t\t\tscnr.next();\r\n\t\t\t}\r\n\t\t\tcycled = 1;\r\n\t\t\tnewservice = scnr.nextInt();\r\n\t\t} while(newservice < 1 || newservice > 2);\r\n\t\t\r\n\t\tString servString = \"\";\r\n\t\tif(newservice == 1) {\r\n\t\t\tservString = \"Brokerage\";\r\n\t\t} else if(newservice == 2) {\r\n\t\t\tservString = \"Retirement\";\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Error: Client could not be entered\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(connection == true) {\r\n\t\t\tserverConnector.updateClientChoice(changechoice, servString);\r\n\t\t\tclientListUpdater();\r\n\r\n\t\t} else {\r\n\t\t\tclientList.get(changechoice-1).setClientServ(servString);\r\n\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public abstract Chip checkWinner();", "public static void getBattleChoice() {\n \t\tMainGame.display.disp(\"What do you want to do?:\");\r\n \t\tMainGame.display.Enable(MainGame.display.attack, MainGame.display.defend, MainGame.display.heal);\r\n \t}", "public void switchToMap()\n {\n feedbackLabel.setVisible(false);\n d.setVisible(false);\n a.setText(destinations[0].getName());\n b.setText(destinations[1].getName());\n c.setText(destinations[2].getName());\n currentClue=destinations[0].getRandClue();\n questionLabel.setText(currentClue);\n atQuestionStage=false;\n shuffleButtons();\n questionLabel.setBounds(650-questionLabel.getPreferredSize().width,120,600,30);\n mapImageLabel.setVisible(true);\n mapImageLabel.repaint();\n revalidate();\n }", "private ScanState switchState(ScanState desired,EnumSet<ScanState> allowed) {\n final ScanState old;\n final long timestamp;\n final long sequence;\n synchronized(this) {\n old = state;\n if (!allowed.contains(state))\n throw new IllegalStateException(state.toString());\n state = desired;\n timestamp = System.currentTimeMillis();\n sequence = getNextSeqNumber();\n }\n LOG.fine(\"switched state: \"+old+\" -> \"+desired);\n if (old != desired)\n queueStateChangedNotification(sequence,timestamp,old,desired);\n return old;\n }", "public void initiateTwoPlayers() {\n spaceShips.add(new SpaceShip(250, 700, friendlyBullets, \"spaceship_blue_30x30.png\", \"bullet_blue_20x30.png\", \"heart_blue_13x13.png\", 50, Bullets.BulletType.NORMAL, 0));\n spaceShips.add(new SpaceShip(500, 700, friendlyBullets, \"green_spaceship_30x30.png\", \"bullet_green_20x30.png\", \"heart_green_13x13.png\", 730, Bullets.BulletType.NORMAL, 0));\n\n playerOne = new Player(KeyboardEvent.KEY_UP, KeyboardEvent.KEY_DOWN, KeyboardEvent.KEY_LEFT, KeyboardEvent.KEY_RIGHT, KeyboardEvent.KEY_SPACE, spaceShips.get(0));\n playerTwo = new Player(KeyboardEvent.KEY_W, KeyboardEvent.KEY_S, KeyboardEvent.KEY_A, KeyboardEvent.KEY_D, KeyboardEvent.KEY_T, spaceShips.get(1));\n\n versus = false;\n init(); // TODO: 13/02/2019 passar nr de player\n\n }", "public boolean startBattle()\n {\n if(a.getHealth() <= 0) //if the health is 0 then you lose\n {\n return false; //lose\n }\n if(b.getHealth() <= 0) //if AI is 0 you when\n {\n return true; //win\n }\n if(gotAway)\n {\n return false;\n }\n if(!init) //first time\n {\n System.out.println(\"Go \" + a.getName() + \"!\");\n init = true; //sets it so its not first time anymore\n }\n System.out.println(\"What will \" + a.getName() + \" do?\");\n System.out.println(\"1. Fight 2. Run\");\n Scanner scanner = new Scanner(System.in); //scan for user input, fight or run\n int choice = scanner.nextInt();\n switch(choice) //switch for choices of options\n {\n case 1:\n {\n // Display move options\n System.out.println(\"Fight!\");\n for(int i = 1; i < a.actions.length + 1; i++) //print out all of the possible moves\n {\n System.out.println(i + \". \" + a.actions[i - 1]);\n }\n int fightSelection = scanner.nextInt();\n if(fightSelection < 1 || fightSelection > 4) //keeps the selection within boundaries\n {\n System.out.println(\"INVALID CHOICE\");\n startBattle();\n } else\n {\n Actions current = a.actions[fightSelection - 1];\n if(hit(current.getAccuracy())) //if the attack hits\n {\n b.subtractHealth(current.getPower()); //AIHealth - power\n current.subtractPp(1); //-PP\n //Display stats\n System.out.println(a.getName() + \" used \" + current.getName());\n System.out.println(a.getName() + \" Health: \" + a.getHealth());\n System.out.println(b.getName() + \" Health: \" + b.getHealth());\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n break;\n } else\n {\n System.out.println(a.getName() + \" missed!\");\n System.out.println(a.getName() + \" Health: \" + a.getHealth());\n System.out.println(b.getName() + \" Health: \" + b.getHealth());\n current.subtractPp(1);\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n break;\n }\n }\n break;\n }\n case 2:\n {\n // Run\n if(hit(75))\n {\n // Run away successful\n System.out.println(\"Got away safely\");\n gotAway = true;\n break;\n } else\n {\n System.out.println(\"Can't escape!\");\n gotAway = false;\n break;\n }\n\n }\n default:\n {\n System.out.println(\"Please choose a valid choice.\");\n startBattle();\n }\n }\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n\n if(!gotAway)\n {\n // AI Turn\n Random random = new Random();\n int move = random.nextInt(4);\n int counter = 0;\n while(b.actions[move].getPp() <= 0 && counter < 50)\n {\n move = random.nextInt(4); //picks a random move\n counter++;\n }\n Actions aiAction = b.actions[move];\n if(hit(aiAction.getAccuracy()))\n {\n a.subtractHealth(aiAction.getPower());\n aiAction.subtractPp(1);\n System.out.println(b.getName() + \" used \" + aiAction.getName());\n System.out.println(a.getName() + \" Health: \" + a.getHealth());\n System.out.println(b.getName() + \" Health: \" + b.getHealth());\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n } else\n {\n System.out.println(b.getName() + \" missed!\");\n System.out.println(a.getName() + \" Health: \" + a.getHealth());\n System.out.println(b.getName() + \" Health: \" + b.getHealth());\n aiAction.subtractPp(1);\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n }\n startBattle();\n return false;\n }\n return false;\n }", "@Test\n void testBotBIsNextPlayerWhenBotAHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); //botA is nextPlayer\n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotB().getId(), testDealer.getNextPlayer());\n }", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void setAsUp () \n\t{ \n\t\tn.setFailureState(true);\n\t\tfinal SortedSet<WLightpathRequest> affectedDemands = new TreeSet<> ();\n\t\tgetOutgoingFibers().forEach(f->affectedDemands.addAll(f.getTraversingLpRequestsInAtLeastOneLp()));\n\t\tgetIncomingFibers().forEach(f->affectedDemands.addAll(f.getTraversingLpRequestsInAtLeastOneLp()));\n\t\tfor (WLightpathRequest lpReq : affectedDemands)\n\t\t\tlpReq.internalUpdateOfRoutesCarriedTrafficFromFailureState();\n\t}", "private void cp1turn(){\n\t\tboolean attacked = false;\n\t\twhile(!attacked){\n\t\t\tranX = ranNum.nextInt(30);\n\t\t\tranY = ranNum.nextInt(30);\n\n\t\t\tif(cp1Attacks[ranX][ranY] == false){\n\t\t\t\tcp1Shots.add(new Shot(ranX * 20,ranY * 20));\n\t\t\t\tboardTwo.add(cp1Shots.get(cp1ShotCount));\n\t\t\t\tboardTwo.setComponentZOrder(cp1Shots.get(cp1ShotCount), 0);\n\n\t\t\t\tfor(int x = 0; x < ships.length; x++){\n\t\t\t\t\tif(ships[x].getPlayer() == 2){\n\t\t\t\t\t\tif(ships[x].checkBounds(ranX * 20 + 5, ranY * 20 + 5)){\n\t\t\t\t\t\t\tcp1Shots.get(cp1ShotCount).hit();\n\t\t\t\t\t\t\tships[x].hit();\n\t\t\t\t\t\t\tif(ships[x].sunk()){\n\t\t\t\t\t\t\t\tcp2BoatsSunk++;\n\t\t\t\t\t\t\t\tcp2shipLabel.setText(\"Computer Player 2 ships sunk: \" + cp2BoatsSunk);\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\tcp1ShotCount++;\n\t\t\t\tattacked = true;\n\t\t\t\tcp1Attacks[ranX][ranY] = true;\n\t\t\t}\n\t\t}\n\t\trepaint();\n\t}", "public void chooseAttackStarter(){\n gameState = GameState.ATTACKERSELECTION;\n currentTerritoriesOfInterest = Player.getTerritoryStringArray(currentPlayer.getAttackStarters());\n notifyObservers();\n }", "public void attack() {\r\n\t\tmch.clicked = false;\r\n\t\t\r\n\t\t//Makes the troopsToDeploy and cashinButton not visible\r\n\t\t//This code will only be called once per attack()\r\n\t\tif (phaseInit == 0) {\r\n\t\t\ttroopsToDeploy.setVisible(false);\r\n\t\t\tcashInButton.setVisible(false);\r\n\t\t\t//Removes the mouse listeners from the cards and makes them invisible\r\n\t\t\tfor (int x = 0; x < 5; x++) {\r\n\t\t\t\tif (cardPics[x].getMouseListeners() != null)\r\n\t\t\t\t\tcardPics[x].removeMouseListener(mch);\r\n\t\t\t\tcardSelectedPics[x].setVisible(false);\r\n\t\t\t}\r\n\t\t}\r\n\t\tphaseInit++;\r\n\r\n\t\t//This code will determine when a battle will happen\r\n\t\tString s = \"\";\r\n\t\tfor (Player p : Board.players) {\r\n\t\t\t//get the name of the country that has been clicked\r\n\t\t\tfor (Country c : p.getCountries()) {\r\n\t\t\t\tif (hoveredColor.equals(c.getDetectionColor())) {\r\n\t\t\t\t\ts = c.getName();\r\n\t\t\t\t}\r\n\t\t\t\t//Ensure this country is one the current player owns and the country has more than one troop\r\n\t\t\t\tif (hoveredColor.equals(c.getDetectionColor()) && players.get(turnCounter).checkOwn(s)\r\n\t\t\t\t\t\t&& c.getTroops() > 1) {\r\n\t\t\t\t\t//Dehighlight any countries that were previously selected\r\n\t\t\t\t\tfor (Player player : players) {\r\n\t\t\t\t\t\tfor (Country ca : player.getCountries()) {\r\n\t\t\t\t\t\t\tif (ca.isHighlighted()) {\r\n\t\t\t\t\t\t\t\tnew threadz(ca, player.getColor(), false);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Highlight the new selected country, and its neighboring countries\r\n\t\t\t\t\tnew threadz(c, players.get(turnCounter).getColor().brighter().brighter().brighter(), true);\r\n\t\t\t\t\tc.HighlightNeighbours();\r\n\t\t\t\t\t//the attacking country is the first clicked country\r\n\t\t\t\t\tattackingCountry = c;\r\n\t\t\t\t\ttempAtt = attackingCountry.getTroops();\r\n\t\t\t\t\t\r\n\t\t\t\t\tattackSlide.setVisible(true);\r\n\t\t\t\t\tattackSlide.setMaximum(attackingCountry.getTroops()-1);\r\n\t\t\t\t\tattackSlide.setMinimum(1);\r\n\t\t\t\t\tattackSlide.setValue(attackSlide.getMaximum());\r\n\t\t\t\t\tattacker.setVisible(true);\r\n\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} else if (hoveredColor.equals(c.getDetectionColor()) && c.isHighlighted() && c.getName().equals(attackingCountry.getName()) == false && checkO(c) == false) {\r\n\t\t\t\t\t//The defending country is the second clicked country, and it must be highlighted\r\n\t\t\t\t\tdefendingCountry = c;\r\n\t\t\t\t\tbattle = true;\r\n\t\t\t\t\thasAttacked = true;\r\n\t\t\t\t\tattackSlide.setVisible(false);\r\n\t\t\t\t\tattacker.setVisible(false);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//If a battle has been determined to happen\r\n\t\tif (battle == true) {\r\n\t\t\t\r\n\t\t\t//Makes sure the attacking country has more than one troop and that it is attacking a neighbour\r\n\t\t\tif (attackingCountry.getTroops() > 1 && defendingCountry.isHighlighted()) {\r\n\t\t\t\t//Makes a new battle between the attacker and defender then updates their troops after the battle \r\n\t\t\t\tBattle battle1 = new Battle(attackSlide.getValue(), defendingCountry.getTroops());\r\n\t\t\t\tbattle1.BattleTroops();\r\n\t\t\t\tattackingCountry.setTroops(Battle.getAttackers());\r\n\t\t\t\tdefendingCountry.setTroops(Battle.getDefenders());\r\n\t\t\t}\r\n\r\n\t\t\t//Determines the array index of the defending country in the players array\r\n\t\t\tint defNum = 0;\r\n\t\t\tfor (Player po : players) {\r\n\t\t\t\tfor (Country co : po.getCountries()) {\r\n\t\t\t\t\tif (defendingCountry.getName().equals(co.getName())) {\r\n\t\t\t\t\t\tdefNum = po.getPlayerNum();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//These two ifs ensure that the troops never go into the negative\r\n\t\t\tif (attackingCountry.getTroops() < 0) {\r\n\t\t\t\tattackingCountry.setTroops(0);\r\n\t\t\t}\r\n\t\t\tif (defendingCountry.getTroops() < 0) {\r\n\t\t\t\tdefendingCountry.setTroops(0);\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\t// If Attackers lose\r\n\t\t\tif (attackingCountry.getTroops() == 0) {\r\n\t\t\t\t//Unhighlight its neighbors\r\n\t\t\t\tattackingCountry.unHighlightNeighbours();\r\n\t\t\t\t\r\n\t\t\t\tattackingCountry.setTroops(tempAtt - attackSlide.getValue());\r\n\t\t\t\t//Updates the defenders based on the defenders left\r\n\t\t\t\tdefendingCountry.setTroops(defendingCountry.getTroops());\r\n\r\n\t\t\t\t\r\n\t\t\t\t//Ensures the troops never go negative or less than zero\r\n\t\t\t\tif (defendingCountry.getTroops() <= 0) {\r\n\t\t\t\t\tdefendingCountry.setTroops(1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//If defenders lose\r\n\t\t\tif (defendingCountry.getTroops() == 0) {\r\n\t\t\t\t//Unhighlights the defending country\r\n\t\t\t\tfor (Player p: players) {\r\n\t\t\t\t\tfor (Country c: p.getCountries()) {\r\n\t\t\t\t\t\tif (c.getName().equals(defendingCountry.getName())){\r\n\t\t\t\t\t\t\tc.setHighlighted(false);\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//Recolor the defenders country to the attackers color\r\n\t\t\t\tnew threadz(defendingCountry, players.get(turnCounter).getColor(), false);\r\n\t\t\t\tattackingCountry.unHighlightNeighbours();\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Updates the troop numbers\r\n\t\t\t\r\n\t\t\t\tdefendingCountry.setTroops(attackingCountry.getTroops());\r\n\t\t\t\tattackingCountry.setTroops(tempAtt - attackSlide.getValue());\r\n\t\t\t\tif (attackingCountry.getTroops() <= 0) {\r\n\t\t\t\t\tattackingCountry.setTroops(1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Removes the defender from the defenders country arraylist\r\n\t\t\t\tplayers.get(defNum).getCountries().remove(defendingCountry);\r\n\t\t\t\t//Adds the defender country to the attackers country arrayList.\r\n\t\t\t\tplayers.get(turnCounter).getCountries().add(defendingCountry);\r\n\t\t\t\thasWon = true;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif (players.get(defNum).getCountries().size() == 0) {\r\n\t\t\t\t\tFile fanfare = new File(\"Ressources/\" + \"fanfare2.wav\");\r\n\t\t\t\t\tplaySound(fanfare);\r\n\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\tJOptionPane.showMessageDialog(window.getFrame(), \"Player \" + (defNum+1) + \" has been Eliminated!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\twhile(players.get(defNum).getCards().size() > 0) {\r\n\t\t\t\t\t\tusedCards.add(players.get(defNum).getCards().get(0));\r\n\t\t\t\t\t\tplayers.get(defNum).getCards().remove(0);\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\r\n\t\t} // End of i\r\n\r\n\t\tbattle = false;\r\n\t\t\r\n\t}", "private Board twinBySwitching(int x1, int y1, int x2, int y2) {\n int value1 = blocks[x1][y1];\n int value2 = blocks[x2][y2];\n\n int[][] newBlocks = new int[dimension()][dimension()];\n for (int i = 0; i < dimension(); i++){\n for (int j = 0; j < dimension(); j++) {\n if (i == x1 && j == y1) {\n newBlocks[i][j] = value2;\n } else if (i == x2 && j == y2) {\n newBlocks[i][j] = value1;\n } else {\n newBlocks[i][j] = blocks[i][j];\n }\n }\n }\n\n return new Board(newBlocks);\n }", "public void changeTurn(){\r\n model.setCheckPiece(null);\r\n model.swapPlayers();\r\n }", "private void startUpConditions(){\n\t\t\tString strSize = JOptionPane.showInputDialog(null, \n\t\t\t\t\t\"Pick a Board Size between 3-30.\");\n\t\t\ttry{\n\t\t\t\tselectedSize = Integer.parseInt(strSize);\n\t\t\t\t\n\t\t\tif(selectedSize < 2||selectedSize > 30){\n\t\t\t\tselectedSize = 10;\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The Game has\"\n\t\t\t\t+ \" defaulted to a Board Size of 10.\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}catch(NumberFormatException exception){\n\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The Game has\"\n\t\t\t\t+ \" defaulted to a Board Size of 10.\"+\n\t\t\t\t\" Because you input characters other than numbers.\");\n\t\t\t\tselectedSize = 10;\t\t\t\t\n\t\t\t}\n\n\t\n\t\t//selecting the number of players within the game\n\t\t//verifying a valid input for the Players\n\t\t//It's awfully boring to play by yourself after all.\n\t\t\tString strPlay = JOptionPane.showInputDialog(null, \n\t\t\t\t\t\"Pick number of players between 2-10\");\n\t\t\ttry{\n\t\t\t\tif(strPlay==null){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" has defaulted to 2 players.\");\n\t\t\t\t\tselectedPlayers = 2;\n\t\t\t\t}\n//\t\t\t\tif(input == JOptionPane.CANCEL_OPTION){\n//\t\t\t\t\tSystem.exit(1);\n//\t\t\t\t}\n\t\t\t\tif(strPlay!=null){\n\t\t\t\t\tselectedPlayers = Integer.parseInt(strPlay);\n\t\t\t\t\t\n\t\t\t\t\tif(selectedPlayers < 2||selectedPlayers > 10){\n\t\t\t\t\t\tselectedPlayers = 2;\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t\t\t+\" has defaulted to 2 players.\"\n\t\t\t\t\t\t\t+\" Because you input a number that \"\n\t\t\t\t\t\t\t+\"was out of bounds.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(NumberFormatException exception){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"You input \"\n\t\t\t\t\t+ \"something that was not a number.\"\n\t\t\t\t\t+ \" The game has defaulted to 2 players.\");\n\t\t\t\tselectedPlayers = 2;\n\t\t\t}\n\t\t\t\n\t\t\tString goFirst = JOptionPane.showInputDialog(null, \"Pick\"\n\t\t\t+ \" who will go first.\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif(goFirst==null){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" has defaulted to Player 1s turn.\");\n\t\t\t\t\tthis.firstTurn = 0;\n\t\t\t\t}\n\t\t\t\tif(goFirst!=null){\n\t\t\t\t\t this.firstTurn = Integer.parseInt(goFirst);\n\t\t\t\t}\n\t\t\t}catch(NumberFormatException exception){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You input \"\n\t\t\t\t+ \"something other than a number.\"\n\t\t\t\t+ \" The Game has defaulted to player 1s turn.\");\n\t\t\t\tthis.firstTurn = 0;\n\t\t\t}finally{\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" will now begin.\");\n\t\t\t}\n\t\t\t\n\t\t}", "public void activateShield() {\n shield.activate();\n }", "public void initMission() {\n\t\tinitNumOfMoves();\t//reset counter\n\t\t//Begin by creating a random board.\n\t\t/* 1st parameter: is the cell at (0,0) always empty?\n\t\t * 2nd parameter: will this board be accessed by the AI?\n\t\t * See the constructor comments in Board.java for more details. */\n\n\t\tboard = new Board(this.options.toUpperCase().contains(\"00\") ? true : false, false);\n\n\t\t//TODO OPTIONAL: instead of spawning a random board, we can customize\n\t\t//our own board! Just un-comment any of the below boards or paste your own!\n\n\t\t//Wastes to the right AND to the south! Watch how the AI would react.\n\t\t//try one-player AI version (aggressive or not, doesn't matter)\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"P\", \"W\", \"\", \"\", \"\"},\n//\t\t\t\t {\"W\", \"\", \"\", \"\", \"G\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"P\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t});\n\t\t//What's the most efficient way for the AI to find the victim?\n\t\t//Note there are no wastes or fire pits in this scenario.\n//\t\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\" \", \" \", \" \", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \"G\", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \" }\n//\t\t\t\t});\n\n\t\t//Impossible one. Useful for explaining probability during presentation.\n//\t\t\t\t\t\tboard = new Board(new String[][]\n//\t\t\t\t\t\t\t\t{{\"\", \"\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"\", \"P\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"P\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"W\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"\", \"\", \"\", \"W\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"\", \"G\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t});\n\n\t\t/* Very tough board, but the AI is up to the task. */\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"P\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"W\", \"\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t {\"G\", \"\", \"\", \"W\", \"\", \"\"},\n//\t\t\t\t});\n\n\t\t//tough tough tough. The victim is surrounded by a wall of fire!\n\t\t//try it with 2 AI's, starting in random cell. One of them might die!\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"P\", \"\", \"G\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"P\", \"W\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"W\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"P\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t});\n\n\t\t//with aggressiveModeOn set to true, the AI will disinfect both wastes.\n\t\t//if set to false, the AI will disinfect only one.\n\t\t//Either way, AI gets the victim.\n\t\t//\t\t\t\tboard = new Board(new String[][]\n\t\t//\t\t\t\t\t\t{{\"\", \"\", \"\", \"\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t{\"\", \"\", \"\", \"P\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t{\"\", \"W\", \"\", \"\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t{\"\", \"W\", \"\", \"G\", \"\", \"P\"},\n\t\t//\t\t\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t{\"P\", \"\", \"\", \"\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t});\n\n\n\t\t//RARE situation (one-player mode) where setting aggressiveModeOn to true will result in death.\n\t\t//Non-aggressive mode will get the victim. Start at cell (0,0).\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"\", \"\", \"P\", \"G\", \"P\"},\n//\t\t\t\t{\"\", \"\", \"P\", \"W\", \"W\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"P\", \"P\", \"\"},\n//\t\t\t\t{\"P\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t});\n\n\n\t\t//Very rare instance. if both players are AI and start at cell (0,0),\n\t\t//they will BOTH die. However, note that it's not the AI's fault.\n\t\t//The AI still managed to MINIMIZE risk. They just got unlucky.\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"\", \"\", \"\", \"P\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t{\"\", \"W\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t{\"W\", \"\", \"\", \"\", \"G\", \"\"},\n//\t\t\t\t{\"P\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t});\n\n\t\t/* Use custom method in Board class to print the board to the console and save it to a text file.\n\t\t * See the method comments in Board.java class for more details. */\n\t\tboard.printBoard();\n\n\t\t/* Initialize the cell in which the players will start the mission. */\n\t\tCell startRoom;\n\t\tCellAsPerceivedByAI startRoomAI;\n\t\tCell[] startRooms = this.setStartRoomAndBoardAI(this.options.toUpperCase().contains(\"00\"));\n\t\tstartRoom = startRooms[0];\n\t\tstartRoomAI = (CellAsPerceivedByAI)startRooms[1];\n\n\t\tthis.createPlayers(startRoom, startRoomAI, this.p1Name, this.p2Name,\n\t\t\t\tthis.options.toUpperCase().contains(\"A1\"), this.options.toUpperCase().contains(\"A2\"), this.options.toUpperCase().contains(\"S\"),\n\t\t\t\tthis.options.toUpperCase().contains(\"H\") ? \"H\" : this.options.toUpperCase().contains(\"R\") ? \"R\" : \"B\");\t//create players\n\n\t\tthis.hideAllPics();\n\t\tgreyOutCell(startRoomAI.getX(), startRoomAI.getY());\n\t\trepaint();\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 }", "private static void setUpInit(Map<GdlSentence, ExternalizedStateComponent> components,\n\t\t\tExternalizedStateConstant trueComponent, ExternalizedStateConstant falseComponent) {\n\t\tExternalizedStateProposition initProposition = new ExternalizedStateProposition(GdlPool.getProposition(INIT_CAPS));\n\t\tfor(Entry<GdlSentence, ExternalizedStateComponent> entry : components.entrySet()) {\n\t\t\t//Is this something that will be true?\n\t\t\tif(entry.getValue() == trueComponent) {\n\t\t\t\tif(entry.getKey().getName().equals(INIT)) {\n\t\t\t\t\t//Find the corresponding true sentence\n\t\t\t\t\tGdlSentence trueSentence = GdlPool.getRelation(TRUE, entry.getKey().getBody());\n\t\t\t\t\t//System.out.println(\"True sentence from init: \" + trueSentence);\n\t\t\t\t\tExternalizedStateComponent trueSentenceComponent = components.get(trueSentence);\n\t\t\t\t\tif(trueSentenceComponent.getInputs().isEmpty()) {\n\t\t\t\t\t\t//Case where there is no transition input\n\t\t\t\t\t\t//Add the transition input, connect to init, continue loop\n\n\t\t\t\t\t\t// @author c.sironi: Also set to TRUE that fact that the value of this transition\n\t\t\t\t\t\t// depends on the INIT proposition value.\n\t\t\t\t\t\tExternalizedStateTransition transition = new ExternalizedStateTransition(true);\n\t\t\t\t\t\t//init goes into transition\n\t\t\t\t\t\ttransition.addInput(initProposition);\n\t\t\t\t\t\tinitProposition.addOutput(transition);\n\t\t\t\t\t\t//transition goes into component\n\t\t\t\t\t\ttrueSentenceComponent.addInput(transition);\n\t\t\t\t\t\ttransition.addOutput(trueSentenceComponent);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//The transition already exists\n\t\t\t\t\t\tExternalizedStateComponent transition = trueSentenceComponent.getSingleInput();\n\n\t\t\t\t\t\t//We want to add init as a thing that precedes the transition\n\t\t\t\t\t\t//Disconnect existing input\n\t\t\t\t\t\tExternalizedStateComponent input = transition.getSingleInput();\n\t\t\t\t\t\t//input and init go into or, or goes into transition\n\t\t\t\t\t\tinput.removeOutput(transition);\n\t\t\t\t\t\ttransition.removeInput(input);\n\t\t\t\t\t\tList<ExternalizedStateComponent> orInputs = new ArrayList<ExternalizedStateComponent>(2);\n\t\t\t\t\t\torInputs.add(input);\n\t\t\t\t\t\torInputs.add(initProposition);\n\t\t\t\t\t\torify(orInputs, transition, falseComponent);\n\t\t\t\t\t\t// @author c.sironi: Also set to TRUE that fact that the value of this transition\n\t\t\t\t\t\t// depends on the INIT proposition value.\n\t\t\t\t\t\t((ExternalizedStateTransition) transition).setDependingOnInit(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void beginDeal()\n { \n for (int i = 0; i < DEAL; i++)\n {\n FirstPlayer.addCard(gameDeck.dealCard());\n SecondPlayer.addCard(gameDeck.dealCard());\n }\n \n }", "static void backtocheckpoint1_version2() {\n System.out.println(\"You arrived to the main entrance of challenge 1... Are you ready to restart this challenge?\");\n strings = responses.nextLine();\n if (strings.contains(\"n\")) {\n System.out.println(\"It's not an option\"); \n backtocheckpoint1_version2();\n }else if (strings.contains(\"y\")) { \n Door2challenge();\n }else {\n System.out.println(\"I don't understand...type it correctly\");\n backtocheckpoint1_version2();//in case the player types something else that the system can't read\n }\n \n \n \n }", "private void switches() {\n finland.setChecked(true);\n chosenArea = \"Finland\";\n wholeWorld.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n europe.setChecked(false);\n nordic.setChecked(false);\n finland.setChecked(false);\n chosenArea = \"Whole world\";\n }\n }\n });\n europe.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n wholeWorld.setChecked(false);\n nordic.setChecked(false);\n finland.setChecked(false);\n chosenArea = \"Europe\";\n\n }\n }\n });\n nordic.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n wholeWorld.setChecked(false);\n europe.setChecked(false);\n finland.setChecked(false);\n chosenArea = \"Nordic countries and Estonia\";\n }\n }\n });\n finland.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n wholeWorld.setChecked(false);\n europe.setChecked(false);\n nordic.setChecked(false);\n chosenArea = \"Finland\";\n }\n }\n });\n }", "public static void options(){\n //player 1 not enough cards\n if(hand1.isEmpty()){\n System.out.println();\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \" + hand2.cardsLeft()+\"\\n\");\n System.out.println(\"Not enough cards, Player 1 loses\");\n outcome = 2;\n outcomes();\n //player 2 not enough cards\n }else if(hand2.isEmpty()){\n System.out.println();\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \" + hand2.cardsLeft()+\"\\n\");\n System.out.println(\"Not enough cards, Player 2 loses\");\n outcome = 1;\n outcomes();\n //tie by both 0 cards\n }else if(hand1.isEmpty()&&hand2.isEmpty()){\n System.out.println();\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \" + hand2.cardsLeft()+\"\\n\");\n System.out.println(\"No winner\");\n outcome = 3;\n outcomes();\n }\n }", "public void onYesButtonClicked() {\n changeAfterClientPick();\n }", "public void tryDeal() {\n if(previousTie){\n previousTie = false;\n emptyHands();\n shuffle();\n }\n if (player.getBet() < 2) {\n errorFlag = true;\n userMessage = \"You must bet a minimum of $2\";\n return;\n } else if (player.getHand().size() > 0) {\n errorFlag = true;\n userMessage = \"You have already been dealt your initial hand\";\n return;\n } else {\n player.setHand(deal(player.getHand(), 2));\n if (player.getHand().get(0).getValue() == player.getHand().get(1).getValue()) {\n //User can split if they want to\n userMessage = \"Hit, Stand or Split\";\n splitDisabled = false;\n }else{\n userMessage = \"Hit or Stand\";\n }\n dealDisabled = true;\n againDisabled = true;\n doubleDisabled = false;\n standDisabled = false;\n hitDisabled = false;\n bettingDisabled = true;\n }\n }", "public void turnOn(){\n Logger.getGlobal().log(Level.INFO,\" Turning On..\");\n vendingMachine = new VendingMachine();\n inventoryPopulation();\n idle();\n }", "private ScanState switchState(ScanState desired,String forOperation) {\n return switchState(desired,allowedStates.get(forOperation));\n }", "public void activate(){\r\n\r\n\t}", "@Test\n public void CardRequirement2() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(1);\n\n LeaderCard l3 = new LeaderCard(4,\n new CardRequirements(Map.of(Color.YELLOW, new ReqValue(1, 2))),\n new Production(Resource.SHIELD));\n ArrayList<LeaderCard> cards = new ArrayList<>();\n cards.add(l1);\n cards.add(l3);\n p.associateLeaderCards(cards);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.GREEN, 0, null, null);\n DevelopmentCard card2 = new DevelopmentCard(2, Color.YELLOW, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n p.getDevelopmentSlot().addCard(card2, 1);\n c.emptyQueue();\n\n assertTrue(am.activateLeaderCard(p, message));\n\n assertTrue(l3.isEnabled());\n\n assertEquals(1, c.messages.stream().filter(x -> x.getMessageType() == MessageType.MSG_NOTIFICATION).count());\n assertEquals(1, c.messages.stream().filter(x -> x.getMessageType() == MessageType.MSG_UPD_Player).count());\n assertEquals(2, c.messages.size());\n }", "public void Protocol(Plane Board,ServerConnect server1,ServerConnect server2){\n\t\tDice dice = new Dice();\n\t\tJudge judge = new Judge();\n\t\tString action = null;\n\t\tint receive1, receive2;\n\t\tboolean WinOrNot=false;\n\t\tBoard.initial();\n\t\touter:\n\t\twhile(!WinOrNot){\n\t\t\t//send current state to client\n\t\t\tserver1.SendToSocket(\"current,\"+Integer.toString(Board.CurrentBoard()[0])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[1])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[2])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[3])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[4])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[5])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[6])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[7])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[8])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[9])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[10]));\n\t\t\tserver2.SendToSocket(\"current,\"+Integer.toString(Board.CurrentBoard()[0])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[1])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[2])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[3])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[4])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[5])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[6])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[7])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[8])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[9])+\",\"+\n\t\t\t\t\tInteger.toString(Board.CurrentBoard()[10]));\n\t\t\tinner:\n\t\t\twhile(true){\n\t\t\t\tString[] receive = null;\n\t\t\t\tString s = \"\";\n\t\t\t\ts = server1.ReceiveFromSocket();\n\t\t\t\treceive = null;\n\t\t\t\treceive = s.split(\",\");\n\t\t\t\taction = receive[0];\n\t\t\t\tif (action.trim().equals(\"roll\")){\t//\"roll\" received from client, generate four random numbers\n\t\t\t\t\tdice.Roll();\n\t\t\t\t\tServe4Game.roll1=dice.Dice1();\n\t\t\t\t\tServe4Game.roll2=dice.Dice2();\n\t\t\t\t\tServe4Game.roll3=dice.Dice3();\n\t\t\t\t\tServe4Game.roll4=dice.Dice4();\n\t\t\t\t\tserver1.SendToSocket(\"dice,\"+Serve4Game.roll1+\",\"+Serve4Game.roll2+\",\"+\n\t\t\t\t\t\tServe4Game.roll3+\",\"+Serve4Game.roll4);\n\t\t\t\t\tserver2.SendToSocket(\"dice,\"+Serve4Game.roll1+\",\"+Serve4Game.roll2+\",\"+\n\t\t\t\t\t\tServe4Game.roll3+\",\"+Serve4Game.roll4);\n\t\t\t\t\tint r1,r2,r3,r4,r5,r6;\n\t\t\t\t\tr1 = Serve4Game.roll1 + Serve4Game.roll2;\n\t\t\t\t\tr2 = Serve4Game.roll1 + Serve4Game.roll3;\n\t\t\t\t\tr3 = Serve4Game.roll1 + Serve4Game.roll4;\n\t\t\t\t\tr4 = Serve4Game.roll2 + Serve4Game.roll3;\n\t\t\t\t\tr5 = Serve4Game.roll2 + Serve4Game.roll4;\n\t\t\t\t\tr6 = Serve4Game.roll3 + Serve4Game.roll4;\n\t\t\t\t\t\n\t\t\t\t\t//judge whether the player craps out\n\t\t\t\t\tif(!judge.judger(r1, Board)&&!judge.judger(r2, Board)&&!judge.judger(r3, Board)\n\t\t\t\t\t\t&&!judge.judger(r4, Board)&&!judge.judger(r5, Board)&&!judge.judger(r6, Board))\n\t\t\t\t\t{\n\t\t\t\t\t\tBoard.initial();\n\t\t\t\t\t\tserver1.SendToSocket(\"crap,\"+Integer.toString(Board.CurrentBoard()[0])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[1])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[2])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[3])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[4])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[5])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[6])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[7])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[8])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[9])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[10]));\n\t\t\t\t\t\tserver2.SendToSocket(\"crap,\"+Integer.toString(Board.CurrentBoard()[0])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[1])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[2])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[3])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[4])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[5])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[6])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[7])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[8])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[9])+\",\"+\n\t\t\t\t\t\t\tInteger.toString(Board.CurrentBoard()[10]));\n\t\t\t\t\t\tServe4Game.act1 = !Serve4Game.act1 ;\n\t\t\t\t\t\tServe4Game.act2 = !Serve4Game.act2 ;\n\t\t\t\t\t\tbreak outer;\t\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcontinue inner;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//judge whether the numbers client chose can make a move\n\t\t\t\telse if (action.trim().equals(\"number\")){\n\t\t\t\t\treceive1 = Integer.parseInt(receive[1]);\n\t\t\t\t\treceive2 = Integer.parseInt(receive[2]);\n\t\t\t\t\tjudge.err = judge.judge(receive1, receive2, Board);\n\t\t\t\t\tif (judge.err == 1||judge.err==2||judge.err ==3){\n\t\t\t\t\t\tserver1.SendToSocket(\"err,\");\n\t\t\t\t\t\tserver2.SendToSocket(\"err,\");\n\t\t\t\t\t\tcontinue inner;\n\t\t\t\t\t}\n\t\t\t\t\telse if(judge.bool1&&judge.bool2){\n\t\t\t\t\t\tBoard.ChangeCurrent(judge.num1);\n\t\t\t\t\t\tif(judge.num2 !=0){\n\t\t\t\t\t\t\tjudge.bool2 = judge.judger(judge.num2,Board);\n\t\t\t\t\t\t\tif(judge.bool2 && judge.num2 != 0)\n\t\t\t\t\t\t\t\tBoard.ChangeCurrent(judge.num2);\n\t\t\t\t\t\t\telse if(!judge.bool2)\n\t\t\t\t\t\t\t\tjudge.num2 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tserver1.SendToSocket(\"ack,\"+judge.num1+\",\"+judge.num2);\n\t\t\t\t\t\tserver2.SendToSocket(\"ack,\"+judge.num1+\",\"+judge.num2);\n\t\t\t\t\t\tcontinue inner;\n\t\t\t\t\t}\n\t\t\t\t\telse if((judge.bool1)&&(!judge.bool2)){\n\t\t\t\t\t\tBoard.ChangeCurrent(judge.num1);\n\t\t\t\t\t\tserver1.SendToSocket(\"ack,\"+judge.num1+\",\"+0);\n\t\t\t\t\t\tserver2.SendToSocket(\"ack,\"+judge.num1+\",\"+0);\n\t\t\t\t\t\tcontinue inner;\n\t\t\t\t\t}\n\t\t\t\t\telse if((!judge.bool1)&&(judge.bool2)&&judge.num2!=0){\n\t\t\t\t\t\tBoard.ChangeCurrent(judge.num2);\n\t\t\t\t\t\tjudge.num1 = 0;\n\t\t\t\t\t\tserver1.SendToSocket(\"ack,\"+judge.num1+\",\"+judge.num2);\n\t\t\t\t\t\tserver2.SendToSocket(\"ack,\"+judge.num1+\",\"+judge.num2);\n\t\t\t\t\t\tcontinue inner;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (action.trim().equals(\"stop\")){\t//\"stop\" received from client, change current state\n\t\t\t\t\tserver1.SendToSocket(\"stop\");\n\t\t\t\t\tserver2.SendToSocket(\"stop\");\n\t\t\t\t\tBoard.ChangePrevious();\n\t\t\t\t\tWinOrNot =Board.WinerOrNot();\t//judge whether the player win the game\n\t\t\t\t\tBoard.initial();\n\t\t\t\t\tServe4Game.act1 = !Serve4Game.act1 ;\n\t\t\t\t\tServe4Game.act2 = !Serve4Game.act2 ;\n\t\t\t\t\tif (WinOrNot){\n\t\t\t\t\t\tserver1.SendToSocket(\"win\");\n\t\t\t\t\t\tserver2.SendToSocket(\"win\");\n\t\t\t\t\t\tbreak outer;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tserver1.SendToSocket(\"ACK\");\n\t\t\t\t\t\tserver2.SendToSocket(\"ACK\");\n\t\t\t\t\t}\n\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tjudge.err = 0;\n\t\treturn;\n\t}", "public void actionPerformed(ActionEvent ae)\n{\n String str = ae.getActionCommand();\n if(str.equals(\"Deal\"))\n {\n\t\t//dealCards();\n\t\tcontrolP.deal.setEnabled(false);\n\t\t//Set rest of buttons active\n\t\tcontrolP.check.setEnabled(true);\n\t\tcontrolP.bet.setEnabled(true);\n\t\tcontrolP.call.setEnabled(false);\n\t\tcontrolP.raise.setEnabled(false);\n\t\tcontrolP.allIn.setEnabled(true);\n\t\tcontrolP.fold.setEnabled(true);\n\n\t\tmain.initGame();\n\n\n\n\t}\n\telse\n\tif(str.equals(\"Bet\"))\n\t{\n\t\tmain.playerBet();\n\t\tmain.userBet = true;\n\t\tmain.userAction = true;\n\t\t//controlP.bet.setEnabled(false);\n\t}\n\telse\n\tif(str.equals(\"Check\"))\n\t{\n\t\tmain.playerCheck();\n\t\tmain.userCheck = true;\n\t\tmain.userAction = true;\n\t\t//controlP.check.setEnabled(false);\n\t}\n\telse\n\tif(str.equals(\"Call\"))\n\t{\n\t\tmain.playerCall();\n\t\tmain.userAction = true;\n\t\tmain.userCall = true;\n\t\t//controlP.call.setEnabled(false);\n\t}\n\telse\n\tif(str.equals(\"Raise\"))\n\t{\n\t\tmain.playerRaise();\n\t\tmain.userAction = true;\n\t\tmain.userRaise = true;\n\t\t//controlP.raise.setEnabled(false);\n\t}\n\telse\n\tif(str.equals(\"All In\"))\n\t{\n\t\tmain.playerAllIn();\n\t\tcontrolP.deal.setEnabled(true);\n\t\tcontrolP.check.setEnabled(false);\n\t\tcontrolP.bet.setEnabled(false);\n\t\tcontrolP.call.setEnabled(false);\n\t\tcontrolP.raise.setEnabled(false);\n\t\tcontrolP.allIn.setEnabled(false);\n\t\tcontrolP.fold.setEnabled(false);\n\t\tmain.userAction = true;\n\t\tmain.userAllIn = true;\n\t\t//controlP.allIn.setEnabled(false);\n\t}\n\telse\n\tif(str.equals(\"Fold\"))\n\t{\n\t\tmain.playerFold();\n\t\tmain.userFold = true;\n\t\tcontrolP.deal.setEnabled(true);\n\t\tcontrolP.check.setEnabled(false);\n\t\tcontrolP.bet.setEnabled(false);\n\t\tcontrolP.call.setEnabled(false);\n\t\tcontrolP.raise.setEnabled(false);\n\t\tcontrolP.allIn.setEnabled(false);\n\t\tcontrolP.fold.setEnabled(false);\n\t}\n\telse\n\tif(str.equals(\"Exit\"))\n\t{\n\t\t//Exit the System\n\t\tint answer = JOptionPane.showConfirmDialog(null, \"Do you really want to exit?\", \"Exit PokerShark\", JOptionPane.YES_NO_OPTION);\n\t\tif(answer == 0)\n\t\t{\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t}\n\n}", "private void charonSwitch() {\n resetUpdate();\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.setCharonSwitching(true);\n gameMessage.notify(gameMessage);\n }", "public static void stageTwo() {\n status.recount();\n if (play) {\n coar_maze1.ending1();\n }\n while (status.getCounter() < 6 && play) {\n coar_maze1.direction();\n if (coar_maze1.china) {\n china_maze.china_orbs();\n china_maze.china_enemies();\n } else if (coar_maze1.amazon_forest) {\n amazon_jungle.amazon_river_orbs();\n amazon_jungle.amazon_river_enemies();\n }\n status.addCounter();\n quit();\n }\n status.recount();\n }", "public void round(){\n if (player2.getName().equals(\"Computer\")) {\n battle(JOptionPane.showInputDialog(\"Player 1 enter: paper; rock; or scissors\"),\n new Computer().choice());\n } else {\n battle(JOptionPane.showInputDialog(\"Player 1 enter: paper; rock; or scissors\"),\n JOptionPane.showInputDialog(\"Player 2 enter: paper; rock; or scissors\"));\n }\n }", "public void secondLeftNeighborGivesChipToCurrent() {\n\t\tif(players.indexOf(current)<2) {\n\t\t\tcurrent.addChip(players.get(players.size()-players.indexOf(current)-1).removeChip());\n\t\t}\n\t\telse {\n\t\t\tcurrent.addChip(players.get(players.indexOf(current)-2).removeChip());\n\t\t}\n\t}", "static void Door2challenge() {\n System.out.println(\"Ready! 3...2...1...GO!\");\n System.out.println(\"Where do you want to go? Left, Right, or Straight\");\n direction = next.nextLine();\n //this is where the player will decide where to go\n //the rest of the maze will branch off from this decision. These choices will have the same outcome.\n \n if(direction.contains(\"left\")) {\n door2challenge_leftpath();\n //player enters the left branch maze\n \n }else if(direction.contains(\"right\")){\n door2challenge_rightpath();\n //player enters the right branch of the maze\n \n }else if(direction.contains(\"straight\")){\n door2challenge_straightpath();\n //player enters the straight branch of the maze\n }else{\n System.out.println(\"I don't understand...type it correctly!!!\");\n Door2challenge();\n }\n \n }", "public void tryLogin() {\n\t\tcontroller.setupClient(txtNickname.getText());\n\t\tString cardDesign = comboBoxCardDesign.getSelectionModel()\n\t\t\t\t.getSelectedItem();\n\t\tConfiguration.chooseCardDesign(cardDesign);\n\t\tConfiguration.chooseMeepleDesign(cardDesign);\n\t}", "private void checkAndActivateCPU() {\n statusController.checkIfCPU();\n if (modelCheck.isCurrentPlayerCPU()) {\n CPU.actionSequence();\n }\n }", "public void selectDualExciters(){\r\n if(checkDualExciters())\r\n System.out.println(\"Dual Exciters Checked\");\r\n else\r\n System.out.println(\"Dual Exciters Unchecked\");\r\n }", "public static void Turno(){\n\t\tif (pl1){\n\t\t\tpl1=false;\n\t\t\tpl2=true;\t\n\t\t\tvalore = 1;\n\t\t}\n\t\telse{\n\t\t\tpl1=true;\n\t\t\tpl2=false;\n\t\t\tvalore = 2;\n\t\t}\n\t}", "public void turnoSistema(){\r\n if(tipo_simulacion == 2){\r\n JOptionPane.showMessageDialog(this.vc,\"Simulando acciones. . .\", \"Turno Sistema\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n System.out.println(\"Turno: \"+ entrenador2.getNombre());\r\n if(evaluarAccion(this.pokemon_activo2, this.pokemon_activo1).equals(\"Cambiar\")){\r\n System.out.println(\"Sistema eligio Cambiar Pokemon\");\r\n pokemon_activo2.setConfuso(false);\r\n pokemon_activo2.setDormido(false);\r\n if(getEquipo2()[0].getDebilitado() == false && getEquipo2()[0]!=pokemon_activo2){\r\n pokemon_activo2 = getEquipo2()[0]; \r\n }\r\n else if(getEquipo2()[1].getDebilitado() == false && getEquipo2()[1]!=pokemon_activo2){\r\n pokemon_activo2 = getEquipo2()[1]; \r\n }\r\n else if(getEquipo2()[2].getDebilitado() == false && getEquipo2()[2]!=pokemon_activo2){\r\n pokemon_activo2 = getEquipo2()[2]; \r\n }\r\n else if(getEquipo2()[3].getDebilitado() == false && getEquipo2()[3]!=pokemon_activo2){\r\n pokemon_activo2 = getEquipo2()[3]; \r\n }\r\n else if(getEquipo2()[4].getDebilitado() == false && getEquipo2()[4]!=pokemon_activo2){\r\n pokemon_activo2 = getEquipo2()[4]; \r\n }\r\n else if(getEquipo2()[5].getDebilitado() == false && getEquipo2()[5]!=pokemon_activo2){\r\n pokemon_activo2 = getEquipo2()[5]; \r\n }\r\n vc.setjL_especie2(pokemon_activo2.getNombre_especie());\r\n vc.setjL_nombrepokemon2(pokemon_activo2.getPseudonimo());\r\n vc.setjL_vida_actual2(pokemon_activo2.getVida_restante(), pokemon_activo2.getVida());\r\n vc.setjL_Nivel2(pokemon_activo2.getNivel());\r\n setLabelEstados(0);\r\n setLabelEstados(1);\r\n this.turno = 0;\r\n if(tipo_simulacion == 2){\r\n JOptionPane.showMessageDialog(this.vc, \"Turno\"+\" \"+entrenador1.getNombre(), \"Tu Turno\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n }\r\n else if(evaluarAccion(this.pokemon_activo2, this.pokemon_activo1).equals(\"Atacar\")){\r\n System.out.println(\"Sistema eligio Atacar\");\r\n inflingirDaño(pokemon_activo2.getMovimientos()[(int)(Math.random()*4)], pokemon_activo1, pokemon_activo2);\r\n if(pokemon_activo1.getVida_restante() <= 0){\r\n pokemon_activo1.setVida_restante(0);\r\n pokemon_activo1.setDebilitado(true);\r\n System.out.println(\"El Pokemon: \"+ pokemon_activo1.getPseudonimo()+\" se ha Debilitado\");\r\n JOptionPane.showMessageDialog(this.vc, \"El Pokemon: \"+ pokemon_activo1.getPseudonimo()+\" se ha Debilitado\", \"Debilitado\", JOptionPane.INFORMATION_MESSAGE);\r\n if(condicionVictoria(getEquipo1(), getEquipo2()) == true){\r\n JOptionPane.showMessageDialog(this.vc, \"El Ganador de este Combate es:\"+ entrenador2.getNombre(), \"Ganador\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"El Ganador de este Combate es:\"+ entrenador2.getNombre());\r\n System.out.println(equipo1[0].getVida_restante()+ \" \"+equipo1[1].getVida_restante()+ \" \"+equipo1[2].getVida_restante()+ \" \"+equipo1[3].getVida_restante()+ \" \"+equipo1[4].getVida_restante()+ \" \"+equipo1[5].getVida_restante());\r\n System.out.println(equipo2[0].getVida_restante()+ \" \"+equipo2[1].getVida_restante()+ \" \"+equipo2[2].getVida_restante()+ \" \"+equipo2[3].getVida_restante()+ \" \"+equipo2[4].getVida_restante()+ \" \"+equipo2[5].getVida_restante());\r\n JOptionPane.showMessageDialog(this.vc, equipo1[0].getVida_restante()+ \" \"+equipo1[1].getVida_restante()+ \" \"+equipo1[2].getVida_restante()+ \" \"+equipo1[3].getVida_restante()+ \" \"+equipo1[4].getVida_restante()+ \" \"+equipo1[5].getVida_restante()+\"\\n\"+ equipo2[0].getVida_restante()+ \" \"+equipo2[1].getVida_restante()+ \" \"+equipo2[2].getVida_restante()+ \" \"+equipo2[3].getVida_restante()+ \" \"+equipo2[4].getVida_restante()+ \" \"+equipo2[5].getVida_restante(), \"Estadisticas finales(vida)\", JOptionPane.INFORMATION_MESSAGE);\r\n vc.dispose();\r\n vpc.dispose();\r\n combate.setGanador(entrenador2);\r\n combate.setPerdedor(entrenador1);\r\n this.termino = true;\r\n }\r\n else if(getEquipo1()[0].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[0]; \r\n }\r\n else if(getEquipo1()[1].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[1]; \r\n }\r\n else if(getEquipo1()[2].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[2]; \r\n }\r\n else if(getEquipo1()[3].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[3]; \r\n }\r\n else if(getEquipo1()[4].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[4]; \r\n }\r\n else if(getEquipo1()[5].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[5]; \r\n } \r\n vc.setjL_nombrepokemon1(pokemon_activo1.getPseudonimo());\r\n vc.setjL_especie1(pokemon_activo1.getNombre_especie());\r\n }\r\n vc.setjL_especie1(pokemon_activo1.getNombre_especie());\r\n vc.setjL_nombrepokemon1(pokemon_activo1.getPseudonimo());\r\n vc.setjL_vida_actual1(pokemon_activo1.getVida_restante(), pokemon_activo1.getVida());\r\n vc.setjL_Nivel1(pokemon_activo1.getNivel());\r\n setLabelEstados(0);\r\n setLabelEstados(1);\r\n this.turno = 0;\r\n if(tipo_simulacion == 2){\r\n JOptionPane.showMessageDialog(this.vc, \"Turno\"+\" \"+entrenador1.getNombre(), \"Tu Turno\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n }\r\n \r\n }", "private void changeActionPerformed(final java.awt.event.ActionEvent evt) {\n\t\t\tpainting = paintChecked;\n\t\t\tif (!paintChecked) {\n\t\t\t\tBot.getEventManager().removeListener(PaintListener.class, s);\n\t\t\t}\n\t\t\tif (timeChecked) {\n\t\t\t\tint h = 0, m = 0;\n\t\t\t\tstopping = false;\n\t\t\t\ttry {\n\t\t\t\t\th = Integer.parseInt(hours.getText());\n\t\t\t\t\tm = Integer.parseInt(minutes.getText());\n\t\t\t\t} finally {\n\t\t\t\t\ttimeToStop = System.currentTimeMillis() + m * 60000 + h\n\t\t\t\t\t\t\t* 60000 * 60;\n\t\t\t\t\tstopping = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstopping = false;\n\t\t\t}\n\t\t\tfinal String areaName = (String) location.getItemAt(location\n\t\t\t\t\t.getSelectedIndex());\n\t\t\tlog(\"Changing to area: \" + areaName);\n\t\t\tfoodName = ((String) food.getItemAt(food.getSelectedIndex()))\n\t\t\t\t\t.toLowerCase();\n\t\t\tlog(\"Now cooking: \" + foodName);\n\t\t\tif (areaName.equals(\"Varrock West Bank - North Side\")) {\n\t\t\t\tchosenArea = varrockwestnorth;\n\t\t\t} else if (areaName.equals(\"Varrock West Bank - South Side\")) {\n\t\t\t\tchosenArea = varrockwestsouth;\n\t\t\t} else if (areaName.equals(\"Varrock East Bank\")) {\n\t\t\t\tchosenArea = varrockeast;\n\t\t\t} else if (areaName.equals(\"Al Kharid Bank\")) {\n\t\t\t\tchosenArea = alkharid;\n\t\t\t} else if (areaName.equals(\"Draynor Village Bank\")) {\n\t\t\t\tchosenArea = draynor;\n\t\t\t} else if (areaName.equals(\"Falador East Bank\")) {\n\t\t\t\tchosenArea = faladoreast;\n\t\t\t} else if (areaName.equals(\"Falador West Bank\")) {\n\t\t\t\tchosenArea = faladorwest;\n\t\t\t} else if (areaName.equals(\"Grand Exchange - East Side\")) {\n\t\t\t\tchosenArea = geeast;\n\t\t\t} else if (areaName.equals(\"Grand Exchange - West Side\")) {\n\t\t\t\tchosenArea = gewest;\n\t\t\t} else if (areaName.equals(\"Edgeville Bank - West Side\")) {\n\t\t\t\tchosenArea = edgevillewest;\n\t\t\t} else if (areaName.equals(\"Edgeville Bank - East Side\")) {\n\t\t\t\tchosenArea = edgevilleeast;\n\t\t\t} else if (areaName.equals(\"Edgeville Bank - North Side\")) {\n\t\t\t\tchosenArea = edgevillenorth;\n\t\t\t} else if (areaName.equals(\"*Fishing Guild\")) {\n\t\t\t\tchosenArea = fishingguild;\n\t\t\t} else if (areaName.equals(\"Duel Arena\")) {\n\t\t\t\tchosenArea = duelarena;\n\t\t\t} else if (areaName.equals(\"Bounty Hunter\")) {\n\t\t\t\tchosenArea = bountyhunter;\n\t\t\t} else if (areaName.equals(\"*Ardougne South Bank\")) {\n\t\t\t\tchosenArea = ardougnesouth;\n\t\t\t} else if (areaName.equals(\"*Ardougne North Bank\")) {\n\t\t\t\tchosenArea = ardougnenorth;\n\t\t\t} else if (areaName.equals(\"*Lletya Bank\")) {\n\t\t\t\tchosenArea = lletya;\n\t\t\t} else if (areaName.equals(\"*Yanille Bank\")) {\n\t\t\t\tchosenArea = yanille;\n\t\t\t} else if (areaName.equals(\"*Seer's Village Bank\")) {\n\t\t\t\tchosenArea = seersvillage;\n\t\t\t} else if (areaName.equals(\"Fist of Guthix\")) {\n\t\t\t\tchosenArea = fistofguthix;\n\t\t\t} else if (areaName.equals(\"*Catherby\")) {\n\t\t\t\tchosenArea = catherby;\n\t\t\t} else if (areaName.equals(\"*Shilo Village\")) {\n\t\t\t\tchosenArea = shilovillage;\n\t\t\t} else if (areaName.equals(\"*TzHaar\")) {\n\t\t\t\tchosenArea = tzhaar;\n\t\t\t} else if (areaName.equals(\"*Jatizso\")) {\n\t\t\t\tchosenArea = jatizso;\n\t\t\t} else if (areaName.equals(\"*Neitiznot\")) {\n\t\t\t\tchosenArea = neitiznot;\n\t\t\t} else if (areaName.equals(\"*Miscellania\")) {\n\t\t\t\tchosenArea = miscellania;\n\t\t\t} else if (areaName.equals(\"*Lunar Isle\")) {\n\t\t\t\tchosenArea = lunarisle;\n\t\t\t} else if (areaName.equals(\"*Lumbridge Basement\")) {\n\t\t\t\tchosenArea = lumbridgebasement;\n\t\t\t} else if (areaName.equals(\"*Canifis\")) {\n\t\t\t\tchosenArea = canifis;\n\t\t\t} else if (areaName.equals(\"*Port Phasmatys (Reqs Ammy!)\")) {\n\t\t\t\tchosenArea = portphasmatys;\n\t\t\t} else if (areaName.equals(\"*Castle Wars\")) {\n\t\t\t\tchosenArea = castlewars;\n\t\t\t} else if (areaName.equals(\"*Pest Control\")) {\n\t\t\t\tchosenArea = pestcontrol;\n\t\t\t} else if (areaName.equals(\"*Oo'glog\")) {\n\t\t\t\tchosenArea = ooglog;\n\t\t\t} else if (areaName.equals(\"Mos Le'Harmless\")) {\n\t\t\t\tchosenArea = mosleharmless;\n\t\t\t} else if (areaName.equals(\"*Nardah\")) {\n\t\t\t\tchosenArea = nardah;\n\t\t\t} else if (areaName.equals(\"*Zanaris\")) {\n\t\t\t\tchosenArea = zanaris;\n\t\t\t} else if (areaName.equals(\"*Dorgesh-Kaan (Goblin City)\")) {\n\t\t\t\tchosenArea = dorgeshkaan;\n\t\t\t} else if (areaName.equals(\"*Keldagrim\")) {\n\t\t\t\tchosenArea = keldagrim;\n\t\t\t} else if (areaName.equals(\"*Rogues Den\")) {\n\t\t\t\tchosenArea = roguesden;\n\t\t\t}\n\n\t\t\t// Foods\n\t\t\tif (foodName.equals(\"anchovies\")) {\n\t\t\t\tfoodID = 321;\n\t\t\t} else if (foodName.equals(\"bass\")) {\n\t\t\t\tfoodID = 363;\n\t\t\t} else if (foodName.equals(\"bear meat\")) {\n\t\t\t\tfoodID = 2136;\n\t\t\t} else if (foodName.equals(\"beef\")) {\n\t\t\t\tfoodID = 2132;\n\t\t\t} else if (foodName.equals(\"cave eel\")) {\n\t\t\t\tfoodID = 5001;\n\t\t\t} else if (foodName.equals(\"chicken\")) {\n\t\t\t\tfoodID = 2138;\n\t\t\t} else if (foodName.equals(\"cod\")) {\n\t\t\t\tfoodID = 341;\n\t\t\t} else if (foodName.equals(\"crayfish\")) {\n\t\t\t\tfoodID = 13435;\n\t\t\t} else if (foodName.equals(\"herring\")) {\n\t\t\t\tfoodID = 345;\n\t\t\t} else if (foodName.equals(\"lobster\")) {\n\t\t\t\tfoodID = 377;\n\t\t\t} else if (foodName.equals(\"mackerel\")) {\n\t\t\t\tfoodID = 353;\n\t\t\t} else if (foodName.equals(\"manta ray\")) {\n\t\t\t\tfoodID = 389;\n\t\t\t} else if (foodName.equals(\"monkfish\")) {\n\t\t\t\tfoodID = 7944;\n\t\t\t} else if (foodName.equals(\"pawya meat\")) {\n\t\t\t\tfoodID = 12535;\n\t\t\t} else if (foodName.equals(\"pike\")) {\n\t\t\t\tfoodID = 349;\n\t\t\t} else if (foodName.equals(\"rabbit\")) {\n\t\t\t\tfoodID = 3226;\n\t\t\t} else if (foodName.equals(\"rainbow fish\")) {\n\t\t\t\tfoodID = 10138;\n\t\t\t} else if (foodName.equals(\"rat meat\")) {\n\t\t\t\tfoodID = 2134;\n\t\t\t} else if (foodName.equals(\"salmon\")) {\n\t\t\t\tfoodID = 331;\n\t\t\t} else if (foodName.equals(\"sardine\")) {\n\t\t\t\tfoodID = 327;\n\t\t\t} else if (foodName.equals(\"sea turtle\")) {\n\t\t\t\tfoodID = 395;\n\t\t\t} else if (foodName.equals(\"shark\")) {\n\t\t\t\tfoodID = 383;\n\t\t\t} else if (foodName.equals(\"shrimps\")) {\n\t\t\t\tfoodID = 317;\n\t\t\t} else if (foodName.equals(\"swordfish\")) {\n\t\t\t\tfoodID = 371;\n\t\t\t} else if (foodName.equals(\"trout\")) {\n\t\t\t\tfoodID = 335;\n\t\t\t} else if (foodName.equals(\"tuna\")) {\n\t\t\t\tfoodID = 359;\n\t\t\t} else if (foodName.equals(\"ugthanki meat\")) {\n\t\t\t\tfoodID = 1859;\n\t\t\t} else if (foodName.equals(\"yak meat\")) {\n\t\t\t\tfoodID = 10816;\n\t\t\t}\n\t\t\tsavedItems[savedItems.length - 1] = foodID;\n\t\t\tPrintWriter out = null;\n\t\t\ttry {\n\t\t\t\tout = new PrintWriter(new FileWriter(\"MHTYChefConfig.txt\"));\n\t\t\t\tfinal String[] settings = { \"\" + (paintChecked ? 1 : 0),\n\t\t\t\t\t\t\"\" + (timeChecked ? 1 : 0), hours.getText(),\n\t\t\t\t\t\tminutes.getText(), food.getSelectedIndex() + \"\",\n\t\t\t\t\t\tlocation.getSelectedIndex() + \"\" };\n\t\t\t\tfor (final String line : settings) {\n\t\t\t\t\tout.println(line);\n\t\t\t\t}\n\t\t\t\tout.close();\n\t\t\t\tlog(\"Configuration saved to MHTYChefConfig.txt!\");\n\t\t\t} catch (final IOException e) {\n\t\t\t\tlog(\"Saving configuration failed!\");\n\t\t\t}\n\t\t}", "public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}", "public static void main(String[] args) {\n\t\tboolean gotLockCode=false;\n\t\tint guessTime=0;\n\t\tComboLock lock1=new ComboLock();\n\t\tComboLock lock2;\n\t\tScanner userInput=new Scanner (System.in);\n\t\t//setting combo lock\n\t\tSystem.out.println(\"Do you want to set the lock to a new number? Type 1 to change.\");\n\t\tif (userInput.nextInt()==1)\n\t\t{\n\t\t\tSystem.out.println(\"Type the number for the new first number\");\n\t\t\tlock1.setNumb1(userInput.nextInt());\n\t\t\tSystem.out.println(\"Type the number for the new second number\");\n\t\t\tlock1.setNumb2(userInput.nextInt());\n\t\t\tSystem.out.println(\"Type the number for the new third number\");\n\t\t\tlock1.setNumb3(userInput.nextInt());\n\t\t}//end if\n\t\tSystem.out.println(\"Enter the 3 numbers to unlock the code\");\n\t\t//check for number 1\n\t\tSystem.out.println(\"Enter the first number:\");\n\t\tif(userInput.nextInt()==lock1.getNumb1())\n\t\t{\n\t\t\tgotLockCode=true;\n\t\t}//end if\n\t\t//check number 2\n\t\tSystem.out.println(\"Enter the second number:\");\n\t\tif(userInput.nextInt()==lock1.getNumb2())\n\t\t{\n\t\t\tgotLockCode=true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgotLockCode=false;\n\t\t}//end if\n\t\t//check number 3\n\t\tSystem.out.println(\"Enter the third number:\");\n\t\tif(userInput.nextInt()==lock1.getNumb3())\n\t\t{\n\t\t\tgotLockCode=true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgotLockCode=false;\n\t\t}//end if\n\t\t//checks if you got it right.\n\t\tif (gotLockCode==false)\n\t\t{\n\t\t\tSystem.out.println(\"You got the wrong code.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"*Click* The lock unlocked\");\n\t\t}//end if\n\t\tSystem.out.println(\"Creating a random Lock...\");\n\t\tlock2 = new ComboLock();\n\t\t//randomize the lock\n\t\tlock2.randomizeLock();\n\t\tgotLockCode=false;\n\t\twhile (gotLockCode==false)\n\t\t{\n\t\t\tSystem.out.println(\"Enter the 3 numbers to unlock the code\");\n\t\t\t//check for number 1\n\t\t\tSystem.out.println(\"Enter the first number:\");\n\t\t\tif(userInput.nextInt()==lock2.getNumb1())\n\t\t\t{\n\t\t\t\tgotLockCode=true;\n\t\t\t}//end if\n\t\t\t//check number 2\n\t\t\tSystem.out.println(\"Enter the second number:\");\n\t\t\tif(userInput.nextInt()==lock2.getNumb2())\n\t\t\t{\n\t\t\t\tgotLockCode=true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgotLockCode=false;\n\t\t\t}//end if\n\t\t\t//check number 3\n\t\t\tSystem.out.println(\"Enter the third number:\");\n\t\t\tif(userInput.nextInt()==lock2.getNumb3())\n\t\t\t{\n\t\t\t\tgotLockCode=true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgotLockCode=false;\n\t\t\t}//end if\n\t\t\t//checks if you got it right.\n\t\t\tif (gotLockCode==false)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You got the wrong code.\");\n\t\t\t\tguessTime++;\n\t\t\t\tif (guessTime>=2)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Your out of trys\");\n\t\t\t\t\t//prints out the correct answer\n\t\t\t\t\tSystem.out.println(\"The correct code is: \"+lock2.getNumb1()+\" \"+lock2.getNumb2()+\" \"+lock2.getNumb3());\n\t\t\t\t\tbreak;\n\t\t\t\t}//end if\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"*Click* The lock unlocked\");\n\t\t\t\tgotLockCode=true;\n\t\t\t}//end if\n\t\t}//end unlocking code\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==btnDeposit) {//change pin\r\n//\t\t\tSystem.out.println(Integer.valueOf(passwordField_1.getText()));\r\n//\t\t\tSystem.out.println(Integer.valueOf(passwordField_2.getText()));\r\n//\t\t\tSystem.out.println(Integer.valueOf(passwordField_1.getText())-Integer.valueOf(passwordField_2.getText())==0 );\r\n\t\t\tif((passwordField_2.getText()!=\"\" && Integer.valueOf(passwordField_1.getText())-Integer.valueOf(passwordField_2.getText())!=0 ) || Integer.valueOf(passwordField.getText())!=c.getPin())\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Kindly recheck your Pin!\");\r\n\t\t\telse{\r\n\t\t\t\tdispose();\r\n\t\t\tc.setPin(Integer.valueOf(passwordField_1.getText()));\r\n\t\t\tif(BankContoller.pinChange(c))JOptionPane.showMessageDialog(null, \"Your Password has been changed Successfully, \"+c.getName());\r\n\t\t\tnew Bank_ThankYou();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(e.getSource()==btnLogin) {//cancel\r\n\t\t\tdispose();\r\n\t\t}\r\n\t}", "protected boolean pickAndExecuteAnAction() {\n\t//print(\"in waiter scheduler\");\n\t//Starts the break cycle if onBreak == true\n\tif(onBreak && working ) {\n\t initiateBreak();\n\t return true;\n\t}\n\n\t//Once all the customers have been served\n\t//then the waiter can actually go on break\n\tif(!working && customers.isEmpty() && !startedBreak) {\n\t goOnBreak();\n\t return true;\n\t}\n\n\tif(!onBreak && !working){\n\t endBreak();\n\t}\n\n\t\n\t//Runs through the customers for each rule, so \n\t//the waiter doesn't serve only one customer at a time\n\tif(!customers.isEmpty()){\n\t //System.out.println(\"in scheduler, customers not empty:\");\n\t //Gives food to customer if the order is ready\n\t for(MyCustomer c:customers){\n\t\tif(c.state == CustomerState.ORDER_READY) {\n\t\t giveFoodToCustomer(c);\n\t\t return true;\n\t\t}\n\t }\n\t //Clears the table if the customer has left\n\t for(MyCustomer c:customers){\n\t\tif(c.state == CustomerState.IS_DONE) {\n\t\t clearTable(c);\n\t\t return true;\n\t\t}\n\t }\n\n\t //Seats the customer if they need it\n\t for(MyCustomer c:customers){\n\t\tif(c.state == CustomerState.NEED_SEATED){\n\t\t seatCustomer(c);\n\t\t return true;\n\t\t}\n\t }\n\n\t //Gives all pending orders to the cook\n\t for(MyCustomer c:customers){\n\t\tif(c.state == CustomerState.ORDER_PENDING){\n\t\t giveOrderToCook(c);\n\t\t return true;\n\t\t}\n\t }\n\n\t //Takes new orders for customers that are ready\n\t for(MyCustomer c:customers){\n\t\t//print(\"testing for ready to order\"+c.state);\n\t\tif(c.state == CustomerState.READY_TO_ORDER) {\n\t\t takeOrder(c);\n\t\t return true;\n\t\t}\n\t }\t \n\t}\n\tif (!currentPosition.equals(originalPosition)) {\n\t moveToOriginalPosition();\n\t return true;\n\t}\n\n\t//we have tried all our rules and found nothing to do. \n\t// So return false to main loop of abstract agent and wait.\n\t//print(\"in scheduler, no rules matched:\");\n\treturn false;\n }", "private void switchDeck() {\n\t\tif (!isInMainDeck()) {\n\t\t\tactiveDeck = MAIN_DECK;\n\t\t\tsetCurrentDeck(mainDeck, charDeck);\n\t\t} else {\n\t\t\tactiveDeck = CHARACTER_DECK;\n\t\t\tsetCurrentDeck(charDeck, mainDeck);\n\t\t}\n\t\tcurrentDeck.updateHandpos(-1);\n\t}", "protected void setReproduction(Plateau.Cases case1, Plateau.Cases case2)\n\t\tthrows ActionFailureException {\n\n\t\tsetDirectionReproduction(case1, case2);\n neFaitRien(case1);\n\t\tneFaitRien(case2);\n\t}" ]
[ "0.5913025", "0.5809006", "0.5705216", "0.5692205", "0.5651889", "0.56140506", "0.5602921", "0.55978096", "0.5588105", "0.5569946", "0.55569637", "0.5535411", "0.55023795", "0.54634964", "0.54365104", "0.54294616", "0.54247445", "0.5401437", "0.539032", "0.5385171", "0.5380197", "0.5375651", "0.53735816", "0.5363294", "0.5360924", "0.53234917", "0.52991545", "0.5284608", "0.5270617", "0.52659655", "0.52653545", "0.52596056", "0.52593917", "0.52507615", "0.52427596", "0.52380335", "0.523583", "0.52290696", "0.5225764", "0.5224025", "0.5206545", "0.5201789", "0.5200667", "0.5194111", "0.51939833", "0.51869017", "0.5186882", "0.5185833", "0.5180589", "0.5179632", "0.5171792", "0.51678616", "0.5167691", "0.51638573", "0.51529676", "0.5150091", "0.5149885", "0.514747", "0.51468056", "0.5144742", "0.5140386", "0.51346266", "0.5132132", "0.51205355", "0.51197386", "0.5118805", "0.5117521", "0.5116373", "0.5115244", "0.5108136", "0.5107493", "0.5099258", "0.50979704", "0.5096392", "0.5095139", "0.50920355", "0.5090684", "0.50904536", "0.5087663", "0.50801325", "0.5077397", "0.50771326", "0.50750035", "0.507327", "0.5071988", "0.5065936", "0.50647384", "0.5059466", "0.5059323", "0.5056263", "0.50560015", "0.50540435", "0.50469404", "0.5045955", "0.5037867", "0.50377846", "0.5036417", "0.50356656", "0.5035656", "0.50343996" ]
0.61842614
0
this function will label candies that have a 3 or more combination
public void LabelingCandiesToDestroy() { int i; int j; int checkIfSame = 1; int NumOfSame = 1; System.out.println(" "); //the two sets of nested for loops are used to check for combinations in different directions (top-bottom, left-right) for (i = 0; i < 9; i++) { for (j = 0; j < 9; j++) { NumOfSame = 1; checkIfSame = 1; while (checkIfSame < (9 - j)) { //when there is a valid combination, it labels the candies as 9 if (pictures[i][j] == pictures[i][j + checkIfSame]) { checkIfSame++; NumOfSame++; } else { break; } } if (NumOfSame > 2) { for (int k = 0; k < NumOfSame; k++) { pictures2[i][j + k] = 9; //9 is set to candies that have a 3 or more combinations } } } } //this is the second set for the other direction for (j = 0; j < 9; j++) { for (i = 0; i < 9; i++) { NumOfSame = 1; checkIfSame = 1; while (checkIfSame < (9 - i)) { if (pictures[i][j] == pictures[i + checkIfSame][j]) { checkIfSame++; NumOfSame++; } else { break; } } if (NumOfSame > 2) { for (int k = 0; k < NumOfSame; k++) { pictures2[i + k][j] = 9; } } } } for (j = 0; j < 9; j++) { for (i = 0; i < 9; i++) { System.out.print(pictures2[i][j] + " "); } System.out.println(); } DestroyCandies(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "WinningCombination getDescription();", "public static void main(String[] args){\n\t\t\n\t\tLabelSet cLabelSet=new LabelSet();\n\t\tLabelSet tLabelSet=new LabelSet();\n\t\t\n\t\tList<Label> cLabels=new ArrayList<Label>();\n\t\tList<Label> tLabels=new ArrayList<Label>();\n\t\t\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"1\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\t\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"o\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"2\"));tLabels.add(tLabelSet.newLabel(\"d\"));\n\t\t\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"x\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"d\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"d\"));\n\t\tcLabels.add(cLabelSet.newLabel(\"3\"));tLabels.add(tLabelSet.newLabel(\"d\"));\n\t\t\n\t\tExternalCQM m=new RI();\n\t\t\n\t\tSystem.out.println(m.getClass().getSimpleName()+\": \"+FormatUtil.d4(m.measure(cLabels,tLabels)));\n\t\t\n\t}", "private boolean checkCaTegoryLegitness(int[] dice, int category) {\n\t\t// our boolean that is false at the beginning.\n\t\tboolean legitnessStatus = false;\n\t\t// we don't need to check anything for one to six or for check so\n\t\t// boolean\n\t\t// will be true. we don't need to check for one to six because if player\n\t\t// chose one to six we score++ every time we get that number\n\t\t// in the dice. and if there is no that number than the score\n\t\t// automatically will be 0.\n\t\tif (category >= 1 && category <= 6 || category == CHANCE) {\n\t\t\tlegitnessStatus = true;\n\t\t} else {\n\t\t\t// but if player chose something other than one to six or chance we\n\t\t\t// make 6 array lists.\n\t\t\tArrayList<Integer> ones = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> twos = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> threes = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> fours = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> fives = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> sixes = new ArrayList<Integer>();\n\t\t\t// after that we get ones, twos and etc. until six from the dice\n\t\t\t// numbers we randomly got and add that numbers in the array it\n\t\t\t// belongs. for example if the integer on first dice is 5 we add 1\n\t\t\t// in array list called fives. finally, arrays size will give us how\n\t\t\t// many that number we have in our dices.\n\t\t\tfor (int i = 0; i < N_DICE; i++) {\n\t\t\t\tif (dice[i] == 1) {\n\t\t\t\t\tones.add(1);\n\t\t\t\t} else if (dice[i] == 2) {\n\t\t\t\t\ttwos.add(1);\n\t\t\t\t} else if (dice[i] == 3) {\n\t\t\t\t\tthrees.add(1);\n\t\t\t\t} else if (dice[i] == 4) {\n\t\t\t\t\tfours.add(1);\n\t\t\t\t} else if (dice[i] == 5) {\n\t\t\t\t\tfives.add(1);\n\t\t\t\t} else if (dice[i] == 6) {\n\t\t\t\t\tsixes.add(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// after we know how many ones, twos etc. we have its easy to check.\n\t\t\t// for THREE_OF_A_KIND if there is any of the arrays that size is\n\t\t\t// equal or more than 3 legitnessStatus should get true.\n\t\t\tif (category == THREE_OF_A_KIND) {\n\t\t\t\tif (ones.size() >= 3 || twos.size() >= 3 || threes.size() >= 3\n\t\t\t\t\t\t|| fours.size() >= 3 || fives.size() >= 3\n\t\t\t\t\t\t|| sixes.size() >= 3) {\n\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t}\n\t\t\t\t// for FOUR_OF_A_KIND if there is any of the arrays that size is\n\t\t\t\t// equal or more than 4 legitnessStatus should get true.\n\t\t\t} else if (category == FOUR_OF_A_KIND) {\n\t\t\t\tif (ones.size() >= 4 || twos.size() >= 4 || threes.size() >= 4\n\t\t\t\t\t\t|| fours.size() >= 4 || fives.size() >= 4\n\t\t\t\t\t\t|| sixes.size() >= 4) {\n\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t}\n\t\t\t\t// for FULL_HOUSE we want any of our array list size to be equal\n\t\t\t\t// to three and after that we have that we want one more array\n\t\t\t\t// to be\n\t\t\t\t// equal to two. that means that we will have three similar dice\n\t\t\t\t// and two more similar dice.\n\t\t\t} else if (category == FULL_HOUSE) {\n\t\t\t\tif (ones.size() == 3 || twos.size() == 3 || threes.size() == 3\n\t\t\t\t\t\t|| fours.size() == 3 || fives.size() == 3\n\t\t\t\t\t\t|| sixes.size() == 3) {\n\t\t\t\t\tif (ones.size() == 2 || twos.size() == 2\n\t\t\t\t\t\t\t|| threes.size() == 2 || fours.size() == 2\n\t\t\t\t\t\t\t|| fives.size() == 2 || sixes.size() == 2) {\n\t\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// there is only 3 way we can get SMALL_STRAIGHT. these are if\n\t\t\t\t// dices show: 1,2,3,4 or 2,3,4,5, or 3,4,5,6. for first one it\n\t\t\t\t// means we need our first array size to be one AND our second\n\t\t\t\t// array size to be one AND our third array size to be one AND\n\t\t\t\t// out fourth array list size to be one. and so on for other two\n\t\t\t\t// ways.\n\t\t\t} else if (category == SMALL_STRAIGHT) {\n\t\t\t\tif (ones.size() == 1 && twos.size() == 1 && threes.size() == 1\n\t\t\t\t\t\t&& fours.size() == 1) {\n\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t} else if (twos.size() == 1 && threes.size() == 1\n\t\t\t\t\t\t&& fours.size() == 1 && fives.size() == 1) {\n\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t} else if (threes.size() == 1 && fours.size() == 1\n\t\t\t\t\t\t&& fives.size() == 1 && sixes.size() == 1) {\n\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t}\n\t\t\t\t// for LARGE_STRAIGHT there is only 2 ways. these are:1,2,3,4,5\n\t\t\t\t// or 2,3,4,5,6. for first one it\n\t\t\t\t// means we need our first array size to be one AND our second\n\t\t\t\t// array size to be one AND our third array size to be one AND\n\t\t\t\t// out fourth array list size to be one AND our fifth array list\n\t\t\t\t// size to be one. similar for second way starting from second\n\t\t\t\t// array list and going through to last sixth array list.\n\t\t\t} else if (category == LARGE_STRAIGHT) {\n\t\t\t\tif (ones.size() == 1 && twos.size() == 1 && threes.size() == 1\n\t\t\t\t\t\t&& fours.size() == 1 && fives.size() == 1) {\n\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t} else if (twos.size() == 1 && threes.size() == 1\n\t\t\t\t\t\t&& fours.size() == 1 && fives.size() == 1\n\t\t\t\t\t\t&& sixes.size() == 1) {\n\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t}\n\t\t\t\t// and for YAHTZEE we want any of our array list size to be\n\t\t\t\t// five. it will mean that all dices show same thing. because if\n\t\t\t\t// for example array list ones size is five it means that we\n\t\t\t\t// added 1 in that array 5 times and it means that we see 5 same\n\t\t\t\t// number on all dices.\n\t\t\t} else if (category == YAHTZEE) {\n\t\t\t\tif (ones.size() == 5 || twos.size() == 5 || threes.size() == 5\n\t\t\t\t\t\t|| fours.size() == 5 || fives.size() == 5\n\t\t\t\t\t\t|| sixes.size() == 5) {\n\t\t\t\t\tlegitnessStatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finally it will return boolean of true or false.\n\t\treturn legitnessStatus;\n\t}", "String getCombination(int numberOfSides);", "boolean isWinningCombination(Ticket ticket);", "private void generateCandies(){\n\t\tfor (int i = 0; i < 16; i++){\n\t\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\t\tCandy candy = new Candy(coordX, coordY, i);\n\t\t\tcandies.put(i, candy);\n\t\t}\n\t}", "public static Object[] ticket_combo(int l, Set<Set<Object>> ticket_indices_powerset, Object[] all_number_subset_array, Object[] winning_number_subset_array) {\n \n Set<Object> curr_t = new HashSet<Object>(); //carries one ticket\n Set<Object> set_to_buy = new HashSet<Object>(); //carries one winning combo\n Set<Object> curr_win_combo = new HashSet<Object>(); //carries one ticket combo\n \n boolean has_winning = false;\n int match_count = 0;\n int ticket_amount_count = all_number_subset_array.length; //smallest amount of tickets needed so far\n \n // a combo to possibly buy\n for(Set<Object> curr_indices_subset : ticket_indices_powerset) {\n int curr_num_tickets_to_buy = curr_indices_subset.toArray().length;\n if(ticket_amount_count <= curr_num_tickets_to_buy && has_winning)\n {\n continue;\n }\n //copy a winning array\n Object[] winning_number_subset_array_copy = Arrays.copyOf(winning_number_subset_array, winning_number_subset_array.length);\n //setup a counter of uncovered winning combos\n int uncovered_winning_possibilities = winning_number_subset_array_copy.length;\n Object[] curr_indices_subset_array = curr_indices_subset.toArray();\n \n //take each ticket in a combo\n for(Object curr_index : curr_indices_subset_array) {\n int curr_index_int = ((Integer) curr_index).intValue() - 1;\n curr_t = (java.util.HashSet<java.lang.Object>) all_number_subset_array[curr_index_int];\n \n //see which winning combos you can cross out\n for(int i = 0; i < winning_number_subset_array_copy.length; i++) {\n match_count = 0;\n curr_win_combo = (java.util.HashSet<java.lang.Object>) winning_number_subset_array[i];\n if (winning_number_subset_array_copy[i] instanceof Integer)\n {\n continue;\n }\n \n for(Object combo_num : curr_win_combo) {\n for(Object ticket_num : curr_t) {\n if(((Integer)combo_num).intValue() == ((Integer)ticket_num).intValue())\n {\n match_count++;\n }\n }\n }\n if(match_count >= l)\n {\n uncovered_winning_possibilities--;\n winning_number_subset_array_copy[i] = 0;\n }\n }\n }\n //after ticket combo loop\n if((uncovered_winning_possibilities == 0) && (!has_winning || (curr_num_tickets_to_buy < ticket_amount_count)))\n {\n has_winning = true;\n ticket_amount_count = curr_num_tickets_to_buy;\n set_to_buy = curr_indices_subset;\n \n }\n }\n Object[] final_ticket_indeces = set_to_buy.toArray();\n return final_ticket_indeces;\n }", "public String isWinnable(Card c[]) {\n\t\tString solutionEquation=\"There is no solution for this set\";\n\t\t// ++(+-/*)\n\t\tint i=0,j=1,k=2,l=3;\n\t\tansCount=0;\n\t\tint count=0;\n\t\tfor(count=0;count<25;count++) {\n\t\tif(c[i].getValue()+c[j].getValue()+c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"+\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()+c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"+\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()+c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"+\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()+c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"+\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// +-(+-/*)\n\t\telse if(c[i].getValue()+c[j].getValue()-c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"-\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()-c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"-\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()-c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"-\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()-c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"-\"+c[k].getValue()+\"*\"+c[l].getValue();\t\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// +/(+-/*)\n\t\telse if(c[i].getValue()+c[j].getValue()/c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"/\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()/c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"/\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()/c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"/\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()/c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"/\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// +*(+-/*)\n\t\telse if(c[i].getValue()+c[j].getValue()*c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"*\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()*c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"*\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()*c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"*\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()+c[j].getValue()*c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"+\"+c[j].getValue()+\"*\"+c[k].getValue()+\"*\"+c[l].getValue();\t\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t////////////////\n\t\t////////////////\n\t\t// -+(+-/*)\n\t\telse if(c[i].getValue()-c[j].getValue()+c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"+\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()+c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"+\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()+c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"+\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()+c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"+\"+c[k].getValue()+\"*\"+c[l].getValue();\t\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// --(+-/*)\n\t\telse if(c[i].getValue()-c[j].getValue()-c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"-\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()-c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"-\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()-c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"-\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()-c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"-\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// -/(+-/*)\n\t\telse if(c[i].getValue()-c[j].getValue()/c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"/\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()/c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"/\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()/c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"/\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()/c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"/\"+c[k].getValue()+\"*\"+c[l].getValue();\t\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// -*(+-/*)\n\t\telse if(c[i].getValue()-c[j].getValue()*c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"*\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()*c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"*\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()*c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"*\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()-c[j].getValue()*c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"-\"+c[j].getValue()+\"*\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t////////////////\n\t\t////////////////\n\t\t// /+(+-/*)\n\t\telse if(c[i].getValue()/c[j].getValue()+c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"+\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()+c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"+\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()+c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"+\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()+c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"+\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// /-(+-/*)\n\t\telse if(c[i].getValue()/c[j].getValue()-c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"-\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()-c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"-\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()-c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"-\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()-c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"-\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// //(+-/*)\n\t\telse if(c[i].getValue()/c[j].getValue()/c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"/\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()/c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"/\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()/c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"/\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()/c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"/\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// /*(+-/*)\n\t\telse if(c[i].getValue()/c[j].getValue()*c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"*\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()*c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"*\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()*c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"*\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()/c[j].getValue()*c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"/\"+c[j].getValue()+\"*\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t////////////////\n\t\t////////////////\n\t\t// *+(+-/*)\n\t\telse if(c[i].getValue()*c[j].getValue()+c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"+\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()+c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"+\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()+c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"+\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()+c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"+\"+c[k].getValue()+\"*\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// *-(+-/*)\n\t\telse if(c[i].getValue()*c[j].getValue()-c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"-\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()-c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"-\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()-c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"-\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()-c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"-\"+c[k].getValue()+\"*\"+c[l].getValue();\t\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// /*(+-/*)\n\t\telse if(c[i].getValue()*c[j].getValue()/c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"/\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()/c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"/\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()/c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"/\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()/c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"/\"+c[k].getValue()+\"*\"+c[l].getValue();\t\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t// **(+-/*)\n\t\telse if(c[i].getValue()*c[j].getValue()*c[k].getValue()+c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"*\"+c[k].getValue()+\"+\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()*c[k].getValue()-c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"*\"+c[k].getValue()+\"-\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()*c[k].getValue()/c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"*\"+c[k].getValue()+\"/\"+c[l].getValue();\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\telse if(c[i].getValue()*c[j].getValue()*c[k].getValue()*c[l].getValue()==24) {\n\t\t\tsolutionEquation=\"\"+c[i].getValue()+\"*\"+c[j].getValue()+\"*\"+c[k].getValue()+\"*\"+c[l].getValue();\t\t\n\t\t\tsolutions[ansCount]=solutionEquation;\n\t\t\tansCount++;\n\t\t}\n\t\t\n\t\ti++;\n\t\tj++;\n\t\tk++;\n\t\tl++;\n\t\tif (i==4) \n\t\t\ti=0;\n\t\tif (j==4) \n\t\t\tj=0;\n\t\tif (k==4) \n\t\t\tk=0;\n\t\tif (l==4) \n\t\t\tl=0;\n\t\tSystem.out.println(\"i=\"+i);\n\t\tSystem.out.println(\"j=\"+j);\n\t\tSystem.out.println(\"k=\"+k);\t\t\n\t\tSystem.out.println(\"l=\"+l);\n\t\tSystem.out.println(\"Count: \"+count);\n\t\tSystem.out.println(\"Solution: \"+solutionEquation);\n\t\t}\n\t\t\n\t\tif (solutionEquation.equals(\"\"))\n\t\t\tsolutionEquation=\"There is no solution for this set\";\n\t\tSystem.out.println(\"Amount of Solutions: \"+ansCount);\n\t\t//for verify store all solutions into an array then check against the solution they enter\n\t\treturn solutionEquation;\n\t}", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "public Vector genCandidate(int k) {\n\t\tVector<String> tempCandidateList = new Vector<String>();\n\t\tVector<String> temp_v = new Vector<String>();\n\t\tint length;\n\t\tString candidate1 = new String();\n\t\tString candidate2 = new String();\n\t\tString newCandidate = new String();\n\t\t// 1 itemset\n\t\tif( 1 == k ) {\n\t\t\tfor(int i = 1; i<=NUM; i++) {\n\t\t\t\ttempCandidateList.addElement(Integer.toString(i));\n\t\t\t}\n\t\t}\n\t\t// >=2\n\t\telse {\n\t\t\ttemp_v = (Vector)largeItemset.get(k-2); //-2, not 1\n\t\t\tlength = temp_v.size();\n\t\t\tfor(int j = 0; j<length; j++) {\n\t\t\t\t// get 1 itemset element\n\t\t\t\tcandidate1 = temp_v.get(j);\n\t\t\t\t// newCandidate = new String();\n\t\t\t\tfor(int jj=j+1; jj<length; jj++) {\n\t\t\t\t\tcandidate2 = temp_v.get(jj);\n\t\t\t\t\tnewCandidate = new String();\n\t\t\t\t\t// attention: if k == 2, no rule, just join\n\t\t\t\t\tif( 2 == k) {\n\t\t\t\t\t\tnewCandidate = candidate1.concat(\" \");\n\t\t\t\t\t\tnewCandidate = newCandidate.concat(candidate2);\n\t\t\t\t\t\ttempCandidateList.addElement(newCandidate.trim());\n\t\t\t\t\t}\n\t\t\t\t\telse { //only first k-2 element same ->downward closure property!\n\t\t\t\t\t\tString s1, s2;\n\t\t\t\t\t\tboolean same = true;\n\t\t\t\t\t\tfor(int pos = 1; pos<k-1; pos++) {\n\t\t\t\t\t\t\ts1 = getItemAt(candidate1, pos);\n\t\t\t\t\t\t\ts2 = getItemAt(candidate2, pos);\n\t\t\t\t\t\t\tif(s1.compareToIgnoreCase(s2) != 0) {\n\t\t\t\t\t\t\t\tsame = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tnewCandidate = newCandidate.concat(\" \");\n\t\t\t\t\t\t\t\tnewCandidate = newCandidate.concat(s1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// a legal C(k+1) element we've got\n\t\t\t\t\t\tif(same) {\n\t\t\t\t\t\t\ts1 = getItemAt(candidate1, k-1);\n\t\t\t\t\t\t\ts2 = getItemAt(candidate2, k-1);\n\t\t\t\t\t\t\tnewCandidate = newCandidate.concat(\" \");\n\t\t\t\t\t\t\tnewCandidate = newCandidate.concat(s1);\n\t\t\t\t\t\t\tnewCandidate = newCandidate.concat(\" \");\n\t\t\t\t\t\t\tnewCandidate = newCandidate.concat(s2);\n\t\t\t\t\t\t\ttempCandidateList.addElement(newCandidate.trim());\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\t\t\t\n\t\treturn tempCandidateList;\n\t}", "public void DestroyCandies() {\n NineExists = 0;\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if (pictures2[i][j] == 9) {\n scorevalue += 10;\n NineExists = 1;\n combinationValid = 1;\n NoMovesRemaining = 0;\n for (int k = 0; k < j; k++) {\n pictures2[i][j - k] = pictures2[i][j - k - 1]; //candies are shifted down to fill in the spaces\n }\n pictures2[i][0] = indices[random.nextInt(indices.length)]; //random candies are generated\n\n }\n }\n }\n\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n pictures[i][j] = pictures2[i][j];\n\n }\n }\n System.out.println(\" \");\n for (int j = 0; j < 9; j++) {\n for (int i = 0; i < 9; i++) {\n System.out.print(pictures2[i][j] + \" \");\n }\n System.out.println();\n }\n\n if ((NineExists == 1)) { //if there is a combination\n LabelingCandiesToDestroy();\n }\n }", "private static void addCombos() {\n\t\tcombos.put(\"All pixels, three LSB\", 13);\n\t\tcombos.put(\"All pixels, two LSB\", 12);\n\t\tcombos.put(\"Every even pixel, three LSB\", 23);\n\t\tcombos.put(\"Every odd pixel, three LSB\", 33);\n\t\tcombos.put(\"Every pixel, one LSB\", 11);\n\t\tcombos.put(\"Every even pixel, two LSB\",22);\n\t\tcombos.put(\"Every odd pixel, two LSB\", 32);\n\t\tcombos.put(\"Every third pixel, three LSB\",43);\n\t\tcombos.put(\"Every third pixel, two LSB\",42);\n\t\tcombos.put(\"Every even pixel, one LSB\",21);\n\t\tcombos.put(\"Every odd pixel, one LSB\",31);\n\t\tcombos.put(\"Every third pixel, one LSB\",41);\n\t\tcombos.put(\"Every prime-numbered pixel, three LSB\", 53);\n\t\tcombos.put(\"Every prime-numbered pixel, two LSB\",52);\n\t\tcombos.put(\"Every prime-numbered pixel, one LSB\",51);\n\n\n\t}", "static int numberOfWays(int[] arr, int k) {\n\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < arr.length; i++) {\n if (!map.containsKey(arr[i])) {\n map.put(arr[i], 1);\n } else {\n map.put(arr[i], map.get(arr[i]) + 1);\n }\n }\n int result = 0;\n Iterator<Map.Entry<Integer, Integer>> iter = map.entrySet().iterator();\n while (iter.hasNext()) {\n Map.Entry<Integer, Integer> e = iter.next();\n int curNum = (int) e.getKey();\n int countOfOccurance = (int) e.getValue();\n int complement = k - curNum;\n\n if (map.containsKey(complement)) {\n // found target value\n if (curNum == complement) {\n // 3 + 3 = 6\n // add combination of them. count choose 2. For example [3, 3, 3, 3] = 4 choose 2\n result += getCombinationCount(countOfOccurance, 2);\n } else {\n // 1 + 5 = 6\n result += countOfOccurance;\n }\n }\n iter.remove();\n }\n\n return result;\n }", "private int[] constructCandidates1(int n) {\n int cands[] = new int[subsetCount];\n for (int i = 0; i < subsetCount; i++) {\n cands[i] = i;\n }\n for (int i = 0; i < n; i++) { // Remove currently used sets in partialSol.\n cands[partialSol[i]] = DNU;\n }\n for (int i = 0; i < n; i++) {\n if (getDiff(cands, i, n) == 0) {\n cands[i] = DNU;\n }\n }\n int dnuCount = 0;\n for (int i = 0; i < cands.length; i++) {\n if (cands[i] == DNU) {\n dnuCount++;\n }\n }\n int[] ret = new int[cands.length - dnuCount];\n int retIndex = 0;\n for (int i = 0; i < cands.length; i++) {\n if (cands[i] != DNU) {\n ret[retIndex] = i;\n retIndex++;\n }\n }\n return sortCandidates(ret, n);\n// return ret;\n }", "public static void combinations(int[] boxes, int ci, int ti, int lb){\n if(ci>ti){\n for(int i=0;i<boxes.length;i++){\n if(boxes[i]==1){\n System.out.print(\"i\");\n }\n else if(boxes[i]==0){\n System.out.print(\"-\");\n }\n \n }\n System.out.println();\n return;\n }\n \n for(int i=lb+1;i<boxes.length;i++){\n if(boxes[i]==0){\n boxes[i]=1;\n combinations(boxes,ci+1,ti,i);\n boxes[i]=0;\n }\n }\n }", "static int distributeCandy(int[] score) {\n java.util.TreeMap<Integer,Integer> candcalmap=new java.util.TreeMap<Integer,Integer>();\n int totcand=0,numcan=1;\n /* for(int indx=1;indx<score.length;indx++)\n {\n while(score[indx-1]<(indx<score.length?score[indx]:Integer.MAX_VALUE))\n {\n numcan++;\n indx++;\n totcand+=numcan;\n //System.out.println(numcan+\"-\"+indx+\":\"+totcand);\n if(indx==score.length)\n break;\n }\n numcan=1;\n totcand+=numcan;\n \n }\n*/\tfor(int sc:score)\n {\n candcalmap.put(sc,candcalmap.get(sc)==null?1:candcalmap.get(sc)+1);\n }\n for(Map.Entry<Integer,Integer> e:candcalmap.entrySet())\n {\n totcand+=numcan*e.getValue();\n// System.out.println(e.getValue()+\"-\"+e.getKey()+\":\"+numcan+\" \"+totcand);\n numcan++;\n }\n return totcand;\n }", "private void generateRandomCombination() {\n Random num_generator = new Random();\n\n //First combo number should not be in range -5 to 5.\n int temp_combo_one;\n do {\n temp_combo_one = num_generator.nextInt(40);\n } while (temp_combo_one >= -5 && temp_combo_one <= 5);\n\n //Combo numbers should not repeat\n //Consecutive combo numbers should be separated by ~5 ticks in either direction\n int temp_combo_two;\n do {\n temp_combo_two = num_generator.nextInt(40);\n }\n while (temp_combo_two == temp_combo_one || (temp_combo_two >= temp_combo_one - 5 && temp_combo_two <= temp_combo_one + 5));\n\n //If second combo number is a 0, we don't want the third combo number to be in the 38 to 40 range\n int temp_combo_three;\n do {\n temp_combo_three = num_generator.nextInt(40);\n }\n while (temp_combo_three == temp_combo_one || temp_combo_three == temp_combo_two || (temp_combo_three >= temp_combo_two - 5 && temp_combo_three <= temp_combo_two + 5) || (temp_combo_two == 0 && temp_combo_three >= 38));\n\n current_combination[0] = temp_combo_one;\n current_combination[1] = temp_combo_two;\n current_combination[2] = temp_combo_three;\n\n //Display combination\n String combo_one = Integer.toString(current_combination[0]);\n String combo_two = Integer.toString(current_combination[1]);\n String combo_three = Integer.toString(current_combination[2]);\n\n combo_1.setText(combo_one);\n combo_2.setText(combo_two);\n combo_3.setText(combo_three);\n }", "private void crossProduct() {\n BaseCandidateElement[] it = o.inputObject.firstStageCandidates.values().toArray(new BaseCandidateElement[0]);\n // logger.info(Arrays.toString(it));\n for (int i = 0; i < it.length; i++) {\n for (int j = i + 1; j < it.length; j++) {\n if (PrecisConfigProperties.HIERARCHY_DIMS_ENABLED && hierarchyDimsNegation.checkIfBelongToSameHierarchyGroup(it[i], it[j]))\n continue;\n if (it[i].xor(it[j]).cardinality() == 4) {\n BitSet b = it[i].or(it[j]);\n o.inputObject.addCandidate(b);\n }\n }\n }\n }", "public int candy(int[] ratings){\n\t\tint n = ratings.length;\n\t\tint[] pre_count = new int[n];\n\t\tfor(int i = 0; i < n; i ++)\n\t\t\tpre_count[i] = 0;\n\t\t\n\t\tfor(int i = 1; i < n; i ++){\n\t\t\tif (ratings[i] < ratings[i-1])\n\t\t\t\tpre_count[i-1] ++;\n\t\t\tif (ratings[i] > ratings[i-1])\n\t\t\t\tpre_count[i]++;\t\t\t\t\n\t\t}\n\t\tint[] candies = new int[n];\n\t\tLinkedList<Integer> topo_que = new LinkedList<Integer>();\n\t\tfor(int i = 0; i < n; i++)\n\t\t\tif (pre_count[i] == 0){\n\t\t\t\tcandies[i] = 1;\n\t\t\t\ttopo_que.add(i);\n\t\t\t}\n\t\twhile( ! topo_que.isEmpty()){\n\t\t\tint i = topo_que.removeFirst();\n\t\t\tif (i>0)\n\t\t\t\tif ( ratings[i] < ratings[i - 1]){\n\t\t\t\t\t// remove dependency\n\t\t\t\t\tpre_count[i-1] --;\n\t\t\t\t\t// update the candies\n\t\t\t\t\tif ( candies[i] + 1 > candies[i-1])\n\t\t\t\t\t\tcandies[i-1] = candies[i] + 1;\n\t\t\t\t\tif (pre_count[i-1] == 0)\n\t\t\t\t\t\ttopo_que.add(i-1);\n\t\t\t\t}\n\t\t\tif (i < n-1)\n\t\t\t\tif ( ratings[i] < ratings[i + 1]){\n\t\t\t\t\t// remove dependency\n\t\t\t\t\tpre_count[i+1] --;\n\t\t\t\t\t// update the candies\n\t\t\t\t\tif ( candies[i] + 1 > candies[i+1])\n\t\t\t\t\t\tcandies[i+1] = candies[i] + 1;\n\t\t\t\t\tif (pre_count[i+1] == 0)\n\t\t\t\t\t\ttopo_que.add(i+1);\n\t\t\t\t}\t\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < n ; i ++)\n\t\t\tsum += candies[i];\n\t\t\n\t\treturn sum;\n\t\n\n }", "public static int combinationCounter(int n) {\r\n int hasil = n * (n - 1) / 2;\r\n return hasil;\r\n }", "public static void compareCombos() {\n\t\tint currentTotal = 0;\n\t\tint pastTotal = 0;\n\n\t\tcost++;\n\t\tfor (int i = 0; i < numPeople; i++) {\n\t\t\tcurrentTotal += board[i][currentCombo[i]];\n\t\t\tpastTotal += board[i][bestCombo[i]];\n\t\t}\n\t\t\n\t\tif (currentTotal >= pastTotal) {\n\t\t\tbestTotal = 0;\n\t\t\tfor (int i = 0; i < numPeople; i++) {\n\t\t\t\tbestCombo[i] = currentCombo[i];\n\t\t\t\tbestTotal += board[i][currentCombo[i]];\n\t\t\t}\n\t\t}\n\n\t}", "public static void combinations(boolean[]boxes, int ci, int ti, int llb){\n if(ci > ti){\n for (int i = 0; i < boxes.length; i++) {\n if(boxes[i]){\n System.out.print(\"i\");\n }\n else{\n System.out.print(\"-\");\n }\n }\n System.out.println();\n return;\n }\n for(int b = llb+1; b < boxes.length; b++){\n if(boxes[b] == false) {\n boxes[b] = true;\n combinations(boxes, ci + 1, ti, b);\n boxes[b] = false;\n }\n }\n }", "protected LinkedList<FunQuadruple> generateCandidates(List<FunQuadruple> lk) {\n\n LinkedList<FunQuadruple> lkPlus1 = new LinkedList<>();\n if (lk.isEmpty()) {\n return lkPlus1;\n }\n Set<ColumnCombinationBitset> subsets = new HashSet<>();\n int k = lk.get(0).candidate.size();\n ColumnCombinationBitset union = new ColumnCombinationBitset();\n for (FunQuadruple subsetQuadruple : lk) {\n // TODO optimise: all bits are set? --> break\n // If subsetQuadruple represents a unique do not add it to subsets and union (it should be pruned).\n if (subsetQuadruple.count == 0) {\n continue;\n }\n union = subsetQuadruple.candidate.union(union);\n subsets.add(subsetQuadruple.candidate);\n }\n\n Map<ColumnCombinationBitset, Integer> candidateGenerationCount = new HashMap<>();\n\n List<ColumnCombinationBitset> lkPlus1Candidates;\n FunQuadruple lkPlus1Member;\n for (ColumnCombinationBitset subset : subsets) {\n lkPlus1Candidates = union.getNSubsetColumnCombinationsSupersetOf(\n subset, k + 1);\n // FIXME add key conditional here\n // Removed key conditional - should not be triggerable?\n for (ColumnCombinationBitset candidate : lkPlus1Candidates) {\n if (candidateGenerationCount.containsKey(candidate)) {\n int count = candidateGenerationCount.get(candidate);\n count++;\n candidateGenerationCount.put(candidate, count);\n } else {\n candidateGenerationCount.put(candidate, 1);\n }\n }\n }\n\n for (ColumnCombinationBitset candidate : candidateGenerationCount\n .keySet()) {\n if (candidateGenerationCount.get(candidate) == (k + 1)) {\n lkPlus1Member = new FunQuadruple(candidate, addPliGenerate(\n candidate).getRawKeyError());\n lkPlus1.add(lkPlus1Member);\n }\n }\n return lkPlus1;\n }", "public boolean label(IntVar[] vars) {\r\n\r\n\r\n //System.out.println(\"ct \" + vars.length);\r\n count++;\r\n if (trace) {\r\n for (int i = 0; i < vars.length; i++)\r\n System.out.print (vars[i] + \" \");\r\n System.out.println ();\r\n }\r\n\r\n ChoicePoint choice = null;\r\n boolean consistent;\r\n\r\n // Instead of imposing constraint just restrict bounds\r\n // -1 since costValue is the cost of last solution\r\n if (costVariable != null) {\r\n try {\r\n if (costVariable.min() <= costValue - 1)\r\n costVariable.domain.in(store.level, costVariable, costVariable.min(), costValue - 1);\r\n else\r\n return false;\r\n } catch (FailException f) {\r\n return false;\r\n }\r\n }\r\n\r\n consistent = store.consistency();\r\n\r\n if (!consistent) {\r\n // Failed leaf of the search tree\r\n return false;\r\n } else { // consistent\r\n\r\n if (vars.length == 0) {\r\n // solution found; no more variables to label\r\n\r\n // update cost if minimization\r\n if (costVariable != null)\r\n costValue = costVariable.min();\r\n\r\n reportSolution();\r\n\r\n return costVariable == null; // true is satisfiability search and false if minimization\r\n }\r\n\r\n choice = new ChoicePoint(vars);\r\n\r\n levelUp();\r\n\r\n store.impose(choice.getConstraint());\r\n\r\n // choice point imposed.\r\n\r\n consistent = label(choice.getSearchVariables());\r\n\r\n if (consistent) {\r\n levelDown();\r\n return true;\r\n } else {\r\n\r\n restoreLevel();\r\n store.impose(new Not(choice.getConstraint()));\r\n\r\n\r\n\r\n // negated choice point imposed.\r\n\r\n consistent = label(vars);\r\n\r\n levelDown();\r\n\r\n if (consistent) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int t = Integer.parseInt(s.nextLine());\n for(int i=1;i<=t;i++){\n int n = Integer.parseInt(s.nextLine());\n Set<String> a = new HashSet<>();\n\n for(int j=0;j<n;j++) {\n String str = s.nextLine();\n if(str.equals(\"easy-medium\"))\n str=\"medium\";\n else if(str.equals(\"medium-hard\"))\n str=\"hard\";\n a.add(str);\n }\n System.out.println(a.size()<5?\"No\":\"Yes\");\n /*int a1=0,a2=0,a3=0,a4=0,a5=0;\n for(int k=0;k<n;k++){\n if(a.contains(\"cakewalk\"))\n a1++;\n if(a.contains(\"simple\"))\n a2++;\n if(a[k].equals(\"easy\"))\n a3++;\n if(a[k].equals(\"easy-medium\") || a[k].equals(\"medium\"))\n a4++;\n if(a[k].equals(\"medium-hard\") || a[k].equals(\"hard\"))\n a5++;\n }\n if(a1==1&&a2==1&&a3==1&&a4==1&&a5==1)\n System.out.println(\"Yes\");\n else\n System.out.println(\"No\");\n*/\n }\n }", "private void makeTrips() {\n int highestThree, firstKicker, secondKicker;\n highestThree = firstKicker = secondKicker = -1;\n for (Integer key : this.cardOccurrence.keySet()) {\n int value = this.cardOccurrence.get(key);\n if(value == 3 && value > highestThree)\n highestThree = key;\n else {\n if(key > firstKicker) {\n secondKicker = firstKicker;\n firstKicker = key;\n }\n else if(key > secondKicker)\n secondKicker = key;\n }\n }\n\n //Go through Cards ArrayList to get the actual cards pertaining\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = 0; i < this.cards.size(); i++) {\n Card c = this.cards.get(i);\n if(c.sameValue(highestThree))\n validHand.add(c.toString());\n else if(c.sameValue(firstKicker) || c.sameValue(secondKicker))\n validHand.add(c.toString());\n }\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }", "private Set<List<Integer>> combCount(int[] candidates, int i, int target) {\n int len = candidates.length;\n if (i >= len || (i == len - 1 && candidates[i] != target)) {\n return Collections.emptySet();\n }\n\n Set<List<Integer>> comb = new HashSet<>();\n if (candidates[i] == target) {\n List<Integer> list = new ArrayList<>();\n list.add(candidates[i]);\n comb.add(list);\n }\n\n List<Integer> out = new ArrayList<>();\n if (i != len - 1) {\n out.add(0);\n }\n if (candidates[i] < target) {\n out.add(candidates[i]);\n }\n for (Integer val: out) {\n Set<List<Integer>> lists = combCount(candidates, i + 1, target - val);\n if (val != 0) {\n for (List<Integer> list : lists) {\n list.add(val);\n }\n }\n comb.addAll(lists);\n }\n return comb;\n }", "public static void main(String[] args) {\n\t\tWords_possible sn = new Words_possible();\n\t\tList<String> list = sn.letterCombinations(\"2\");\n\t\tfor(String s:list)\n\t\t{\n\t\t\tSystem.out.println(s);\n\t\t}\n\t}", "public static void main(String[] args) {\n //The letters are randomly chosen through this block of code with use of ASCII code.\n char let1 = (char) ((int)(Math.random() * 26 + 65));\n char let2 = (char) ((int)(Math.random() * 26 + 65));\n char let3 = (char) ((int)(Math.random() * 26 + 65));\n \n //This generates a number of four digits to follow the letters. \n int num = (int)(Math.random() * 9000 + 999);\n \n //The combination is now printed to the screen through this. \n System.out.println(\"The plate number is \" + let1 + let2 +let3 + num); \n }", "public static List<List<Integer>> combinationSum2(int[] candidates, int target) {\n Arrays.sort(candidates);\n List<List<List<Integer>>> dp = new ArrayList<>();\n Map<Integer, Integer> candMap = new HashMap<>();\n for (int i = 0; i < candidates.length; i++) {\n if (candidates[i] > target) break;\n if(candMap.containsKey(candidates[i])) candMap.put(candidates[i], candMap.get(candidates[i]) + 1);\n else candMap.put(candidates[i], 1);\n }\n for (int i = 1; i <= target; i++) {\n Set<List<Integer>> subCand = new HashSet<>();\n for (int j = 0; j < candidates.length && candidates[j] <= i; j++) {\n if (candidates[j] == i) subCand.add(Arrays.asList(i));\n else for (List<Integer> l : dp.get(i - 1 - candidates[j])) {\n if (candidates[j] <= l.get(0)) {\n List<Integer> cl = new ArrayList<>();\n cl.add(candidates[j]);\n cl.addAll(l);\n int cnt = 1;\n for (int a : l) {\n if(a == candidates[j]) cnt++;\n else break;\n }\n if(cnt <= candMap.get(candidates[j])) subCand.add(cl);\n }\n }\n }\n List<List<Integer>> subCandList = new ArrayList<>();\n subCandList.addAll(subCand);\n dp.add(subCandList);\n }\n return dp.get(target - 1);\n }", "@Test\n public void testConnectedComponents()\n {\n Collection<IIntArray> cc1 = MarkovModel.util.connectedComponents(P1);\n assertTrue(cc1.containsAll(C1));\n assertEquals(cc1.size(), C1.size());\n\n Collection<IIntArray> cc2 = MarkovModel.util.connectedComponents(P2);\n assertTrue(cc2.containsAll(C2));\n assertEquals(cc2.size(), C2.size());\n\n Collection<IIntArray> cc3 = MarkovModel.util.connectedComponents(P3);\n assertTrue(cc3.containsAll(C3));\n assertEquals(cc3.size(), C3.size()); \n }", "public Set<List<String>> getCombination(int[] inHand) {\n Set<List<String>> result = new HashSet<>();\n for (int i = 0; i < inHand.length; i++) {\n if (inHand[i] < 1) continue;\n int[] copyHand = copyArray(inHand);\n //possibility of A AA AAA\n for (int j = 1; j <= inHand[i]; j++) {\n if (j == 1) {\n String cSet = \"\";\n\n for (int seq = i; seq <= i + 2; seq++) {\n if (seq >= inHand.length || copyHand[seq] < 1) continue;\n cSet += seq;\n copyHand[seq] -= 1;\n }\n// System.out.println(\"i: \" + i + \" j: \" + j+\"inhand: \" + arrayToString\n// (inHand));\n\n Set<List<String>> a = getCombination(copyHand);\n Set<List<String>> newA = new HashSet<>();\n for (List<String> s : a) {\n s.add(cSet);\n s.sort(Comparator.naturalOrder());\n if (s.equals(\"\")) continue;\n newA.add(s);\n }\n result.addAll(newA);\n continue;\n }\n\n String currentSet = \"\";\n int[] copyOfInHand = copyArray(inHand);\n for (int t = 0; t < j; t++) {\n currentSet += i;\n }\n\n copyOfInHand[i] -= j;\n Set<List<String>> after = getCombination(copyOfInHand);\n Set<List<String>> newAfter = new HashSet<>();\n for (List<String> s : after) {\n s.add(currentSet);\n s.sort(Comparator.naturalOrder());\n newAfter.add(s);\n }\n result.addAll(newAfter);\n }\n }\n if (result.isEmpty()) result.add(new ArrayList<>());\n int min = result.stream().map(set -> set.size()).min(Comparator\n .naturalOrder()).get();\n Set<List<String>> minSets = result.stream().filter(set -> set.size() == min)\n .collect(Collectors\n .toSet());\n// combinationCache.put(inHand, minSets);\n return minSets;\n }", "private void computeConjunNum()\r\n\t{\n\t\tconjunNum = 0;\r\n\t\tfor (int i=0;i<lilyNum;i++)\r\n\t\t{\r\n\t\t\tboolean flag=false;\r\n\t\t\tfor (int j=0;j<refNum;j++)\r\n\t\t\t{\r\n\t\t\t\tif (refResult[j].sourceLabel.equals(lilyResult[i].sourceLabel) && \r\n\t\t\t\t\trefResult[j].targetLabel.equals(lilyResult[i].targetLabel) &&\r\n\t\t\t\t\t(refResult[j].relationType == lilyResult[i].relationType))\t\t\t\t\t\r\n\t\t\t\t{\r\n\t\t\t\t\tconjunNum++;\r\n\t\t\t\t\tflag=true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!flag){\r\n\t\t\t\tSystem.out.println(\"错误:\"+lilyResult[i].sourceLabel+int2type(lilyResult[i].relationType)+lilyResult[i].targetLabel);\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tconjunNum = 0;\r\n\t\tfor (int i=0;i<refNum;i++)\r\n\t\t{\r\n\t\t\tboolean flag=false;\r\n\t\t\tfor (int j=0;j<lilyNum;j++)\r\n\t\t\t{\r\n\t\t\t\tif (refResult[i].sourceLabel.equals(lilyResult[j].sourceLabel) && \r\n\t\t\t\t\trefResult[i].targetLabel.equals(lilyResult[j].targetLabel) &&\r\n\t\t\t\t\t(refResult[i].relationType == lilyResult[j].relationType))\t\t\t\t\t\r\n\t\t\t\t{\r\n\t\t\t\t\tconjunNum++;\r\n\t\t\t\t\tflag=true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!flag){\r\n\t\t\t\tSystem.out.println(\"遗漏:\"+refResult[i].sourceLabel+int2type(refResult[i].relationType)+refResult[i].targetLabel);\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void actionPerformed(ActionEvent event)\n {\n if(Database.checkUniqueCountyID(Integer.parseInt(Database.getUserInfo().get(7)))){ //if no election for that county\n electionIndex = insertElections(); //insert into election table\n Database.insertCandidates(candidates, electionIndex); //insert into candidates table\n }\n else{\n enterCandidateArea.setText(\"Ballot already created for \" + Database.getUserInfo().get(5) + \" county\");\n }\n for(Map.Entry<String,ArrayList<String>> e : candidates.entrySet()){ //clear ballot creation\n e.setValue(null );\n e.setValue(new ArrayList<String>() );\n }\n showCandidatesArea.setText(\"\");\n }", "public static void main(String[] args) {\r\n \t\r\n \tfor (int i = 0; i < 20; ++i)\r\n System.out.println(i + \" - Unique Ways DP : \" + countUniqueCombinationsDP(i)\r\n\t\t\t \t\t + \", Unique Ways Recursive : \" + countUniqueCombinationsR(i));\r\n }", "public void addTotalNumberOfCombinations(int nr);", "private void apriori(){\n HashMap<BitSet, Integer> frequentItemsBit = new HashMap<>();\n HashMap<BitSet, Integer> allAssociations = new HashMap<>();\n \n // Put all the 1-itemsets in frequent item hashmap. It will be scanned\n // for getting k-itemsets and cleared iteratively. \n for (int i = 0; i < frequentItemListSetLenOne.size(); i++) {\n BitSet bitSet = new BitSet(bitsetLen);\n bitSet.set(i, true);\n frequentItemsBit.put(bitSet, frequentItemListSetLenOne.get(i).getValue());\n }\n\n int currentK = 1;\n boolean emptyFrequentSet = false;\n \n while (!emptyFrequentSet) {\n \n // create candidates\n if(currentK > 1){\n HashMap<BitSet, Integer> frequentItemsBitT = (HashMap)frequentItemsBit.clone();\n frequentItemsBit.clear();\n frequentItemsBit = candidate_gen(frequentItemsBitT, currentK);\n }\n \n // If no frequent itemSet in current level break\n if(frequentItemsBit.isEmpty())\n break;\n \n // if currentK >= minimumK insert into final list\n if (currentK >= min_itemset_size_K) {\n for (Map.Entry<BitSet, Integer> entry : frequentItemsBit.entrySet()) {\n allAssociations.put(entry.getKey(), entry.getValue());\n }\n }\n currentK++;\n }\n \n printAssociations(allAssociations);\n }", "private void combinationSum3(int[] candidates, int k, int i, int currentSum, int target, List<List<Integer>> response, List<Integer> temp) {\n if (temp.size() == k) {\n\n if (currentSum == target)\n response.add(new ArrayList<>(temp));\n\n\n return;\n }\n\n if (i == candidates.length)\n return;\n\n\n //1. Our choices: We can choose a number from the list any number of times and all the numbers\n for (int s = i; s < candidates.length; s++) {\n\n //if this element is greater than target, then adding it to current sum make bigger than target\n //since,elements are sorted, then all the element after this element are > target\n if (candidates[s] > target)\n break;\n\n //Our constraints : We can't go beyond target, we can take more element than available in array\n if (currentSum + candidates[s] <= target) {\n currentSum += candidates[s];\n temp.add(candidates[s]);\n\n combinationSum3(candidates, k, s + 1, currentSum, target, response, temp);\n\n //backtrack\n temp.remove(temp.size() - 1);\n currentSum -= candidates[s];\n }\n }\n\n }", "@Override\n public String getSolutionCombination(int nbrDigits, int nbrRange, String sizure) {\n\n // randomRange\n int[][] randomRange = new int[2][nbrDigits];\n\n for (int i = 0; i < 2; i++) {\n\n for (int j = 0; j < nbrDigits; j++) {\n\n if (i == 0) {\n\n // Min value limit\n randomRange[i][j] = 0;\n\n } else {\n\n // Max value limit\n randomRange[i][j] = nbrRange;\n\n }\n\n }\n\n }\n\n // inputmachine\n List<Integer> inputMachine = new ArrayList<Integer>();\n\n for (int i = 0; i < nbrDigits; i++) {\n\n inputMachine.add((int) ((randomRange[1][i] - randomRange[0][i]) * Math.random()) + randomRange[0][i]);\n\n log.info(\"test A : \" + inputMachine.get(i) + \" \");\n\n }\n\n // convertListIntegerToString\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < inputMachine.size(); i++) {\n int num = inputMachine.get(i);\n sb.append(num);\n }\n\n return sb.toString();\n\n }", "public void cancelJoinsNLEGJoin() {\n\n List<String> currEG = null;\n List<String> currOuterTP = null;\n\n for (int keyOuter : mapTmpEGtoAllTPs.keySet()) {\n\n if (mapEGtoCancel.get(keyOuter) != null) {\n\n currEG = mapTmpEGtoAllTPs.get(keyOuter);\n\n for (int i = 0; i < currEG.size(); i += 3) {\n\n currOuterTP = new LinkedList<>(currEG.subList(i, i + 3));\n //BUUUUUUUUUUUUG check if it is a ontology\n if (!currOuterTP.get(0).contains(\"?\") && !currOuterTP.get(0).contains(\"#\")\n || !currOuterTP.get(2).contains(\"?\") && !currOuterTP.get(2).contains(\"#\")) {\n\n myDedUtils.cancelDTP(currOuterTP);\n for (int j = i + 3; j < currEG.size(); j += 3) {\n\n totalPairs--;\n }\n }\n\n }\n }\n\n }\n\n }", "private void generateCombination() {\r\n\r\n\t\tfor (byte x = 0; x < field.length; x++) {\r\n\t\t\tfor (byte y = 0; y < field[x].length; y++) {\r\n\t\t\t\tfield[x][y].setValue((byte) newFigure(Constants.getRandom()));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setMultChoices() {\r\n Random randomGenerator = new Random();\r\n int howManyAnswer = randomGenerator.nextInt(6) + 1;\r\n for (int i = 0; i < howManyAnswer; i++) {\r\n int multipleAnswer = randomGenerator.nextInt(6);\r\n checkDuplicate(studentAnswer, multipleAnswer);\r\n\r\n }\r\n }", "private Pair[] bribeCalculateBag(final int maxCards,\n final HashMap<String, Integer> association) {\n final int minMoney = 5;\n final int maxBagSize = 3;\n if (getInventory().getMoney() < minMoney || numberOfIllegals(association) == 0) {\n return calculateBag(maxCards, association);\n }\n Pair[] result;\n if (numberOfIllegals(association) <= 2 || getInventory().getMoney() < minMoney * 2) {\n getInventory().getBagToGive().setBribe(minMoney);\n getInventory().setMoney(getInventory().getMoney() - minMoney);\n int duplicate = findIllegal(association);\n removeOneAsset(findIllegal(association));\n if (duplicate == findIllegal(association)) {\n result = new Pair[1];\n result[0] = new Pair<>(findIllegal(association), 2);\n getInventory().setNumberOfDeclared(2);\n } else {\n if (findIllegal(association) == -1) {\n result = new Pair[1];\n result[0] = new Pair<>(duplicate, 1);\n getInventory().setNumberOfDeclared(1);\n } else {\n result = new Pair[2];\n result[0] = new Pair<>(duplicate, 1);\n result[1] = new Pair<>(findIllegal(association), 1);\n getInventory().setNumberOfDeclared(2);\n }\n }\n removeOneAsset(findIllegal(association));\n getInventory().setDeclaredAssets(0);\n return result;\n } else {\n getInventory().getBagToGive().setBribe(minMoney * 2);\n getInventory().setMoney(getInventory().getMoney() - (minMoney * 2));\n int contor = maxCards - 1;\n final int contorStart = contor;\n int[] resultAux = new int[maxBagSize];\n getInventory().setDeclaredAssets(0);\n while (contor > 0 && findIllegal(association) != -1) {\n resultAux[findIllegal(association) % maxBagSize]++;\n removeOneAsset(findIllegal(association));\n contor--;\n }\n getInventory().setNumberOfDeclared(contorStart - contor);\n getInventory().setDeclaredAssets(0);\n contor = 0;\n for (int it : resultAux) {\n if (it != 0) {\n contor++;\n }\n }\n result = new Pair[contor];\n if (contor == maxBagSize) {\n result = new Pair[maxBagSize];\n result[0] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n result[1] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n result[2] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n } else {\n if (contor == 1) {\n result = new Pair[1];\n if (resultAux[0] > 0) {\n result[0] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n }\n if (resultAux[1] > 0) {\n result[0] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n }\n if (resultAux[2] > 0) {\n result[0] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n }\n } else {\n result = new Pair[2];\n int i = 0;\n if (resultAux[0] > 0) {\n result[i] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n i++;\n }\n if (resultAux[1] > 0) {\n result[i] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n i++;\n }\n if (resultAux[2] > 0) {\n result[i] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n }\n }\n }\n return result;\n }\n\n }", "public void Pairs()\r\n {\n int pairsize = 0;\r\n int ind1 = 0;\r\n for(int i = 0; i < 5; i++){\r\n// while(cards[i].getNumber() != pairnum){\r\n for(int j = i+1; j < 5; j++)\r\n {\r\n if(cards[i].getFace().equals(cards[j].getFace()))\r\n {\r\n ind1 = i;\r\n if(pairsize < 3){\r\n pairsize += 1;\r\n// paircounts += 1;\r\n }\r\n if(cards[i].compareTo(cards[ind1]) > 0){\r\n// Maxpair = cards[i].getNumber();\r\n index = i;\r\n }\r\n \r\n }\r\n }\r\n// }\r\n }\r\n if(pairsize == 1)\r\n Judge = 2;\r\n if(pairsize == 2)\r\n Judge = 3;\r\n if(pairsize == 3)\r\n Judge = 6;\r\n }", "private int getCBAnswers() {\n CheckBox cbAns1 = findViewById(R.id.multiplication);\n CheckBox cbAns2 = findViewById(R.id.subtraction);\n CheckBox cbAns3 = findViewById(R.id.addition);\n CheckBox cbAns4 = findViewById(R.id.division);\n if (cbAns2.isChecked() && cbAns3.isChecked() && cbAns4.isChecked() && !cbAns1.isChecked()) {\n return 1;\n } else {\n return 0;\n }\n }", "public void candidateSelection(int n, int k, int m) //method that gives political selectors the amount of people (nodes) to go\n {\n Node forward; //node that represents the selector going clockwise \n Node backward; //node that represents the selector going counter-clockwise\n forward = Head; //clockwise selector starts at the first node\n backward = Tail; //counter-clockwise selector starts at the last node\n writer.println(\" \");\n writer.println(\"N = \" + n + \", \" + \"k = \" + k + \", \" + \"m = \" + m);\n writer.println(\" \");\n writer.println(\"Output\");\n writer.println(\"------\");\n if (m > n) //if so that the counter-clockwise selector doesn't waste time circling\n { \n m = m % n;\n }\n if (k > n) //if so that the clockwise selector doesn't waste time circling\n { \n k = k % n;\n }\n while (cand > 0) //as long as the candidates in the circle are > 0\n {\n for (int x = n - 1; x > (n - m); x--) //iterates until backward is on the person m away\n {\n backward = backward.getPrev();\n }\n for (int x = 1; x < k; x++) //iterates until forward is on the the person k away\n {\n forward = forward.getNext();\n }\n if (forward.getData() == backward.getData()) //if the selectors end\n { //on the same person\n writer.println(forward.getData()); //only print once, for\n delete(forward.getData()); //they are worthy\n backward = backward.getPrev(); //but still remove them\n forward = forward.getNext(); //from the circle and set\n } //the selectors on the next candidates\n else \n {\n writer.println(forward.getData() + \" \" + backward.getData());\n delete(backward.getData()); //if the selectors aren't on the\n delete(forward.getData()); //same candidate, remove both\n forward = forward.getNext(); //for they are not worthy,\n backward = backward.getPrev(); //then move the selectors to the\n if (cand == 2) //next candidates\n {\n backward = backward.getPrev(); //resloves an error that I was suffering\n } //with the last 2 lines of output\n }\n }\n }", "public int getMaxCombinationsInRegion();", "public ArrayList<Chair> combinations(ArrayList <Chair> item, String type, int amount) {\n for (int i = 0; i < item.size(); i++)\n {\n Chair temp = item.get(i);\n if (temp.getType() == type)\n myType.add(temp);\n }\n int legs = 0;\n int arms = 0;\n int seat = 0;\n int cushion = 0;\n\n for (int i = 0, i<myType.size(); i++)\n {\n Chair temp = item.get(i);\n if (temp.getLegs() == 'Y')\n legs++;\n if (temp.getArms() == 'Y')\n arms++;\n if (temp.getSeat() == 'Y')\n seat++;\n if (temp.getCushion() == 'Y')\n cushion++;\n }\n\n if (legs < amount || arms < amount || seat < amount || cushion < amount)\n ///call Manufacturing class\n\n else {\n List<String> list = new List <String>();\n for (String id : myType.getID()) //can be replaced with for loop of I did this wrong\n list.add(id);\n\n String[] passID = list.toArray(String[]::new);\n int set = myType.size();\n int maxmimum = 4*amount;\n if (set<maximum)\n maximum = set;\n powerSet(passID, maximum);\n }\n }", "static int countFriendsPairings(int n) \n { \n int a = 1, b = 2, c = 0; \n if (n <= 2) { \n return n; \n } \n for (int i = 3; i <= n; i++) { \n c = b + (i - 1) * a; \n a = b; \n b = c; \n } \n return c; \n }", "public HashSet<OWLClass> getCycleCausingNames(){\n\t\tHashSet<OWLClass> cycleCausing = new HashSet<>();\n\t\t//Belongs to SCC > 1 in size...\n\t\ttarj.getStronglyConnectComponents()\n\t\t\t\t.stream()\n\t\t\t\t.filter(components -> components.size() > 1)\n\t\t\t\t.forEach(cycleCausing::addAll);\n\n\t\t//...or defined in terms of self\n\t\tfor(GraphBuilder.Vertex v : g.values()){\n\t\t\tif(v.joinedToSelf){\n\t\t\t\tcycleCausing.add(v.value);\n\t\t\t}\n\t\t}\n\t\treturn cycleCausing;\n\t}", "public static void main(String[] args) {\n TargetSumCombination obj = new TargetSumCombination();\n int nums[] = {1,1,1};\n int res[] = new int[nums.length];\n obj.giveCombinations(nums, res, 0);\n System.out.println(\"-----------------\");\n obj.giveCombinations1(nums, res, 0);\n }", "public static void useCabinets (String item, Tile tile, Player player){\n\n if(!cabinetUsed) {\n if (item.equalsIgnoreCase(tile.gettIntractable())) {\n if (firstInteraction) {\n System.out.println(\"You shift the cabinet onto it's back.\");\n firstInteraction = false;\n }\n System.out.println(\"You place your hand on the locks dial and remembering the markings from before\\n(4b*1c-5e, (2e*4b%3d)+2d, 3d+=3d) you enter -\");\n Scanner code = new Scanner(System.in);\n int[] combination = new int[3];\n for (int i = 0; i < combination.length; ) {\n if (i == 0) {\n System.out.println(\"The first number:\");\n } else if (i == 1) {\n System.out.println(\"The second number:\");\n } else if (i == 2) {\n System.out.println(\"The third number:\");\n }\n System.out.print(\">\");\n try {\n\n int temp = code.nextInt();\n code.nextLine();\n if (temp >= 0 && temp <= 35) {\n combination[i] = temp;\n i++;\n } else {\n System.out.println(\"The lock only takes numbers from 0-35\");\n }\n } catch (Exception e) {\n System.out.println(\"The lock only takes numbers from 0-35\");\n code.nextLine();\n }\n }\n System.out.println(\"You turn the dial clockwise to \" + combination[0] + \".\\nThen counterclockwise to \" + combination[1] + \".\\nFinally clockwise once more to \" + combination[2]);\n if ((combination[0] == 26) && (combination[1] == 17) && (combination[2] == 28)) {\n System.out.println(\"\"\"\n \n The numbers match and the lock opens.\n You find the Hazmat suit and dosimeter inside, a small key and a thick pile of rouble bills.\n \n Putting the heavy suit on is an ordeal though, and you half-collapse from the effort,\n losing your hold on the key and roubles, which scuttle away, back from where you came.\n \n \"\"\");\n player.addItems(\"hazmat\");\n tile.settItems(\"roubles\");\n tile.settItems(\"key\");\n player.setHasProtectiveClothing(true);\n cabinetUsed = true;\n } else {\n System.out.println(\"The lock doesn't budge perhaps I got it wrong.\\nYou step back from the cabinet to think about it.\");\n }\n calculateDamage(player, tile);\n }\n }else{\n System.out.println(\"There is nothing else to use in the cabinet\");\n }\n\n }", "public int possibleCombinations(\r\n\t\t\tList< Scenario > first,\r\n\t\t\tList< Scenario > second\r\n\t\t\t) {\r\n\t\treturn first.size() * second.size();\r\n\t}", "public static void printcom( int cb,int n ,int bssf , int r , String asf){\n if(cb==n)///cb==tb\n {\n if(bssf==r)//box selected so far==number of boxes to be selected\n {\n System.out.println(asf); \n }\n return;\n }\n\n //no loop required when number of choices are same at each level\n\n \n //box selected \n printcom(cb+1 , n , bssf+1 , r , asf+cb);\n //box rejected\n printcom(cb+1 , n , bssf , r , asf); \n \n \n\n \n }", "public static void main(String[] args) {\n //\n // define set of fruits\n Set<String> fruits = \n ImmutableSet.<String>builder()\n .add(\"apple\")\n .add(\"orange\")\n .add(\"banana\")\n .add(\"guava\")\n .build();\n\n // all combinations\n Set<Set<String>> fruitsPowerSet = Sets.powerSet(fruits);\n\n // print combinations\n for (Set<String> fruit : fruitsPowerSet) {\n System.out.println(fruit);\n }\n }", "public static void printComb(int[] numbers) {\n\t\tSystem.out.print(\"\\n\\n\\t|\");\n\t\t//create a variable in order to print a better visual of the possible combinations\n\t\tint count = 6;\n\t\t/** Created a main loop in order to run all the positions using every time, as a first number \n\t\t * between the two numbers that must be picked */\n\t\tfor (int i = 0; i < numbers.length; i++) {\n\t\t\t/** Created a nested for loop in order to run all the positions of the array variable as \n\t\t\t * a second number between of the two numbers picked */\n\t\t\tfor (int j = 0; j < numbers.length; j++) {\n\t\t\t\t/** created an if statement in order of\n\t\t\t\t * only avoid the same position in every loop */\n\t\t\t\tif (i != j) {\n\t\t\t\t\t\n\t\t\t\t\t//created a if statement in order to print only five combinations each line, making a better visualization\n\t\t\t\t\tif(count > 0) {\n\t\t\t\t\t\tSystem.out.print( numbers[i] + \" - \" + numbers[j] + \"\\t|\");\n\t\t\t\t\t\tcount--;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.print(\"\\n\\t|\");\n\t\t\t\t\t\tSystem.out.print(numbers[i] + \" - \" + numbers[j] + \"\\t|\");\n\t\t\t\t\t\tcount = 5;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}//closing the if statement\n\t\t\t}//closing the nested for loop\n\t\t}//closing the main for loop\n\t}", "int numberOfCandidates();", "public void check4winner(){\n String winner = \"\";\n //checking different combinations\n if((circle1 && circle2 && circle3) ||\n (circle4 && circle5 && circle6) ||\n (circle7 && circle8 && circle9) ||\n (circle1 && circle4 && circle7) ||\n (circle2 && circle5 && circle8) ||\n (circle3 && circle6 && circle9) ||\n (circle1 && circle5 && circle9) ||\n (circle3 && circle5 && circle7)){\n //highlighting the winning combination\n if((circle1 && circle2 && circle3)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton1);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton2);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton3);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((circle4 && circle5 && circle6)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton4);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton5);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton6);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((circle7 && circle8 && circle9)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton7);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton8);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton9);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((circle1 && circle4 && circle7)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton1);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton4);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton7);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((circle2 && circle5 && circle8)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton2);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton5);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton8);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((circle3 && circle6 && circle9)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton3);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton6);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton9);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((circle1 && circle5 && circle9)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton1);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton5);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton9);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((circle3 && circle5 && circle7)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton3);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton5);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton7);\n vv.setImageResource(R.drawable.redbox);\n }\n\n winner = \"circlewins\";\n winner(winner);\n } else if((cross1 && cross2 && cross3) ||\n (cross4 && cross5 && cross6) ||\n (cross7 && cross8 && cross9) ||\n (cross1 && cross4 && cross7) ||\n (cross2 && cross5 && cross8) ||\n (cross3 && cross6 && cross9) ||\n (cross1 && cross5 && cross9) ||\n (cross3 && cross5 && cross7)){\n\n if((cross1 && cross2 && cross3)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton1);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton2);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton3);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((cross4 && cross5 && cross6)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton4);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton5);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton6);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((cross7 && cross8 && cross9)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton7);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton8);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton9);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((cross1 && cross4 && cross7)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton1);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton4);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton7);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((cross2 && cross5 && cross8)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton2);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton5);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton8);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((cross3 && cross6 && cross9)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton3);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton6);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton9);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((cross1 && cross5 && cross9)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton1);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton5);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton9);\n vv.setImageResource(R.drawable.redbox);\n }\n if ((cross3 && cross5 && cross7)){\n ImageButton vv = (ImageButton) findViewById(R.id.imageButton3);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton5);\n vv.setImageResource(R.drawable.redbox);\n vv = (ImageButton) findViewById(R.id.imageButton7);\n vv.setImageResource(R.drawable.redbox);\n }\n\n winner = \"crosswins\";\n winner(winner);\n } else {\n return;\n }\n }", "@Test\n\tpublic void classificationTest(){\n\n\t\tJavaPairRDD<String, Set<String>> javaRDD = javaSparkContext.textFile(\"/Downloads/book2-master/2rd_data/ch02/Gowalla_totalCheckins.txt\")\n\t\t\t\t.map(line -> line.split(\"~\"))\n\t\t\t\t.map(s -> new AppDto(s[0],s[1],s[2],s[3],s[4]))\n\t\t\t\t.mapToPair(app -> {\n\t\t\t\t\tSet<String> setIntro = Arrays.stream(app.getIntroduction().split(\" \"))\n\t\t\t\t\t\t\t.map(s -> s.split(\"/\"))\n\t\t\t\t\t\t\t.filter(ss -> ss[0].length()>1 && (ss[1].equals(\"v\") || ss[1].indexOf(\"n\")>-1))\n\t\t\t\t\t\t\t.map(ss -> ss[0]).collect(Collectors.toSet());\n\n\t\t\t\t\treturn new Tuple2<>(app.getCls(), setIntro);\n\t\t\t\t});\n\n\t\tjavaRDD.map(t -> t._2).zipWithIndex();\n\t}", "static void whatFlavors(int[] cost, int money) {\n Map<Integer, List<Integer>> priceVsIndexMap = new HashMap<>();\n for(int i = 0; i < cost.length; i++) {\n int price = cost[i];\n List<Integer> entry = priceVsIndexMap.get(price);\n if(entry == null) {\n entry = new ArrayList<>();\n priceVsIndexMap.put(price, entry);\n }\n entry.add(i);\n }\n for(int i = 0; i < cost.length; i++) {\n List<Integer> entry = priceVsIndexMap.get(cost[i]);\n if(entry.size() > 1) {\n if(cost[entry.get(0)] + cost[entry.get(1)] == money) {\n System.out.println((entry.get(0)+1) +\" \"+ (entry.get(1)+1));\n break;\n }\n } else {\n int diff = money - cost[entry.get(0)];\n if(priceVsIndexMap.containsKey(diff)) {\n List<Integer> otherEntry = priceVsIndexMap.get(diff);\n if(entry.get(0) != otherEntry.get(0)) {\n System.out.println((entry.get(0)+1) +\" \"+ (otherEntry.get(0)+1));\n break;\n }\n }\n\n }\n }\n\n }", "private int pickBlueChampion(String cN) {\n\t\tif (bannedChamps.contains(cN) || bluePicks.contains(cN) || purplePicks.contains(cN)) {\n\t\t\treturn -1;\n\t\t}\n\t\tURL url = getClass().getResource(\".coredata/championicons/\" + cN + \"Square.png\");\n\t\tImageIcon champIcon = new ImageIcon(Toolkit.getDefaultToolkit().getImage(url));\n\t\tJLabel champLabel = new JLabel();\n\t\tchampLabel.setIcon(champIcon);\n\t\tleftPanel.add(champLabel, new Integer(2));\n\t\tint i = numBluePicks;\n\t\tchampLabel.setBounds(91, 22 + 99*i, 64, 64);\n\t\tbluePicks.add(cN);\n\t\tnumBluePicks += 1;\n\t\treturn 0;\n\t}", "public static void printGivenAndGeneratedCombinations() {\n\t\tSystem.out.println(GENERATE_START);\n\t\t\n\t\tfor(int row = 0; row < SAFE_COMBINATIONS.length; row++) {\n\t\t\tfor(int col = 0; col < SAFE_COMBINATIONS[0].length; col++) {\n\t\t\t\tSystem.out.print(SAFE_COMBINATIONS[row][col] + COMMA);\n\t\t\t}\n\t\t\tSystem.out.print(true + NEWLINE);\n\t\t}\n\t\t\n\t\tSystem.out.println(LINE_BREAK);\n\t\t\n\t\tfor(int i = 0; i < 10; i++) {\n\t\t\tprintGeneratedCombination();\n\t\t}\n\t\t\n\t}", "public String solve(long n, long a, long b, long c, long d, long x0, long y0, long m)\n {\n long[] count = new long[9];\n long x = x0;\n long y = y0;\n for (long t = 0; t < n; t++)\n {\n// System.out.println(x + \", \" + y);\n int i = (int) (x % 3) * 3 + (int) (y % 3);\n count[i]++;\n x = (a * x + b) % m;\n y = (c * y + d) % m;\n }\n\n long totalCount = 0;\n for (int i1 = 0; i1 < 9; i1++)\n {\n long count1 = count[i1];\n if (count1 == 0)\n {\n continue;\n }\n count[i1]--;\n for (int i2 = i1; i2 < 9; i2++)\n {\n long count2 = count[i2];\n if (count2 == 0)\n {\n continue;\n }\n count[i2]--;\n int x1 = i1 / 3;\n int y1 = i1 % 3;\n int x2 = i2 / 3;\n int y2 = i2 % 3;\n int x3 = (3 - (x1 + x2) % 3) % 3;\n int y3 = (3 - (y1 + y2) % 3) % 3;\n int i3 = (x3 % 3) * 3 + (y3 % 3);\n long count3 = count[i3];\n if (i3 >= i2 && count3 > 0)\n {\n // either i1==i2==i3 OR i1!=i2!=i3; you can never have only two i's the same.\n if (i1 == i2 && i2 == i3)\n {\n totalCount += calcCombinations(count1);//the first count value is the genuine count for that x,y coordinate.\n }\n else\n {\n totalCount += count1 * count2 * count3;\n }\n }\n count[i2]++;\n }\n count[i1]++;\n }\n\n return String.valueOf(totalCount);\n }", "public int candy(int[] ratings) {\n int result = 0;\n if (ratings == null || ratings.length == 0) {\n return 0;\n }\n int cur = 1;\n for (int i = 0; i < ratings.length; ++i) {\n //At the beginning of each iteration, cur is the possible candies satisfying \n //left side constraint\n if (i == ratings.length - 1 || ratings[i] <= ratings[i + 1]) {\n result += cur;\n if (i < ratings.length - 1 && ratings[i] < ratings[i + 1]) {\n cur++;\n } else {\n cur = 1;\n }\n } else {\n int count = 0;\n for (; i < ratings.length - 1 && ratings[i] > ratings[i + 1]; ++i, ++count);\n int newCur = 1 + count;\n result += Math.max(cur, newCur);\n result += (1 + count) * count / 2;\n if (i < ratings.length - 1 && ratings[i] == ratings[i + 1]) {\n cur = 1;\n } else {\n cur = 2;\n }\n }\n }\n return result;\n }", "public void triplet(int[] b,int n){\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tfor(int j=i+1;j<n-1;j++){\r\n\t\t\t\tfor(int k=j+1;k<n-2;k++){\r\n\t\t\t\t\tif(b[i]+b[j]+b[k]==0){\r\n\t\t\t\t\t\tSystem.out.println(b[i]+\" \"+b[j]+\" \"+b[k]);\r\n\t\t\t\t\t\tcount++;\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\tSystem.out.println(\"no of distinct triplet is:\"+count);\t\r\n\r\n\t}", "static void palabras(){\n palabras=(stateCountS-1)*(stateCountP-1);\n System.out.println(\"S: \"+(stateCountS-1)+\" P: \"+(stateCountP-1)+\"palabras: \"+palabras);\n int coincidencias=0;\n for(int i=0;i<100005;i++){\n for(int j=0;j<26;j++){\n if(gs[i][j]!=0 && gs[i][j]!=-1 && gp[i][j]!=0 && gp[i][j]!=-1 && gs[i][j]==gp[i][j]){\n ++coincidencias;\n }\n }\n \n }\n System.out.println(coincidencias);\n \n palabras=palabras-coincidencias;\n System.out.println(palabras);\n }", "public void getChampionBans() {\n\t\tcreateBlueBanHighlight();\n\t\tcreatePurpleBanHighlight();\n\t\tblueBan = true;\n\t\tArrayList<String> temp = CHAMPIONLIST;\n\t while (numBlueBans < 3 || numPurpleBans < 3) {\n\t \ttry {\n\t \t\tArrayList<String> aL = findChampions();\n\t \t\tif (!aL.equals(temp)) {\n\t \t\t\taddChampions(panel, aL);\n\t \t\t\ttemp = aL;\n\t \t\t}\n\t \t\tThread.sleep(100);\n\t \t} catch (InterruptedException e) {\n\t \t\tcontinue;\n\t \t}\n\t }\n\t}", "public void can_counter()\n {\n candidate_count=0;\n for (HashMap.Entry<String,Candidate> set : allCandidates.entrySet())\n {\n candidate_count++;\n }\n }", "@Test\n public void checkIfPassportAndDefaultCombinationReturnsHighConfidencePassport() {\n triplets.add(new Triplets<String, Integer, Double>(\"dummy\", 1, 90.00));\n triplets.add(new Triplets<String, Integer, Double>(\"passport\", 2, 90.00));\n triplets.add(new Triplets<String, Integer, Double>(\"passport\", 3, 190.00));\n Triplets<String, Integer, Double> resultTriplet = Triplets.rankRecords(triplets);\n Assert.assertEquals(\"passport\", resultTriplet.getLabel());\n Assert.assertEquals(new Integer(3), resultTriplet.getImageNumber());\n Assert.assertEquals(new Double(190.00), resultTriplet.getMatchConfidence());\n }", "private String[] findSuitableK(String[] trainingDataSet){\n\t\ttry{\n\t\t\t\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tthrow ex;\n\t\t}\n\t\tfinally{\n\t\t\t\n\t\t}\n\t\t\n\t\treturn new String[]{\"neighbor1\", \"neighbor2\", \"neighbor3\"};\n\t}", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint t=sc.nextInt();\n\t\tint pike=sc.nextInt();\n\t\tint pick=sc.nextInt();\n\t\tint total=sc.nextInt();\n\t\tint out=0;\n\t\tfor(int count=0;count*t<=total;count++) {\n\t\t\tfor(int count2=0;count2*pike<=total;count2++) {\n\t\t\t\tfor(int count3=0;count3*pick<=total;count3++) {\n\t\t\t\t\tif(count!=0||count2!=0||count3!=0) {\n\t\t\t\t\t\tif(count*t+count2*pike+count3*pick<=total) {\n\t\t\t\t\t\t\tSystem.out.println(count+\" Brown Trout, \"+count2+\" Northern Pike, \"+count3+\" Yellow Pickerel\");\n\t\t\t\t\t\t\tout++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Number of ways to catch fish: \"+out);\n\t\tsc.close();\n\t\t\n\t}", "public void printRemainingCouncilors(CouncillorsPool pool);", "private static void banFeature(ArrayList t) {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\t\tSystem.out.print(\"Word cut : [\");\n\t\tint idx = 0;\n\t\twhile (i.hasNext()) {\n\t\t\tString s = (String) i.next();\n\t\t\tInteger df = (Integer) Utility.vocabHM.get(s);\n\n\t\t\tif (t.contains(s)){\n\t\t\t\tSystem.out.print(s+\", \");\n\t\t\t\ti.remove();\n\t\t\t\tidx++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"]\\n ::banned::\"+idx+\" feature.\");\n\t}", "private void createCNSHIsFullCNCHHasOnlyOnePlace() {\r\n createStudentList(new Student(\"Vasile Ana\", 10), new Student(\"Marin Alina\", 6), new Student(\"Ilie David\", 8), new Student(\"Gheorghe Alex\", 9));\r\n createSchoolList(new School(\"C.N.S.H.\", 0), new School(\"C.N.C.H.\", 1), new School(\"C.N.A.E.\", 10));\r\n createStudentPreferences(new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1])), new LinkedList<>(Arrays.asList(schools[0], schools[2])));\r\n createSchoolPreferences(new LinkedList<>(Arrays.asList(students[3], students[0], students[1], students[2])), new LinkedList<>(Arrays.asList(students[0], students[2], students[1])), new LinkedList<>(Arrays.asList(students[0], students[1], students[3])));\r\n }", "public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"art2.in\"));\n PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"art2.out\")));\n int len=Integer.parseInt(br.readLine());\n int[] list=new int[len];\n for(int i=0;i<len;i++)\n list[i]=Integer.parseInt(br.readLine());\n\n //finds the troll test case\n boolean symmetric=true;\n for(int i=0;i<len;i++)\n if(list[i]!=list[len-i-1]) {\n symmetric = false;\n break;\n }\n if(symmetric){\n pw.println(len/2);\n pw.close();\n return;\n }\n\n DisjointSet disjointSet=new DisjointSet(len,list);\n HashMap<Integer,Range> ranges=new HashMap<>(len/10);\n int totalColors=0;\n for(int i=0;i<len;i++){\n if(list[i]==0)\n continue;\n if(!ranges.containsKey(list[i])) {\n ranges.put(list[i],new Range(i, i));\n totalColors++;\n }\n else\n ranges.get(list[i]).end=i;\n }\n\n// System.out.println(Arrays.toString(ranges));\n int iter=0;\n int colorsUsed=0;\n// System.out.println(Arrays.toString(disjointSet.parent));\n while(true){\n int foundThisIter=0;\n HashSet<Integer> connectionSpots=new HashSet<>();\n ArrayDeque<Integer> toRemove=new ArrayDeque<>(ranges.size());\n for(int e:ranges.keySet()){\n Range cur=ranges.get(e);\n if(disjointSet.find(cur.start)==disjointSet.find(cur.end)){\n connectionSpots.add(cur.start);\n connectionSpots.add(cur.end);\n toRemove.add(e);\n colorsUsed++;\n foundThisIter++;\n }\n\n }\n\n if(foundThisIter==0)\n break;\n if(colorsUsed==totalColors)\n break;\n for(int e:toRemove){\n ranges.remove(e);\n }\n for(int e:connectionSpots){\n// System.out.println(e);\n if(e-1>=0&&list[e-1]!=0)\n disjointSet.union(e,e-1);\n if(e+1<list.length&&list[e+1]!=0)\n disjointSet.union(e,e+1);\n }\n\n\n iter++;\n }\n// System.out.println(iter+1);\n if(colorsUsed!=totalColors)\n pw.println(-1);\n else\n pw.println(iter+1);\n pw.close();\n }", "public static boolean[] solution_used(int[][] dp_array,int objects,int capacity){\r\n\r\n boolean[] opt_set = new boolean[objects+1]; // to store solutions\r\n int Items = 0;\r\n int i = dp_array.length-1;\r\n for (int j = dp_array[0].length - 1; j >= 0 && i > 0;i--) {\r\n if (dp_array[i][j] != dp_array[i-1][j]) { // trace back algorithm\r\n opt_set[i-1] = true ; // set the array value true if the values are used\r\n j -= randvariables[i-1];\r\n Items++;\r\n }\r\n }\r\n return Arrays.copyOfRange(opt_set, 0, objects); //return the items\r\n }", "public void sensibleMatches2() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n for (String eachClient : clientMap.keySet()) \n {\n if (!eachClient.equals(\"Hal\")) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }\n }", "public int evaluate(PentagoBoardState pbs) {\n PentagoBoardState.Piece[][] pieces = pbs.getBoard();\n\n\n int whitescore =0; //keep track of white's total score\n int blackscore = 0;//keep track of black's total score\n\n //Check rows\n for (int x = 0; x <6 ; x++) {\n int countWHori = 0;\n int countBHori = 0;\n\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = 0; y <5 ; y++) {\n //Count how many black and white pieces\n if (pieces[x][y].ordinal() == 0 ) {\n\n //countBHori = countBHori + countvalue;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWHori = countWHori +countvalue;\n whites++;\n }\n\n //Check for consecutive\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n\n //Check for disjoint and joint set If * B B W * * then disjoint and * B B * B * Then joint set for B * B\n if (y!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 && pieces[x][y+2].ordinal() == 1){\n countBHori = countBHori +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 && pieces[x][y+2].ordinal() == 0){\n countWHori = countWHori +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 0){\n countBHori = countBHori +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 1){\n countWHori = countWHori +jointset;\n }\n }\n }\n //check if unwinnable\n if (blacks == 4 && whites==2){\n countBHori += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWHori += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countWHori += unwinnable;\n countBHori += unwinnable;\n }\n\n\n //Run value for row in evaluation scheme and add to total score\n int valuew = consecutivevalue(countWHori);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBHori);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec hori \" + valueb + \"White consec hori \" + valuew);\n\n }\n\n //Check Verticals\n for (int y = 0; y <6 ; y++) {\n int countWvert = 0;\n int countBvert = 0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int x = 0; x <5 ; x++) {\n if (pieces[x][y].ordinal() == 0) {\n\n //countBvert = countBvert +1;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWvert = countWvert +1;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n\n if (x!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 1){\n countBvert = countBvert +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 0){\n countWvert = countWvert +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0){\n countBvert = countBvert +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1){\n countWvert = countWvert +jointset;\n }\n }\n }\n\n if (blacks == 4 && whites==2){\n countBvert += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBvert += unwinnable;\n countWvert += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWvert += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBvert + \"White consec \" + countWvert);\n int valuew = consecutivevalue(countWvert);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBvert);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec VERT \" + valueb + \"White consec hori \" + valuew);\n }\n\n //S West N EAST Top\n for (int a = 1; a <6 ; a++) { //loop through all diagonal lines\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = a; y !=0 ; y--) { //loop through one diagonal line\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +2;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n // check for joint and disjoint set at these x y coordinates by looking 2 pieces ahead\n if (x==0 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==0 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n\n x++;\n\n\n }\n if (blacks == 4 && whites==2){\n countBdiagSoNe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n //S West N EAST Bot\n for (int a = 1; a <5 ; a++) {\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int y=5;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n if (x==1 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n //System.out.println(x + \" y:\" + y +\" Black consec DIAGOMAAL \" + countBdiagSoNe + \"White consec hori \" + countWdiagSoNe);\n y--;\n\n\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n /*if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }*/\n if (a==1&& blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n\n //NorthWest S EAST Left\n for (int a = 0; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int y=0;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n //System.out.println(pbs+\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n y++;\n\n\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n if (blacks == 4 && whites==2){\n countBdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagNoSe += unwinnable;\n countWdiagNoSe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n //NorthWest S EAST Right\n for (int a = 1; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n for (int y = a; y <5 ; y++) {\n //System.out.println(\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0 ) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n x++;\n\n\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n\n\n\n\n\n //System.out.println(\"Black consec score \" + blackscore +\" \" + \"White consec scpre \" + whitescore);\n //System.out.println(\"max player is \" + maxplayer + \"My colour is \" + mycolour);\n int i = -123456789;\n if (mycolour == 0){\n //System.out.println(blackscore-whitescore +\" I am black\");\n\n\n i= blackscore-whitescore;\n return i;\n\n }\n else {\n //System.out.println(whitescore-blackscore +\" I am white\");\n i= whitescore-blackscore;\n return i;\n }\n /*\n if(i>0 && i<1000){\n return 100; //i*2;\n }\n else if(i>=1000 && i<10000){\n return 1000; //i*10;\n }\n else if(i>=10000 && i<100000){\n return 10000; //i*50;\n }\n else if(i>=100000){\n return 100000;//i*500;\n }\n else if(i<=0 && i>-100){\n return -100; //i*2;\n }\n else if(i<=-100 && i>-1000){\n return -1000; //i*10;\n }\n else if(i<=-1000 && i>-10000){\n return -10000; //i*50;\n }\n else if(i<=0 && i>-100000){\n return -100000;//i*500;\n }\n\n */\n\n\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int cases = scanner.nextInt();\n\n for (int i = 0; i < cases; i++) {\n int contestants = scanner.nextInt();\n\n if (contestants <= 1) {\n System.out.println(contestants);\n continue;\n }\n\n int [] skillList = new int[contestants];\n\n for (int j = 0; j < contestants; j++) {\n skillList[j] = scanner.nextInt();\n }\n\n Arrays.sort(skillList);\n Map<Integer, Integer> skillLevelFrequency = new LinkedHashMap<Integer, Integer>();\n int skillLevel = skillList[0];\n int frequency = 1;\n\n for (int j = 1; j < contestants; j++) {\n if (skillLevel == skillList[j]) {\n frequency++;\n }\n else {\n skillLevelFrequency.put(skillLevel, frequency);\n skillLevel = skillList[j];\n frequency = 1;\n }\n }\n\n List<Integer> team = new ArrayList<Integer>();\n int minGroupSize = Integer.MAX_VALUE;\n }\n }", "static int waysToGiveACheck(char[][] board) {\n\t\tint[] pawnPos = new int[2];\n\t\tint[] bkPos = new int[2];\n\t\tint[] wkPos = new int[2];\n\t\tint[] forthPos = new int[2];\n\t\tchar fourth = 'x';\n\t\tint answerCount = 0;\n\t\tint hashCount = 0;\n\t\tfor(int board_i = 0; board_i < 8; board_i++){\n\t\t\tfor(int board_j = 0; board_j < 8; board_j++){\n\t\t\t\tswitch(board[board_i][board_j]){\n\t\t\t\tcase 35:\n\t\t\t\t\thashCount++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 80:\n\t\t\t\t\t{pawnPos[0] = board_i;\n\t\t\t\t\tpawnPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tcase 107:\n\t\t\t\t\t{bkPos[0] = board_i;\n\t\t\t\t\tbkPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tcase 75:\n\t\t\t\t\t{wkPos[0] = board_i;\n\t\t\t\t\twkPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tdefault:\n\t\t\t\t\t{forthPos[0] = board_i;\n\t\t\t\t\tforthPos[1] = board_j;\n\t\t\t\t\tfourth = board[board_i][board_j];\n\t\t\t\t\tbreak;}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint xdistPk = Math.abs(pawnPos[0] - bkPos[0]);\n\t\tint ydistPk = Math.abs(pawnPos[1] - bkPos[1]);\n\n\t\tif(xdistPk == ydistPk)\n\t\t\tanswerCount = answerCount+2;\n\t\tif(xdistPk==0)\n\t\t\tanswerCount++;\n\t\tif(ydistPk ==0)\n\t\t\tanswerCount++;\n\t\tif((xdistPk == 2 && ydistPk==1) || (xdistPk == 1 && ydistPk==2) )\n\t\t\tanswerCount++;\n\n\t\treturn answerCount;\n\n\t}", "public static void main(String[] args) {\n Solution s = new Solution();\n System.out.println(s.letterCombinations(\"67\").toString());\n\n }", "private String showWeaponAccusations() {\n\t\tButtonGroup weaponButtons = new ButtonGroup();\n\t\tList<JRadioButton> btns = setupWeaponButtons();\n\t \n\t\t// set up the dialog box\n\t JPanel weaponPanel = new JPanel(new GridLayout(0, 1));\n\t\tJLabel lbl = new JLabel(\"Select the weapon that you suspect.\");\n\t\tweaponPanel.add(lbl);\n\t // add the buttons to the panel\n\t for(JRadioButton b : btns){\n\t \tweaponButtons.add(b);\n\t \tweaponPanel.add(b);\n\t }\n\t \n\t\t// display the dialog box\n\t JOptionPane.showMessageDialog(frame, weaponPanel);\n\t // decide which button was selected\n\t for(JRadioButton b : btns){\n\t \tif(b.isSelected()){\n\t \t\treturn b.getText();\n\t \t}\n\t }\n\t return null;\n\t}", "public void sensibleMatches1() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n Map<String, Set<String>> mapWithoutHal = new HashMap<>(clientMap);\n mapWithoutHal.remove(\"Hal\");\n for (String eachClient : mapWithoutHal.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }", "public void matchingcouple()\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Output :\");\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Following are the matching pairs \");\r\n\t\t\t\t\r\n\t\t\t\tfor(int i=0;i<womenmatchinlist.size();i++)\r\n\t\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t// print the matching pair from same index of men and women matching list\r\n\t\t\t\tSystem.out.println(menmatchinglist.get(i)+\" is engaged with \"+womenmatchinlist.get(i));\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\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 static void main(String[] args) {\n\t\tint n = 4;\n\t\tint index = 0;\n\t\tint a[] = { 1, 1, 2, 2 };\n\t\tString data[] = { \"hackerrank\", \"hacker\" };\n\t\tString partial = \"hak\";\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\n\t\t\tif(a[i] == 1){\n\t\t\t\tString contact = data[index++];\n\t\t\t\tadd(contact);\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"Count: \"+find(partial));\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) \n {\n //Read how many campuses are needed to be solved for\n scan = new Scanner(System.in);\n int n = scan.nextInt();\n \n //Loop through every campus\n for (c = 1; c <= n; c++)\n {\n //Build all the tunnels in the most efficient way\n buildTunnels();\n \n //Check that tunnels connect all the hills and print their result\n printAnswer(connectedHills == h);\n }\n }", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "private boolean getFeedback(TaxonNameBucket[] taxonNameBuckets, TokenSequence text, LinkedHashSet functionalOptions) {\n\t\t\n\t\t//\tdon't show empty dialog\n\t\tif (taxonNameBuckets.length == 0)\n\t\t\treturn false;\n\t\t\n\t\t//\tcreate store for feedback results\n\t\tString[] selectedOptions = new String[taxonNameBuckets.length];\n\t\t\n\t\t//\tcompute number of sets per dialog\n\t\tint dialogCount = ((taxonNameBuckets.length + 9) / 10);\n\t\tint dialogSize = ((taxonNameBuckets.length + (dialogCount / 2)) / dialogCount);\n\t\tdialogCount = ((taxonNameBuckets.length + dialogSize - 1) / dialogSize);\n\t\t\n\t\t//\tbuild dialogs\n\t\tAssignmentDisambiguationFeedbackPanel[] adfps = new AssignmentDisambiguationFeedbackPanel[dialogCount];\n\t\tfor (int d = 0; d < adfps.length; d++) {\n\t\t\tadfps[d] = new AssignmentDisambiguationFeedbackPanel(\"Check Authorities\");\n\t\t\tadfps[d].setLabel(\"<HTML>Please select the appropriate authority for these <B>taxonomic names</B>.\" +\n\t\t\t\t\t\"<BR>Select <I>&lt;Ignore epithet&gt;</I> to not assign the name any authority now.\" +\n\t\t\t\t\t\"<BR>Select <I>&lt;Enter Manually&gt;</I> to manually enter the authority.</HTML>\");\n\t\t\tint dialogOffset = (d * dialogSize);\n\t\t\tfor (int b = 0; (b < dialogSize) && ((b + dialogOffset) < taxonNameBuckets.length); b++) {\n\t\t\t\t\n\t\t\t\t//\tput locations in array\n\t\t\t\tString[] hierarchyOptions;\n\t\t\t\tString selectedHierarchyOption = ENTER_MANUALLY_CHOICE;\n\t\t\t\t\n\t\t\t\thierarchyOptions = new String[taxonNameBuckets[b + dialogOffset].authorities.length + functionalOptions.size()];\n\t\t\t\tSystem.arraycopy(((String[]) functionalOptions.toArray(new String[functionalOptions.size()])), 0, hierarchyOptions, 0, functionalOptions.size());\n\t\t\t\tfor (int h = 0; h < taxonNameBuckets[b + dialogOffset].authorities.length; h++) {\n\t\t\t\t\thierarchyOptions[h + functionalOptions.size()] = (taxonNameBuckets[b + dialogOffset].authorities[h].toString() + \" \" + taxonNameBuckets[b + dialogOffset].authorities[h].getScoreSourceString());\n\t\t\t\t\tif (h == 0)\n\t\t\t\t\t\tselectedHierarchyOption = hierarchyOptions[h + functionalOptions.size()];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tcount occurrences of distinct name strings\n\t\t\t\tStringIndex taxonNameStringCounts = new StringIndex();\n\t\t\t\tfor (Iterator tnit = taxonNameBuckets[b + dialogOffset].iterator(); tnit.hasNext();) {\n\t\t\t\t\tAnnotation taxonName = ((Annotation) tnit.next());\n\t\t\t\t\ttaxonNameStringCounts.add(TokenSequenceUtils.concatTokens(taxonName, true, true));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tbuild epithet & context display (showing each name string only once, though)\n\t\t\t\tStringBuffer epithetContext = new StringBuffer(\"<HTML>\");\n\t\t\t\tfor (Iterator tnit = taxonNameBuckets[b + dialogOffset].iterator(); tnit.hasNext();) {\n\t\t\t\t\tAnnotation taxonName = ((Annotation) tnit.next());\n\t\t\t\t\tString taxonNameString = TokenSequenceUtils.concatTokens(taxonName, true, true);\n\t\t\t\t\tint taxonNameStringCount = taxonNameStringCounts.getCount(taxonNameString);\n\t\t\t\t\tif (taxonNameStringCount == 0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (epithetContext.length() > \"<HTML>\".length())\n\t\t\t\t\t\tepithetContext.append(\"<BR>\");\n\t\t\t\t\tepithetContext.append(buildLabel(text, taxonName, 10));\n\t\t\t\t\tif (taxonName.hasAttribute(PAGE_NUMBER_ATTRIBUTE)) {\n\t\t\t\t\t\tif (taxonNameStringCount > 1)\n\t\t\t\t\t\t\tepithetContext.append(\" (\" + taxonNameStringCount + \" occurrences, first on page \" + taxonName.getAttribute(PAGE_NUMBER_ATTRIBUTE) + \")\");\n\t\t\t\t\t\telse epithetContext.append(\" (page \" + taxonName.getAttribute(PAGE_NUMBER_ATTRIBUTE) + \")\");\n\t\t\t\t\t}\n\t\t\t\t\telse if (taxonNameStringCount > 1)\n\t\t\t\t\t\tepithetContext.append(\" (\" + taxonNameStringCount + \" occurrences)\");\n\t\t\t\t\ttaxonNameStringCounts.removeAll(taxonNameString);\n\t\t\t\t}\n\t\t\t\tepithetContext.append(\"</HTML>\");\n\t\t\t\t\n\t\t\t\t//\tadd to feedback panel\n\t\t\t\tadfps[d].addLine(epithetContext.toString(), hierarchyOptions, selectedHierarchyOption);\n\t\t\t}\n\t\t\t\n\t\t\t//\tadd background information\n\t\t\tadfps[d].setProperty(FeedbackPanel.TARGET_DOCUMENT_ID_PROPERTY, ((Annotation) taxonNameBuckets[dialogOffset].get(0)).getDocumentProperty(DOCUMENT_ID_ATTRIBUTE));\n\t\t\tadfps[d].setProperty(FeedbackPanel.TARGET_PAGE_NUMBER_PROPERTY, ((Annotation) taxonNameBuckets[dialogOffset].get(0)).getAttribute(PAGE_NUMBER_ATTRIBUTE, \"\").toString());\n\t\t\tadfps[d].setProperty(FeedbackPanel.TARGET_PAGE_ID_PROPERTY, ((Annotation) taxonNameBuckets[dialogOffset].get(0)).getAttribute(PAGE_ID_ATTRIBUTE, \"\").toString());\n\t\t\tadfps[d].setProperty(FeedbackPanel.TARGET_ANNOTATION_ID_PROPERTY, ((Annotation) taxonNameBuckets[dialogOffset].get(0)).getAnnotationID());\n\t\t\tadfps[d].setProperty(FeedbackPanel.TARGET_ANNOTATION_TYPE_PROPERTY, TAXONOMIC_NAME_ANNOTATION_TYPE);\n\t\t\t\n\t\t\t//\tadd target page numbers\n\t\t\tString targetPages = FeedbackPanel.getTargetPageString((Annotation[]) taxonNameBuckets[dialogOffset].toArray(new Annotation[taxonNameBuckets[dialogOffset].size()]));\n\t\t\tif (targetPages != null)\n\t\t\t\tadfps[d].setProperty(FeedbackPanel.TARGET_PAGES_PROPERTY, targetPages);\n\t\t\tString targetPageIDs = FeedbackPanel.getTargetPageIdString((Annotation[]) taxonNameBuckets[dialogOffset].toArray(new Annotation[taxonNameBuckets[dialogOffset].size()]));\n\t\t\tif (targetPageIDs != null)\n\t\t\t\tadfps[d].setProperty(FeedbackPanel.TARGET_PAGE_IDS_PROPERTY, targetPageIDs);\n\t\t}\n\t\t\n\t\t//\tshow feedback dialogs\n\t\tint cutoffSet = taxonNameBuckets.length;\n\t\tboolean feedbackCancelled = false;\n\t\t\n\t\t//\tcan we issue all dialogs at once?\n\t\tif (FeedbackPanel.isMultiFeedbackEnabled()) {\n\t\t\tFeedbackPanel.getMultiFeedback(adfps);\n\t\t\t\n\t\t\t//\tprocess all feedback data together\n\t\t\tfor (int d = 0; d < adfps.length; d++) {\n\t\t\t\tint dialogOffset = (d * dialogSize);\n\t\t\t\tfor (int b = 0; b < adfps[d].lineCount(); b++)\n\t\t\t\t\tselectedOptions[b + dialogOffset] = adfps[d].getSelectedOptionAt(b);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\tdisplay dialogs one by one otherwise (allow cancel in the middle)\n\t\telse for (int d = 0; d < adfps.length; d++) {\n\t\t\tif (d != 0)\n\t\t\t\tadfps[d].addButton(\"Previous\");\n\t\t\tadfps[d].addButton(\"Cancel\");\n\t\t\tadfps[d].addButton(\"OK\" + (((d+1) == adfps.length) ? \"\" : \" & Next\"));\n\t\t\t\n\t\t\tString title = adfps[d].getTitle();\n\t\t\tadfps[d].setTitle(title + \" - (\" + (d+1) + \" of \" + adfps.length + \")\");\n\t\t\t\n\t\t\tString f = adfps[d].getFeedback();\n\t\t\tif (f == null) f = \"Cancel\";\n\t\t\t\n\t\t\tadfps[d].setTitle(title);\n\t\t\t\n\t\t\t//\tcurrent dialog submitted, process data\n\t\t\tif (f.startsWith(\"OK\")) {\n\t\t\t\tint dialogOffset = (d * dialogSize);\n\t\t\t\tfor (int b = 0; b < adfps[d].lineCount(); b++)\n\t\t\t\t\tselectedOptions[b + dialogOffset] = adfps[d].getSelectedOptionAt(b);\n\t\t\t}\n\t\t\t\n\t\t\t//\tback to previous dialog\n\t\t\telse if (\"Previous\".equals(f))\n\t\t\t\td-=2;\n\t\t\t\n\t\t\t//\tcancel from current dialog onward\n\t\t\telse {\n\t\t\t\tcutoffSet = (d * dialogSize);\n\t\t\t\tfeedbackCancelled = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\tprocess feedback\n\t\tfor (int b = 0; b < cutoffSet; b++) {\n\t\t\t\n\t\t\t//\tepithet cannot be handled right now\n\t\t\tif (IGNORE_NAME_CHOICE.equals(selectedOptions[b]))\n\t\t\t\ttaxonNameBuckets[b].authority = IGNORE;\n\t\t\t\n\t\t\t//\tepithet selected for manual handling\n\t\t\telse if (SEPARATE_NAMES_CHOICE.equals(selectedOptions[b]))\n\t\t\t\ttaxonNameBuckets[b].authority = SEPARATE_NAMES;\n\t\t\t\n\t\t\t//\tepithet selected for manual handling\n\t\t\telse if (ENTER_MANUALLY_CHOICE.equals(selectedOptions[b]))\n\t\t\t\ttaxonNameBuckets[b].authority = MANUALLY;\n\t\t\t\n\t\t\t//\tfind higher taxonomy for selected option\n\t\t\telse for (int t = 0; t < taxonNameBuckets[b].authorities.length; t++) {\n\t\t\t\tif (selectedOptions[b].startsWith(taxonNameBuckets[b].authorities[t].toString())) {\n\t\t\t\t\ttaxonNameBuckets[b].authority = taxonNameBuckets[b].authorities[t];\n\t\t\t\t\tt = taxonNameBuckets[b].authorities.length;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\tfinally ...\n\t\treturn feedbackCancelled;\n\t}", "public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(new FileReader(\"talent.in\"));// new InputStreamReader(System.in)); //\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"talent.out\")));\n int N = sc.nextInt();\n int minWeight = sc.nextInt();\n int[] weight = new int[N];\n int[] value = new int[N];\n int totalTalent = 0;\n for (int i = 0; i < N; i++) {\n int wt = sc.nextInt();\n int val = sc.nextInt();\n weight[i] = wt;\n value[i] = val;\n totalTalent += val;\n }\n\n // Store, for a given talent, what is the smallest weight used to achieve it?\n int[] dp = new int[totalTalent + 1];\n Arrays.fill(dp, (int) 1e9);\n dp[0] = 0;\n // the min weight to produce 0 talent is 0. However,\n // it is necessary to make everything else big because we can only BUILD\n // from 0\n double bestRatio = 0;\n for (int cow = 0; cow < N; cow++) {\n // look at each cow, and go DOWN THROUGH THE dp array, updating the\n // best weight achievable BEHIND US. This countercurrent motion ensures no repeated\n // counting of a single cow's talents\n int contribution = value[cow];\n int wt = weight[cow];\n for (int talent = totalTalent; talent >= 0; talent--) {\n int boostedTalent = contribution + talent;\n int boostedWeight = dp[talent] + wt;\n // with the min weight of a certain talent,\n // is it possible to get a smaller boostedWeight for a boostedTalent\n if (boostedTalent <= totalTalent) {\n // If we are in bounds,\n if (boostedWeight < dp[boostedTalent]) {\n // and the attempted team has a better weight value\n // then update it!\n // Initially, when everything is 1 billion, this cannot\n // happen except for from the base cases, building outward\n dp[boostedTalent] = boostedWeight;\n\n // At the same time, we can be more efficient by constantly\n // checking if we had enough weight first of all, and\n // second of all had a better talent/weight ratio!\n double ratio = (double) boostedTalent / boostedWeight;\n if (ratio > bestRatio && boostedWeight >= minWeight) {\n bestRatio = ratio;\n }\n }\n }\n }\n }\n\n out.println((int) (1000 * bestRatio));\n out.close();\n }", "private void setWinningTuples() {\n\t\tWINS = new ArrayList<Set<CMNMove>>();\n\t\tSet<CMNMove> winSet = new TreeSet<CMNMove>();\n\t\tfor (int i = MM; i > 0; i--) {\n\t\t\tknapsack(winSet, CC, i, NN);\n\t\t}// end for\n\n\t}", "@FXML void showclist3(MouseEvent event) throws IOException {\t\t\nint i = 0, n = 0, k = 0;\nString candidature3[] = new String[3];\nString emailcandidature3[] = new String[3];\nLabel candidati3[] = { c1p3, c2p3, c3p3 } ;\nLabel emailcandidati3[] = { mailc1p3, mailc2p3, mailc3p3 } ;\ntry {\n\tBufferedReader reader = new BufferedReader(new FileReader(FileCerqoLavoroBusinessFactoryImpl.CANDIDATES_FILE_NAME));\n\tint lines = 0;\n\twhile (reader.readLine() != null) {\n\t\tlines++; }\n\treader.close();\n\tint cont = lines / 2;\t\n\tfor ( i = 0; i < 3; i++ ) {\n\t\tif ( candidati3[i] != null ) {\n\t\t\tcandidati3[i].setVisible(false); }\n\t}\t\n\tBufferedReader read = new BufferedReader(\n\t new InputStreamReader(\n\t new FileInputStream(FileCerqoLavoroBusinessFactoryImpl.CANDIDATES_FILE_NAME), StandardCharsets.UTF_8));\n List<String> line = Files.readAllLines(Paths.get(FileCerqoLavoroBusinessFactoryImpl.CANDIDATES_FILE_NAME), StandardCharsets.UTF_8);\n int j = 0, m = 1;\n\tcandidates:\n while ( line != null && n < cont ) {\n \tif ( k < 3 ) {\n if ( line.get(m).equals( TitleLabel1.getText().toString() )) {\n emailcandidature3[k] = line.get(j).toString();\n candidature3[k] = line.get(j).toString();\n k++; }\n }\n else {\n break candidates; }\n j += 2; m += 2; n++;\n }\n read.close();\n if ( k < 3 ) {\n \tfor ( i = k; i < 3; i++ ) {\n \t\tcandidati3[i].setVisible(false);\n \t}\n } \n if ( k != 0 ) {\n for ( i = 0; i < k; i++ ) {\n candidati3[i].setVisible(true);\n emailcandidati3[i].setText(emailcandidature3[i]);\n candidati3[i].setText(candidature3[i]);\n }\n }\n } catch (FileNotFoundException ex) {\n } catch (IOException e) {\n\t\te.printStackTrace();\n\t}\n}", "public int numberOfKnightsIn() { // numero di cavalieri a tavola\n \n return numeroCompl;\n }", "private String showCharacterAccusations() {\n\t\tButtonGroup characterButtons = new ButtonGroup();\n\t\tList<JRadioButton> btns = setupCharacterButtons();\n\t \n\t\t// set up dialog box\n\t\tJPanel characterPanel = new JPanel(new GridLayout(0, 1));\n\t\tJLabel lbl = new JLabel(\"Select the character that you suspect.\");\n\t\tcharacterPanel.add(lbl);\n\t // add buttons to panel\n\t for(JRadioButton b : btns){\n\t \tcharacterButtons.add(b);\n\t \tcharacterPanel.add(b);\n\t }\n\t\t\n\t // show dialog box\n\t JOptionPane.showMessageDialog(frame, characterPanel);\n\t // decide which button was selected\n\t for(JRadioButton b : btns){\n\t \tif(b.isSelected()){\n\t \t\treturn b.getText();\n\t \t}\n\t }\n\t return null;\n\t}", "public static void main(String[] args) {\n System.out.println(\"------Random items and knapsacks------\");\n int itemLen = 10;\n int knapsackLen = 4;\n float[] benefit = new float[itemLen];\n float[] weight = new float[itemLen];\n int[] knapsackWeight = new int[knapsackLen];\n\n Random random = new Random();\n for (int i = 0; i < itemLen; i++) {\n // random benefit: 1 ~ 10\n benefit[i] = random.nextInt(9) + 1;\n // random weight: 1 ~ 10\n weight[i] = random.nextInt(9) + 1;\n }\n for (int i = 0; i < knapsackLen; i++) {\n // random knapsack weight: 5 ~ 15\n knapsackWeight[i] = random.nextInt(10) + 5;\n }\n\n /*\n Print items and knapsacks\n */\n System.out.print(\"Items benefit:\");\n for (int i = 0; i < itemLen; i++) {\n System.out.print(benefit[i] + \" \");\n }\n System.out.println();\n\n System.out.print(\"Items weight:\");\n for (int i = 0; i < itemLen; i++) {\n System.out.print(weight[i] + \" \");\n }\n System.out.println();\n\n System.out.print(\"Knapsacks weight:\");\n for (int i = 0; i < knapsackLen; i++) {\n System.out.print(knapsackWeight[i] + \" \");\n }\n System.out.println();\n\n // neighborhood search\n neighborhoodSearch(benefit, weight, knapsackWeight);\n\n }", "public static int countUniqueCombinationsDP(int score) {\r\n /*\r\n * Return Type of DP array is same as return type of the recursive function\r\n * Dimensions of DP array is the number of non constant parameters to the recursive function\r\n */\r\n \t\r\n \t/*\r\n \t * Fn(s) = Fn(s-7) [if(s>=7)] + Fn(s-3) [if(s>=3)] + Fn(s-2) [if(s>=2)]\r\n\t\t * Fn(0) = 1\r\n\t\t * \r\n * F(11) = F(4) + F(8) + F(9)\r\n */\r\n \tint[][] comb = new int[score + 1][3];\r\n // int[] points = {2,3,7};\r\n \r\n // Halting Conditions\r\n comb[0][0] = 1;\r\n comb[0][1] = 1;\r\n comb[0][2] = 1;\r\n \r\n /*\r\n * Loop goes in the direction opposite to that of the recursion \r\n */\r\n for (int s = 1; s <= score; ++s) {\t\t// s is the score of the recursion\r\n \tfor (int p = 0; p < 3; ++p) {\r\n\t \tint total = 0;\r\n\t if (s >= 2 && p == 0)\r\n\t \ttotal = total + comb[s - 2][0];\r\n\t if (s >= 3 && p <= 1)\r\n\t \ttotal = total + comb[s - 3][1];\r\n\t if (s >= 7)\t\t\t// No need of condition p<=2; as it will always be true\r\n\t \ttotal = total + comb[s - 7][2];\r\n\t comb[s][p] = total;\r\n \t}\r\n }\r\n\r\n return comb[score][0];\r\n }", "public boolean checkCategoryInput(Die [] dice, int chose) {\n if (!checkCategory(chose)) {\n\n switch (chose) {\n //case 1 is Aces\n case (1):\n case (2):\n case (3):\n case (4):\n case (5):\n case (6):\n if (checkUpper(dice, chose)) {\n categoryScore[chose - 1] = sumDice(dice, chose);\n categoryCheck[chose - 1] = true;\n }\n else{\n categoryScore[chose - 1] = 0;\n categoryCheck[chose - 1] = true;\n }\n return categoryCheck[chose - 1];\n\n\n //case 7 is ThreeOfAKind\n case (7):\n if (checkLowerSector[1] == true) {\n categoryScore[chose - 1] = ;\n categoryCheck[chose - 1] = true;\n return checkMatch(dice, 3);\n }\n return categoryCheck[chose - 1];\n\n\n //case 8 is FourOfAKind\n case (8):\n if (checkLowerSector[2] = true) {\n categoryScore[chose - 1] =;\n categoryCheck[chose - 1] = true;\n return checkMatch(dice, 4);\n\n }\n\n //case 9 is SmallStraight\n case (9):\n\n return true;\n\n //case 10 is LargeStraight\n case (10):\n if (inDice(\n scoreStraight(\n false,inDice(dice,))))\n return true;\n\n //case 11 is FullHouse\n case (11):\n //test print lines were for testing.\n /* System.out.println(\"Test 11\");*/\n if (checkMatch(dice, 3) &&\n checkMatch(dice, 2)) {\n return true;\n }\n //not sure if i need the !checkMatch(5)\n break;\n\n //case 12 is Yahtzee\n case (12):\n if (checkLowerSector[3] = true) {\n return checkMatch(dice, 5);\n }\n\n //case 13 is Chance\n case (13):\n sumDice(dice, chose);\n return true;\n //test print lines were for testing.\n\n\n\n default:\n System.out.println(\"Invalid number or faulty code.\");\n break;\n }\n// if (chose < 7 && chose > 0) {\n// if (checkUpper(player.getDice(), chose)) {\n// categoryScore[chose - 1] = sumDice(player.getDice(), chose);\n// categoryCheck[chose - 1] = true;\n// return true;\n// }\n// } else {\n//\n//\n// }\n\n } else {\n return false;\n\n }\n\n return false;\n\n }", "public long numCandidates();", "public void matchesDemo() \n {\n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection;\n\n for (String eachClient : clientMap.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString) ;\n }\n }" ]
[ "0.5684731", "0.5641531", "0.55537456", "0.54724026", "0.54167426", "0.5389143", "0.5359319", "0.53479886", "0.53360814", "0.5307247", "0.52750266", "0.52641964", "0.5258166", "0.5253414", "0.5231642", "0.5210355", "0.5199985", "0.5187462", "0.51504844", "0.51472735", "0.51250046", "0.51198125", "0.5116802", "0.51115936", "0.5058387", "0.501051", "0.499125", "0.4972693", "0.4969015", "0.49484676", "0.49409956", "0.49202493", "0.49116373", "0.49101454", "0.49059996", "0.4902837", "0.48958102", "0.48943397", "0.48935518", "0.48871973", "0.48719144", "0.48624673", "0.48557594", "0.4845766", "0.48450828", "0.48404413", "0.48398578", "0.48395327", "0.48388422", "0.48288712", "0.4828213", "0.48229113", "0.48210898", "0.4820153", "0.48155645", "0.48093325", "0.48053563", "0.48011318", "0.48006278", "0.4794472", "0.47920895", "0.4785782", "0.47784352", "0.4765936", "0.47556767", "0.4754816", "0.4750621", "0.47449377", "0.47411236", "0.47380194", "0.4721976", "0.47208086", "0.4714141", "0.4713385", "0.47093004", "0.47076297", "0.47059783", "0.47058985", "0.46997046", "0.46955132", "0.4687931", "0.4680522", "0.46766183", "0.46760452", "0.46750122", "0.46641707", "0.46627948", "0.465927", "0.46559745", "0.46550673", "0.4648466", "0.46384868", "0.4637621", "0.4637589", "0.46350372", "0.46337375", "0.4632563", "0.46315414", "0.46289223", "0.4625169" ]
0.6632048
0
this will delete the candies that have a 3 or more combination the nine that are previously labeled are deleted
public void DestroyCandies() { NineExists = 0; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (pictures2[i][j] == 9) { scorevalue += 10; NineExists = 1; combinationValid = 1; NoMovesRemaining = 0; for (int k = 0; k < j; k++) { pictures2[i][j - k] = pictures2[i][j - k - 1]; //candies are shifted down to fill in the spaces } pictures2[i][0] = indices[random.nextInt(indices.length)]; //random candies are generated } } } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { pictures[i][j] = pictures2[i][j]; } } System.out.println(" "); for (int j = 0; j < 9; j++) { for (int i = 0; i < 9; i++) { System.out.print(pictures2[i][j] + " "); } System.out.println(); } if ((NineExists == 1)) { //if there is a combination LabelingCandiesToDestroy(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void LabelingCandiesToDestroy() {\n int i;\n int j;\n int checkIfSame = 1;\n int NumOfSame = 1;\n System.out.println(\" \");\n //the two sets of nested for loops are used to check for combinations in different directions (top-bottom, left-right)\n for (i = 0; i < 9; i++) {\n for (j = 0; j < 9; j++) {\n NumOfSame = 1;\n checkIfSame = 1;\n while (checkIfSame < (9 - j)) { //when there is a valid combination, it labels the candies as 9\n if (pictures[i][j] == pictures[i][j + checkIfSame]) {\n checkIfSame++;\n NumOfSame++;\n } else {\n break;\n }\n }\n if (NumOfSame > 2) {\n for (int k = 0; k < NumOfSame; k++) {\n pictures2[i][j + k] = 9; //9 is set to candies that have a 3 or more combinations\n }\n }\n\n }\n }\n //this is the second set for the other direction\n for (j = 0; j < 9; j++) {\n for (i = 0; i < 9; i++) {\n NumOfSame = 1;\n checkIfSame = 1;\n while (checkIfSame < (9 - i)) {\n if (pictures[i][j] == pictures[i + checkIfSame][j]) {\n checkIfSame++;\n NumOfSame++;\n } else {\n break;\n }\n }\n if (NumOfSame > 2) {\n for (int k = 0; k < NumOfSame; k++) {\n pictures2[i + k][j] = 9;\n }\n }\n\n }\n }\n\n for (j = 0; j < 9; j++) {\n for (i = 0; i < 9; i++) {\n System.out.print(pictures2[i][j] + \" \");\n }\n System.out.println();\n }\n DestroyCandies();\n }", "private static void removeCurrentColors(){\n\t\tIterator<ArrayList<Peg>> itr = possibleCombinations.iterator();\n\t\twhile(itr.hasNext()){\n\t\t\tArrayList <Peg> victim=itr.next();\n\t\t\tfor(int i=0; i<aiGuess.size(); i++){\n\t\t\t\t\n\t\t\t\tif(victim.contains(aiGuess.get(i))){\n\t\t\t\t\titr.remove();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void removeNonIntersections(int PegsCount){\n\t\tint correctColor = 0;\n\t\tIterator<ArrayList<Peg>> itr = possibleCombinations.iterator();\n\t\twhile(itr.hasNext()){\n\t\t\tcorrectColor = 0;\n\t\t\tArrayList <Peg> victim=itr.next();\n\t\t\tArrayList <Peg> victimTemp = new ArrayList<Peg>(victim);\n\t\t\tfor(int i=0; i<aiGuess.size(); i++){\n\t\t\t\tif(victimTemp.contains(aiGuess.get(i))){\n\t\t\t\t\tvictimTemp.remove(aiGuess.get(i));\n\t\t\t\t\tcorrectColor+=1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(correctColor<PegsCount){\n\t\t\t\titr.remove();\n\t\t\t}\n\t\t}\n\t}", "void deleteAllChallenges();", "void deleteChains() {\n\t\tif (!params.isDebug()) {\n\t\t\tfor (File deleteCandidate : toDelete) {\n\t\t\t\tdeleteCandidate.delete();\n\t\t\t\t\n\t\t\t\ttry (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(deleteCandidate.toPath())) {\n\t\t\t\t\tfor (Path path : directoryStream) {\n\t\t\t\t\t\tif (!path.getFileName().toString().endsWith(\"_SCWRLed.pdb\")) {\n\t\t\t\t\t\t\tpath.toFile().delete();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void cancelJoinsNLEGJoin() {\n\n List<String> currEG = null;\n List<String> currOuterTP = null;\n\n for (int keyOuter : mapTmpEGtoAllTPs.keySet()) {\n\n if (mapEGtoCancel.get(keyOuter) != null) {\n\n currEG = mapTmpEGtoAllTPs.get(keyOuter);\n\n for (int i = 0; i < currEG.size(); i += 3) {\n\n currOuterTP = new LinkedList<>(currEG.subList(i, i + 3));\n //BUUUUUUUUUUUUG check if it is a ontology\n if (!currOuterTP.get(0).contains(\"?\") && !currOuterTP.get(0).contains(\"#\")\n || !currOuterTP.get(2).contains(\"?\") && !currOuterTP.get(2).contains(\"#\")) {\n\n myDedUtils.cancelDTP(currOuterTP);\n for (int j = i + 3; j < currEG.size(); j += 3) {\n\n totalPairs--;\n }\n }\n\n }\n }\n\n }\n\n }", "private void borrarCombos(){\n this.jcbSeleccionAñoIni.removeAllItems();\n this.jcbSeleccionAñoFin.removeAllItems();\n this.jcbSeleccionMesIni.removeAllItems();\n this.jcbSeleccionMesFin.removeAllItems();\n this.jcbSeleccionInicio.removeAllItems();\n this.jcbSeleccionFin.removeAllItems();\n }", "public void remove(Candy candy) {\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\t\t\tfor (int j = 0; j < size; j++) {\r\n\t\t\t\tif (candyBoard[i][j] != null && candyBoard[i][j].equals(candy))\r\n\t\t\t\t\tcandyBoard[i][j] = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void prune(ArrayList<Morphism> candidates,\n\t\t\tAutomaton automaton) {\n\t\t// this is really inefficient!\n\t\t// at a minimum, we could avoid recomputing lessThan twice for each\n\t\t// candidate.\n\t\tMorphism least = candidates.get(0);\n\t\tfor (Morphism candidate : candidates) {\n\t\t\tif (lessThan(candidate, least, automaton)) {\n\t\t\t\tleast = candidate;\n\t\t\t}\n\t\t}\n\n\t\tint diff = 0;\n\t\tfor (int i = 0; i != candidates.size(); ++i) {\n\t\t\tMorphism candidate = candidates.get(i);\n\t\t\tif (lessThan(least, candidate, automaton)) {\n\t\t\t\tdiff = diff + 1;\n\t\t\t} else {\n\t\t\t\tcandidates.set(i - diff, candidate);\n\t\t\t}\n\t\t}\n\n\t\t// now actually remove those bypassed.\n\t\tint last = candidates.size();\n\t\twhile (diff > 0) {\n\t\t\tcandidates.remove(--last);\n\t\t\tdiff = diff - 1;\n\t\t}\n\t}", "private void deleteAttacks(){\n while(!attacksToDelete.isEmpty()){\n attacks.remove(attacksToDelete.remove());\n }\n }", "private void step4(Node node) {\n\t\tHashMap<String, ArrayList<String>> svn = node.svN;\r\n\t\tHashMap<String, ArrayList<String>> cn = node.cN;\r\n\t\tArrayList<String> keys = node.keysN;\r\n\t\tString c = checksubset(cn);\r\n\r\n\t\tif (c != null) {\r\n\t\t\tfor (int i = 0; i < keys.size(); i++) {\r\n\t\t\t\tif (svn.get(keys.get(i)).contains(c)) {\r\n\t\t\t\t\tsvn.get(keys.get(i)).remove(c);\r\n\t\t\t\t\tif (svn.get(keys.get(i)).size() <= 1) {\r\n\t\t\t\t\t\tsvn.remove(keys.get(i));\r\n\t\t\t\t\t\tkeys.remove(i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcn.remove(c);\r\n\t\t}\r\n\t}", "public void clear() {\n for (int i = 0; i < if_you_items.length; i++) {\n if_you_items[i].setEnabled(true);\n }\n for (int i = 0; i < then_we_items.length; i++) {\n then_we_items[i].setEnabled(true);\n }\n non_promised_ministries.clear();\n non_promised_ministries.addAll(all_ministries);\n // if not at war, can't ask/offer peace\n if (game.getDiplomacy().getDiplomaticState(game.getTurn(), faction) != C.DS_WAR) {\n if_you_items[IfYouWill.PEACE.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.PEACE.ordinal()].setEnabled(false);\n }\n if (faction > C.HOUSE5) { // non-house\n non_promised_ministries.clear();\n if_you_items[IfYouWill.TECH.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.TECH.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n return;\n }\n // search for promised votes and ministries in pending contracts of sender\n for (Contract con : game.getDiplomacy().getSentContracts()) {\n for (Term term : con.getTerms()) {\n if (term.getDonor() == game.getTurn()) {\n switch (term.getType()) {\n case VOTES:\n System.out.println(\"DBG no votes\");\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n break;\n case MINISTRY:\n non_promised_ministries.remove(new Integer(term.getAmount()));\n break;\n case MONEY:\n break;\n case STATE:\n break;\n case TECH:\n break;\n default:\n throw new AssertionError();\n }\n }\n if (term.getDonor() == faction) {\n switch (term.getType()) {\n case VOTES:\n System.out.println(\"DBG no votes\");\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n break;\n case MINISTRY:\n non_promised_ministries.remove(new Integer(term.getAmount()));\n break;\n case MONEY:\n break;\n case STATE:\n break;\n case TECH:\n break;\n default:\n throw new AssertionError();\n }\n }\n }\n }\n // search for promised votes and ministries for sender and for receiver\n // those that are made with sender\n if (game.getRegency().getVotes()[game.getTurn()][Regency.CANDIDATE_IDX] > -1\n || game.getRegency().getVotes()[faction][Regency.CANDIDATE_IDX] == game.getTurn()) {\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n }\n int[] promises = game.getDiplomacy().getMinistryPromises(game.getTurn());\n for (int i = 0; i < promises.length; i++) {\n if (promises[i] > -1) {\n non_promised_ministries.remove(new Integer(promises[i]));\n }\n }\n promises = game.getDiplomacy().getMinistryPromises(faction);\n for (int i = 0; i < promises.length; i++) {\n if (promises[i] == game.getTurn()) {\n non_promised_ministries.remove(new Integer(promises[i]));\n }\n }\n if (non_promised_ministries.isEmpty()) {\n then_we_items[ThenWeWill.MINISTRY.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.MINISTRY.ordinal()].setEnabled(false);\n }\n }", "public void discard(){\n for(int i = 1 ; i <= 110 ; i++) cardDeck.remove(i);\n }", "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}", "private void createNewItemsetsFromPreviousOnes() {\n // by construction, all existing itemsets have the same size\n int currentSizeOfItemsets = itemsets.get(0).length;\n Logger.getLogger(Apriori.class.getName()).log(Level.INFO, \"Creating itemsets of size {0} based on {1} itemsets of size {2}\", new Object[]{currentSizeOfItemsets + 1, itemsets.size(), currentSizeOfItemsets});\n\n HashMap<String, String[]> tempCandidates = new HashMap<>(); //temporary candidates\n\n // compare each pair of itemsets of size n-1\n for (int i = 0; i < itemsets.size(); i++) {\n for (int j = i + 1; j < itemsets.size(); j++) {\n String[] X = itemsets.get(i);\n String[] Y = itemsets.get(j);\n\n assert (X.length == Y.length);\n\n //make a string of the first n-2 tokens of the strings\n String[] newCand = new String[currentSizeOfItemsets + 1];\n for (int s = 0; s < newCand.length - 1; s++) {\n newCand[s] = X[s];\n }\n\n int ndifferent = 0;\n // then we find the missing value\n for (int s1 = 0; s1 < Y.length; s1++) {\n boolean found = false;\n // is Y[s1] in X?\n for (int s2 = 0; s2 < X.length; s2++) {\n if (X[s2].equals(Y[s1])) {\n found = true;\n break;\n }\n }\n if (!found) { // Y[s1] is not in X\n ndifferent++;\n // we put the missing value at the end of newCand\n newCand[newCand.length - 1] = Y[s1];\n }\n\n }\n\n // we have to find at least 1 different, otherwise it means that we have two times the same set in the existing candidates\n assert (ndifferent > 0);\n\n /*if (ndifferent==1) {\n \tArrays.sort(newCand);*/\n tempCandidates.put(Arrays.toString(newCand), newCand);\n //}\n }\n }\n\n //set the new itemsets\n itemsets = new ArrayList<>(tempCandidates.values());\n Logger.getLogger(Apriori.class.getName()).log(Level.INFO, \"Created {0} unique itemsets of size {1}\", new Object[]{itemsets.size(), currentSizeOfItemsets + 1});\n\n }", "private void removeSpeciesUnmatching(int optionselected) {\n for (String s : speciesLeft) {\n if (!(criteriaList.get(currentCriteria).getOptionList().get(optionselected).getEntities().contains(s)))\n speciesLeft.remove(s);\n }\n }", "public ReducedCellInfo[] EliminateEntries( ReducedCellInfo[] possibilities, \r\n String[] latticeTypes,\r\n String[] CenteringTypes)\r\n {\r\n return possibilities;\r\n }", "public void removeFound() {\n\t\tString[] unique = Arrays.stream(this.bestCombination).distinct().toArray(String[]::new);\n\t\tint numToRemove = unique.length;\n\t\tint newLength = foundRequest.length - numToRemove; // newLength is equal to foundRequest length - unique length\n\t\t// create new array tempArr of same size as foundRequest\n\t\tString[][] tempArr = new String[this.foundRequest.length][this.foundRequest[0].length];\n\t\t// copy values of of foundRequest to tempArr\n\t\tSystem.arraycopy(foundRequest, 0, tempArr, 0, this.foundRequest.length);\n\n\t\t// set foundRequest to new size [newLength[original foundRequest size]\n\t\tthis.foundRequest = new String[newLength][this.foundRequest[0].length];\n\t\tint i = 0;\n\t\tfor (String[] row : tempArr) { // goes through row\n\t\t\tif (checkRowToCopy(row)) { // if row must be copied:\n\t\t\t\t// copies values of row to foundRequest\n\t\t\t\tSystem.arraycopy(row, 0, this.foundRequest[i++], 0, row.length);\n\t\t\t}\n\t\t}\n\t}", "boolean removeWordFromCandidatesSet(Set<Character> characters, Integer index) {\n List<String> candidatesToBeRemoved = new ArrayList<>();\n for (String word : candidates) {\n if (!characters.contains(word.charAt(index))) {\n candidatesToBeRemoved.add(word);\n }\n }\n return candidates.removeAll(candidatesToBeRemoved);\n }", "public void supprimerCases(){ \r\n \r\n for(int del=0; del<nVides; del++) {\r\n \tint i = (int) Math.floor((Math.random()*N));\r\n \tint j = (int) Math.floor((Math.random()*N));\r\n\r\n if (tab[i][j] == 0) //si la case est vide, on ne peut pas la supprimer donc on remet increment pas del\r\n \tdel--; \r\n else //sinon, on efface la case\r\n \ttab[i][j] = 0;\r\n } \r\n }", "@Test\n\tpublic void testEliminationByMediumBox(){\n\t\tsetBoardUp();\n\t\tMediumBox mBox = new MediumBox(board, 1, 1);\n\t\talgorithm.applyEliminationInMediumBox(mBox);\n\t\tint[] toBeRemoved = {1, 2, 8, 9};\n\t\tint[] fromCells = {0, 1, 4, 7, 8};\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCells.length; j++)\n\t\t\t\tcondition &= !mBox.cell[fromCells[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\t\n\t\tassertTrue(condition);\n\t}", "private void cull() {\n\t\tArrayList<NQueenBoard> temp = new ArrayList<NQueenBoard>();\n\t\ttemp.add(populationArray.get(0));\n\t\tfor (int i = 1; i < population; ++i) {\n\t\t\tfor (int j = 0; j < temp.size(); ++j) {\n\t\t\t\tif (populationArray.get(i).getFitness() > temp.get(j).getFitness()) {\n\t\t\t\t\ttemp.add(j, populationArray.get(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (populationArray.get(i).getFitness() <= temp.get(temp.size()-1).getFitness()) {\n\t\t\t\ttemp.add(populationArray.get(i));\n\t\t\t}\n\t\t}\n\t\t//replace the worst half with newly generated random boards\n\t\tfor (int i = temp.size()/2; i < temp.size(); ++i) {\n\t\t\ttemp.set(i, new NQueenBoard(n));\n\t\t}\n\t\tpopulationArray = temp;\n\t}", "public void removePowerUp(List<CardPower> cost)\n {\n cardPower.removeAll(cost);\n }", "public static boolean checkPath(int[][] bs, int i) {\n ArrayList<Integer> temp_cP = new ArrayList<Integer>();\r\n Set<Integer> temp_setcP = new HashSet<Integer>();\r\n boolean denoter = true;\r\n while (i == 3) {\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n while (i == 6) {\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n }\r\n return denoter;\r\n }", "public void deleteSelected() {\r\n \t\tObject cells[] = graph.getSelectionCells();\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \r\n \t\t// If a cell is a blocking region avoid removing its edges and\r\n \t\t// select its element at the end of the removal process\r\n \t\tSet edges = new HashSet();\r\n \t\tSet<Object> select = new HashSet<Object>();\r\n \r\n \t\t// Set with all regions that can be deleted as its child were removed\r\n \t\tSet<Object> regions = new HashSet<Object>();\r\n \t\t// Set with all JmtCells that we are removing\r\n \t\tSet<Object> jmtCells = new HashSet<Object>();\r\n \r\n \t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t// for(int k=0; k<cells.length; k++){\r\n \t\t// if(cells[k] instanceof JmtEdge){\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)cells[k])))).SubOut();\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)cells[k])))).SubIn();\r\n \t\t// }\r\n \t\t//\r\n \t\t// }\r\n \t\tfor (int i = 0; i < cells.length; i++) {\r\n \t\t\tif (!(cells[i] instanceof BlockingRegion)) {\r\n \t\t\t\t// Adds edge for removal\r\n \t\t\t\tedges.addAll(DefaultGraphModel.getEdges(graphmodel, new Object[] { cells[i] }));\r\n \t\t\t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t\t\t// quando vado a eliminare un nodo, a cui collegato un arco,\r\n \t\t\t\t// vado ad incrementare o diminuire il contatore per il\r\n \t\t\t\t// pulsanteAGGIUSTATUTTO\r\n \t\t\t\t// Iterator iter = edges.iterator();\r\n \t\t\t\t// while (iter.hasNext()) {\r\n \t\t\t\t// Object next = iter.next();\r\n \t\t\t\t// if (next instanceof JmtEdge){\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)next)))).SubOut();\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)next)))).SubIn();\r\n \t\t\t\t// }\r\n \t\t\t\t//\r\n \t\t\t\t// }\r\n \t\t\t\t// Stores parents information and cell\r\n \t\t\t\tif (cells[i] instanceof JmtCell) {\r\n \t\t\t\t\tif (((JmtCell) cells[i]).getParent() instanceof BlockingRegion) {\r\n \t\t\t\t\t\tregions.add(((JmtCell) cells[i]).getParent());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tjmtCells.add(cells[i]);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\t// Adds node for selection\r\n \t\t\t\tObject[] nodes = graph.getDescendants(new Object[] { cells[i] });\r\n \t\t\t\tfor (Object node : nodes) {\r\n \t\t\t\t\tif (node instanceof JmtCell || node instanceof JmtEdge) {\r\n \t\t\t\t\t\tselect.add(node);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\t// Removes blocking region from data structure\r\n \t\t\t\tmodel.deleteBlockingRegion(((BlockingRegion) cells[i]).getKey());\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tif (!edges.isEmpty()) {\r\n \t\t\tgraphmodel.remove(edges.toArray());\r\n \t\t}\r\n \t\t// removes cells from graph\r\n \t\tgraphmodel.remove(cells);\r\n \r\n \t\t// Checks if all children of a blocking region have been removed\r\n \t\tIterator<Object> it = regions.iterator();\r\n \t\twhile (it.hasNext()) {\r\n \t\t\tjmtCells.add(null);\r\n \t\t\tBlockingRegion region = (BlockingRegion) it.next();\r\n \t\t\tList child = region.getChildren();\r\n \t\t\tboolean empty = true;\r\n \t\t\tfor (int i = 0; i < child.size(); i++) {\r\n \t\t\t\tif (child.get(i) instanceof JmtCell && !jmtCells.contains(child.get(i))) {\r\n \t\t\t\t\tempty = false;\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (empty) {\r\n \t\t\t\tmodel.deleteBlockingRegion(region.getKey());\r\n \t\t\t\tgraphmodel.remove(new Object[] { region });\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Removes cells from data structure\r\n \t\tfor (Object cell : cells) {\r\n \t\t\tif (cell instanceof JmtCell) {\r\n \t\t\t\tmodel.deleteStation(((CellComponent) ((JmtCell) cell).getUserObject()).getKey());\r\n \t\t\t} else if (cell instanceof JmtEdge) {\r\n \t\t\t\tJmtEdge link = (JmtEdge) cell;\r\n \t\t\t\tmodel.setConnected(link.getSourceKey(), link.getTargetKey(), false);\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// If no stations remains gray select and link buttons\r\n \t\tif (graph.getModel().getRootCount() == 0) {\r\n \t\t\tcomponentBar.clearButtonGroupSelection(0);\r\n \t\t\tsetConnect.setEnabled(false);\r\n \t\t\tsetSelect.setEnabled(false);\r\n \t\t}\r\n \r\n \t\t// Selects components from removed blocking regions\r\n \t\tif (select.size() > 0) {\r\n \t\t\tgraph.setSelectionCells(select.toArray());\r\n \t\t\t// Resets parent information of cells that changed parent\r\n \t\t\tit = select.iterator();\r\n \t\t\twhile (it.hasNext()) {\r\n \t\t\t\tObject next = it.next();\r\n \t\t\t\tif (next instanceof JmtCell) {\r\n \t\t\t\t\t((JmtCell) next).resetParent();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "private void cleanAfterMatch() {\n\t\t// clean all consumables from all calculators\n\t\tfor (AggregationCalculator calc : calculators.values()) {\n\t\t\tcalc.cleanConsumables();\n\t\t}\n\t}", "void unsetMultipleBetMinimum();", "private List<Box> removeBoxes(List<Box> boxes, List<Integer> toKillList){\n for(int toKill : toKillList){\n if(contains(boxes,toKill)){\n boxes.remove(getBox(boxes,toKill));\n }\n }\n return boxes;\n }", "private void purgeCases() {\n\t\tVector<String> owners = new Vector<String>();\n\t\tVector<String> users = new Vector<String>(); \n\t\tfor(IStorageIterator<User> userIterator = CommCareApplication._().getUserStorage(User.class).iterate(); userIterator.hasMore();) {\n\t\t\tString id = userIterator.nextRecord().getUniqueId();\n\t\t\towners.addElement(id);\n\t\t\tusers.addElement(id);\n\t\t}\n\t\t\n\t\t//Now add all of the relevant groups\n\t\t//TODO: Wow. This is.... kind of megasketch\n\t\tfor(String userId : users) {\n\t\t\tDataInstance instance = CommCareUtil.loadFixture(\"user-groups\", userId);\n\t\t\tif(instance == null) { continue; }\n\t\t\tEvaluationContext ec = new EvaluationContext(instance);\n\t\t\tfor(TreeReference ref : ec.expandReference(XPathReference.getPathExpr(\"/groups/group/@id\").getReference())) {\n\t\t\t\tAbstractTreeElement<AbstractTreeElement> idelement = ec.resolveReference(ref);\n\t\t\t\tif(idelement.getValue() != null) {\n\t\t\t\t\towners.addElement(idelement.getValue().uncast().getString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tSqlStorage<ACase> storage = CommCareApplication._().getUserStorage(ACase.STORAGE_KEY, ACase.class);\n\t\tCasePurgeFilter filter = new CasePurgeFilter(storage, owners);\n\t\tstorage.removeAll(filter);\n\t\t\n\t\tSqlStorage<Ledger> stockStorage = CommCareApplication._().getUserStorage(Ledger.STORAGE_KEY, Ledger.class);\n\t\tLedgerPurgeFilter stockFilter = new LedgerPurgeFilter(stockStorage, storage);\n\t\tstockStorage.removeAll(stockFilter);\n\t}", "private void removeInvalidFromPool()\r\n\t{\r\n\t\tint i;\r\n\t\tint size_mature_pool;\r\n\t\tint idx_1st_oldest;//index of the oldest individual\r\n\t\tint idx_2nd_oldest;//index of the 2nd oldest individual\r\n\t\tint idx_to_remove;//index of an chromosome which has to be removed\r\n\t\tint idx_current;//index of currently checked genotype\r\n\t\tint num_errors;//number of errors of the current chromosome\r\n\t\tint max_num_errors;//maximum numbers of stored errors among checked chromosomes\r\n\t\tdouble error_1st_oldest;//average error of the oldest individual\r\n\t\tdouble error_2nd_oldest;//average error of the 2nd oldest individual\r\n\t\tdouble max_error;//largest error among the oldest individuals\r\n\t\tVector<Integer> idx_oldest;//indices of all chromosomes with a life span larger than a predefined threshold\r\n\t\t\r\n\t\tsize_mature_pool = _pool_of_bests.size();\r\n\t\t\r\n\t\t//if the maturity pool is full and none of the genotypes could be removed above because of module outputs\r\n\t\t//then remove one of the oldest individuals according to the errors\r\n\t\tif(_pool_of_bests.size()==_size_pool_of_bests)\r\n\t\t{\r\n\t\t\tidx_oldest = new Vector<Integer>(0, 1);\r\n\t\t\t\r\n\t\t\t//find all oldest genotypes\r\n\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t{\r\n\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\tif(num_errors>=_min_life_span)\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_oldest.add(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//1) find the worst oldest gentypes with a span above a threshold\r\n\t\t\t//2) do not remove a single genotype without comparison;\r\n\t\t\t// it could have very high performance\r\n\t\t\tif(idx_oldest.size() > 1)\r\n\t\t\t{\r\n\t\t\t\tidx_to_remove = idx_oldest.get(0);\r\n\t\t\t\tmax_error = _pool_of_bests.get(idx_to_remove)._error.getAverageError();\r\n\t\t\t\tfor(i=idx_to_remove+1; i<idx_oldest.size(); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_current = idx_oldest.get(i);\r\n\t\t\t\t\tif(max_error < _pool_of_bests.get(idx_current)._error.getAverageError())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tidx_to_remove = idx_current;\r\n\t\t\t\t\t\tmax_error = _pool_of_bests.get(idx_to_remove)._error.getAverageError();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse//remove the worst of two oldest genotypes if none of genotypes had span above the threshold\r\n\t\t\t{\r\n\t\t\t\t//find the oldest and 2nd oldest individuals\r\n\t\t\t\tidx_1st_oldest = -1;\r\n\t\t\t\tmax_num_errors = 0;\r\n\t\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t//\"[0]\" because the number of errors is equal for all sub-individuals of the same individual\r\n\t\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\t\tif(max_num_errors < num_errors)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmax_num_errors = num_errors;\r\n\t\t\t\t\t\tidx_1st_oldest = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//find the 2nd oldest individuals\r\n\t\t\t\tidx_2nd_oldest = -1;\r\n\t\t\t\tif(size_mature_pool > 1)//the 2nd oldest individual exists if there are 2 or more individuals\r\n\t\t\t\t{\r\n\t\t\t\t\tmax_num_errors = 0;\r\n\t\t\t\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i!=idx_1st_oldest)//the oldest individual should be ignored\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//\"[0]\" because the number of errors is equal for all sub-individuals of the same individual\r\n\t\t\t\t\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\t\t\t\t\tif(max_num_errors < num_errors)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmax_num_errors = num_errors;\r\n\t\t\t\t\t\t\t\tidx_2nd_oldest = i;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//compare performances of both oldest genotypes using their average errors;\r\n\t\t\t\terror_1st_oldest = _pool_of_bests.get(idx_1st_oldest)._error.getAverageError();\r\n\t\t\t\tif(idx_2nd_oldest!=-1)\r\n\t\t\t\t{\r\n\t\t\t\t\terror_2nd_oldest = _pool_of_bests.get(idx_2nd_oldest)._error.getAverageError();\r\n\r\n\t\t\t\t\tif(error_1st_oldest < error_2nd_oldest)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tidx_to_remove = idx_2nd_oldest;\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\tidx_to_remove = idx_1st_oldest;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse//a single individual must always be replaced\r\n\t\t\t\t{\r\n\t\t\t\t\tidx_to_remove = idx_1st_oldest;\r\n\t\t\t\t}\r\n\t\t\t}//are there genotypes with life span above a threshold?\r\n\t\t\t\r\n\t\t\t_pool_of_bests.remove(idx_to_remove);\r\n\t\t}//is maturity pool full?\r\n\t}", "public void removeAll() {\n\t\tsynchronized (mNpcs) {\n\t\t\tmNpcs = Collections.synchronizedList(new ArrayList<Npc>());\n\t\t\tmDemonCount = 0;\n\t\t\tmHumanCount = 0;\n\t\t}\n\t}", "public void candidateSelection(int n, int k, int m) //method that gives political selectors the amount of people (nodes) to go\n {\n Node forward; //node that represents the selector going clockwise \n Node backward; //node that represents the selector going counter-clockwise\n forward = Head; //clockwise selector starts at the first node\n backward = Tail; //counter-clockwise selector starts at the last node\n writer.println(\" \");\n writer.println(\"N = \" + n + \", \" + \"k = \" + k + \", \" + \"m = \" + m);\n writer.println(\" \");\n writer.println(\"Output\");\n writer.println(\"------\");\n if (m > n) //if so that the counter-clockwise selector doesn't waste time circling\n { \n m = m % n;\n }\n if (k > n) //if so that the clockwise selector doesn't waste time circling\n { \n k = k % n;\n }\n while (cand > 0) //as long as the candidates in the circle are > 0\n {\n for (int x = n - 1; x > (n - m); x--) //iterates until backward is on the person m away\n {\n backward = backward.getPrev();\n }\n for (int x = 1; x < k; x++) //iterates until forward is on the the person k away\n {\n forward = forward.getNext();\n }\n if (forward.getData() == backward.getData()) //if the selectors end\n { //on the same person\n writer.println(forward.getData()); //only print once, for\n delete(forward.getData()); //they are worthy\n backward = backward.getPrev(); //but still remove them\n forward = forward.getNext(); //from the circle and set\n } //the selectors on the next candidates\n else \n {\n writer.println(forward.getData() + \" \" + backward.getData());\n delete(backward.getData()); //if the selectors aren't on the\n delete(forward.getData()); //same candidate, remove both\n forward = forward.getNext(); //for they are not worthy,\n backward = backward.getPrev(); //then move the selectors to the\n if (cand == 2) //next candidates\n {\n backward = backward.getPrev(); //resloves an error that I was suffering\n } //with the last 2 lines of output\n }\n }\n }", "void dropcard3()\n{\nfor (int i=0;i<numberofhc()-1;i++)\n\t{\n\tint judgeA = (getcard(i)-3)/4;\n\t\n\tif(judgeA==12)\n\t\t{\n\t\tif(getcard(i)==54 && getcard(i+1)==54) //if the player has 2 SA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==52) //if the player has CA and DA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==53) //if the player has CA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==52 && getcard(i+1)==53) //if the player has DA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\t}\n\telse\n\t\t{if((((getcard(i))-3)/4)==(((getcard(i+1))-3)/4))\n\t\t\t{remove(i);\n\t\t\tremove(i);\n\t\t\ti--;}}\n\t}\n\t}", "private int[] constructCandidates1(int n) {\n int cands[] = new int[subsetCount];\n for (int i = 0; i < subsetCount; i++) {\n cands[i] = i;\n }\n for (int i = 0; i < n; i++) { // Remove currently used sets in partialSol.\n cands[partialSol[i]] = DNU;\n }\n for (int i = 0; i < n; i++) {\n if (getDiff(cands, i, n) == 0) {\n cands[i] = DNU;\n }\n }\n int dnuCount = 0;\n for (int i = 0; i < cands.length; i++) {\n if (cands[i] == DNU) {\n dnuCount++;\n }\n }\n int[] ret = new int[cands.length - dnuCount];\n int retIndex = 0;\n for (int i = 0; i < cands.length; i++) {\n if (cands[i] != DNU) {\n ret[retIndex] = i;\n retIndex++;\n }\n }\n return sortCandidates(ret, n);\n// return ret;\n }", "protected void deleteSelectedControlPoints() {\n\t\tfor (int i = 0; i < selectedPoints.size(); ++i) {\n\t\t\tif (i == 0)\n\t\t\t\tpush();\n\n\t\t\tfor (int j = 0; j < selectedCurves.size(); ++j) {\n\t\t\t\tint temp;\n\t\t\t\t// Als het controlepunt tot de curve behoort --> het punt uit\n\t\t\t\t// die curve verwijderen.\n\t\t\t\twhile ((temp = selectedCurves.elementAt(j).containsInputPointi(\n\t\t\t\t\t\tselectedPoints.elementAt(i))) != -1) {\n\t\t\t\t\tselectedCurves.elementAt(j).getInput().remove(temp);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Het punt ook uit de container halen.\n\t\t\tselectionTool.deleteControlPoint(selectedPoints.elementAt(i).X(),\n\t\t\t\t\tselectedPoints.elementAt(i).Y());\n\t\t}\n\n\t\t// Indien curves nu leeg blijken te zijn --> die curves verwijderen.\n\t\tfor (int j = 0; j < selectedCurves.size(); ++j) {\n\t\t\tif (selectedCurves.elementAt(j).getNbInputPoints() == 0) {\n\t\t\t\tselectionTool.deleteCurve(selectedCurves.elementAt(j));\n\t\t\t\tselectedCurves.remove(j--);\n\t\t\t}\n\t\t}\n\n\t\trecalculateSelectedCurves(); // De curves herberekenen.\n\t\tcurves.addAll(selectedCurves); // De curves deselecteren.\n\t\tselectedCurves.clear();\n\t\tselectedPoints.clear();\n\t\tpushNew();\n\t}", "public void filterClosedConvoysinMerge(List<Convoy> VpccResult, List<Convoy> VpccTrue){\n\t\t\t\tList<Convoy> toRemove=new ArrayList<Convoy>();\n\t\t\t\tfor(Convoy v:VpccTrue){\n\t\t\t\t\tif(VpccResult.contains(v)){\n\t\t\t\t\t\ttoRemove.add(v);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"To Remove size = \" + toRemove.size());\n\t\t\t\tint sizeVpcc=VpccTrue.size();\n\t\t\t\tSystem.out.println(\"Vpcc Size before Filtering = \"+sizeVpcc);\n\t\t\t\tint sizeVpccn=VpccResult.size();\n\t\t\t\tSystem.out.println(\"Vpccn Size before Filtering = \"+sizeVpccn);\n\t\t\t\tfor(Convoy v:toRemove){\n\t\t\t\t\tsizeVpcc=VpccTrue.size();\n\t\t\t\t\tsizeVpccn=VpccResult.size();\n\t\t\t\t\tVpccResult.remove(v);\n\t\t\t\t\tVpccTrue.remove(v);\n\t\t\t\t\tif(VpccTrue.size()-sizeVpcc>1){\n\t\t\t\t\t\tSystem.out.println(\"The convoy exists more in Vpcc true\");\n\t\t\t\t\t\tSystem.out.println(v);\n\t\t\t\t\t}\n\t\t\t\t\tif(VpccResult.size()-sizeVpccn>1){\n\t\t\t\t\t\tSystem.out.println(\"The convoy exists more in Vpccn Result\");\n\t\t\t\t\t\tSystem.out.println(v);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Vpcc Size after Filtering = \"+VpccTrue.size());\n\t\t\t\tSystem.out.println(\"Vpccn Size after Filtering = \"+VpccResult.size());\n\t\t\t\tSystem.out.println(\"Convoys closed = \"+(VpccResult.size()-VpccTrue.size()));\n\t\t\t\tthis.VpccVcoda=VpccTrue;\n\t\t\t\tthis.VpccMerge=VpccResult;\n\t}", "private void clean() {\n // TODO: Your code here.\n for (Long id : vertices()) {\n if (adj.get(id).size() == 1) {\n adj.remove(id);\n }\n }\n }", "private ArrayList<Integer> pruneIllegals(ArrayList<Integer> cm,\n ArrayList<Integer> config) {\n //Remove out of bound spots\n for (int i = 0; i < cm.size(); i++) {\n if(cm.get(i) < 0) {\n cm.remove(i);\n i--;\n } else if (cm.get(i) >= config.size()) {\n cm.remove(i);\n i--;\n }\n }\n //Remove points that have no person there\n boolean occupied;\n for (int i = 0; i < cm.size(); i++) {\n if (config.get(cm.get(i)) == '.') {\n cm.remove(i);\n i--;\n }\n }\n\n return cm;\n }", "private void removeRedundantPatterns() {\n HashSet<String> patternsToRemove = new HashSet<>();\n for (Map.Entry<String, Pattern> entry : patterns.entrySet()) {\n\n Pattern pattern = entry.getValue();\n\n if (!parameters.keepAllPatterns) {\n String suffixStr = getSuffix(pattern);\n PatternsUtils.addSubPatternToRemoveList(patterns, suffixStr, pattern, patternsToRemove);\n }\n\n if (crossStrand) {\n PatternsUtils.removeReverseCompliments(patterns, pattern, patternsToRemove);\n }\n }\n patterns.keySet().removeAll(patternsToRemove);\n }", "private void makeTrips() {\n int highestThree, firstKicker, secondKicker;\n highestThree = firstKicker = secondKicker = -1;\n for (Integer key : this.cardOccurrence.keySet()) {\n int value = this.cardOccurrence.get(key);\n if(value == 3 && value > highestThree)\n highestThree = key;\n else {\n if(key > firstKicker) {\n secondKicker = firstKicker;\n firstKicker = key;\n }\n else if(key > secondKicker)\n secondKicker = key;\n }\n }\n\n //Go through Cards ArrayList to get the actual cards pertaining\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = 0; i < this.cards.size(); i++) {\n Card c = this.cards.get(i);\n if(c.sameValue(highestThree))\n validHand.add(c.toString());\n else if(c.sameValue(firstKicker) || c.sameValue(secondKicker))\n validHand.add(c.toString());\n }\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }", "void pairDown() {\n\n Set<String> ingredientsToRemove = new HashSet<String>();\n Set<String> allergensToRemove = new HashSet<String>();\n\n do {\n\n ingredientsToRemove.clear();\n allergensToRemove.clear();\n\n // Iterate the dishes.\n for (Dish dish : dishes) {\n \n // Iterate the allergens.\n for (String allergen : dish.allergenNames) {\n\n Set<String> ingredientsInAll = new HashSet<String>();\n\n // Iterate the ingredients.\n for (String ingredient : dish.ingredientNames) {\n\n boolean inAll = true;\n\n // Iterate the dishes.\n for (Dish iDish : dishes) {\n\n // Check if this dish has the allergen.\n if (!iDish.allergenNames.contains(allergen))\n continue;\n\n // Check if this dish has the ingredient.\n if (!iDish.ingredientNames.contains(ingredient)) {\n inAll = false;\n break;\n }\n }\n\n if (inAll) {\n \n // This ingredient is in all.\n // It's a candidate for removal. But are there others?\n ingredientsInAll.add(ingredient);\n }\n }\n\n // If there's only one ingredient in all of the dishes with this allergen\n // then the ingredient and allergen can be removed from the entire menu and we can start over.\n if (ingredientsInAll.size() == 1) {\n ingredientsToRemove.add((String)ingredientsInAll.toArray()[0]);\n allergensToRemove.add(allergen);\n\n // For part 2, store the allergen and the food that contains it.\n allergensToIngredients.put(allergen, (String)ingredientsInAll.toArray()[0]);\n \n if (!allAllergens.contains(allergen))\n allAllergens.add(allergen);\n }\n }\n }\n\n // Remove identified ingredients and allergens from the menu.\n for (Dish dish : dishes) {\n\n for (String ingredient : ingredientsToRemove)\n dish.ingredientNames.remove(ingredient);\n \n for (String allergen : allergensToRemove)\n dish.allergenNames.remove(allergen); \n }\n\n } while (ingredientsToRemove.size() > 0);\n }", "private void eliminate() {\n\t\t// when the election is not closed,\n\t\ttry{\n\t\t\tMap<String,Integer> results = election.getResultsFromPolls();\n\t\t\tList<Map.Entry<String,Integer>> entryList = new ArrayList(results.entrySet());\n\n\t\t\tCollection<Integer> values = results.values();\n\t\t\tint totalVotes = 0;\n\n\t\t\tfor(Integer i:values){\n\t\t\t\ttotalVotes += i;\n\t\t\t}\n\n\t\t\tif(entryList.get(entryList.size()-1).getValue()/(double)totalVotes > 0.5) {\n\t\t\t\t// when the election already has a winner,\n\t\t\t\tSystem.out.println(\"A candidate already has a majority of the votes.\");\n\t\t\t\tSystem.out.println(\"You cannot remove any more candidates.\");\n\t\t\t}else {\n\n\t\t\t\t// when we can eliminate a candidate,\n\t\t\t\tSystem.out.println(\"Eliminating the lowest-ranked candidate.\");\n\t\t\t\tList lowestCans = new ArrayList();\n\t\t\t\tlowestCans.add(entryList.get(0).getKey());\n\t\t\t\tint i = 1;\n\t\t\t\twhile (i<entryList.size() && entryList.get(i).getValue() == entryList.get(0).getValue() ){\n\t\t\t\t\tlowestCans.add(entryList.get(i).getKey());\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\tif (lowestCans.size() >1) {\n\t\t\t\t\tCollections.sort(lowestCans);\n\t\t\t\t\tCollections.reverse(lowestCans);\n\t\t\t\t}\n\t\t\t\t\telection.eliminateCandidateWithName((String) lowestCans.get(0));\n\n\t\t\t\tSystem.out.println(\"Eliminated \"+lowestCans.get(0)+\".\");\n\t\t\t}\n\n\t\t}catch(UnsupportedOperationException uso){\n\t\t\tSystem.out.println(\"The election is still open for votes.\");\n\t\t\tSystem.out.println(\"You must close the election before eliminating candidates.\");\n\t\t}\n\n\t}", "private static Instances pruneRule(Instances data, Instances predOr, Instances itemsets) {\n\t\tInstances bestCopy = itemsets;\n\t\tInstances workingData = new Instances(predOr);\n\t\tdouble bestError = calcError(data, predOr);\n\t\tfor(int i = itemsets.numInstances() - 2; i > 0 ; i--){\n\t\t\tInstances itemsetCopy = new Instances(itemsets);\n\t\t\titemsetCopy.delete(i);\n\t\t\tapplyRules(itemsetCopy, workingData);\n\t\t\tdouble error = calcError(data, workingData);\n\t\t\tif( calcNewError(error) < bestError ){ \n\t\t\t\tbestError = calcNewError(error);\n\t\t\t\tbestCopy = itemsetCopy;\n\t\t\t}\n\t\t}\n\t\treturn bestCopy;\n\t}", "private List<Graph> possRemove(Graph pag, Map<Edge, Boolean> necEdges) {\n // list of edges that can be removed\n List<Edge> remEdges = new ArrayList<>();\n for (Edge remEdge : necEdges.keySet()) {\n if (!necEdges.get(remEdge))\n remEdges.add(remEdge);\n }\n // powerset of edges that can be removed\n PowerSet<Edge> pset = new PowerSet<>(remEdges);\n List<Graph> possRemove = new ArrayList<>();\n // for each set of edges in the powerset remove edges from graph and add to PossRemove\n for (Set<Edge> set : pset) {\n Graph newPag = new EdgeListGraph(pag);\n for (Edge edge : set) {\n newPag.removeEdge(edge);\n }\n possRemove.add(newPag);\n }\n return possRemove;\n }", "private static void option3(List<Runway> runways, Queue<Plane> unclearedPlanes) {\n \n }", "private void generateCandies(){\n\t\tfor (int i = 0; i < 16; i++){\n\t\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\t\tCandy candy = new Candy(coordX, coordY, i);\n\t\t\tcandies.put(i, candy);\n\t\t}\n\t}", "private void deleteSelectedWaypoints() {\r\n\t ArrayList<String> waypointsToRemove = new ArrayList<String>();\r\n\t int size = _selectedList.size();\r\n\t for (int i = _selectedList.size() - 1; i >= 0; --i) {\r\n boolean selected = _selectedList.get(i);\r\n if (selected) {\r\n waypointsToRemove.add(UltraTeleportWaypoint.getWaypoints().get(i).getWaypointName());\r\n }\r\n }\r\n\t UltraTeleportWaypoint.removeWaypoints(waypointsToRemove);\r\n\t UltraTeleportWaypoint.notufyHasChanges();\r\n\t}", "private static void banFeature(ArrayList t) {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\t\tSystem.out.print(\"Word cut : [\");\n\t\tint idx = 0;\n\t\twhile (i.hasNext()) {\n\t\t\tString s = (String) i.next();\n\t\t\tInteger df = (Integer) Utility.vocabHM.get(s);\n\n\t\t\tif (t.contains(s)){\n\t\t\t\tSystem.out.print(s+\", \");\n\t\t\t\ti.remove();\n\t\t\t\tidx++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"]\\n ::banned::\"+idx+\" feature.\");\n\t}", "private static void task3333(int nUMS, SplayTree<Integer> j) {\n\t\t// TODO Auto-generated method stub\n\t\tdouble search_start = 0, search_end = 0;\n\n\t System.out.println(\"SPLAY DELETION Started...\");\n\t search_start = System.nanoTime();\n\t int count = 0;\n\t \t\n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (j.contains(checker)) {\n\t j.remove(checker);\n//\t System.out.println(\"INT Removed\");\n\t count++;\n\t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each deletion: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t \n\t System.out.println(\"TOTAL REMOVES\" + count);\n\n\t\t\n\t}", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "abstract public void deleteAfterBetaReduction();", "public static void kill() {\n Iterator<Recipe> recipes = tj.getServer().recipeIterator();\r\n Recipe recipe;\r\n\r\n while (recipes.hasNext()) {\r\n recipe = recipes.next();\r\n\r\n if (recipe != null && customItems.containsValue(recipe.getResult()))\r\n recipes.remove();\r\n }\r\n\r\n tj = null;\r\n messages = null;\r\n playerDataFolder = null;\r\n players = null;\r\n customItems = null;\r\n }", "protected void removeFromAllSubsets()\r\n {\n if (!m_subsets.isEmpty()) {\r\n List<SubsetImpl> tmp = new ArrayList<SubsetImpl>(m_subsets);\r\n m_subsets.clear();\r\n tmp.forEach(r -> {if (r != null) r.remove(this);});\r\n }\r\n }", "public void removeSolution(int count) {\n // the iterator helps to go over the HashSet\n Iterator<String> iter = this.possibleSol.iterator();\n // get the current token\n String currentToken = Token.values()[this.curToken].getNum();\n //remove impossible token from possibleSolution\n while (iter.hasNext()) {\n //get the next string\n String s = iter.next();\n //check the sequence of tokens and count for the current test tokens.\n int c = 0;\n for (String st : s.split(\"\")) {\n if (st.equals(currentToken)) { c++; }\n }\n //remove the solution of with the wrong tokens\n if (c != count) { iter.remove(); }\n }\n }", "public void removeAllPawns(){\n\n for (Map.Entry<Integer, ImageView> entry : actionButtons.entrySet()) {\n Image image = null;\n entry.getValue().setImage(image);\n }\n\n for (Map.Entry<Integer, ImageView> entry : harvestBox.entrySet()) {\n\n Image image = null;\n entry.getValue().setImage(image);\n harvestBoxFreeSlot = 0;\n\n }\n\n for (Map.Entry<Integer, ImageView> entry : productionBox.entrySet()) {\n\n Image image = null;\n entry.getValue().setImage(image);\n productionBoxFreeSlot = 0;\n\n }\n\n for (Map.Entry<Integer, ImageView> entry : gridMap.entrySet()) {\n Image image = null;\n entry.getValue().setImage(image);\n gridFreeSlot = 0;\n }\n }", "private void shrinkChangeCombinationSearchSpace(int usedBanknoteIndex, int remainingAmount,\n\t\t\tList<Integer> tempSearchSpace) {\n\t\ttempSearchSpace.remove(usedBanknoteIndex);\n\t\t// eliminate denominations larger than remaining amount\n\t\tfor (Iterator<Integer> iterator = tempSearchSpace.iterator(); iterator.hasNext();) {\n\t\t\tif (iterator.next() > remainingAmount) {\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\t}", "public Set<List<String>> getCombination(int[] inHand) {\n Set<List<String>> result = new HashSet<>();\n for (int i = 0; i < inHand.length; i++) {\n if (inHand[i] < 1) continue;\n int[] copyHand = copyArray(inHand);\n //possibility of A AA AAA\n for (int j = 1; j <= inHand[i]; j++) {\n if (j == 1) {\n String cSet = \"\";\n\n for (int seq = i; seq <= i + 2; seq++) {\n if (seq >= inHand.length || copyHand[seq] < 1) continue;\n cSet += seq;\n copyHand[seq] -= 1;\n }\n// System.out.println(\"i: \" + i + \" j: \" + j+\"inhand: \" + arrayToString\n// (inHand));\n\n Set<List<String>> a = getCombination(copyHand);\n Set<List<String>> newA = new HashSet<>();\n for (List<String> s : a) {\n s.add(cSet);\n s.sort(Comparator.naturalOrder());\n if (s.equals(\"\")) continue;\n newA.add(s);\n }\n result.addAll(newA);\n continue;\n }\n\n String currentSet = \"\";\n int[] copyOfInHand = copyArray(inHand);\n for (int t = 0; t < j; t++) {\n currentSet += i;\n }\n\n copyOfInHand[i] -= j;\n Set<List<String>> after = getCombination(copyOfInHand);\n Set<List<String>> newAfter = new HashSet<>();\n for (List<String> s : after) {\n s.add(currentSet);\n s.sort(Comparator.naturalOrder());\n newAfter.add(s);\n }\n result.addAll(newAfter);\n }\n }\n if (result.isEmpty()) result.add(new ArrayList<>());\n int min = result.stream().map(set -> set.size()).min(Comparator\n .naturalOrder()).get();\n Set<List<String>> minSets = result.stream().filter(set -> set.size() == min)\n .collect(Collectors\n .toSet());\n// combinationCache.put(inHand, minSets);\n return minSets;\n }", "private void DeleteBurnInsOnPreviousSamples() {\n\t\tif (gibbs_sample_num <= num_gibbs_burn_in + 1 && gibbs_sample_num >= 2){\n\t\t\tgibbs_samples_of_bart_trees[gibbs_sample_num - 2] = null;\n\t\t}\n\t}", "public void pruneRules_cbaLike() {\n LOGGER.info(\"STARTED Postpruning\");\n //HashMap<ExtendRule,Integer> ruleErrors = new HashMap();\n //HashMap<ExtendRule,AttributeValue> ruleDefClass = new HashMap();\n ArrayList<ExtendRule> rulesToRemove = new ArrayList(); \n int totalErrorsWithoutDefault = 0; \n AttributeValue defClassForLowestTotalErrorsRule = getDefaultRuleClass();\n int lowestTotalErrors = getDefaultRuleError(defClassForLowestTotalErrorsRule);;\n ExtendRule lowestTotalErrorsRule = null;\n // DETERMINE TOTAL ERROR AND DEFAULT CLASS ASSOCIATED WITH EACH RULE \n // REMOVE RULES MATCHING ZERO TRANSACTIONS AND OF ZERO LENGTH\n for (Iterator<ExtendRule> it = extendedRules.iterator(); it.hasNext();) {\n\n ExtendRule rule = it.next();\n rule.updateQuality();\n rule.setQualityInRuleList(rule.getRuleQuality());\n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.log(Level.FINE, \"Processing rule {0}\", rule.toString());\n }\n\n if (rule.getAntecedentLength() == 0) {\n LOGGER.fine(\"Rule of length 0, MARKED FOR REMOVAL\");\n rulesToRemove.add(rule); //covered transactions should not be removed\n } \n else if (rule.getRuleQuality().getA() == 0)\n {\n LOGGER.fine(\"Rule classifying 0 instances correctly, MARKED FOR REMOVAL\");\n rulesToRemove.add(rule); //covered transactions should not be removed \n }\n else\n {\n rule.removeTransactionsCoveredByAntecedent(true); \n totalErrorsWithoutDefault = totalErrorsWithoutDefault + rule.getRuleQuality().getB();\n // since transactions matching the current rule have been removed, the default class and error can change\n AttributeValue newDefClass = getDefaultRuleClass();\n int newDefError = getDefaultRuleError(newDefClass);\n int totalErrorWithDefault = newDefError + totalErrorsWithoutDefault;\n if (totalErrorWithDefault < lowestTotalErrors)\n {\n lowestTotalErrors = totalErrorWithDefault;\n lowestTotalErrorsRule = rule;\n defClassForLowestTotalErrorsRule= newDefClass;\n } \n //ruleErrors.put(rule,totalErrorWithDefault );\n //ruleDefClass.put(rule, newDefClass); \n }\n \n }\n boolean removeTail;\n // now we know the errors associated with each rule not marked for removal, we can perform pruning\n if (lowestTotalErrorsRule == null)\n {\n // no rule improves error over a classifier composed of only default rule\n // remove all rules\n removeTail = true;\n }\n else \n {\n removeTail = false;\n }\n \n data.getDataTable().unhideAllTransactions();\n for (Iterator<ExtendRule> it = extendedRules.iterator(); it.hasNext();) {\n ExtendRule rule = it.next();\n if (rulesToRemove.contains(rule) || removeTail)\n {\n it.remove();\n continue;\n }\n if (rule.equals(lowestTotalErrorsRule))\n {\n removeTail = true;\n }\n rule.updateQuality(); \n }\n \n \n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.fine(\"Creating new default rule within narrow rule procedure\");\n }\n \n \n extendedRules.add(createNewDefaultRule(defClassForLowestTotalErrorsRule));\n \n \n LOGGER.info(\"FINISHED Postpruning\");\n }", "static void updatePossible(int[][] G, int[][][] P){\n //only makes changes to possibility array\n \n int k;\n \n for(int i=1; i<G.length; i++){\n for (int j=1; j<G[i].length; j++){\n if (G[i][j]>0) {\n int m = G[i][j]; //this is the candidate # being removed from P[][][]\n \n //remove m as candidate, from P[i][j][m] for rows\n for(int ii=1; ii<G.length; ii++){\n if (ii!=i){ //skip the current box\n if (P[ii][j][0]>1 && P[ii][j][m]>0){ //only change candidate values if it's not filled\n P[ii][j][m] = 0; //set candidate value to 0\n P[ii][j][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n \n //remove m from P[i][j][m] for columns\n for(int jj=1; jj<G.length; jj++){\n if (jj!=j){ //skip the current box\n if (P[i][jj][0]>1 && P[i][jj][m]>0){ //only change candidate values if it's not filled\n P[i][jj][m] = 0; //set candidate value to 0\n P[i][jj][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n \n //remove m from P[i][j][m] for box!\n int I = getAnchor(i);\n int J = getAnchor(j);\n for(int s=I; s<=I+2; s++){\n for(int t=J; t<=J+2; t++){\n if((s!=i)||(t!=j)){\n if (P[s][t][0]>1 && P[s][t][m]>0){ //only change candidate values if it's not filled\n P[s][t][m] = 0; //set candidate value to 0\n P[s][t][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n }\n \n }\n }\n }\n }", "public void deleteWerker(Worker w)\n {\n if(aantalWerkers > 0)\n {\n for(int i=0; i<5;i++)\n {\n if(workers[i] == w)\n {\n workers[i] = null;\n }\n }\n w.setInStructure(false);\n aantalWerkers--;\n }\n }", "public void deleteAllOptset() {\n this.optionSet = new ArrayList<OptionSet>();\n }", "void dropcard()\n{\nfor (int i=0;i<hc.size()-1;i++)\n\t{\n\tif(hc.get(i)==1||hc.get(i)==2)\n\t\tcontinue;\n\telse if((((hc.get(i))-3)/4)==(((hc.get(i+1))-3)/4))\n\t\t{hc.remove(i);\n\t\thc.remove(i);\n\t\ti--;}\t\n\t}\n}", "public void deleteCopiedPendingLedgerEntries();", "void removeNeighbors();", "public static void QTdeletionMinimization (Graph<Integer,String> g, int currentSize) {\n\t\t\r\n\t\tboolean existsP4orC4 = false;\r\n\t\t\r\n\t\t//int temp = QTDelHeuristic1(Copy(g));\r\n\t\t//System.out.print(\"n = \"+g.getVertexCount()+\" m=\"+g.getEdgeCount()+\" hVal = \"+temp +\"\\n\");\r\n\t\tif (currentSize >= minSoFar) return; \r\n\t\tIterator<Integer> a = g.getVertices().iterator();\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\t\twhile(a.hasNext()){\r\n\t\t\tInteger A = a.next();\r\n\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\tb = g.getNeighbors(A).iterator();\r\n\t\t\twhile(b.hasNext()){\r\n\t\t\t\tInteger B = b.next();\r\n\t\t\t\tc = g.getNeighbors(B).iterator();\r\n\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\tif (g.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\td = g.getNeighbors(C).iterator();\r\n\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\tif (g.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\texistsP4orC4 = true;\r\n\t\t\t\t\t\tif (currentSize + 1 >= minSoFar) return;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\t\t\t\t\t\tif (g.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t// delete any two edges\r\n\t\t\t\t\t\t\tif (currentSize + 2 >= minSoFar) return;\r\n\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(A, B));\r\n\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\tQTdeletionMinimization(g,2+currentSize);\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\tQTdeletionMinimization(g,2+currentSize);\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\r\n\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(D, A));\r\n\t\t\t\t\t\t\tQTdeletionMinimization(g,2+currentSize);\r\n\t\t\t\t\t\t\t//g.addEdge(\"mar-\"+A+\"-\"+D, A,D);\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+B, A,B);\r\n\t\t\t\t\t\t\t// all cases with AB deleted are done. AD is STILL deleted\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\tQTdeletionMinimization(g,2+currentSize);\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\tQTdeletionMinimization(g,2+currentSize);\r\n\r\n\t\t\t\t\t\t\t// all cases with AB deleted or AD deleted are done\r\n\t\t\t\t\t\t\t// at this point, CD and AD are still deleted\r\n\t\t\t\t\t\t\t// only need to try BC and CD together deleted.\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+D, A,D);\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\tQTdeletionMinimization(g,2+currentSize);\r\n\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint choice = randomInt(1,4);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (choice == 1) {\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(A, B));\r\n\t\t\t\t\t\t\t\tQTdeletionMinimization(g,1+currentSize);\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+B, A,B);\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\telse if (choice == 2) {\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\t\tQTdeletionMinimization(g,1+currentSize);\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\t\tQTdeletionMinimization(g,1+currentSize);\r\n\t\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (existsP4orC4==true) {\r\n\t\t\t\t\t\t\t// it found an obstruction and branched on all its ways.\r\n\t\t\t\t\t\t\t// No need to deal with this graph further.\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext() \r\n\t\t} // end a.hasNext()\r\n\r\n\t\t// if we reached here, no P4 was found\r\n\t\tif (existsP4orC4 == false) {\r\n\t\t\t// arrived at a quasi-threshold graph since no P4 or C4 was found\r\n\t\t\tSystem.out.print(\"\\n currentSize = \"+currentSize+\" and minSoFar = \"+minSoFar+\"\\n\");\r\n\t\t\tSystem.out.print(\"Modified graph has \"+g.getEdgeCount()+\" edges and is:\\n\");\r\n\t\t\tminSoFar = currentSize;\r\n\t\t\tSystem.out.print(\"\"+g+\"\\n\");\r\n\t\t\tNewTools.printToFile(currentSize,g,null,\"QTDel.txt\");\r\n\t\t\t//NewTools.DrawIt(g);\r\n\t\t\t//PleaseWait(60000); // one minute\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// ...\r\n\t\tSystem.out.print(\"Critical Error. No P_4 or C_4 found in a non-quasi-threshold graph.\\n\");\r\n\t\treturn;\r\n\r\n\t\t\r\n\t}", "@Test\n\tpublic void testEliminationByRow(){\n\t\tsetBoardUp();\n\t\tRow r = new Row(board, 1);\n\t\talgorithm.applyEliminationInRow(r);\n\t\tboolean condition = true;\n\t\tcondition &= !r.cell[1].possibilities.contains(4) && !r.cell[1].possibilities.contains(5) && !r.cell[1].possibilities.contains(7);\n\t\tcondition &= !r.cell[2].possibilities.contains(4) && !r.cell[2].possibilities.contains(5) && !r.cell[2].possibilities.contains(7);\n\t\tcondition &= !r.cell[4].possibilities.contains(4) && !r.cell[4].possibilities.contains(5) && !r.cell[4].possibilities.contains(7);\n\t\tcondition &= !r.cell[5].possibilities.contains(4) && !r.cell[5].possibilities.contains(5) && !r.cell[5].possibilities.contains(7);\n\t\tcondition &= !r.cell[6].possibilities.contains(4) && !r.cell[6].possibilities.contains(5) && !r.cell[6].possibilities.contains(7);\n\t\tcondition &= !r.cell[8].possibilities.contains(4) && !r.cell[8].possibilities.contains(5) && !r.cell[8].possibilities.contains(7);\n\t\t\n\t\tassertTrue(condition);\n\t}", "public int removeCarbs(double grams) {\n return this.carbohydrates -= grams;\n }", "public void purgeRelations() {\n this.purged = true;\n for (AS tCust : this.customers) {\n tCust.providers.remove(this);\n tCust.purgedNeighbors.add(this.asn);\n }\n for (AS tProv : this.providers) {\n tProv.customers.remove(this);\n tProv.purgedNeighbors.add(this.asn);\n }\n for (AS tPeer : this.peers) {\n tPeer.peers.remove(this);\n tPeer.purgedNeighbors.add(this.asn);\n }\n }", "private void crossProduct() {\n BaseCandidateElement[] it = o.inputObject.firstStageCandidates.values().toArray(new BaseCandidateElement[0]);\n // logger.info(Arrays.toString(it));\n for (int i = 0; i < it.length; i++) {\n for (int j = i + 1; j < it.length; j++) {\n if (PrecisConfigProperties.HIERARCHY_DIMS_ENABLED && hierarchyDimsNegation.checkIfBelongToSameHierarchyGroup(it[i], it[j]))\n continue;\n if (it[i].xor(it[j]).cardinality() == 4) {\n BitSet b = it[i].or(it[j]);\n o.inputObject.addCandidate(b);\n }\n }\n }\n }", "public void verifyDestroyedBoatsOnColumns(){ \n for (int i = 0; i < canvasNumberOfColumns; i++){\n int start = 0;\n int startCopy = 0;\n \n for (int j = 0; j < canvasNumberOfLines; j++){\n if (gameMatrix[j][i] != 0 && booleanMatrixUserChoices[j][i] == 1 && booleanFoundBoats[j][i] == 0){\n if (startCopy != gameMatrix[j][i] || start == 0){\n start = gameMatrix[j][i]+1;\n startCopy = gameMatrix[j][i];\n }\n }\n \n if (gameMatrix[j][i] == 0){\n start = 0;\n startCopy = 0;\n }\n \n if (start > 0 && booleanMatrixUserChoices[j][i] == 1){\n start--;\n }\n \n if (start == 1){\n if (startCopy == 1){\n boatsNumber[0] -= 1;\n booleanFoundBoats[j][i] = 1;\n }\n else if (startCopy == 2){\n boatsNumber[1] -= 1;\n booleanFoundBoats[j][i] = 1;\n booleanFoundBoats[j-1][i] = 1;\n }\n else if (startCopy == 3){\n boatsNumber[2] -= 1;\n booleanFoundBoats[j][i] = 1;\n booleanFoundBoats[j-1][i] = 1;\n booleanFoundBoats[j-2][i] = 1;\n }\n else if (startCopy == 4){\n boatsNumber[3] -= 1;\n booleanFoundBoats[j][i] = 1;\n booleanFoundBoats[j-1][i] = 1;\n booleanFoundBoats[j-2][i] = 1;\n booleanFoundBoats[j-3][i] = 1;\n }\n else if (startCopy == 5){\n boatsNumber[4] -= 1;\n booleanFoundBoats[j][i] = 1;\n booleanFoundBoats[j-1][i] = 1;\n booleanFoundBoats[j-2][i] = 1;\n booleanFoundBoats[j-3][i] = 1;\n booleanFoundBoats[j-4][i] = 1;\n }\n \n start = 0;\n startCopy = 0;\n }\n \n } \n } \n }", "public static boolean canPrune() {\n\t\tboolean result = false;\n\t\tint projectedTotal = 0;\n\t\t\n\t\tint i = 0;\n\t\twhile(i<jobsChosen){\n\t\t\tprojectedTotal += board[i][currentCombo[i]];\n\t\t\ti++;\n\t\t}\n\t\twhile(i<numPeople){\n\t\t\tprojectedTotal += bestPossibleCombination[i];\n\t\t\ti++;\n\t\t}\n\t\tif(projectedTotal<bestTotal){//Cant be greater than current Best Total\n\t\t\tresult = true;\n\t\t}\n\t\treturn result;\n\t}", "public void verifyDestroyedBoatsOnLines(){\n for (int i = 0; i < canvasNumberOfLines; i++){\n int start = 0;\n int startCopy = 0;\n \n for (int j = 0; j < canvasNumberOfColumns; j++){\n if (gameMatrix[i][j] != 0 && booleanMatrixUserChoices[i][j] == 1 && booleanFoundBoats[i][j] == 0){\n if (startCopy != gameMatrix[i][j] || start == 0){\n start = gameMatrix[i][j]+1;\n startCopy = gameMatrix[i][j];\n }\n }\n \n if (gameMatrix[i][j] == 0){\n start = 0;\n startCopy = 0;\n }\n \n if (start > 0 && booleanMatrixUserChoices[i][j] == 1){\n start--;\n }\n \n if (start == 1){\n if (startCopy == 1){\n boatsNumber[0] -= 1;\n booleanFoundBoats[i][j] = 1;\n }\n else if (startCopy == 2){\n boatsNumber[1] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n }\n else if (startCopy == 3){\n boatsNumber[2] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n }\n else if (startCopy == 4){\n boatsNumber[3] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n booleanFoundBoats[i][j-3] = 1;\n }\n else if (startCopy == 5){\n boatsNumber[4] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n booleanFoundBoats[i][j-3] = 1;\n booleanFoundBoats[i][j-4] = 1;\n }\n \n start = 0;\n startCopy = 0;\n }\n \n } \n } \n }", "private void cleanMnemonicsConflict() {\n Enumeration enumer = mnemonicConflict.keys();\n \n while(enumer.hasMoreElements()) {\n String key = (String)enumer.nextElement();\n HashSet hs = (HashSet)mnemonicConflict.get(key);\n if(hs.size()==1)\n mnemonicConflict.remove(key);\n }\n \n }", "public void test5() {\n\t\tSet<String> keySet = member.keySet();\n\t\tfor(String key : keySet) {\n\t\t\tif(key ==\"leess\") {\n\t\t\t\tmember.remove(key);\n\t\t\t}\n\t\t}\n\t}", "public static boolean[] solution_used(int[][] dp_array,int objects,int capacity){\r\n\r\n boolean[] opt_set = new boolean[objects+1]; // to store solutions\r\n int Items = 0;\r\n int i = dp_array.length-1;\r\n for (int j = dp_array[0].length - 1; j >= 0 && i > 0;i--) {\r\n if (dp_array[i][j] != dp_array[i-1][j]) { // trace back algorithm\r\n opt_set[i-1] = true ; // set the array value true if the values are used\r\n j -= randvariables[i-1];\r\n Items++;\r\n }\r\n }\r\n return Arrays.copyOfRange(opt_set, 0, objects); //return the items\r\n }", "private void removeCards(int pileNumber, List<Card> build) {\n List<Card> pile = cascadePiles.get(pileNumber);\n for (Card c : build) {\n pile.remove(c);\n }\n }", "private int removeBoxes(int[] boxes, int l, int r, int k, Integer[][][] dp) {\n if (l > r)\n return 0;\n if (dp[l][r][k] != null)\n return dp[l][r][k];\n int x = l, y = r, z = k;\n while (l+1 <= r && boxes[l] == boxes[l+1]) {\n l++; //\n k++; // count of same elements in a row, starting from l\n }\n int ans = (k+1) * (k+1) + removeBoxes(boxes, l+1, r, 0, dp);\n for (int j = l+1; j <= r; ++j) {\n if (boxes[l] == boxes[j]) {\n ans = Math.max(ans, removeBoxes(boxes, j, r, k+1, dp) + removeBoxes(boxes, l+1, j-1, 0, dp));\n }\n }\n return dp[x][y][z] = ans;\n }", "public void removeEdge() {\n Graph GO = new Graph(nbOfVertex + 1);\n Value.clear();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n Value.add(j);\n if (MaxMatch[i] == Map.get(j)) {\n GO.addEdge(Map.get(j), i);\n } else {\n GO.addEdge(i, Map.get(j));\n }\n }\n }\n\n for (int i : V2) {\n for (int j : Value) {\n if (!V2.contains(j)) {\n GO.addEdge(i, j);\n }\n }\n }\n //System.out.println(\"GO : \");\n //System.out.println(GO);\n int[] map2Node = GO.findStrongConnectedComponent();\n //GO.printSCC();\n\n ArrayList<Integer>[] toRemove = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n toRemove[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n for (int j : x[i].getDomain()) {\n ////System.out.println(i + \" \" + j);\n if (map2Node[i] != map2Node[Map.get(j)] && MaxMatch[i] != Map.get(j)) {\n toRemove[i].add(j);\n if (debug == 1) System.out.println(\"Remove arc : \" + i + \" => \" + j);\n }\n }\n }\n for (int i = 0; i < n; i++) {\n for (int j : toRemove[i]) {\n x[i].removeValue(j);\n }\n }\n }", "public void deleteSelectedCategories() {\n\t\tfor (IFlashcardSeriesComponent x : selectionListener.selectedComponents) {\n\t\t\tFlashCategory cat = (FlashCategory) x;\n\t\t\t/*\n\t\t\tif (cat.getParent() == null) {\n\t\t\t\troot = new FlashCategory(root.getName());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t*/\n\t\t\tList<Flashcard> copy = new ArrayList<Flashcard>(flashcards);\n\t\t\tfor (Flashcard f : copy) {\n\t\t\t\tif (cat.containsFlashcard(f)) {\n\t\t\t\t\tflashcards.remove(f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcat.getParent().removeI(cat);\n\t\t\t\n\t\t\tif (selectRootAction != null) selectRootAction.selectRoot();\n\t\t\t\n\t\t}\n\t\tfireIntervalChanged(this,-1,-1);\n\t}", "public void deleteExperimentColors();", "private static void cleanTrainingData(Collection<TransitionMemory> trainingData) {\n\t\tint maxD = 0;\n\t\tfor (TransitionMemory tm : trainingData) maxD = Math.max(maxD, tm.getAllVars().length);\n\t\tfor (Iterator<TransitionMemory> iter = trainingData.iterator(); iter.hasNext();) {\n\t\t\tTransitionMemory tm = iter.next();\n\t\t\tif (tm.getAllVars().length < maxD) iter.remove();\n\t\t}\n\t}", "public static boolean QuasiThresholdDeletion (Graph<Integer,String> g, Integer k){\n\t\t\r\n\t\tif (k<0) return false;\r\n\t\t//System.out.print(\" \"+k+\"\\n\");\r\n\t\tboolean existsP4orC4 = false;\r\n\t\t\r\n\t\tIterator<Integer> a = g.getVertices().iterator();\r\n\t\tIterator<Integer> b;\r\n\t\tIterator<Integer> c;\r\n\t\tIterator<Integer> d;\r\n\t\twhile(a.hasNext()){\r\n\t\t\tInteger A = a.next();\r\n\t\t\t//System.out.print(\"\"+A+\" \");\r\n\t\t\tb = g.getNeighbors(A).iterator();\r\n\t\t\twhile(b.hasNext()){\r\n\t\t\t\tInteger B = b.next();\r\n\t\t\t\tc = g.getNeighbors(B).iterator();\r\n\t\t\t\twhile (c.hasNext()){\r\n\t\t\t\t\tInteger C = c.next();\r\n\t\t\t\t\tif (g.isNeighbor(C, A) || C==A) continue;\r\n\t\t\t\t\td = g.getNeighbors(C).iterator();\r\n\t\t\t\t\twhile (d.hasNext()){\r\n\t\t\t\t\t\tInteger D = d.next();\r\n\t\t\t\t\t\tif (D==B) continue; \r\n\t\t\t\t\t\tif (g.isNeighbor(D,B)) continue;\r\n\t\t\t\t\t\t//otherwise, we have a P4 or a C4\r\n\r\n\t\t\t\t\t\texistsP4orC4 = true;\r\n\t\t\t\t\t\t//System.out.print(\"Found P4: \"+A+\"-\"+B+\"-\"+C+\"-\"+D+\"... not a cograph\\n\");\r\n\r\n\t\t\t\t\t\tif (g.isNeighbor(D,A)) {\r\n\t\t\t\t\t\t\t// we have a C4 = a-b-c-d-a\r\n\t\t\t\t\t\t\t// delete any two edges\r\n\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(A, B));\r\n\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-2) == true) return true;\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-2) == true) return true;\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(D, A));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-2) == true) return true;\r\n\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+B, A,B);\r\n\t\t\t\t\t\t\t// all cases with AB deleted are done. AD is still deleted\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-2) == true) return true;\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-2) == true) return true;\r\n\r\n\t\t\t\t\t\t\t// all cases with AB deleted or AD deleted are done\r\n\t\t\t\t\t\t\t// at this point, CD and AD are still deleted\r\n\t\t\t\t\t\t\t// only need to try BC and CD together deleted.\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+D, A,D);\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-2) == true) return true;\r\n\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// this case says:\r\n\t\t\t\t\t\t\t// else D is NOT adjacent to A. Then we have P4=abcd\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(A, B));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-1) == true) return true;\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+A+\"-\"+B, A,B);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(B, C));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-1) == true) return true;\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+B+\"-\"+C, B,C);\r\n\t\r\n\t\t\t\t\t\t\tg.removeEdge(g.findEdge(C, D));\r\n\t\t\t\t\t\t\tif(QuasiThresholdDeletion(g,k-1) == true) return true;\r\n\t\t\t\t\t\t\tg.addEdge(\"mar-\"+C+\"-\"+D, C,D);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t} // end d.hasNext()\r\n\t\t\t\t} // end c.hasNext()\r\n\t\t\t} // end b.hasNext() \r\n\t\t} // end a.hasNext()\r\n\r\n\t\t// if we reached here, no P4 was found\r\n\t\tif (existsP4orC4 == false) {\r\n\t\t\t// arrived at a quasi-threshold graph since no P4 or C4 was found\r\n\t\t\tSystem.out.print(\"Edge deletion found with \" +k+ \" left to spare.\\n\");\r\n\t\t\tSystem.out.print(\"Resulting graph is \" + g);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t// ...\r\n\t\tSystem.out.print(\"Critical Error. No P_4 or C_4 found in a non-quasi-threshold graph.\\n\");\r\n\t\treturn false;\r\n\r\n\t\t\r\n\t}", "public void deleteFurniture(List<HomePieceOfFurniture> deletedFurniture) {\n final boolean basePlanLocked = this.home.isBasePlanLocked();\n final boolean allLevelsSelection = this.home.isAllLevelsSelection();\n final List<Selectable> oldSelection = this.home.getSelectedItems(); \n List<HomePieceOfFurniture> homeFurniture = this.home.getFurniture(); \n\n // Replace pieces by their group when they have to be all deleted\n deletedFurniture = new ArrayList<HomePieceOfFurniture>(deletedFurniture);\n List<HomeFurnitureGroup> homeGroups = new ArrayList<HomeFurnitureGroup>(); \n searchGroups(homeFurniture, homeGroups);\n boolean updated;\n do {\n updated = false;\n for (HomeFurnitureGroup group : homeGroups) {\n List<HomePieceOfFurniture> groupFurniture = group.getFurniture();\n if (deletedFurniture.containsAll(groupFurniture)) {\n deletedFurniture.removeAll(groupFurniture);\n deletedFurniture.add(group);\n updated = true;\n }\n }\n } while (updated);\n \n // Sort the deletable furniture in the ascending order of their index in home or their group\n Map<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>> deletedFurnitureMap =\n new HashMap<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>>();\n int deletedFurnitureCount = 0;\n for (HomePieceOfFurniture piece : deletedFurniture) {\n // Check piece is deletable and doesn't belong to a group\n if (isPieceOfFurnitureDeletable(piece)) {\n HomeFurnitureGroup group = getPieceOfFurnitureGroup(piece, null, homeFurniture);\n Map<Integer, HomePieceOfFurniture> sortedMap = deletedFurnitureMap.get(group);\n if (sortedMap == null) {\n sortedMap = new TreeMap<Integer, HomePieceOfFurniture>();\n deletedFurnitureMap.put(group, sortedMap);\n }\n if (group == null) {\n sortedMap.put(homeFurniture.indexOf(piece), piece);\n } else {\n sortedMap.put(group.getFurniture().indexOf(piece), piece);\n }\n deletedFurnitureCount++;\n }\n }\n final HomePieceOfFurniture [] furniture = new HomePieceOfFurniture [deletedFurnitureCount]; \n final int [] furnitureIndex = new int [furniture.length];\n final Level [] furnitureLevels = new Level [furniture.length];\n final HomeFurnitureGroup [] furnitureGroups = new HomeFurnitureGroup [furniture.length];\n int i = 0;\n for (Map.Entry<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>> sortedMapEntry : deletedFurnitureMap.entrySet()) {\n for (Map.Entry<Integer, HomePieceOfFurniture> pieceEntry : sortedMapEntry.getValue().entrySet()) {\n furniture [i] = pieceEntry.getValue();\n furnitureIndex [i] = pieceEntry.getKey(); \n furnitureLevels [i] = furniture [i].getLevel();\n furnitureGroups [i++] = sortedMapEntry.getKey();\n }\n } \n doDeleteFurniture(furniture, basePlanLocked, false); \n if (this.undoSupport != null) {\n UndoableEdit undoableEdit = new AbstractUndoableEdit() {\n @Override\n public void undo() throws CannotUndoException {\n super.undo();\n doAddFurniture(furniture, furnitureGroups, furnitureIndex, null, furnitureLevels, basePlanLocked, allLevelsSelection); \n home.setSelectedItems(oldSelection);\n }\n \n @Override\n public void redo() throws CannotRedoException {\n super.redo();\n home.setSelectedItems(Arrays.asList(furniture));\n doDeleteFurniture(furniture, basePlanLocked, false); \n }\n \n @Override\n public String getPresentationName() {\n return preferences.getLocalizedString(FurnitureController.class, \"undoDeleteSelectionName\");\n }\n };\n this.undoSupport.postEdit(undoableEdit);\n }\n }", "private void discardRestrictedCards()\n\t{\n\t\tif (playerList.size() == 2)\n\t\t{\n\t\t\tfor(Card card : restrictedCard2PlayerList)\n\t\t\t{\n\t\t\t\tswitch (card.getType())\n\t\t\t\t{\n\t\t\t\t\tcase GreenPlayerCard:\n\t\t\t\t\tcase BrownPlayerCard:\n\t\t\t\t\t\tCard playerCardMatch = board.getPlayerCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (playerCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(playerCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CityAreaCard:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PersonalityCard:\n\t\t\t\t\t\tCard personalityCardMatch = board.getPersonalityCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (personalityCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(personalityCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RandomEventCard:\n\t\t\t\t\t\tCard randomEventCardMatch = board.getRandomEventCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (randomEventCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(randomEventCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void deleteBooking() \n {\n Scanner memberID=new Scanner(System.in);\n System.out.println(\"Please enter your member number: \");\n int memberId = memberID.nextInt();\n \n Member mem = sportsClub.searchMember(memberId);\n if(mem==null || mem.getBookings()==null)\n {\n System.out.println(\"Sorry! There are no members with the given ID. \");\n\n \n\n }\n else\n {\n for(Booking b : mem.getBookings())//Displays the member details n bookings\n {\n System.out.println(\"Booking Id : \" + b.hashCode()+ \" Booking made by \"+mem.getMemberName() +\" for \" + b.getBookingDate() + \" at \" + b.getBookingTime() + \" for \" + b.getBookingEndTime() + \" minutes on Court number \" + b.getCourt().getCourtId());\n\n }\n \n if(mem.getBookings().size()!=0)\n {\n Scanner inputID=new Scanner(System.in);\n System.out.println(\"Enter Booking ID: \");\n int input = inputID.nextInt();\n Iterator<Booking> itr = mem.getBookings().iterator();\n\n\n while(itr.hasNext())//delettion starts based on the ID\n { \n if(itr.next().hashCode() == input)\n {\n itr.remove();\n for(String str : mem.getSportsPlayed())\n {\n Sport sportObj = sportsClub.findSport(str);\n\n ArrayList<Court> itrCourt = sportObj.getCourtList();\n for(Court c : itrCourt)//finds the court\n {\n\n Iterator<Booking> itrBooking = c.getCourtBookings().iterator();\n while(itrBooking.hasNext())//helps to get the booking object\n {\n if(itrBooking.next().hashCode() == input)\n {\n itrBooking.remove();//removes the booking object\n System.out.println(\"Deleted Successfully\");\n }\n } \n } \n } \n }\n }\n }\n }\n\n\n\n }", "public void removeAllPieces()\n\t{\n\t\t/* iterate over the rows and columns */\n\t\tfor (int i = 0; i < m_rows; i++) {\n\t\t\tfor (int j = 0; j < m_cols; j++) {\n\t\t\t\tremovePiece(i, j);\n\t\t\t}\n\t\t}\n\t}", "private void deleteExec(){\r\n\t\tList<HashMap<String,String>> selectedDatas=ViewUtil.getSelectedData(jTable1);\r\n\t\tif(selectedDatas.size()<1){\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Please select at least 1 item to delete\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint options = 1;\r\n\t\tif(selectedDatas.size() ==1 ){\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete this Item ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}else{\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete these \"+selectedDatas.size()+\" Items ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}\r\n\t\tif(options==1){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor(HashMap<String,String> map:selectedDatas){\r\n\t\t\t\r\n\t\t\tdiscountService.deleteDiscountByMap(NameConverter.convertViewMap2PhysicMap(map, \"Discount\"));\r\n\t\t}\r\n\t\tthis.initDatas();\r\n\t}", "protected void removeCandidate(Integer candidate) throws NoCandidatesException \n {\n for (Cell cell : cells) \n {\n cell.remove(candidate);\n }\n }", "@Override\r\n\tpublic void deleteCombination(Combination combination) {\n\t\tgetHibernateTemplate().delete(combination);\r\n\t}", "private void removalOfTemporaryAttSet(Context context, StringList sLFeatAndRuleIds)\r\n \t throws Exception{\r\n\r\n \t \t\tStringBuffer sbTypePattern = new StringBuffer(50);\r\n \t\t\tsbTypePattern.append(ConfigurationConstants.TYPE_LOGICAL_STRUCTURES);\r\n \t\t\tsbTypePattern.append(\",\");\r\n \t\t\tsbTypePattern.append(ConfigurationConstants.TYPE_CONFIGURATION_FEATURES);\r\n \t\t\tsbTypePattern.append(\",\");\r\n \t\t\tsbTypePattern.append(ConfigurationConstants.TYPE_PRODUCTS);\r\n \t\t\tsbTypePattern.append(\",\");\r\n \t\t\tsbTypePattern.append(ConfigurationConstants.TYPE_RULE);\r\n\r\n \t\t\tStringBuffer sbWhereClause = new StringBuffer(50);\r\n \t\t\tsbWhereClause.append(\"(\");\r\n \t\t\tsbWhereClause.append(\"interface[FTRIntermediateObjectMigration] == \\\"\" + ConfigurationConstants.RANGE_VALUE_TRUE + \"\\\"\");\r\n \t\t\tsbWhereClause.append(\")\");\r\n\r\n \t\t\tStringList objectSelects = new StringList();\r\n \t\t\tobjectSelects.add(SELECT_TYPE);\r\n \t\t\tobjectSelects.add(\"interface\");\r\n objectSelects.add(SELECT_NAME);\r\n objectSelects.add(SELECT_REVISION);\r\n objectSelects.add(SELECT_ID);\r\n\r\n \t \t\tMapList MapListObjects = DomainObject.findObjects(context, // context\r\n \t \t\t\t\t\t\t\t\t\t\t\t\tsbTypePattern.toString(), // typePattern\r\n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\"*\", // vaultPattern\r\n\t\t\t\t\t\t\t\t\t \t\t\t\t\tsbWhereClause.toString(), // whereExpression\r\n\t\t\t\t\t\t\t\t\t \t\t\t\t\tobjectSelects); // objectSelects\r\n\r\n\r\n \t \t\tStringList sLObjIds = new StringList();\r\n \t \t\tfor(int i=0;i<MapListObjects.size();i++){\r\n \t \t\t\t Map mObj = (Map) MapListObjects.get(i);\r\n \t \t\t\t String strObjId = (String) mObj.get(SELECT_ID);\r\n \t \t\t\t sLObjIds.add(strObjId);\r\n \t \t\t}\r\n\r\n\r\n\r\n \t \t\t//Intersection of 2 lists\r\n \t \t\tsLObjIds.retainAll(sLFeatAndRuleIds);\r\n\r\n\r\n \t \t\t try {\r\n\t\t\t\t\tfor(int i=0;i<sLObjIds.size();i++){\r\n\t\t\t\t\t\t String strObjId = (String) sLObjIds.get(i);\r\n\t\t\t\t\t\t //String strMqlCommand = \"modify bus \" + strObjId + \" remove interface\" + \" \" + INTERFACE_FTRIntermediateObjectMigration;\r\n\t\t\t\t\t\t String strMqlCommand = \"modify $1 $2 remove interface $3\";\r\n\t\t\t\t\t\t MqlUtil.mqlCommand(context,strMqlCommand, \"bus\", strObjId, INTERFACE_FTRIntermediateObjectMigration);\r\n\t\t\t\t\t }\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\r\n \t }", "public void deleteCt() {\n\t\tlog.info(\"-----deleteCt()-----\");\n\t\t//int index = selected.getCtXuatKho().getCtxuatkhoThutu().intValue() - 1;\n\t\tlistCtKhoLeTraEx.remove(selected);\n\t\tthis.count = listCtKhoLeTraEx.size();\n\t\ttinhTien();\n\t}", "@Test\n public void testTwoBssids() throws Exception {\n // Make a duplicate of the first config\n mConfig2 = new WifiConfiguration(mConfig1);\n // Make a second scan result, same network, different BSSID.\n mScanResult2.SSID = mScanResult1.SSID;\n mScanResult2.BSSID = mScanResult1.BSSID.replace('1', '2');\n // Add both\n mWifiCandidates.add(mScanDetail1, mConfig1, 2, 0.0, false, 100);\n mWifiCandidates.add(mScanDetail2, mConfig2, 2, 0.0, false, 100);\n // We expect them both to be there\n assertEquals(2, mWifiCandidates.size());\n // But just one group\n assertEquals(1, mWifiCandidates.getGroupedCandidates().size());\n // Now remove them one at a time\n WifiCandidates.Candidate c1, c2;\n c1 = mWifiCandidates.getGroupedCandidates().iterator().next().iterator().next();\n assertTrue(mWifiCandidates.remove(c1));\n assertEquals(1, mWifiCandidates.size());\n assertEquals(1, mWifiCandidates.getGroupedCandidates().size());\n // Should not be able to remove the one that isn't there\n assertFalse(mWifiCandidates.remove(c1));\n // Remove the other one, too\n c2 = mWifiCandidates.getGroupedCandidates().iterator().next().iterator().next();\n assertTrue(mWifiCandidates.remove(c2));\n assertFalse(mWifiCandidates.remove(c2));\n assertEquals(0, mWifiCandidates.size());\n assertEquals(0, mWifiCandidates.getGroupedCandidates().size());\n }", "private void removeJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeJButtonActionPerformed\n //remove current index from name and temp then redo edge and graph\n //check enabled\n int index = cityJList.getSelectedIndex();\n //determine if user still wants to delte employee\n int result = JOptionPane.showConfirmDialog(null, \"Are you sure you want\"\n + \" to delete city: \"\n + namesArray.get(index) + \" (\" + tempArray.get(index).get(0) \n + \", \" + tempArray.get(index).get(1) +\")?\",\n \"Delete City\", JOptionPane.YES_NO_OPTION);\n\n if(result == JOptionPane.YES_OPTION)\n {\n namesArray.remove(index);\n tempArray.remove(index);\n //make list of edges\n makeEdgeList(namesArray, tempArray);\n //make weighted graph object\n graph = new WeightedGraph(namesArray, edgeArray);\n loadJList();\n checkEnabled();\n clearStats();\n calculateJButton.doClick();\n }\n }", "int removeObstacle(int numRows, int numColumns, List<List<Integer>> lot)\r\n {\r\n \tint m = 0;\r\n \tint n = 0;\r\n \tfor(List<Integer> rowList: lot) {\r\n \t\tfor(Integer num: rowList) {\r\n \t\t\tif(num == 9 ) {\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tn++;\r\n \t\t}\r\n \t\tm++;\r\n \t}\r\n \t// to store min cells required to be \r\n // covered to reach a particular cell \r\n int dp[][] = new int[numRows][numColumns]; \r\n \r\n // initially no cells can be reached \r\n for (int i = 0; i < numRows; i++) \r\n for (int j = 0; j < numColumns; j++) \r\n dp[i][j] = Integer.MAX_VALUE; \r\n \r\n // base case \r\n dp[0][0] = 1; \r\n \r\n for (int i = 0; i < lot.size(); i++) {\r\n \tList<Integer> columnList = lot.get(i);\r\n for (int j = 0; j < columnList.size(); j++) { \r\n \r\n // dp[i][j] != INT_MAX denotes that cell \r\n // (i, j) can be reached from cell (0, 0) \r\n // and the other half of the condition \r\n // finds the cell on the right that can \r\n // be reached from (i, j) \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (j + columnList.get(j)) < numColumns && (dp[i][j] + 1) \r\n < dp[i][j + columnList.get(j)]\r\n \t\t && columnList.get(j) != 0) \r\n dp[i][j + columnList.get(j)] = dp[i][j] + 1; \r\n \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (i + columnList.get(j)) < numRows && (dp[i][j] + 1) \r\n < dp[i + columnList.get(j)][j] && columnList.get(j) != 0) \r\n dp[i + columnList.get(j)][j] = dp[i][j] + 1; \r\n } \r\n } \r\n \r\n if (dp[m - 1][n - 1] != Integer.MAX_VALUE) \r\n return dp[m - 1][n - 1]; \r\n \r\n return -1; \r\n }", "boolean restrictCategory(){\n\n\n if((!top.isEmpty()||!bottom.isEmpty())&&!suit.isEmpty()){\n Toast.makeText(this, \"상의/하의와 한벌옷은 동시에 설정할 수 없습니다.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n detail_categories = new ArrayList<>(Arrays.asList(top_detail,bottom_detail,suit_detail,\n outer_detail,shoes_detail,bag_detail,accessory_detail));\n\n for (int kindNum=0; kindNum<7; kindNum++){\n String category = categories.get(kindNum); //해당 종류(ex.상의)에 설정된 카테고리명 받아옴\n String kind = Utils.getKey(Utils.Kind.kindNumMap,kindNum); //종류명 받아옴\n\n if(!category.isEmpty()){ //카테고리가 설정 되어있다면\n String detail_category = detail_categories.get(kindNum); //디테일 카테고리 받아옴\n Iterator<ClothesVO> cloListIter = clothesList.iterator();\n int remain_items=0;\n\n if(detail_category.isEmpty()){ //카테고리만 설정되어 있다면\n while (cloListIter.hasNext()) {\n ClothesVO clothes = cloListIter.next();\n String cloKind = clothes.getKind();\n if(cloKind.equals(kind)){\n if(!clothes.getCategory().equals(category))\n cloListIter.remove(); //해당 종류에 해당 카테고리가 아닌 옷들을 제거\n else\n remain_items+=1; //제거되지 않은 옷\n }\n\n if(kindNum == Utils.Kind.TOP || kindNum == Utils.Kind.BOTTOM){\n if(\"한벌옷\".equals(cloKind))\n cloListIter.remove();\n }else if(kindNum == Utils.Kind.SUIT){\n if(\"상의\".equals(cloKind) || \"하의\".equals(cloKind))\n cloListIter.remove(); //제거\n }\n }\n }else{ //디테일 카테고리도 설정되어 있다면\n while (cloListIter.hasNext()) {\n ClothesVO clothes = cloListIter.next();\n String cloKind = clothes.getKind();\n if(cloKind.equals(kind)){\n if(!clothes.getDetailCategory().equals(detail_category))\n cloListIter.remove();//해당 종류에 해당 세부 카테고리가 아닌 옷들을 제거\n else\n remain_items+=1; //제거되지 않은 옷\n }\n\n if(kindNum == Utils.Kind.TOP || kindNum == Utils.Kind.BOTTOM){\n if(\"한벌옷\".equals(cloKind))\n cloListIter.remove();\n }else if(kindNum == Utils.Kind.SUIT){\n if(\"상의\".equals(cloKind) || \"하의\".equals(cloKind))\n cloListIter.remove(); //제거\n }\n }\n }\n\n if(remain_items==0){\n if(!detail_category.isEmpty()){\n category = detail_category;\n }\n\n// if(recommendedDCate!=null ){\n// List<String>recommendedDCateArray = Arrays.asList(recommendedDCate);\n// if(!recommendedDCateArray.contains(category)){\n// Toast.makeText(this, \"해당 날씨에 맞지 않는 <\"+category+\"> 카테고리가 설정에 포함되어 있습니다.\", Toast.LENGTH_LONG).show();\n// return false;\n// }\n// }\n\n Toast.makeText(this, \"설정한 <\"+category+\"> 카테고리의 옷이 없거나 해당 날씨에 맞지 않습니다. \\n더 많은 옷을 추가해보세요.\", Toast.LENGTH_LONG).show();\n return false;\n }\n }\n }\n\n return true;\n }", "public void clean() {\n \tfor(int f=0; f<NUMCARTAS;f++) \n \tfor(int c=0; c<NUMCARTAS;c++) {\n \t\ttablero[f][c].setSelected(false);\n\t \t \t//Devuelve al color original\n\t if(tablero[f][c].getText().length()==2) tablero[f][c].setBackground(colorDiagonal);\n\t else if(tablero[f][c].getText().charAt(2)=='s') tablero[f][c].setBackground(colorSuited);\n\t else tablero[f][c].setBackground(colorOffsuited);\n \t}\n }", "private List<int[]> buildNewCandidates(List<int[]> lastCandidates){\n Map<String, SetWithFrequency> frequency = new HashMap<>();\n\n // Set the threshold to be k\n int threshold = lastCandidates.get(0).length + 1;\n\n // Creates new candidates by merging the previous sets\n for (int i = 0; i < lastCandidates.size(); i++){\n for (int j = i + 1; j < lastCandidates.size(); j++){\n int[] firstSet = lastCandidates.get(i);\n int[] secondSet = lastCandidates.get(j);\n\n int[] candidate = mergeTwoSet(firstSet, secondSet);\n\n if (candidate != null){\n\n // This is a valid candidate (contains all elements from first / second set)\n String key = arrayToString(candidate);\n\n if (frequency.containsKey(key)){\n frequency.get(key).frequency++;\n } else{\n frequency.put(key, new SetWithFrequency(key, candidate, 1));\n }\n }\n }\n }\n\n List<int[]> res = new ArrayList<>();\n\n threshold = threshold * (threshold - 1) / 2;\n for (SetWithFrequency entry: frequency.values()){\n // Prune the candidates which does not have all subsets being frequent\n if (entry.frequency == threshold){\n res.add(entry.set);\n }\n }\n\n return res;\n }", "public List<String> confirmMatchVars(HashMap<String, List<String>> mapCandVarToMatchedVals,\n HashMap<String, List<String>> mapCandVarToAllAnsMaps, int indxCTP) {\n\n System.out.println(\"\\t\\t\\t\\t\\t ================ CONFIRM or REJECT matched vars ================\");\n List<String> valuesCandVar = null;\n List valuesCandVarAns = null;\n List<String> removeKeys = new LinkedList<>();\n double maxMatchValue = 0;\n\n for (String keyOuter : mapCandVarToMatchedVals.keySet()) {\n\n valuesCandVarAns = mapCandVarToAllAnsMaps.get(keyOuter);\n valuesCandVar = mapCandVarToMatchedVals.get(keyOuter);\n double percentageMatchec = (double) valuesCandVar.size() / valuesCandVarAns.size();\n\n if (maxMatchValue < percentageMatchec) {\n\n maxMatchValue = percentageMatchec;\n }\n\n if (valuesCandVarAns != null && valuesCandVar != null) {\n\n //BUUUUUUUUUUUUUUUUUG\n if ((percentageMatchec < inverseThresh && !(Double.toString(percentageMatchec).contains(\"E\")))\n || (DTPCandidates.get(indxCTP).get(1).contains(\"?\") && percentageMatchec < 0.10)\n || (valuesCandVar.size() == 1 && percentageMatchec < 0.04)) {\n\n if (!myBasUtils.elemInListEquals(removeKeys, keyOuter)) {\n\n System.out.println(\"\\t\\t\\t\\t\\t\\t CANCEL var: ?\" + keyOuter.substring(0, keyOuter.indexOf(\"_\")) + \", while actually mathced: \" + (percentageMatchec * 100) + \" %\");\n removeKeys.add(keyOuter);\n }\n } else {\n if (!inverseBestMap) {\n System.out.println(\"\\t\\t\\t\\t\\t\\t VALIDATE candidate var: ?\" + keyOuter.substring(0, keyOuter.indexOf(\"_\")) + \", while actually mathced: \" + (percentageMatchec * 100) + \" %\");\n\n }\n }\n\n } //BUUUUUUUUUUUUUUUUUG\n else if (valuesCandVar == null) {\n removeKeys.add(keyOuter);\n } else {\n if (!inverseBestMap) {\n System.out.println(\"\\t\\t\\t\\t\\t\\t VALIDATE var: ?\" + keyOuter.substring(0, keyOuter.indexOf(\"_\")) + \", while actually mathced: \" + (percentageMatchec * 100) + \" %\");\n\n }\n }\n\n }\n\n if (inverseBestMap) {\n\n for (String keyOuter : mapCandVarToMatchedVals.keySet()) {\n\n valuesCandVarAns = mapCandVarToAllAnsMaps.get(keyOuter);\n valuesCandVar = mapCandVarToMatchedVals.get(keyOuter);\n double percentageMatchec = (double) valuesCandVar.size() / valuesCandVarAns.size();\n\n if (valuesCandVarAns != null && valuesCandVar != null) {\n\n if (maxMatchValue > percentageMatchec) {\n\n if (!myBasUtils.elemInListEquals(removeKeys, keyOuter)) {\n\n System.out.println(\"\\t\\t\\t\\t\\t\\t CANCEL as not best matching var: ?\" + keyOuter.substring(0, keyOuter.indexOf(\"_\")) + \", while actually mathced: \" + (percentageMatchec * 100) + \" %\");\n removeKeys.add(keyOuter);\n }\n } else {\n\n System.out.println(\"\\t\\t\\t\\t\\t\\t VALIDATE candidate var: ?\" + keyOuter.substring(0, keyOuter.indexOf(\"_\")) + \", while actually mathced: \" + (percentageMatchec * 100) + \" %\");\n }\n\n } //BUUUUUUUUUUUUUUUUUG\n else if (valuesCandVar == null) {\n if (!myBasUtils.elemInListEquals(removeKeys, keyOuter)) {\n removeKeys.add(keyOuter);\n }\n\n } else {\n\n System.out.println(\"\\t\\t\\t\\t\\t\\t VALIDATE var: ?\" + keyOuter.substring(0, keyOuter.indexOf(\"_\")) + \", while actually mathced: \" + (percentageMatchec * 100) + \" %\");\n }\n\n }\n }\n\n System.out.println(\"\\t\\t\\t\\t\\t ================ CONFIRM or REJECT matched vars ================\");\n\n return removeKeys;\n }", "@Test\n public void removeResourcesForBuildings(){\n Player player = new Player(2);\n player.addResource(0, 2);\n player.addResource(1, 1);\n player.addResource(2, 3);\n player.addResource(3, 3);\n player.addResource(4, 2);\n assertTrue(\"Error - player has enough resources for building 1, should be true\", player.hasEnoughResourcesFor(1));\n assertTrue(\"Error - player has enough resources for building 2, should be true\", player.hasEnoughResourcesFor(2));\n assertTrue(\"Error - player has enough resources for building 3, should be true\", player.hasEnoughResourcesFor(3));\n player.removeResourcesFor(1);\n assertFalse(\"Error - player does not have enough resources for building 1, should be false\", player.hasEnoughResourcesFor(1));\n assertTrue(\"Error - player has enough resources for building 2, should be true\", player.hasEnoughResourcesFor(2));\n assertTrue(\"Error - player has enough resources for building 3, should be true\", player.hasEnoughResourcesFor(3));\n int resources = player.getResource(0)*10000 + player.getResource(1)*1000 + player.getResource(2)*100+player.getResource(3)*10 + player.getResource(4);\n assertEquals(\"Error - incorrect number of resources after building settlement\",10321,resources);\n player.removeResourcesFor(2);\n assertFalse(\"Error - player does not have enough resources for building 1, should be false\", player.hasEnoughResourcesFor(1));\n assertFalse(\"Error - player does not have enough resources for building 2, should be false\", player.hasEnoughResourcesFor(2));\n assertTrue(\"Error - player has enough resources for building 3, should be true\", player.hasEnoughResourcesFor(3));\n resources = player.getResource(0)*10000 + player.getResource(1)*1000 + player.getResource(2)*100+player.getResource(3)*10 + player.getResource(4);\n assertEquals(\"Error - incorrect number of resources after building town\",10001,resources);\n player.removeResourcesFor(3);\n assertFalse(\"Error - player does not have enough resources for building 1, should be false\", player.hasEnoughResourcesFor(1));\n assertFalse(\"Error - player does not have enough resources for building 2, should be false\", player.hasEnoughResourcesFor(2));\n assertFalse(\"Error - player does not have enough resources for building 3, should be false\", player.hasEnoughResourcesFor(3));\n resources = player.getResource(0) + player.getResource(1) + player.getResource(2) +player.getResource(3) + player.getResource(4);\n assertEquals(\"Error - incorrect number of resources after building town\",0,resources);\n }" ]
[ "0.6689393", "0.5937539", "0.58253366", "0.5725434", "0.56887776", "0.5573971", "0.53876734", "0.5371556", "0.5316808", "0.53145385", "0.52986836", "0.52962136", "0.52903235", "0.5277582", "0.524447", "0.5237959", "0.52352446", "0.5229582", "0.5221394", "0.5207219", "0.51914096", "0.5175231", "0.5168014", "0.514303", "0.5137976", "0.51377946", "0.51365894", "0.5109777", "0.51075876", "0.510661", "0.50761616", "0.5064041", "0.505396", "0.50492793", "0.5039821", "0.5028286", "0.5028181", "0.5027708", "0.5025299", "0.50211275", "0.5013671", "0.5004007", "0.4978998", "0.49734053", "0.49470335", "0.49444282", "0.49411133", "0.4938994", "0.49324384", "0.49307227", "0.49298844", "0.49236065", "0.49192962", "0.4917921", "0.49134997", "0.49130213", "0.49114722", "0.4908699", "0.49064797", "0.48985723", "0.48939145", "0.48819888", "0.48811546", "0.48740155", "0.48706174", "0.48617336", "0.4860431", "0.48593503", "0.48582035", "0.48556852", "0.48553872", "0.48499662", "0.48469284", "0.4845833", "0.48442274", "0.48424754", "0.48411572", "0.48393118", "0.48356283", "0.48335838", "0.48323265", "0.48295993", "0.48268506", "0.48256853", "0.48207492", "0.4818734", "0.48150256", "0.4811596", "0.4807614", "0.48033282", "0.48023647", "0.4800902", "0.479849", "0.47968727", "0.47925642", "0.4787361", "0.47859156", "0.47807193", "0.47807118", "0.47781703" ]
0.6839048
0
checks if there are playable moves left by shifting each candy up, down, left, and right until it finds a valid combination
public void MovesRemainingExists() { InsideMovesRemainingExists = 1; NoMovesRemaining = 1; Beginning: for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { previousX = i; previousY = j + 1; if ((i + 1) < 9) { ValidSwitch(i + 1, j + 1); if (NoMovesRemaining == 0) { //checks the candies to the right ResetState(); break Beginning; //breaks the loop } } if ((i - 1) >= 0) { ValidSwitch(i - 1, j + 1); if (NoMovesRemaining == 0) { //checks the candies to the left ResetState(); break Beginning; } } if ((j + 1) < 9) { ValidSwitch(i, j + 2); if (NoMovesRemaining == 0) { //checks the candies on the bottom ResetState(); break Beginning; } } if ((j - 1) >= 0) { ValidSwitch(i, j); if (NoMovesRemaining == 0) { //checks the candies at the top ResetState(); break Beginning; } } } } InsideMovesRemainingExists = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void moveLeft()\n {\n // runs through row first, column second\n for ( int row = 0; row < grid.length; row++) {\n\n // check is set to false, meaning no combinations have been made\n boolean check = false;\n for ( int column = 1; column < grid[row].length; column++) {\n int compare = column;\n if ( grid[row][compare] != 0 ) {\n\n // loop continues while there are still zero values to the left of a\n // tile\n while ( grid[row][compare-1] == 0 ) {\n\n // switches places of the current tile with the zero tile\n grid[row][compare-1] = grid[row][compare];\n grid[row][compare] = 0;\n compare --;\n\n // if you reach the end of your board, break from the loop\n if ( compare == 0 ){\n break;\n }\n }\n // if a combination was made on the previous loop, set check to false\n if ( check == true ){\n check = false;\n }\n // if a conbination wasn't made on the previous loop and two tiles\n // next to each other have the same value, combine them\n else if ( compare!=0 && grid[row][compare-1] == grid[row][compare]) {\n grid[row][compare-1] = 2*grid[row][compare-1];\n grid[row][compare] = 0;\n\n // sets check to true to indicate a combination was made\n check = true;\n\n // increases your score by the value of the combined tile\n score+= grid[row][compare-1];\n } \n }\n }\n }\n }", "public static void compute_possible_moves(Board s){\n\t\tint b [][] = s.board;\n\t\tint x = -1;\n\t\tint y = -1;\n\t\tfor (int i = 0;i < b.length;i++) {\n\t\t\tfor (int j = 0;j < b[i].length;j++) {\n\t\t\t\tif(b[i][j] == 0){\n\t\t\t\t\tx = i;\n\t\t\t\t\ty = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\tint left [][];\n\t\tint right [][];\n\t\tint up [][];\n\t\tint down [][];\n\t\tpossible_boards.clear();\n\t\tif(x - 1 != -1 && x >= 0 && x < 3){\n\t\t\t//up is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\n\t\t\tint temp = temporary_board[x - 1][y];\n\t\t\ttemporary_board[x - 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tup = temporary_board;\n\n\t\t\tBoard up_board = new Board(up);\n\t\t\tpossible_boards.add(up_board);\n\n\t\t}\n\t\tif(x + 1 != 3 && x >= 0 && x < 3){\n\t\t\t//down is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x + 1][y];\n\t\t\ttemporary_board[x + 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tdown = temporary_board;\n\t\t\tBoard down_board = new Board(down);\n\t\t\tpossible_boards.add(down_board);\n\t\t}\n\t\tif(y - 1 != -1 && y >= 0 && y < 3){\n\t\t\t//left move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y - 1];\n\t\t\ttemporary_board[x][y - 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tleft = temporary_board;\n\t\t\tBoard left_board = new Board(left);\n\t\t\tpossible_boards.add(left_board);\n\n\t\t}\n\t\tif(y + 1 != 3 && y >= 0 && y < 3){\n\t\t\t//right move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y + 1];\n\t\t\ttemporary_board[x][y + 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tright = temporary_board;\n\t\t\tBoard right_board = new Board(right);\n\t\t\tpossible_boards.add(right_board);\n\n\t\t}\n\n\t}", "@Override\r\n\tpublic void getLegalMoves() {\r\n\t\tint pawnX = this.getX();\r\n\t\tint pawnY = this.getY();\r\n\t\tchar pawnColor = getColor();\r\n\t\tTile[][] chessBoard = SimpleChess.getChessBoard();\r\n\t\tcheckInFront(chessBoard,pawnX,pawnY,pawnColor);\r\n\t\tcheckDiagonal(chessBoard,pawnX,pawnY,pawnColor);\r\n\t}", "public boolean validRook (int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t\n\t\tint distanceMovedUpDown =endRow-startRow; \n\t\tint distanceMovedLeftRight = endColumn-startColumn;\n\n\t\tif (distanceMovedUpDown !=0 && distanceMovedLeftRight != 0) { //have to stay in the same column or row to be valid\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif (startRow == endRow) { //moving left or right \n\t\t\tif (Math.abs(distanceMovedLeftRight) > 1) { //checking if there's pieces btwn start and end if moving more than 1\n\t\t\t\tif (distanceMovedLeftRight > 0) {//moving to the right \n\t\t\t\t\tint x=startColumn + 1;\n\t\t\t\t\twhile (x < endColumn) {\n\t\t\t\t\t\tif (board[startRow][x].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif (distanceMovedLeftRight < 0) {//moving to the left\n\t\t\t\t\tint x = startColumn -1;\n\t\t\t\t\twhile (x > endColumn) {\n\t\t\t\t\t\tif (board[startRow][x].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn true;\n\n\t\t}\n\t\tif (startColumn == endColumn) { //moving up or down\n\t\t\tif (Math.abs(distanceMovedUpDown) > 1) { //checking if there's pieces btwn start and end if moving more than 1\n\t\t\t\tif (distanceMovedUpDown > 0) {//moving up the array\n\t\t\t\t\tint x=startRow + 1;\n\t\t\t\t\twhile (x < endRow) {\n\t\t\t\t\t\tif (board[x][startColumn].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif (distanceMovedUpDown < 0) {//moving down the array\n\t\t\t\t\tint x = startRow -1;\n\t\t\t\t\twhile (x > endRow) {\n\t\t\t\t\t\tif (board[x][startColumn].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}", "public static HashSet<gameState> Actions(gameState currentState) {\n\t\t\n\t\tHashSet<gameState> possibleStates = new HashSet<gameState>();\n\t\t\n\t\t\n\t\t// Store which player goes next after this player plays\n\t\tint nextNextUp;\n\t\tif (currentState.getNextUp() == 0) {\n\t\t\tnextNextUp = 1;\n\t\t} else {\n\t\t\tnextNextUp = 0;\n\t\t}\n\t\t\n\t\t// Store corresponding characters for each player\n\t\t// DARK(X) - 0, LIGHT(O) - 1\n\t\tchar myTile;\n\t\tchar opponentTile;\n\t\tif (currentState.getNextUp() == 0) {\n\t\t\tmyTile = 'x';\n\t\t\topponentTile = 'o';\n\t\t} else {\n\t\t\tmyTile = 'o';\n\t\t\topponentTile = 'x';\n\t\t}\n\n\t\t\n\n\t\t// Check the entire board of the state \n\t\tfor (int i = 0; i<boardSize; i++) {\n\t\t\tfor (int j = 0; j<boardSize; j++) {\n\t\t\t\t\n\t\t\t\t// If the tile is my tile\n\t\t\t\tif (currentState.getBoard()[i][j] == '_') {\n\t\t\t\t\t\n\t\t\t\t\tchar[][] moveBoard = createNewBoard(currentState);\n\t\t\t\t\t\n\t\t\t\t\t// Up\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// If it is an opponent tile, then you keep going up until you either my tile (fail) or\n\t\t\t\t\t\t// a blank space (success/move possible)\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j] == opponentTile) { \n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][j] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k+1; l<=i;l++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[l][j] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][j] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\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\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Down\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][j] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k-1; l>=i;l--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[l][j] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][j] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i][j-1] == opponentTile) { \n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = j-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[i][k] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k+1; l<=j;l++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[i][l] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[i][k] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\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\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i][j+1] == opponentTile) { \n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = j+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[i][k] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k-1; l>=j;l--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[i][l] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[i][k] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Up and Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j-1] == opponentTile) { \n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j-2;\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l+1;\n\t\t\t\t\t\t\t\t\tfor (int q = k+1; q<=i;q++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl--;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\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\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Up and Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j+1] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j+2;\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l-1;\n\t\t\t\t\t\t\t\t\tfor (int q = k+1; q<=i;q++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl++;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\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\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} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Down and Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j-1] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j-2;\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l+1;\n\t\t\t\t\t\t\t\t\tfor (int q = k-1; q>=i;q--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl--;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\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\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Down and Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j+1] == opponentTile) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j+2;\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l-1;\n\t\t\t\t\t\t\t\t\tfor (int q = k-1; q>=i;q--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl++;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\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} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\tif (!compareBoards(moveBoard, currentState.getBoard())) {\n\t\t\t\t\t\tgameState move = new gameState(moveBoard, nextNextUp);\t\t\n\t\t\t\t\t\tpossibleStates.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\n\t\treturn possibleStates;\n\t\t\n\t\t\n\t\t\n\t}", "void checkForPlayer(boolean checkForBlacks, int i, int j) {\n\t\tcounter = 0;\n\t\tpossibleFlips.clear();\n\t\t//**Check vertical**\\\\\n\t\t// Check upwards\n\t\tfor (int n = j-1; n >= 0; --n) {\n\t\t\tif (!check(i, n, checkForBlacks))\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcounter = 0;\n\t\tpossibleFlips.clear();\n\t\t\n\t\t// Check downwards\n\t\tfor (int n = j+1; n < dimensions.y; ++n) {\n\t\t\tif (!check (i, n, checkForBlacks))\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcounter = 0;\n\t\tpossibleFlips.clear();\n\t\t\n\t\t//**Check horizontal**\\\\\n\t\t// Check to left\n\t\tfor (int n = i-1; n >=0; --n) {\n\t\t\tif (!check(n, j, checkForBlacks))\n\t\t\tbreak;\n\t\t}\n\n\t\tcounter = 0;\n\t\tpossibleFlips.clear();\n\t\t\n\t\t// Check to right\n\t\tfor (int n = i+1; n < dimensions.x; ++n) {\n\t\t\tif (!check(n, j, checkForBlacks))\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcounter = 0;\n\t\tpossibleFlips.clear();\n\t\t\n\t\t//**Check diagonals**\\\\\n\t\t// Check North-East\n\t\tfor (int n = 1; i+n < dimensions.x && j-n >= 0; ++n) {\n\t\t\tif (!check(i+n, j-n, checkForBlacks))\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcounter = 0;\n\t\tpossibleFlips.clear();\n\t\t\n\t\t// Check North-West\n\t\tfor (int n = 1; i-n >= 0 && j-n >= 0; ++n) {\n\t\t\tif (!check(i-n, j-n, checkForBlacks))\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcounter = 0;\n\t\tpossibleFlips.clear();\n\t\t\n\t\t// Check South-East\n\t\tfor (int n = 1; i+n < dimensions.x && j+n < dimensions.y; ++n) {\n\t\t\tif (!check(i+n, j+n, checkForBlacks))\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcounter = 0;\n\t\tpossibleFlips.clear();\n\t\t\n\t\t// Check South-West\n\t\tfor (int n = 1; i-n >= 0 && j+n < dimensions.y; ++n) {\n\t\t\tif (!check(i-n, j+n, checkForBlacks))\n\t\t\tbreak;\n\t\t}\n\t}", "public boolean moveLeft()\n {\n\tboolean update;\n\tboolean action = false;\n\t\t\n\tdo\n\t{\n update = false;\n\t\t\t\n for (int y=0; y<cases.length-1; y++)\n {\n for (int x=0; x<cases[y].length; x++)\n\t\t{\n boolean merge;\n boolean move;\n\t\t\t\t\t\n do\n {\n merge = merge(cases[x][y+1],cases[x][y]);\n move = move(cases[x][y+1],cases[x][y]);\n\t\t\tupdate = (update || merge || move);\n if(!action && update)\n {\n action = update; \n }\n } while (merge || move);\n }\n }\n } while (update);\n \n return action;\n }", "public boolean moveLEFT() {\r\n\t\tint i,j,k;\r\n\t\tboolean flag = false;\r\n\t\t\r\n\t\tfor(i = (rows_size-1) ; i >= 0 ; i--) {\r\n\t\t\tfor( j = 0; j < columns_size; j++) {\r\n\t\t\t\tif( !isEmpty(i,j) ) {\r\n\t\t\t\t\tfor(k = j; k >= 0 && isEmpty(i,k-1); k--);\r\n\t\t\t\t\t\tif(k == 0) {\t\r\n\t\t\t\t\t\t\tif( k != j) {\r\n\t\t\t\t\t\t\tgame[i][k] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\tflag = 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(game[i][j].isEqual(game[i][k-1]) && game[i][k-1].getFlag() == false) {\r\n\t\t\t\t\t\t\t\tgame[i][k-1].setValue(game[i][k-1].getValue()*2);\r\n\t\t\t\t\t\t\t\tgame[i][k-1].setFlag(true);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tscore += game[i][k-1].getValue();\r\n\t\t\t\t\t\t\t\t--takenCells;\r\n\t\t\t\t\t\t\t\t++freeCells;\r\n\t\t\t\t\t\t\t\tflag = true;\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\tif( k != j) {\r\n\t\t\t\t\t\t\t\tgame[i][k] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t}\r\n\tFalseFlag();\t\r\n\treturn flag;\r\n\t}", "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 boolean play(int[][] board) //the recursive definition of fillling the board with valid moves\n {\n for (int r = 0; r < board.length; r++) //n\n {\n for (int c = 0; c < board.length; c++) //n\n { \n if (board[r][c] == 0) //1\n {\n for (int y = 1; y <= 9; y++) //n\n {\n if (safeRow(y, board, r) && safeCol(y, board, c) && safeBox(y, board, r, c)) //3n\n { \n board[r][c] = y; //fill cell with the given value (1-9) //1\n\n if (play(board))\n { //1\n return true; //1\n }\n else \n {\n board[r][c] = 0; //reset cell to 0\n }\n }\n } \n return false; //backtracking\n }\n }\n }\n return true; //returns true if board is completely filled with valid numbers //1\n }", "@Test\n public void canMoveTest() {\n assertTrue(cp1.canMove(5, 3));\n assertTrue(cp1.canMove(1, 5));\n assertTrue(cp2.canMove(4, 6));\n assertTrue(cp2.canMove(6, 5));\n\n assertFalse(cp1.canMove(0, 5));\n assertFalse(cp1.canMove(3, 4));\n assertFalse(cp2.canMove(2, 6));\n assertFalse(cp2.canMove(7, 4));\n }", "public static boolean hasWinningMove(int[][] gamePlay){\n\t\tfor(int i=0;i<4;i++){\n\t\t\tfor(int j=0;j<4;j++){\n\t\t\t\tif(gamePlay[i][j]==1){\n\t\t\t\t\tfor(int k=1;k<9;k++){\n\t\t\t\t\t\tint[] root={i,j};\n\t\t\t\t\t\tint[] root1={i,j};\n\t\t\t\t\t\tint[] source=root;\n\t\t\t\t\t\tsource=calculatePosition(root,k);\n\t\t\t\t\t\t//System.out.println(\"Looking in direction \"+k+\" For root\"+i+\",\"+j);\n\t\t\t\t\t\tif(isValidLocation(source)){ \n\t\t\t\t\t\t\tif(gamePlay[source[0]][source[1]]==1){\n\t\t\t\t\t\t\t\tint[] newSource=calculatePosition(source,k);\n\t//System.out.println(\"Two contigous isValid:\"+isValidLocation(newSource)+\"newSource(\"+newSource[0]+\",\"+newSource[1]+\")\"+\" gamePlay:\"+(isValidLocation(newSource)?gamePlay[newSource[0]][newSource[1]]:-1));\n\t\t\t\t\t\t\t\tif(isValidLocation(newSource)){ \n\t\t\t\t\t\t\t\t\tif(gamePlay[newSource[0]][newSource[1]]==0){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Looking in opposite direction\");\n\t\t\t\t\t\t\t\t\t//Lookup in opposite direction\n\t\t\t\t\t\t\t\t\tnewSource=calculatePosition(root1,9-k);\n\t\t\t\t\t\t\t\t\tif(isValidLocation(newSource) && gamePlay[newSource[0]][newSource[1]]==1){\n\t\t\t\t\t\t\t\t\t\t//System.out.println(\"Valid Location:\"+newSource[0]+\" \"+newSource[1]+\" gamePlay\"+gamePlay[newSource[0]][newSource[1]]);\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t}else if(gamePlay[source[0]][source[1]]==0){\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Looking for alternate\");\n\t\t\t\t\t\t\t\t\tsource=calculatePosition(source,k);\n\t\t\t\t\t\t\t\t\tif(isValidLocation(source) && gamePlay[source[0]][source[1]]==1){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//System.out.println(\"Invalid direction or no move here isValid:\"+isValidLocation(source)+\"Source(\"+source[0]+\",\"+source[1]+\")\"+\" gamePlay:\"+(isValidLocation(source)?gamePlay[source[0]][source[1]]:-1));\n\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}\n\t\t}\n\t\treturn false;\n\t}", "public List<Move> validMoves(){\n List<Move> results = new LinkedList<>();\n int kingVal = turn == WHITE ? WHITE_KING : BLACK_KING;\n int kingX = 0, kingY = 0;\n List<Piece> checks = null;\n kingSearch:\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n if (board[y][x] == kingVal){\n kingX = x;\n kingY = y;\n checks = inCheck(x,y);\n break kingSearch;\n }\n }\n }\n if (checks.size() > 1){ // must move king\n for (int x = -1; x < 2; x++){\n for (int y = -1; y < 2; y++){\n if (kingX+x >= 0 && kingX + x < 8 && kingY+y >= 0 && kingY+y < 8){\n int val = board[kingY+y][kingX+x];\n if (val == 0 || turn == WHITE && val > WHITE_KING || turn == BLACK && val < BLACK_PAWN){\n // may still be a move into check, must test at end\n results.add(new Move(kingVal, kingX, kingY, kingX+x, kingY+y, val, 0, this));\n }\n }\n }\n }\n } else { // could be in check TODO: split into case of single check and none, identify pin/capture lines\n int queen = turn == WHITE ? WHITE_QUEEN : BLACK_QUEEN;\n int knight = turn == WHITE ? WHITE_KNIGHT : BLACK_KNIGHT;\n int rook = turn == WHITE ? WHITE_ROOK : BLACK_ROOK;\n int bishop = turn == WHITE ? WHITE_BISHOP : BLACK_BISHOP;\n for (int y = 0; y < 8; y++) {\n for (int x = 0; x < 8; x++) {\n int piece = board[y][x];\n if (piece == (turn == WHITE ? WHITE_PAWN : BLACK_PAWN)) { // pawns\n // regular | 2 move\n if (board[y+turn][x] == 0){\n if (y+turn == 0 || y + turn == 7){ // promotion\n results.add(new Move(piece, x, y, x, y + turn, 0, queen, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, knight, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, rook, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, bishop, this));\n }\n else {\n results.add(new Move(piece, x, y, x, y + turn, 0, 0, this));\n if ((y == (turn == WHITE ? 1 : 6)) && board[y + 2 * turn][x] == 0) { // initial 2 move\n results.add(new Move(piece, x, y, x, y + 2*turn, 0, 0, this));\n }\n }\n }\n // capture\n for (int dx = -1; dx <= 1; dx += 2){\n if (x + dx >= 0 && x + dx < 8) {\n int val = board[y+turn][x+dx];\n if (val > 0 && (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n if (y + turn == 0 || y + turn == 7){ // promotion\n results.add(new Move(piece, x, y, x+dx, y + turn, val, queen, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, knight, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, rook, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, bishop, this));\n } else {\n results.add(new Move(piece, x, y, x+dx, y + turn, val, 0, this));\n }\n }\n if (val == 0 && y == (turn == WHITE ? 4 : 3) && x+dx == enPassant){ // en passant\n results.add(new Move(piece, x, y, x+dx, y + turn, 0, 0, this));\n }\n }\n }\n\n } else if (piece == knight) { // knights TODO: lookup table\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -2; dy <= 2; dy += 4){\n if (x+dx >= 0 && x + dx < 8 && y + dy >= 0 && y + dy < 8){\n int val = board[y+dy][x+dx];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dx,y+dy,val,0,this));\n }\n }\n if (x+dy >= 0 && x + dy < 8 && y + dx >= 0 && y + dx < 8){\n int val = board[y+dx][x+dy];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dy,y+dx,val,0,this));\n }\n }\n }\n }\n } else if (piece == bishop) { // bishops\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (x + dx*i >= 0 && x + dx*i < 8 && y + dy*i >= 0 && y + dy*i < 8){\n int val = board[y+dy*i][x+dx*i];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == rook) { // rooks\n for (int dx = -1; dx <= 1; dx+= 2){\n for (int ax = 0; ax < 2; ax++){\n int i = 1;\n while (ax==0 ? y+dx*i >= 0 && y+dx*i < 8 : x+dx*i >= 0 && x+dx*i < 8){\n int val = board[y+dx*i*(1-ax)][x+dx*i*ax];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == (turn == WHITE ? WHITE_QUEEN : BLACK_QUEEN)) { // queens\n // Diagonals - same as bishops\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (x + dx*i >= 0 && x + dx*i < 8 && y + dy*i >= 0 && y + dy*i < 8){\n int val = board[y+dy*i][x+dx*i];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n for (int dx = -1; dx <= 1; dx+= 2){\n for (int ax = 0; ax < 2; ax++){\n int i = 1;\n while (ax==0 ? y+dx*i >= 0 && y+dx*i < 8 : x+dx*i >= 0 && x+dx*i < 8){\n int val = board[y+dx*i*(1-ax)][x+dx*i*ax];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == (turn == WHITE ? WHITE_KING : BLACK_KING)) { // king\n for (int dx = -1; dx < 2; dx++){\n for (int dy = -1; dy < 2; dy++){\n if ((dx != 0 || dy != 0) && x+dx >= 0 && x + dx < 8 && y + dy >= 0 && y + dy < 8){\n int val = board[y+dy][x+dx];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dx,y+dy,val,0,this));\n }\n }\n }\n }\n }\n }\n }\n // castle\n if (checks.size() == 0){\n if (turn == WHITE && (castles & 0b11) != 0){//(castles[0] || castles[1])){\n board[0][4] = 0; // remove king to avoid check test collisions with extra king\n if ((castles & WHITE_SHORT) != 0 && board[0][5] == 0 && board[0][6] == 0 && inCheck(5,0).size() == 0){\n //if (castles[0] && board[0][5] == 0 && board[0][6] == 0 && inCheck(5,0).size() == 0){\n results.add(new Move(WHITE_KING, 4, 0, 6, 0, 0, 0, this));\n }\n if ((castles & WHITE_LONG) != 0 && board[0][1] == 0 && board[0][2] == 0 && board[0][3] == 0 &&\n inCheck(3,0).size() == 0){\n //if (castles[1] && board[0][1] == 0 && board[0][2] == 0 && board[0][3] == 0 && inCheck(3,0).size() == 0){\n results.add(new Move(WHITE_KING, 4, 0, 2, 0, 0, 0, this));\n }\n board[0][4] = WHITE_KING;\n }else if (turn == BLACK && (castles & 0b1100) != 0){//(castles[2] || castles[3])) {\n board[7][4] = 0; // remove king to avoid check test collisions with extra king\n //if (castles[2] && board[7][5] == 0 && board[7][6] == 0 && inCheck(5, 7).size() == 0) {\n if ((castles & BLACK_SHORT) != 0 && board[7][5] == 0 && board[7][6] == 0 && inCheck(5, 7).size() == 0) {\n results.add(new Move(BLACK_KING, 4, 7, 6, 7, 0, 0, this));\n }\n //if (castles[3] && board[7][1] == 0 && board[7][2] == 0 && board[7][3] == 0 && inCheck(3, 7).size() == 0) {\n if ((castles & BLACK_LONG) != 0 && board[7][1] == 0 && board[7][2] == 0 && board[7][3] == 0 &&\n inCheck(3, 7).size() == 0) {\n results.add(new Move(BLACK_KING, 4, 7, 2, 7, 0, 0, this));\n }\n board[7][4] = BLACK_KING;\n }\n }\n }\n List<Move> fullLegal = new LinkedList<>();\n for (Move m : results){\n makeMove(m);\n turn = -turn;\n if (m.piece == WHITE_KING || m.piece == BLACK_KING){\n if (inCheck(m.toX,m.toY).size() == 0){\n fullLegal.add(m);\n }\n }else if (inCheck(kingX,kingY).size() == 0){\n fullLegal.add(m);\n }\n turn = -turn;\n undoMove(m);\n }\n Collections.sort(fullLegal, (o1, o2) -> o2.score - o1.score); // greatest score treated as least so appears first\n return fullLegal;\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 }", "public static boolean moveking() //returns false if valid move is there\n{ System.out.println(\"IN FUNCTION MOVE KING.....\");\n flag=0;\n int kx,ky;\n if(q==2)\n {\n kx=p2.ka.kbx; //WHITE KING....\n ky=p2.ka.kby;\n } \nelse\n {\n kx=p1.ka.kax; //BLACK KING....\n\tky=p1.ka.kay;\n }\n//CHECKS WHETHER KING CAN MOVE TO THE 8 adjacent places...\n if(kx-1>=0)\n {\n move2(kx,ky,kx-1,ky);\n \n if(flag==1)\n {\n revert(kx,ky,kx-1,ky);\n return false;\n }\n }\n //r\n if(kx+1<=7)\n { move2(kx,ky,kx+1,ky);\n if(flag==1)\n {revert(kx,ky,kx+1,ky);\n return false;\n \n }\n }\n \n //u\n if(ky-1>=0)\n {\n move2(kx,ky,kx,ky-1);\n \n if(flag==1)\n {revert(kx,ky,kx,ky-1);\n return false;\n \n }\n }\n //d\n if(ky+1<=7)\n {\n move2(kx,ky,kx,ky+1);\n \n if(flag==1)\n { revert(kx,ky,kx,ky+1);\n return false;\n \n }\n }\n //lu\n if(kx-1>=0&&ky-1>=0)\n {\n move2(kx,ky,kx-1,ky-1);\n \n if(flag==1)\n {revert(kx,ky,kx-1,ky-1);\n return false;\n \n }\n }\n //ld\n if(kx-1>=0&&ky+1<=7)\n {\n move2(kx,ky,kx-1,ky+1);\n \n if(flag==1)\n {revert(kx,ky,kx-1,ky+1);\n return false;\n \n }\n }\n //ru\n if(kx+1<=7&&ky-1>=0)\n {\n move2(kx,ky,kx+1,ky-1);\n \n if(flag==1)\n {revert(kx,ky,kx+1,ky-1);\n return false;\n \n }\n }\n //rd\n if(kx+1<=7&&ky+1<=7)\n {\n move2(kx,ky,kx+1,ky+1);\n \n if(flag==1)\n {revert(kx,ky,kx+1,ky+1);\n return false;\n \n }\n }\n return true; \n }", "private boolean moveUP() {\r\n\t\tint i,j,k;\r\n\t\tboolean flag = false;\r\n\t\tfor(i = 0 ; i < rows_size; i++) {\r\n\t\t\tfor( j = 0; j < columns_size; j++) {\r\n\t\t\t\tif( !isEmpty(i,j) ) {\r\n\t\t\t\t\tfor(k = i; k >= 0 && isEmpty(k-1,j); k--);\r\n\t\t\t\t\t\tif(k == 0) {\r\n\t\t\t\t\t\t\tif(k != i) {\r\n\t\t\t\t\t\t\tgame[k][j] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\tflag = 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(game[i][j].isEqual(game[k-1][j]) && game[k-1][j].getFlag() == false) {\r\n\t\t\t\t\t\t\t\tgame[k-1][j].setValue(game[k-1][j].getValue()*2);\r\n\t\t\t\t\t\t\t\tgame[k-1][j].setFlag(true);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tscore += game[k-1][j].getValue();\r\n\t\t\t\t\t\t\t\t--takenCells;\r\n\t\t\t\t\t\t\t\t++freeCells;\r\n\t\t\t\t\t\t\t\tflag = true;\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\tif(k != i) {\r\n\t\t\t\t\t\t\t\tgame[k][j] = new Cell2048 (game[i][j]);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tFalseFlag();\r\n\t\treturn flag;\r\n\t}", "public void SwipeLeft(){\n\t\tboolean SwipeSuccess = false;\n\t\tfor(int row = 0; row <= 3; row++){\n\t\t\tLinkedList<BlockFor2048> BlocksInRow = new LinkedList<BlockFor2048>();\n\t\t\tLinkedList<BlockFor2048> Checker = new LinkedList<BlockFor2048>();\n\t\t\tfor(int col = 0; col <= 3; col++){\n\t\t\t\tif(this.myBoard[col][row] != null){\n\t\t\t\t\tBlocksInRow.add(this.myBoard[col][row]);\n\t\t\t\t}\n\t\t\t\tChecker.add(this.myBoard[col][row]);\n\t\t\t}\n\t\t\tLinkedList<BlockFor2048> MergedForRow = MergeBlocks(BlocksInRow);\n\n\t\t\twhile (MergedForRow.size() < 4){\n\t\t\t\tMergedForRow.add(null);\n\t\t\t}\n\t\t\tif (! (MergedForRow.equals(Checker)) ){\n\t\t\t\tSwipeSuccess = true;\n\t\t\t}\n\t\t\tfor(int col = 0; col <= 3; col++){\n\t\t\t\tthis.myBoard[col][row] = MergedForRow.pop();\n\t\t\t}\n\t\t}\n\t\tif (SwipeSuccess){\n\t\t\tthis.AddRandom2();\n\t\t}\n\t}", "boolean findMove(int row, int col, int[][] someStatusBoard) {\n String leftPieces;\n if (_playerOnMove == ORANGE) {\n leftPieces = Game._orangePieces;\n } else {\n leftPieces = Game._violetPieces;\n }\n String trialMove = \"\";\n int numleftPieces = leftPieces.length();\n int l, ori;\n for (l = 0; l < numleftPieces; l++) {\n for (ori = 0; ori < 8; ori++) {\n String piecename = leftPieces.substring(l, l + 1);\n Pieces thispiece = new Pieces();\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n int m, n;\n for (m = 0; m < depth; m++) {\n for (n = 0; n < length; n++) {\n if (finalPositions[m][n] == 1) {\n int newCol = col - 1 - n;\n int newRow = 15 - row - depth;\n if (newCol >= 0 && newRow >= 0) {\n trialMove = piecename + changeBack(newCol) + changeBack(newRow) + ori;\n System.out.println(newCol);\n System.out.println(newRow);\n System.out.println(trialMove);\n if (isLegal(trialMove)) {\n return true;\n }\n }\n }\n }\n }\n }\n }\n return false;\n }", "@Override\r\n\tpublic void moveLeft() {\n\t\tswitch(state) {\r\n\t\tcase 0: case 2:\r\n\t\t\t{\r\n\t\t\t\tboolean ok = true;\r\n\t\t\t\tfor(Case c: cases) {\r\n\t\t\t\t\tif(!grille.isEmpty(c.getX()+x-1, c.getY()+y))\r\n\t\t\t\t\t\tok = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(ok)\r\n\t\t\t\t\t--x;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t{\r\n\t\t\tint x3 = cases.get(3).getX()-1, y3 = cases.get(3).getY();\r\n\t\t\tif(grille.isEmpty(x+x3, y+y3))\r\n\t\t\t\t--x;\r\n\t\t\t\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 3:\r\n\t\t{\r\n\t\t\tint x0 = cases.get(0).getX()-1, y0 = cases.get(0).getY();\r\n\t\t\tif(grille.isEmpty(x+x0, y+y0))\r\n\t\t\t\t--x;\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\r\n\t\tdefault : \r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public boolean legalMove(ArrayList<Point2D> inputMove,ArrayList<Object> Gamestate){\n FooHistory currentGameState = (FooHistory) Gamestate.get(0);\n ArrayList<Point2D> player1moves= currentGameState.getCurrentState().get(0);\n ArrayList<Point2D> player2moves= currentGameState.getCurrentState().get(1);\n //System.out.println(\"Player1 moves in FooRules: \"+ player1moves);\n \n if(inputMove.size()==1){\n for(ArrayList<Point2D> array: currentGameState.getCurrentState()){\n for(Point2D point:array){\n if(inputMove.get(0).getX()==point.getX() && inputMove.get(0).getY()==point.getY()){\n System.out.println(\"Ilegal Move\");\n return false;\n }\n }\n }\n return true;\n }\n else{//Deals with moving a piece to take pieces\n if(adjacent(inputMove.get(0),inputMove.get(1))){//Makes sure the two input moves are adjacent\n if(currentGameState.getTurnCount()%2==1){ //Player 1's turn\n for(Point2D point:player2moves){\n if(point.getX()==inputMove.get(1).getX() && point.getY()==inputMove.get(1).getY()){\n return true;\n }\n }\n }\n if(currentGameState.getTurnCount()%2==0){//Player 2's turn\n for(Point2D point:player1moves){\n if(point.getX()==inputMove.get(1).getX() && point.getY()==inputMove.get(1).getY()){\n return true;\n }\n }\n }\n }\n System.out.println(\"Ilegal Move\"); \n return false; \n }\n \n }", "private boolean check(int l, int r, boolean checkForBlacks) {\n\t\tif (checkForBlacks) {\n\t\t\t// If black increment counter and continue\n\t\t\tif (board[l][r].isBlack()) {\n\t\t\t\tcounter++;\n\t\t\t\tpossibleFlips.add(board[l][r]);\n\t\t\t}\n\n\t\t\t// If red break out of loop\n\t\t\telse if (board[l][r].isRed())\n\t\t\t\treturn false;\n\n\t\t\t// If empty and count > 0 set square as possible move else return from function\n\t\t\telse if (board[l][r].isEmpty()) {\n\t\t\t\tif (counter > 0) {\n\t\t\t\t\tboard[l][r].setPossMove(true);\n\t\t\t\t\tboard[l][r].addToFlipSquares(possibleFlips);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// If red increment counter and continue\n\t\t\tif (board[l][r].isRed()) {\n\t\t\t\tcounter++;\n\t\t\t\tpossibleFlips.add(board[l][r]);\n\t\t\t}\n\n\t\t\t// If black break out of loop\n\t\t\telse if (board[l][r].isBlack()) \n\t\t\t\treturn false;\n\n\t\t\t// If empty and count > 0 set square as possible move else return from function\n\t\t\telse if (board[l][r].isEmpty()) {\n\t\t\t\tif (counter > 0) {\n\t\t\t\t\tboard[l][r].setPossMove(true);\n\t\t\t\t\tboard[l][r].addToFlipSquares(possibleFlips);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\treturn true;\n\t}", "private boolean canMoveLeft()\n {\n // runs through board row first, column second\n for ( int row = 0; row < grid.length ; row++ ) {\n for ( int column = 1; column < grid[row].length; column++ ) {\n\n // looks at tile directly to the left of the current tile\n int compare = column-1;\n if ( grid[row][column] != 0 ) {\n if ( grid[row][compare] == 0 || grid[row][column] ==\n grid[row][compare] ) {\n return true;\n }\n }\n }\n } \n return false;\n }", "public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }", "public int checkCastle(Board b, char race) {\n Set<Coordinate> opponentPieces = (race == 'b') ? b.white : b.black;\n Set<Coordinate> opponentMoves = new HashSet<Coordinate>();\n\n for (Coordinate each : opponentPieces) {\n if (b.board[each.x][each.y] instanceof King) {\n continue;\n }\n if (b.board[each.x][each.y] instanceof Pawn) {\n opponentMoves.addAll(((Pawn) (b.board[each.x][each.y])).killableMoves(b));\n } else {\n opponentMoves.addAll(b.board[each.x][each.y].displayMoves(b));\n }\n }\n\n switch (race) {\n case 'b':\n if (b.board[0][4] != null && b.board[0][4].move == 0) {\n int i = 0;\n if (b.board[0][0] != null && b.board[0][0].move == 0) {\n if (b.board[0][1] == null && b.board[0][2] == null && b.board[0][3] == null) {\n if (!opponentMoves.contains(new Coordinate(0, 2)) && !opponentMoves.contains(new Coordinate(0, 3))\n && !opponentMoves.contains(new Coordinate(0, 4))) {\n i++;\n }\n }\n }\n\n if (b.board[0][7] != null && b.board[0][7].move == 0) {\n if (b.board[0][5] == null && b.board[0][6] == null) {\n if (!opponentMoves.contains(new Coordinate(0, 6)) && !opponentMoves.contains(new Coordinate(0, 5))\n && !opponentMoves.contains(new Coordinate(0, 4))) {\n i += 10;\n }\n }\n }\n return i;\n }\n break;\n\n case 'w':\n if (b.board[7][4] != null && b.board[7][4].move == 0) {\n int i = 20;\n if (b.board[7][0] != null && b.board[7][0].move == 0) {\n if (b.board[7][1] == null && b.board[7][2] == null && b.board[7][3] == null) {\n if (!opponentMoves.contains(new Coordinate(7, 2)) && !opponentMoves.contains(new Coordinate(7, 3))\n && !opponentMoves.contains(new Coordinate(7, 4))) {\n i++;\n }\n }\n }\n\n if (b.board[7][7] != null && b.board[7][7].move == 0) {\n if (b.board[7][5] == null && b.board[7][6] == null) {\n if (!opponentMoves.contains(new Coordinate(7, 6)) && !opponentMoves.contains(new Coordinate(7, 5))\n && !opponentMoves.contains(new Coordinate(7, 4))) {\n i += 10;\n }\n }\n }\n return i;\n }\n break;\n }\n return 69;\n }", "private boolean checkHorizontal(int move)\n\t{\n\t\tPiece moveColor = board[6 - columns[move]][move];\n\t\tint i = move;\n\t\tint idx = 1;\n\t\tint lineCount = 1;\n\t\tboolean left, right;\n\t\tleft = right = true;\n\n\t\tfor (; idx < 4; idx++)\n\t\t{\n\t\t\tif (!left || (i - idx) < 0 || board[6 - columns[move]][i - idx] == null)\n\t\t\t{\n\t\t\t\tleft = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (moveColor.equals(board[6 - columns[move]][i - idx]))\n\t\t\t\t{\n\t\t\t\t\tlineCount++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tleft = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!right || (i + idx) > 6 || board[6 - columns[move]][i + idx] == null)\n\t\t\t{\n\t\t\t\tright = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (moveColor.equals(board[6 - columns[move]][i + idx]))\n\t\t\t\t{\n\t\t\t\t\tlineCount++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tright = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (lineCount > 3)\n\t\t\t{\n\t\t\t\twon = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if (!left && !right)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean makeMove(Bouger m) {\n\tlong oldBits[] = { pieceBits[LIGHT], pieceBits[DARK] };\n\n\tint from, to;\n\t/*\n\t* test to see if a castle move is legal and move the rook (the king is\n\t* moved with the usual move code later)\n\t*/\n\tif ((m.bits & 2) != 0) {\n\n\tif (inCheck(side))\n\treturn false;\n\tswitch (m.getTo()) {\n\tcase 62:\n\tif (color[F1] != EMPTY || color[G1] != EMPTY\n\t|| attack(F1, xside) || attack(G1, xside))\n\treturn false;\n\tfrom = H1;\n\tto = F1;\n\tbreak;\n\tcase 58:\n\tif (color[B1] != EMPTY || color[C1] != EMPTY\n\t|| color[D1] != EMPTY || attack(C1, xside)\n\t|| attack(D1, xside))\n\treturn false;\n\tfrom = A1;\n\tto = D1;\n\tbreak;\n\tcase 6:\n\tif (color[F8] != EMPTY || color[G8] != EMPTY\n\t|| attack(F8, xside) || attack(G8, xside))\n\treturn false;\n\tfrom = H8;\n\tto = F8;\n\tbreak;\n\tcase 2:\n\tif (color[B8] != EMPTY || color[C8] != EMPTY\n\t|| color[D8] != EMPTY || attack(C8, xside)\n\t|| attack(D8, xside))\n\treturn false;\n\tfrom = A8;\n\tto = D8;\n\tbreak;\n\tdefault: /* shouldn't get here */\n\tfrom = -1;\n\tto = -1;\n\tbreak;\n\t}\n\tcolor[to] = color[from];\n\tpiece[to] = piece[from];\n\tcolor[from] = EMPTY;\n\tpiece[from] = EMPTY;\n\tpieceBits[side] ^= (1L << from) | (1L << to);\n\t}\n\t/* back up information so we can take the move back later. */\n\n\tHistoryData h = new HistoryData();\n\th.m = m;\n\tto = m.getTo();\n\tfrom = m.getFrom();\n\th.capture = piece[to];\n\th.castle = castle;\n\th.ep = ep;\n\th.fifty = fifty;\n\th.pawnBits = new long[] { pawnBits[LIGHT], pawnBits[DARK] };\n\th.pieceBits = oldBits;\n\thistDat[hply++] = h;\n\n\t/*\n\t* update the castle, en passant, and fifty-move-draw variables\n\t*/\n\tcastle &= castleMask[from] & castleMask[to];\n\tif ((m.bits & 8) != 0) {\n\tif (side == LIGHT)\n\tep = to + 8;\n\telse\n\tep = to - 8;\n\t} else\n\tep = -1;\n\tif ((m.bits & 17) != 0)\n\tfifty = 0;\n\telse\n\t++fifty;\n\n\t/* move the piece */\n\tint thePiece = piece[from];\n\tif (thePiece == KING)\n\tkingSquare[side] = to;\n\tcolor[to] = side;\n\tif ((m.bits & 32) != 0) {\n\tpiece[to] = m.promote;\n\tpieceMat[side] += pieceValue[m.promote];\n\t} else\n\tpiece[to] = thePiece;\n\tcolor[from] = EMPTY;\n\tpiece[from] = EMPTY;\n\tlong fromBits = 1L << from;\n\tlong toBits = 1L << to;\n\tpieceBits[side] ^= fromBits | toBits;\n\tif ((m.bits & 16) != 0) {\n\tpawnBits[side] ^= fromBits;\n\tif ((m.bits & 32) == 0)\n\tpawnBits[side] |= toBits;\n\t}\n\tint capture = h.capture;\n\tif (capture != EMPTY) {\n\tpieceBits[xside] ^= toBits;\n\tif (capture == PAWN)\n\tpawnBits[xside] ^= toBits;\n\telse\n\tpieceMat[xside] -= pieceValue[capture];\n\t}\n\n\t/* erase the pawn if this is an en passant move */\n\tif ((m.bits & 4) != 0) {\n\tif (side == LIGHT) {\n\tcolor[to + 8] = EMPTY;\n\tpiece[to + 8] = EMPTY;\n\tpieceBits[DARK] ^= (1L << (to + 8));\n\tpawnBits[DARK] ^= (1L << (to + 8));\n\t} else {\n\tcolor[to - 8] = EMPTY;\n\tpiece[to - 8] = EMPTY;\n\tpieceBits[LIGHT] ^= (1L << (to - 8));\n\tpawnBits[LIGHT] ^= (1L << (to - 8));\n\t}\n\t}\n\n\t/*\n\t* switch sides and test for legality (if we can capture the other guy's\n\t* king, it's an illegal position and we need to take the move back)\n\t*/\n\tside ^= 1;\n\txside ^= 1;\n\tif (inCheck(xside)) {\n\ttakeBack();\n\treturn false;\n\t}\n\treturn true;\n\t}", "public void checkEndGame() {\n\t\t\n\t\tboolean gameFinished = false;\n\t\t//boolean playerOne = false;\n\t\t//boolean playerTwo = false;\n\t\t\n\t\t\n\t\tif (bucket[13].getnumOfRocks() == 0 && bucket[12].getnumOfRocks() == 0 && bucket[11].getnumOfRocks() == 0\n\t\t\t\t&& bucket[10].getnumOfRocks() == 0 && bucket[9].getnumOfRocks() == 0\n\t\t\t\t&& bucket[8].getnumOfRocks() == 0) {\n\n\t\t\tint left = bucket[6].getnumOfRocks() + bucket[5].getnumOfRocks() + bucket[4].getnumOfRocks()\n\t\t\t\t\t+ bucket[3].getnumOfRocks() + bucket[2].getnumOfRocks() + bucket[1].getnumOfRocks()\n\t\t\t\t\t+ bucket[0].getnumOfRocks();\n\n\t\t\tbucket[0].setnumOfRocks(left, c);\n\t\t\tbucket[6].setnumOfRocks(0, c);\n\t\t\tbucket[5].setnumOfRocks(0, c);\n\t\t\tbucket[4].setnumOfRocks(0, c);\n\t\t\tbucket[3].setnumOfRocks(0, c);\n\t\t\tbucket[2].setnumOfRocks(0, c);\n\t\t\tbucket[1].setnumOfRocks(0, c);\n\t\t\t\n\t\t\tgameFinished = true;\n\t\t}\n\n\t\tif (bucket[1].getnumOfRocks() == 0 && bucket[2].getnumOfRocks() == 0 && bucket[3].getnumOfRocks() == 0\n\t\t\t\t&& bucket[4].getnumOfRocks() == 0 && bucket[5].getnumOfRocks() == 0 && bucket[6].getnumOfRocks() == 0) {\n\n\t\t\tint right = bucket[13].getnumOfRocks() + bucket[12].getnumOfRocks() + bucket[11].getnumOfRocks();\n\t\t\tright = right + bucket[10].getnumOfRocks() + bucket[9].getnumOfRocks() + bucket[8].getnumOfRocks()\n\t\t\t\t\t+ bucket[7].getnumOfRocks();\n\n\t\t\tbucket[7].setnumOfRocks(right, c);\n\t\t\tbucket[13].setnumOfRocks(0, c);\n\t\t\tbucket[12].setnumOfRocks(0, c);\n\t\t\tbucket[11].setnumOfRocks(0, c);\n\t\t\tbucket[10].setnumOfRocks(0, c);\n\t\t\tbucket[9].setnumOfRocks(0, c);\n\t\t\tbucket[8].setnumOfRocks(0, c);\n\n\t\t\tgameFinished = true;\n\t\t}\n\t\t\n\t\t\n\t\tif(gameFinished==true){\n\t\t\tif(bucket[7].getnumOfRocks()<bucket[0].getnumOfRocks()){\n\t\t\t\tplayerOne=true;\n\t\t\t}else{\n\t\t\t\tplayerTwo=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*if(playerOne==true){\n\t\t\tSystem.out.println(\"Player A won\");\n\t\t}\n\t\tif(playerTwo == true){\n\t\t\tSystem.out.println(\"Player B won\");\n\t\t}\n\t\t */\n\t\t\n\t}", "public boolean switchPhase() {\n int cpuShipCounter = 0;\n int playerShipCounter = 0;\n do {\n cpuShipCounter = 0;\n playerShipCounter = 0;\n if (!cpuHasPlaced) {\n placeComputerShipsDumb((int) (Math.random() * 19) + 1);\n }\n for(int i = 0; i < 10; i++){\n for(int j = 0; j <10; j++){\n if(humanPlayerBoard[i][j] == board.ship.ordinal()){\n playerShipCounter++;\n }\n if (computerPlayerBoard[i][j] == board.ship.ordinal()) {\n cpuShipCounter++;\n }\n }\n }\n if (cpuShipCounter != 17) {\n cpuHasPlaced = false;\n cpuShipCounter = 0;\n playerShipCounter = 0;\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n computerPlayerBoard[i][j] = 0;\n }\n }\n }\n\n } while (cpuShipCounter != 17);\n\n if(cpuShipCounter == 17 && playerShipCounter == 17){\n inGame = true;\n return true;\n }\n\n return false;\n }", "@Override\n\tpublic Collection<Move> calculateLegalMoves(final Board board) {\n\t\t\n\t\t//Array that will hold of the legal moves for the Pawn\n\t\tfinal List<Move> legalMoves = new ArrayList<>();\n\t\t\n\t\t//Loop through all possible moves by applying of the offsets to the Pawn's current position\n\t\tfor(final int currentCandidateOffset: CANDIDATE_MOVE_COORDINATES){\n\t\t\t\n\t\t\t//Apply the offset to the Pawn's current position\n\t\t\tfinal int candidateDestinationCoordinate = this.piecePosition + (this.getPieceTeam().getDirection() * currentCandidateOffset);\n\t\t\t\n\t\t\t//Checks if the Destination Coordinate is valid\n\t\t\tif(!BoardUtils.isValidTileCoordinate(candidateDestinationCoordinate)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Checks if this tile is occupied\n\t\t\tif(currentCandidateOffset == 8 && !board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnMove(board, this, candidateDestinationCoordinate)));\n\t\t\t\telse\n\t\t\t\t\tlegalMoves.add(new Move.PawnMove(board, this, candidateDestinationCoordinate));\t\n\t\t\t}\n\t\t\t//Checks if the Pawn is on it's first move\n\t\t\telse if(currentCandidateOffset == 16 && this.isFirstMove() && ((BoardUtils.SEVENTH_RANK[this.piecePosition] && \n\t\t\t\t\tthis.getPieceTeam().isBlack()) || (BoardUtils.SECOND_RANK[this.piecePosition] && this.getPieceTeam().isWhite()))) {\n\t\t\t\t\n\t\t\t\t//Calculate coordinate of the tile behind candidate coordinate\n\t\t\t\tfinal int behindCandidateDestinationCoordinate = this.piecePosition + (this.pieceTeam.getDirection() * 8);\n\t\t\t\t\n\t\t\t\t//Checks if the tile behind the candidate destination is NOT occupied & if the Tile at the Candidate Destination is NOT occupied\n\t\t\t\tif(!board.getTile(behindCandidateDestinationCoordinate).isTileOccupied() && \n\t\t\t !board.getTile(candidateDestinationCoordinate).isTileOccupied())\n\t\t\t\t\t\tlegalMoves.add(new Move.PawnJump(board, this, candidateDestinationCoordinate));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Checks for edge cases in the 7 direction\t\n\t\t\t} else if(currentCandidateOffset == 7 &&\n\t\t\t\t\t!((BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t\n\t\t\t\t//This basically checks if En Passant Pawn is next to Player's pawn\t\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition + (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//Checks for edge cases in the 9 direction\t\n\t\t\t} else if(currentCandidateOffset == 9 && \n\t\t\t\t\t!((BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition - (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn ImmutableList.copyOf(legalMoves);\n\t}", "public boolean checkForWin()\n {\n //Horizontal win\n for (int r = 0; r <= 5; r++)\n {\n for (int c = 0; c <= 3; c++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r] == player_turn &&\n current_board[c+2][r] == player_turn &&\n current_board[c+3][r] == player_turn)\n return true;\n }\n }\n //Vertical win\n for (int c = 0; c <= 6; c++)\n {\n for (int r = 0; r <= 2; r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c][r+1] == player_turn &&\n current_board[c][r+2] == player_turn &&\n current_board[c][r+3] == player_turn)\n return true;\n }\n }\n //Shortest diagonals/anti diagonals (cell length == 4)\n //postive slope\n if (current_board[0][2] == player_turn && current_board[1][3] == player_turn && current_board[2][4] == player_turn && current_board[3][5] == player_turn)\n return true;\n if (current_board[3][0] == player_turn && current_board[4][1] == player_turn && current_board[5][2] == player_turn && current_board[6][3] == player_turn)\n return true;\n //negative slope\n if (current_board[0][3] == player_turn && current_board[1][2] == player_turn && current_board[2][1] == player_turn && current_board[3][0] == player_turn)\n return true;\n if (current_board[3][5] == player_turn && current_board[4][4] == player_turn && current_board[5][3] == player_turn && current_board[6][2] == player_turn)\n return true;\n\n //Medium-length diagonals/anti diagonals (cell length == 5)\n //positive slope\n if (current_board[0][1] == player_turn && current_board[1][2] == player_turn && current_board[2][3] == player_turn && current_board[3][4] == player_turn)\n return true;\n if (current_board[1][2] == player_turn && current_board[2][3] == player_turn && current_board[3][4] == player_turn && current_board[4][5] == player_turn)\n return true;\n if (current_board[2][0] == player_turn && current_board[3][1] == player_turn && current_board[4][2] == player_turn && current_board[5][3] == player_turn)\n return true;\n if (current_board[3][1] == player_turn && current_board[4][2] == player_turn && current_board[5][3] == player_turn && current_board[6][4] == player_turn)\n return true;\n //negative slope\n if (current_board[0][4] == player_turn && current_board[1][3] == player_turn && current_board[2][2] == player_turn && current_board[3][1] == player_turn)\n return true;\n if (current_board[1][3] == player_turn && current_board[2][2] == player_turn && current_board[3][1] == player_turn && current_board[4][0] == player_turn)\n return true;\n if (current_board[2][5] == player_turn && current_board[3][4] == player_turn && current_board[4][3] == player_turn && current_board[5][2] == player_turn)\n return true;\n if (current_board[3][4] == player_turn && current_board[4][3] == player_turn && current_board[5][2] == player_turn && current_board[6][1] == player_turn)\n return true;\n\n //Longest diagonals/anti diagonals (cell length == 6)\n //positive slope\n for (int c=0, r=0; c <= 2 && r <= 2; c++, r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r+1] == player_turn &&\n current_board[c+2][r+2] == player_turn &&\n current_board[c+3][r+3] == player_turn)\n return true;\n }\n for (int c=1, r=0; c <= 3 && r <= 2; c++, r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r+1] == player_turn &&\n current_board[c+2][r+2] == player_turn &&\n current_board[c+3][r+3] == player_turn)\n return true;\n }\n //negative slope\n for (int c=0, r=5; c <= 2 && r >= 3; c++, r--)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r-1] == player_turn &&\n current_board[c+2][r-2] == player_turn &&\n current_board[c+3][r-3] == player_turn)\n return true;\n }\n for (int c=1, r=5; c <= 3 && r >= 3; c++, r--)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r-1] == player_turn &&\n current_board[c+2][r-2] == player_turn &&\n current_board[c+3][r-3] == player_turn)\n return true;\n }\n\n return false;\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 }", "private boolean makeMoveByMin(Mancala mancalaGame, int choice) {\n \r\n int length = mancalaGame.boardForA.length * 2 + 1;\r\n int[] tempArray = new int[length];\r\n \r\n int j = 0;\r\n for(int i = 0; i < mancalaGame.boardForA.length; i++) {\r\n tempArray[j++] = mancalaGame.boardForA[i];\r\n }\r\n tempArray[j++] = mancalaGame.countForA;\r\n for(int i = mancalaGame.boardForB.length - 1; i >= 0; i--) {\r\n tempArray[j++] = mancalaGame.boardForB[i];\r\n }\r\n \r\n // start from the index choice-1, and distribute\r\n \r\n j = choice;\r\n int lastIndex = -1;\r\n int count = tempArray[choice - 1];\r\n tempArray[choice - 1] = 0;\r\n \r\n while(count-- != 0) {\r\n lastIndex = j;\r\n tempArray[j]++;\r\n j++;\r\n if(j == length) {\r\n j = 0;\r\n }\r\n }\r\n \r\n // copy back everything into the game\r\n \r\n j = 0;\r\n for(int i = 0; i < mancalaGame.boardForA.length; i++) {\r\n mancalaGame.boardForA[i] = tempArray[j++];\r\n }\r\n mancalaGame.countForA = tempArray[j++];\r\n for(int i = mancalaGame.boardForB.length - 1; i >= 0; i--) {\r\n mancalaGame.boardForB[i] = tempArray[j++];\r\n }\r\n \r\n // determine capture\r\n \r\n if(lastIndex < mancalaGame.boardForA.length && lastIndex >= 0 && tempArray[lastIndex] == 1 && mancalaGame.boardForA[lastIndex] != 0) {\r\n mancalaGame.countForA += mancalaGame.boardForB[lastIndex];\r\n mancalaGame.countForA++;\r\n mancalaGame.boardForB[lastIndex] = 0;\r\n mancalaGame.boardForA[lastIndex] = 0;\r\n }\r\n \r\n // determine free turn\r\n \r\n if(lastIndex == Mancala.boardLength) {\r\n mancalaGame.turn = (mancalaGame.turn + 1) % 2;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n \r\n }", "public boolean DecideMove(Crazy8sBoard board){\n boolean haveAnEight = false;\n int locationOf8Card = 0;\n\n String topCard = board.GetTopTrashCard();\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n for(int i = 0; i < board.GetSizeOfComputerHand(); i++){\n\n String card = board.GetComputerCard(i);\n String firstLetter = Character.toString(card.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Play whatever card, get to choose suite\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n if(card.contains(\"8\")){\n haveAnEight = true;\n locationOf8Card = i;\n }\n\n else {\n //the cards match in suite, doesn't matter what it is\n if (firstLetter.equals(topFirstLetter)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n }\n }\n }\n }\n\n //Only play an 8 if all other cards are exhausted\n if(haveAnEight){\n //valid because 8s are wild cards, can place it\n board.ComputerUpdateTopCard(locationOf8Card);\n board.RemoveCardFromComputer(locationOf8Card);\n return true;\n }\n\n //couldn't play any card\n return false;\n }", "@Test\n void checkDoMove() {\n abilities.doMove(turn, board.getCellFromCoords(1, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(1, 1));\n Worker forcedWorker = turn.getWorker();\n for (Worker other : turn.getOtherWorkers()) {\n if (other.getCell() == board.getCellFromCoords(2, 2)) {\n forcedWorker = other;\n }\n }\n\n assertEquals(forcedWorker.getCell(), board.getCellFromCoords(2, 2));\n\n // Can't move anymore after having already moved\n assertFalse(abilities.checkCanMove(turn, board.getCellFromCoords(0, 0)));\n }", "private int Win_Move() {\n\t\tfinal int POSSIBLE_WIN = 8;\n\t\tint move = NO_MOVE;\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t}", "void findSoloAvailMoves(int x, int y) {\n\t\tint counter;\n\t\tint toInsert = 0;\n\t\tfor(int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tcounter = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\ttoInsert = k + 1;\n\t\t\t\t\t\tif (counter > 1) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(counter == 1) {\n\t\t\t\t\tinsertNumber(i, j, toInsert);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public List<Piece> inCheck(int kingX, int kingY){ // returns list of attacking pieces.\n // Also have to look for opponent king to avoid moving into check.\n // In this case only care whether or not a check occurs, not how many so breaks still ok\n // for regular check tests, want to know if 1 or 2 checks, cannot have multiple diagonal checks.\n List<Piece> attackers = new ArrayList<>();\n // knights\n int knight = turn == WHITE ? BLACK_KNIGHT : WHITE_KNIGHT;\n knightSearch:\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -2; dy <= 2; dy += 4){\n if (kingX + dx >= 0 && kingX + dx < 8 && kingY + dy >= 0 && kingY + dy < 8){\n if (board[kingY+dy][kingX+dx] == knight){\n attackers.add(new Piece(knight, kingX+dx, kingY+dy));\n break knightSearch; // can only be checked by 1 knight at a time\n }\n }\n if (kingX + dy >= 0 && kingX + dy < 8 && kingY + dx >= 0 && kingY + dx < 8){\n if (board[kingY+dx][kingX+dy] == knight){\n attackers.add(new Piece(knight, kingX+dy, kingY+dx));\n break knightSearch;\n }\n }\n }\n }\n // bishop/queen/pawn/king\n int pawn = turn == WHITE ? BLACK_PAWN : WHITE_PAWN;\n int bish = turn == WHITE ? BLACK_BISHOP : WHITE_BISHOP;\n int queen = turn == WHITE ? BLACK_QUEEN : WHITE_QUEEN;\n int king = turn == WHITE ? BLACK_KING : WHITE_KING;\n diagSearch:\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (kingX + dx*i >= 0 && kingX + dx*i < 8 && kingY + dy*i >= 0 && kingY + dy*i < 8){\n int piece = board[kingY + dy*i][kingX + dx*i];\n if (piece != 0){\n if (piece == bish || piece == queen || (piece == pawn && i == 1 && dy == turn)\n || (piece == king && i == 1)){\n attackers.add(new Piece(piece, kingX+dx*i, kingY+dy*i));\n break diagSearch;\n }\n break;\n }\n i++;\n }\n }\n }\n // rook/queen/king\n int rook = turn == WHITE ? BLACK_ROOK : WHITE_ROOK;\n straightSearch:\n for (int dx = -1; dx <= 1; dx += 2){\n int i = 1;\n while (kingX + i*dx >= 0 && kingX + i*dx < 8){\n int piece = board[kingY][kingX + dx*i];\n if (piece != 0){\n if (piece == rook || piece == queen || (piece == king && i == 1)){\n attackers.add(new Piece(piece, kingX+dx*i, kingY));\n break straightSearch;\n }\n break;\n }\n i++;\n }\n i = 1;\n while (kingY + i*dx >= 0 && kingY + i*dx < 8){\n int piece = board[kingY+dx*i][kingX];\n if (piece != 0){\n if (piece == rook || piece == queen || (piece == king && i == 1)){\n attackers.add(new Piece(piece, kingX, kingY+dx*i));\n break straightSearch;\n }\n break;\n }\n i++;\n }\n }\n return attackers;\n }", "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 }", "boolean checkWin() {\n Iterator<Integer> seq = sequence.iterator();\n Iterator<Integer> in = input.iterator();\n\n while (seq.hasNext() && in.hasNext()) {\n seq.next();\n in.next();\n if (!seq.hasNext() && !in.hasNext()) {\n return true;\n }\n }\n return false;\n }", "static int waysToGiveACheck(char[][] board) {\n\t\tint[] pawnPos = new int[2];\n\t\tint[] bkPos = new int[2];\n\t\tint[] wkPos = new int[2];\n\t\tint[] forthPos = new int[2];\n\t\tchar fourth = 'x';\n\t\tint answerCount = 0;\n\t\tint hashCount = 0;\n\t\tfor(int board_i = 0; board_i < 8; board_i++){\n\t\t\tfor(int board_j = 0; board_j < 8; board_j++){\n\t\t\t\tswitch(board[board_i][board_j]){\n\t\t\t\tcase 35:\n\t\t\t\t\thashCount++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 80:\n\t\t\t\t\t{pawnPos[0] = board_i;\n\t\t\t\t\tpawnPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tcase 107:\n\t\t\t\t\t{bkPos[0] = board_i;\n\t\t\t\t\tbkPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tcase 75:\n\t\t\t\t\t{wkPos[0] = board_i;\n\t\t\t\t\twkPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tdefault:\n\t\t\t\t\t{forthPos[0] = board_i;\n\t\t\t\t\tforthPos[1] = board_j;\n\t\t\t\t\tfourth = board[board_i][board_j];\n\t\t\t\t\tbreak;}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint xdistPk = Math.abs(pawnPos[0] - bkPos[0]);\n\t\tint ydistPk = Math.abs(pawnPos[1] - bkPos[1]);\n\n\t\tif(xdistPk == ydistPk)\n\t\t\tanswerCount = answerCount+2;\n\t\tif(xdistPk==0)\n\t\t\tanswerCount++;\n\t\tif(ydistPk ==0)\n\t\t\tanswerCount++;\n\t\tif((xdistPk == 2 && ydistPk==1) || (xdistPk == 1 && ydistPk==2) )\n\t\t\tanswerCount++;\n\n\t\treturn answerCount;\n\n\t}", "private static boolean canCaptureUpLeft(ItalianBoard board, int posR, int posC) {\n try {\n if (((board.getBoard()[posR][posC].getPiece() == PieceType.MAN) && (board.getBoard()[posR - 1][posC - 1].getPiece() == PieceType.MAN)) || (board.getBoard()[posR][posC].getPiece() == PieceType.KING))\n return ((board.getBoard()[posR - 1][posC - 1].getPlace() != board.getBoard()[posR][posC].getPlace()) &&\n (board.getBoard()[posR - 1][posC - 1].getPlace() != PlaceType.EMPTY) &&\n (board.getBoard()[posR - 2][posC - 2].getPlace() == PlaceType.EMPTY));\n } catch (ArrayIndexOutOfBoundsException ignored) {\n }\n return false;\n }", "public void startGameState(){\n\n ArrayList<Integer> checkeredSpaces = new ArrayList<Integer>(Arrays.asList(1, 3, 5, 7, 8, 10, 12, 14, 17, 19, 21,\n 23, 24, 26, 28, 30, 33, 35, 37, 39, 41, 42, 44, 46, 48,\n 51, 53, 55, 56, 58, 60, 62));\n\n\n\n for(int i =0; i < 63; i++){\n if(!checkeredSpaces.contains(i)){\n //set all black spaces to null on the board\n mCheckerBoard.add(null);\n }\n else if(i < 24){\n //set first three rows to red checkers\n mCheckerBoard.add(new Checker((i/2), true));\n }\n else if(i < 40){\n //set middle two rows to null\n mCheckerBoard.add(null);\n }\n else{\n //set top three row to black checkers\n mCheckerBoard.add(new Checker((i/2), false));\n }\n }\n\n }", "private boolean isLegalMove(String move) {\n\t\tString[] moveParts = move.split(\";\");\n\n\t\tint fromRow = Integer.parseInt(moveParts[0].charAt(0) + \"\");\n\t\tint fromCol = Integer.parseInt(moveParts[0].charAt(1) + \"\");\n\n\t\tint toRow = Integer.parseInt(moveParts[1].charAt(0) + \"\");\n\t\tint toCol = Integer.parseInt(moveParts[1].charAt(1) + \"\");\n\n\t\tint minRow = Math.min(fromRow, toRow);\n\t\tint minCol = Math.min(fromCol, toCol);\n\n\t\tint maxRow = Math.max(fromRow, toRow);\n\t\tint maxCol = Math.max(fromCol, toCol);\n\n\t\tint piece = board[fromRow][fromCol];//Integer.parseInt(moveParts[2]);\n\t\tint pieceType = Math.abs(piece);\n\t\tint team = Math.round(Math.signum(piece));\n\n\t\tif (team == Math.round(Math.signum(board[toRow][toCol]))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (toRow < 0 || toRow > 7 && toCol < 0 && toCol > 7) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (team > 0) { // WHITE\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isWhiteCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else { //BLACK\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isBlackCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (pieceType == 1) { //Pawn\n\t\t\treturn ((board[toRow][toCol] != 0 && toRow == fromRow + team && (toCol == fromCol + 1 || toCol == fromCol - 1)) || (toCol == fromCol && board[toRow][toCol] == 0 && ((toRow == fromRow + team) || (((fromRow == 1 && team == 1) || (fromRow == 6 && team == -1)) ? toRow == fromRow + 2*team && board[fromRow + team][fromCol] == 0 : false))));\n\t\t} else if (pieceType == 2) { //Rook\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (pieceType == 3) { //Knight\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy == 5;\n\t\t} else if (pieceType == 4) { //Bishop\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\tint m = dy/dx;\n\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && board[i][startCol + m*(i - minRow)] != 7) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (pieceType == 5) { //Queen\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tint dx = toRow - fromRow;\n\t\t\t\tint dy = toCol - fromCol;\n\t\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\t\tint m = dy/dx;\n\t\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && Math.abs(board[i][startCol + m*(i - minRow)]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (pieceType == 6) { //King\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy <= 2;\n\t\t}\n\n\t\treturn false;\n\t}", "@Test(timeout=2000) public void testMovesToReach(){\r\n GameStateSpace states = new GameStateSpace(this.initial);\r\n // For every target state based on the initial game look at a\r\n // target and calculate the moves to reach it\r\n for(int target=0; target<this.targetGameMoves.size(); target++){\r\n GameAndMoves gm = this.targetGameMoves.get(target);\r\n ZombieTrapGame targetGame = gm.game;\r\n List<String> expectMoves = gm.moves;\r\n List<String> actualMoves = states.movesToReach(targetGame);\r\n StringBuilder sb = new StringBuilder(this.name+\"\\n\");\r\n sb.append(\"TARGET GAME NUMBER \"+target+\"\\n\");\r\n \r\n // Check if the moves are equal to the expectation\r\n if(expectMoves==null && actualMoves==null){\r\n continue;\r\n }\r\n else if(expectMoves !=null && expectMoves.equals(actualMoves)){\r\n continue;\r\n }\r\n else if(expectMoves!=null && actualMoves==null){\r\n sb.append(\"State misidentified as NOT reachable\\n\");\r\n sb.append(String.format(\"Expect sequence: %s\\n\",expectMoves));\r\n sb.append(String.format(\"Actual sequence: %s\\n\",actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n\r\n // ALREADY THERE\r\n // If equal length do they produce the correct board: could be\r\n // alternate paths to the same state\r\n ZombieTrapGame game = this.initial.copy();\r\n for(String move : actualMoves){\r\n doShift(game,move);\r\n }\r\n\r\n // ADD THIS CODE to fix a bug in the original test cases\r\n if(expectMoves==null && actualMoves!=null){\r\n sb.append(\"State misidentified as IS reachable\\n\");\r\n sb.append(String.format(\"Expect sequence: %s\\n\",expectMoves));\r\n sb.append(String.format(\"Actual sequence: %s\\n\",actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(String.format(\"Actual End Game:\\n%s\",game));\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n\r\n // ALREADY THERE\r\n if(!game.equals(targetGame)){ // Moves don't lead to target state\r\n sb.append(\"Actual move sequence does not lead to target state\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Actual End Game:\\n%s\",game));\r\n } \r\n // Different path but same length, not an error\r\n else if(actualMoves.size() == expectMoves.size()){\r\n continue;\r\n }\r\n // Check if the moves are longer than the expected\r\n else if(actualMoves.size() > expectMoves.size()){\r\n sb.append(\"Actual move sequence is longer than the expected move sequence\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n }\r\n // A shorter path!?\r\n else {\r\n sb.append(\"Actual move sequence is SHORTER than the expected move sequence\\n\");\r\n sb.append(\"YOU HAVE DISCOVERED A BUG IN THE TEST CASES: NOTIFY THE COURSE INSTRUCTOR\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n }\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n }", "private void checkLegal() {\n\tif (undoStack.size() == 2) {\n ArrayList<Integer> canGo = \n getMoves(undoStack.get(0), curBoard);\n boolean isLegal = false;\n int moveTo = undoStack.get(1);\n for (int i = 0; i < canGo.size(); i++) {\n if(canGo.get(i) == moveTo) {\n isLegal = true;\n break;\n }\n }\n\n if(isLegal) {\n curBoard = moveUnit(undoStack.get(0), \n moveTo, curBoard);\n clearStack();\n\n moveCount++;\n\t setChanged();\n\t notifyObservers();\n }\n\t}\n }", "private boolean canEats(Point piece){\r\n\t// direction -1: red pieces +1: black pieces\r\n int dir = isRed(piece)? -1:+1;\r\n int dest = dir * 2; // eat move destination\r\n // compute movement points\r\n Point left = new Point(piece.getFirst() + dir, piece.getSecond() - 1);\r\n Point left2 = new Point(piece.getFirst()+ dest, piece.getSecond() - 2);\r\n Point right = new Point(piece.getFirst() + dir, piece.getSecond() + 1);\r\n Point right2 = new Point(piece.getFirst() + dest, piece.getSecond() + 2);\r\n // check left eat\r\n if(isValidPosition(left) && isValidPosition(left2)){\r\n if(isRed(piece) && isBlack(left) && isEmpty(left2)) return true;\r\n if(isBlack(piece) && isRed(left) && isEmpty(left2)) return true;\r\n }\r\n // check right eat\r\n if(isValidPosition(right) && isValidPosition(right2)){\r\n if(isRed(piece) && isBlack(right) && isEmpty(right2)) return true;\r\n if(isBlack(piece) && isRed(right) && isEmpty(right2)) return true;\r\n }\r\n // if is a queen\r\n if(isQueen(piece)){\r\n // compute queen move points (invert direction)\r\n Point leftQ = new Point(piece.getFirst() - dir, piece.getSecond() - 1);\r\n Point leftQ2 = new Point(piece.getFirst() - dest, piece.getSecond() - 2);\r\n Point rightQ = new Point(piece.getFirst() - dir, piece.getSecond() + 1);\r\n Point rightQ2 = new Point(piece.getFirst() - dest, piece.getSecond() + 2);\r\n // check left eat\r\n if(isValidPosition(leftQ) && isValidPosition(leftQ2)){\r\n if(isRed(piece) && isBlack(leftQ) && isEmpty(leftQ2)) return true;\r\n if(isBlack(piece) && isRed(leftQ) && isEmpty(leftQ2)) return true;\r\n }\r\n // check right eat\r\n if(isValidPosition(rightQ) && isValidPosition(rightQ2)){\r\n if(isRed(piece) && isBlack(rightQ) && isEmpty(rightQ2)) return true;\r\n if(isBlack(piece) && isRed(rightQ) && isEmpty(rightQ2)) return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean isMovePossible(int start, int end, boolean isRed){\n\n int moveDiff = end - start; //moveDiff tracks the movement made based on difference btwn start and end\n //general check for if a checker is on the end square\n if (mCheckerBoard.get(end) != null)\n {\n return false; //can't move b/c a checker is on the end square\n }\n\n //general checks that start and end are on the board\n if(end<0 || end>63)\n {\n return false; //can't move b/c end is off-board\n }\n\n\n //checks for diagonalRight\n if(moveDiff == 9 || moveDiff ==-7)\n {\n if(start % 8 == 7){\n return false; //can't move b/c off-board on right\n }\n }\n\n //checks for diagonalLeft\n if(moveDiff == 7 || moveDiff ==-9)\n {\n if(start % 8 == 0){\n return false; //can't move b/c off-board on left\n }\n }\n\n //checks for jumpRight\n if(moveDiff == 18 || moveDiff == -14){\n //column check\n if((start % 8 == 7) || (start % 8 == 6)){\n return false; //can't move b/c off-board on right\n }\n //need to check if there is a piece of opposite color in between\n int jumpSpace = start + (moveDiff/2);\n Checker jumped = mCheckerBoard.get(jumpSpace);\n if(jumped == null)\n {\n return false; //can't move b/c no checker to jump\n }\n else if (jumped.isRed() == isRed)\n {\n return false; //can't move b/c can't jump own color\n }\n }\n\n //checks for jumpLeft\n if(moveDiff == 14 || moveDiff == -18){\n if((start % 8 == 7) || (start % 8 == 6)) {\n return false; //can't move b/c off-board on right\n }\n //need to check if there is a piece of opposite color in between\n int jumpSpace = start + (moveDiff/2);\n Checker jumped = mCheckerBoard.get(jumpSpace);\n if(jumped == null)\n {\n return false; //can't move b/c no checker to jump\n }\n else if (jumped.isRed() == isRed)\n {\n return false; //can't move b/c can't jump own color\n }\n }\n\n if(moveDiff == 7 || moveDiff ==-7 || moveDiff ==9 || moveDiff ==-9\n || moveDiff == 18 || moveDiff == -18 || moveDiff == 14 || moveDiff ==-14){\n return true;\n }\n else{\n return false;\n }\n\n }", "public static boolean processScoring() {\r\n\t\tboolean done = true;\r\n\t\tint player1Tricks = 0;\r\n\t\tint player2Tricks = 0;\r\n\t\tint player3Tricks = 0;\r\n\t\tint player4Tricks = 0;\r\n\t\t\r\n\t\t//Gets the data for three players.\r\n\t\tplayer1Tricks = FrameUtils.player1TricksTaken.getSelectedIndex();\r\n\t\tplayer2Tricks = FrameUtils.player2TricksTaken.getSelectedIndex();\r\n\t\tplayer3Tricks = FrameUtils.player3TricksTaken.getSelectedIndex();\r\n\r\n\t\t//Gets the tricks taken if playing with four players.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tplayer4Tricks = FrameUtils.player4TricksTaken.getSelectedIndex();\r\n\t\t}\r\n\r\n\t\t//Check if all the choice boxes have been selected.\r\n\t\tif (player1Tricks == -1 || player1Tricks == 0) {\r\n\t\t\tdone = false;\r\n\t\t}\r\n\t\tif (player2Tricks == -1 || player2Tricks == 0) {\r\n\t\t\tdone = false;\r\n\t\t}\r\n\t\tif (player3Tricks == -1 || player3Tricks == 0) {\r\n\t\t\tdone = false;\r\n\t\t}\r\n\t\t\r\n\t\t//Don't check fourth player if playing three handed game.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tif (player4Tricks == -1 || player4Tricks == 0) {\r\n\t\t\t\tdone = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Get the value of three players tricks taken.\r\n\t\tplayer1Tricks = stringToInt(FrameUtils.player1TricksTaken.getSelectedItem());\r\n\t\tplayer2Tricks = stringToInt(FrameUtils.player2TricksTaken.getSelectedItem());\r\n\t\tplayer3Tricks = stringToInt(FrameUtils.player3TricksTaken.getSelectedItem());\r\n\t\t\r\n\t\t//Get the value of the fourth player in a four handed game.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tplayer4Tricks = stringToInt(FrameUtils.player4TricksTaken.getSelectedItem());\r\n\t\t}\r\n\t\t\r\n\t\t//Check if tricks taken in a three handed game equals 17.\r\n\t\tif (Main.isThreeHanded) {\r\n\t\t\tif (player1Tricks + player2Tricks + player3Tricks != 17) {\r\n\t\t\t\tdone = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Check if tricks taken in a non-three-handed game equals 13.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tif (player1Tricks + player2Tricks + player3Tricks + player4Tricks != 13) {\r\n\t\t\t\tdone = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Show dialog box reminder.\r\n\t\tif (!done) FrameUtils.showDialogBox(\"Tricks taken was entered wrong.\");\r\n\t\t\t\r\n\t\t//Save tricks taken data.\r\n\t\tsaveTricksTakenData();\r\n\t\t\r\n\t\treturn done;\r\n\t}", "private boolean checkOrTurn(int row,int column, ItemState itemStateCurrentPlayer, int x, int y) {\n\t\t if(column==Settings.nbrRowsColumns||column<0){\n\t\t\t return false; //Get the hell out\n\t\t }\n\t\t if(row==Settings.nbrRowsColumns||row<0){ \n\t\t\t return false; //Get the hell out\n\t\t }\n\t\t if (gameStateInt[row][column]==Helpers.getOpponentPlayerCorrespondingInt(itemStateCurrentPlayer)){ //Still another color\n\t\t\t if(checkOrTurn(row+y,column+x, itemStateCurrentPlayer, x, y)){ //continue check next\n\t\t\t\t\t changed.add(new Action(row,column));\n\t\t\t\t return true;\n\t\t\t }else{\n\t\t\t\t return false;\n\t\t\t }\n\t\t }else if (gameStateInt[row][column]==Helpers.getPlayerCorrespondingInt(itemStateCurrentPlayer)){\n\t\t\t return true; //found same color\n\t\t }else{\n\t\t\t return false; //found grass\n\t\t }\n\t }", "@Test\n public void testThatCorrectMovesAreFound() {\n Solver solver = new Solver();\n PuzzleState state = new PuzzleState(Arrays.asList(CANNIBAL, CANNIBAL),\n Arrays.asList(MISSIONARY, MISSIONARY, CANNIBAL, MISSIONARY), PuzzleState.Position.LEFT_BANK);\n\n // get available moves\n List<Move> moves = solver.getAvailableMoves(state);\n\n Move expectedMove = new Move(Move.Direction.LEFT_TO_RIGHT, Arrays.asList(CANNIBAL, CANNIBAL));\n assertEquals(\"Only two moves should be available!\", 2, moves.size());\n assertTrue(\"List of moves doesn't contain exptected move!\", moves.contains(expectedMove));\n }", "private boolean checkAndMove(CellStatus status, boolean checkIfRaPresent, boolean checkIfCaPresent, boolean checkIfVisited, int attempt){\n\t\tif(checkNextSquareStatus(direction).equals(status)){\r\n\t\t\tif(checkIfRaPresent){\r\n\t\t\t\tif(!isAgentPresent(RA)){\r\n\t\t\t\t\tif(checkIfCaPresent){\r\n\t\t\t\t\t\tif(!isAgentPresent(CA)){\r\n\t\t\t\t\t\t\tif(checkIfVisited){\r\n\t\t\t\t\t\t\t\tif(!isAlreadyVisited(direction)){\r\n\t\t\t\t\t\t\t\t\tsubtractInt();\r\n\t\t\t\t\t\t\t\t\tmove(direction);\r\n\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tmove(direction);\r\n\t\t\t\t\t\t\t\treturn 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}else{\r\n\t\t\t\t\t\tmove(direction);\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}else{\r\n\t\t\t\tmove(direction);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(attempt <= 4){\r\n\t\t\tattempt++;\r\n\t\t\ttoggleDirection(direction);\r\n\t\t\treturn checkAndMove(status, checkIfRaPresent, checkIfCaPresent, checkIfVisited, attempt);\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "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 }", "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}", "public void AIMakeMove() {\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint index = randomizer.nextInt(AIPossibleMoves.size());\n\t\tMove move = AIPossibleMoves.get(index);\n\t\tChecker checker = model.findChecker(move.getxOrigin(), move.getyOrigin());\n\t\tint xChange = (move.getxOrigin() - move.getxMove());\n\t\tint yChange = (move.getyOrigin() - move.getyMove());\n\t\t\n\t\tint xMoveNew = 0;\n\t\tint yMoveNew = 0;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(board.getBoard()[move.getyMove()][move.getxMove()] == 0) {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\t//moving down\n\t\t\tif(yChange < 0) {\n\t\t\t\t//moving right\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//moving left\n\t\t\t\t\t\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//moving up\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\t//moving right\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t} else {\n\t\t\t\t\t//moving left \n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(\"New Move is: \" + xMoveNew + \",\" + yMoveNew);\n\t\tif(canBeKing(checker, move)) {\n\t\t\tchecker = convertToKing(checker, move);\n\t\t\tmodel.updateChecker(move, checker, 2);\n\t\t\t\n\t\t\tprintBoard();\n\t\t\tmodel.moves.add(move);\n\t\t\treturn;\n\t\t}\n\t\tmodel.updateChecker(move, checker, 2);\n\t//\tSystem.out.println(\"AI - DEBUGGING\");\n\t//\tSystem.out.println(\"Origin Piece: \" + move.getxOrigin() + \",\" + move.getyOrigin());\n\t//\tSystem.out.println(\"Move Position: \" + move.getxMove() + \",\" + move.getyMove());\n\t\tupdateBoard(move);\n\t\tmodel.moves.add(move);\n\t\tprintBoard();\n\t\t\n\t}", "public boolean validCastling(ArrayList<Piece> pieces, Rook k) {\r\n // must be same color, same row\r\n if (k.getColor() != getColor() || k.getY() != getY())\r\n return false;\r\n // already moved\r\n if (k.pMove > 0 || pMove > 0) // Changed to \"> 0\" from \"== 1\" to adjust for moveTo increment\r\n return false;\r\n\r\n // is any piece blocking?\r\n for (Piece piece : pieces) {\r\n if (piece.getY() == getY() &&\r\n (\r\n (piece.getX() > k.getX() && piece.getX() < getX()) ||\r\n (piece.getX() < k.getX() && piece.getX() > getX())\r\n ) )\r\n return false;\r\n }\r\n\r\n if (kingCheck(pieces))\r\n return false;\r\n\r\n // try moved and test checking\r\n int orgX = getX();\r\n int targetX = (k.getX() < getX()) ? (orgX - 2) : (orgX + 2);\r\n int step = (targetX < orgX) ? -1 : 1;\r\n\r\n int x = orgX;\r\n boolean checked = false;\r\n do\r\n {\r\n x += step;\r\n setX(x);\r\n if (kingCheck(pieces))\r\n {\r\n checked = true;\r\n break;\r\n }\r\n\r\n } while (x != targetX);\r\n setX(orgX);\r\n return !checked;\r\n }", "private void yourturn() {\n if (whosturn != 3) {\n whosturn = 3;\n displayTable();\n }\n\n // TODO mega duplication\n int top = 0;\n // testing is player has a card they can play\n if (pile.notEmpty()) {\n boolean canplay = false;\n if (hand.getCard(0) == null) { // if player only has card on the table\n if (hand.isFaceUp()) // if player has faceup card on the table\n {\n for (int n = 0; n < 3; n++) {\n if (hand.getFaceUp(n) != null) {\n if (nine && pile.topValue() == 9) {\n top = 0;\n for (int i = 0; i < 52; i++) {\n if (pile.get(i) == null) {\n canplay = true;\n break;\n }\n if (pile.get(i).getValue() == 9) top++;\n else break;\n }\n }\n if (canplay) break;\n if (seven\n && pile.get(top).getValue() == 7\n && hand.getFaceUp(n).getValue() < 7) {\n canplay = true;\n break;\n } else if (hand.getFaceUp(n).getValue() == 2\n || hand.getFaceUp(n).getValue() == 10) {\n canplay = true;\n break;\n } else if (nine && hand.getFaceUp(n).getValue() == 9) {\n canplay = true;\n break;\n } else if (!seven || pile.get(top).getValue() != 7) {\n if (pile.get(top).getValue() <= hand.getFaceUp(n).getValue()) {\n canplay = true;\n break;\n }\n }\n }\n }\n } else // if player only has facedown cards\n canplay = true;\n } else {\n for (int n = 0; n < hand.length() - 1; n++) {\n if (hand.getCard(n) == null) break;\n if (nine && pile.topValue() == 9) {\n top = 0;\n for (int i = 0; i < 52; i++) {\n if (pile.get(i) == null) {\n canplay = true;\n break;\n }\n if (pile.get(i).getValue() == 9) top++;\n else break;\n }\n }\n if (canplay) break;\n if (hand.getCard(n).getValue() == 2 || hand.getCard(n).getValue() == 10) {\n canplay = true;\n break;\n }\n if (nine && hand.getCard(n).getValue() == 9) {\n canplay = true;\n break;\n }\n if (seven && pile.get(top).getValue() == 7 && hand.getCard(n).getValue() < 7) {\n canplay = true;\n break;\n } else if (seven != true || pile.get(top).getValue() != 7) {\n if (pile.get(top).getValue() <= hand.getCard(n).getValue()) {\n canplay = true;\n break;\n }\n }\n }\n }\n if (canplay) {\n // sh.addMsg(\"Its Your Turn\");\n sh.setmyTurn(true);\n } else { // cant play then must pick up the pile\n sh.addMsg(\n \"The card played was a \"\n + pile.top().getStringValue()\n + \" you had to pick up the pile. BLAOW\");\n pile.moveToHand(hand);\n sendCommand(\"turn:pickup:\");\n nextTurn();\n displayTable();\n }\n } else {\n // sh.addMsg(\"Its Your Turn\");\n sh.setmyTurn(true);\n }\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 }", "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 }", "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 }", "private void checkInFront(Tile[][] chessBoard,int pawnX,int pawnY, char pawnColor) {\r\n\t\tint direction;\r\n\t\tBoolean extraStep = false;\r\n\t\tif (pawnColor =='w') {\r\n\t\t\tdirection = 1;\r\n\t\t\tif (pawnY == 1){\r\n\t\t\t\textraStep = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tdirection = -1;\r\n\t\t\tif (pawnY == 6) {\r\n\t\t\t\textraStep = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (extraStep) {\r\n\t\t\tcheckMove(chessBoard, pawnX, pawnY, direction);\r\n\t\t\tcheckMove(chessBoard, pawnX, pawnY, 2*direction);\r\n\t\t} else {\r\n\t\t\tcheckMove(chessBoard, pawnX, pawnY,direction);\r\n\t\t}\r\n\t}", "public String computerMove() {\n\t\t// Look to win in a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win in a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Find the non-full row and col w/ least val\n\t\tint bestR = -1;\n\t\tint bestC = -1;\n\t\tint minSum = 10;\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\tint sum = rowSum[r] + colSum[c];\n\t\t\t\t\tif (sum < minSum) {\n\t\t\t\t\t\tminSum = sum;\n\t\t\t\t\t\tbestR = r;\n\t\t\t\t\t\tbestC = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn done(bestR, bestC);\n\t}", "public Tuple move(Board board, Dice dice, BuildDice bdice) {\n // Throw Dice\n int result = dice.roll();\n System.out.println(ANSI() + \"Player\" + id + \" rolls dice\" + ANSI_RESET);\n System.out.println(ANSI() + \"Player\" + id + \" please press any button\" + ANSI_RESET);\n Scanner s = new Scanner(System.in);\n String str = s.nextLine();\n System.out.println(\"Dice: \" + result);\n System.out.println();\n\n // Render legal your previous position\n board.legal[posX][posY] = 0; \n\n boolean capital = false, bank = false;\n Tuple res = new Tuple();\n Tuple player_pos = new Tuple(posX, posY);\n board.setShow(player_pos, board.board[posX][posY]);\n\n for (int i=0; i<result; i++) {\n int x1, x2, y1, y2, x3, y3, x4, y4;\n\n // right\n x1 = posX;\n y1 = posY + 1;\n // up \n x2 = posX - 1;\n y2 = posY;\n // left\n x3 = posX;\n y3 = posY - 1;\n // down\n x4 = posX + 1;\n y4 = posY;\n \n char c1 = board.board[x1][y1];\n char c2 = board.board[x2][y2];\n char c3 = board.board[x3][y3];\n char c4 = board.board[x4][y4];\n\n if (board.board[posX][posY] == 'S') {\n res.a = 6;\n res.b = 11; \n }\n else if ((c1 == 'B' || c1 == 'C' || c1 == 'H' || c1 == 'S' || c1 == 'E' || c1 == 'e') \n && (prevx != x1 || prevy != y1)) {\n res.a = x1;\n res.b = y1;\n }\n else if ((c2 == 'B' || c2 == 'C' || c2 == 'H' || c2 == 'S' || c2 == 'E' || c2 == 'e') \n && (prevx != x2 || prevy != y2)) {\n res.a = x2;\n res.b = y2;\n }\n else if ((c3 == 'B' || c3 == 'C' || c3 == 'H' || c3 == 'S' || c3 == 'E' || c3 == 'e') \n && (prevx != x3 || prevy != y3)) {\n res.a = x3;\n res.b = y3;\n }\n else if ((c4 == 'B' || c4 == 'C' || c4 == 'H' || c4 == 'S' || c4 == 'E' || c4 == 'e') \n && (prevx != x4 || prevy != y4)) {\n res.a = x4;\n res.b = y4;\n }\n\n prevx = posX;\n prevy = posY;\n // (res.a, res.b) is my next position\n posX = res.a;\n posY = res.b;\n\n // Check if player passes Bank ---> + 1000 MLS\n if (posX == board.B.a && posY == board.B.b) \n bank = true;\n \n // Check if player passes Capital ---> entrance ??\n if (posX == board.C.a && posY == board.C.b)\n capital = true;\n\n // if last round of dice result\n if (i == result - 1) {\n int legal = board.setLegal(prevx, prevy, posX, posY);\n if (legal == 0) {\n res.a = posX;\n res.b = posY;\n }\n // Someone else is on this position\n else if (legal == 1) {\n boolean ans = false;\n while (!ans) {\n // right\n x1 = posX;\n y1 = posY + 1;\n // up \n x2 = posX - 1;\n y2 = posY;\n // left\n x3 = posX;\n y3 = posY - 1;\n // down\n x4 = posX + 1;\n y4 = posY;\n \n c1 = board.board[x1][y1];\n c2 = board.board[x2][y2];\n c3 = board.board[x3][y3];\n c4 = board.board[x4][y4];\n \n if (board.board[posX][posY] == 'S') {\n res.a = 6;\n res.b = 11; \n }\n else if ((c1 == 'B' || c1 == 'C' || c1 == 'H' || c1 == 'S' || c1 == 'E' || c1 == 'e') \n && (prevx != x1 || prevy != y1)) {\n res.a = x1;\n res.b = y1;\n }\n else if ((c2 == 'B' || c2 == 'C' || c2 == 'H' || c2 == 'S' || c2 == 'E' || c2 == 'e') \n && (prevx != x2 || prevy != y2)) {\n res.a = x2;\n res.b = y2;\n }\n else if ((c3 == 'B' || c3 == 'C' || c3 == 'H' || c3 == 'S' || c3 == 'E' || c3 == 'e') \n && (prevx != x3 || prevy != y3)) {\n res.a = x3;\n res.b = y3;\n }\n else if ((c4 == 'B' || c4 == 'C' || c4 == 'H' || c4 == 'S' || c4 == 'E' || c4 == 'e') \n && (prevx != x4 || prevy != y4)) {\n res.a = x4;\n res.b = y4;\n }\n\n prevx = posX;\n prevy = posY;\n // (res.a, res.b) is my next position\n posX = res.a;\n posY = res.b;\n\n legal = board.setLegal(prevx, prevy, posX, posY);\n if (legal == 0) {\n ans = true;\n }\n \n // Check if player passes Bank ---> + 1000 MLS\n if (posX == board.B.a && posY == board.B.b) \n bank = true;\n \n // Check if player passes Capital ---> entrance ??\n if (posX == board.C.a && posY == board.C.b)\n capital = true; \n \n } // endwhile\n\n } // endelseif(legal==1)\n\n // Check if player passes Bank ---> + 1000 MLS\n if (posX == board.B.a && posY == board.B.b)\n bank = true;\n // Check if player passes Capital ---> entrance ??\n if (posX == board.C.a && posY == board.C.b)\n capital = true;\n\n } // endif(i==result-1)\n \n } // endfor\n\n /* ΔΙΝΩ ΠΡΟΤΕΡΑΙΟΤΗΤΑ ΠΡΩΤΑ ΣΤΟ ΝΑ ΠΑΙΡΝΩ ΧΡΗΜΑΤΑ ΑΠΟ ΤΗΝ ΤΡΑΠΕΖΑ\n * ΜΕΤΑ ΣΤΟ ΝΑ ΠΛΗΡΩΣΩ ΣΤΟΝ ΑΝΤΙΠΑΛΟ ΜΟΥ\n * ΜΕΤΑ ΣΤΟ ΝΑ ΜΠΟΡΩ ΝΑ ΑΓΟΡΑΣΩ ΕΙΣΟΔΟ Ή ΝΑ ΧΤΙΣΩ Ή ΝΑ ΑΓΟΡΑΣΩ ΞΕΝΟΔΟΧΕΙΟ\n */\n\n System.out.println(ANSI() + \"Player\" + id + \" is moving to position (\" + res.a + \", \" + res.b + \") \" + board.board[res.a][res.b] + \".\" + ANSI_RESET); \n System.out.println();\n if (!hotel_list.isEmpty()) {\n System.out.println(ANSI() + \"Player\" + id + \" hotels:\" + ANSI_RESET);\n for (HotelCard hc : hotel_list) {\n System.out.println(ANSI() + hc.getName() + ANSI_RESET);\n }\n }\n\n // Find player's position on the show board\n board.setShow(res, getMisc());\n\n // Player has passed from Bank, if (bank == true)\n if (bank)\n bank();\n\n // Check if player is on a rival's entrance \n pay(res, dice, board);\n // Check for bankrupt\n if (status == false) return null;\n\n /* Player has passed from Capital, if (capital == true)\n * Player moves to E --> wants to buy an entrance or upgrade??\n */ \n if ((capital || board.board[res.a][res.b] == 'E' || board.board[res.a][res.b] == 'e') \n && !hotel_list.isEmpty()) {\n String cap = null, build = \"no\";\n if (capital) cap = wantsEntrance(\"capital\");\n else if (board.board[res.a][res.b] == 'E' || board.board[res.a][res.b] == 'e') {\n cap = wantsEntrance(\"E\");\n if (cap.equals(\"no\")) {\n System.out.println(ANSI() + \"Want to build or upgrade a hotel?\" + ANSI_RESET);\n build = wantsBuild();\n }\n }\n // wantsEntrance() result\n if (cap.equals(\"yes\")) {\n System.out.println(ANSI() + \"Player\" + id + \" MLS is: \" + mls + \".\" + ANSI_RESET);\n HotelCard cap_hotel = searchHotel();\n System.out.println(ANSI() + \"Give the (line, column) of entrance position\"+ ANSI_RESET);\n int line = -1, column = -1;\n boolean answer = false;\n System.out.println(ANSI() + \"Give line\" + ANSI_RESET);\n while (answer == false) {\n s = new Scanner(System.in);\n str = s.nextLine();\n try {\n line = Integer.parseInt(str);\n answer = true; \n } catch (Exception e) {\n System.out.println(ANSI() + \"Give integer line\" + ANSI_RESET);\n } \n }\n System.out.println(ANSI() + \"Give column\" + ANSI_RESET);\n answer = false;\n while (answer == false) {\n s = new Scanner(System.in);\n str = s.nextLine();\n try {\n column = Integer.parseInt(str);\n answer = true; \n } catch (Exception e) {\n System.out.println(ANSI() + \"Give integer column\" + ANSI_RESET);\n } \n } \n Tuple pos = new Tuple(line, column);\n buyEntrance(cap_hotel, pos, board);\n }\n // wantsBuild() result\n else if (build.equals(\"yes\")) {\n System.out.println(ANSI() + \"Player\" + id + \" MLS is: \" + mls + ANSI_RESET);\n HotelCard cap_hotel = searchHotel();\n build(cap_hotel, bdice);\n }\n }\n \n // Player is on \"H\" --> Wants to buy??\n else if (board.board[res.a][res.b] == 'H') {\n String buy;\n System.out.println(ANSI() + \"Player\" + id + \" MLS is: \" + mls + ANSI_RESET);\n System.out.println(ANSI() + \"Want to buy a hotel?\" + ANSI_RESET);\n buy = wantsBuy();\n if (buy.equals(\"yes\")) { \n HotelCard buy_hotel = searchAdjacentHotels(board, res); \n buyHotel(buy_hotel);\n }\n }\n\n // After all, player's movement reach to an end...\n return res; \n }", "@Test\n public void moreThanOneCheckerOnToLocation() {\n\n assertTrue(game.move(Location.R1, Location.R2));\n assertTrue(game.move(Location.R1, Location.R3));\n game.nextTurn();\n // to der gerne skulle vaere lovlige og stemme med terningerne\n assertTrue(game.move(Location.R6, Location.R5));\n assertTrue(game.move(Location.R8, Location.R6));\n game.nextTurn();\n assertTrue(game.move(Location.R2, Location.R5));\n assertTrue(game.move(Location.R3, Location.R7));\n game.nextTurn();\n // der staar nu to sorte paa R4\n assertFalse(game.move(Location.R6, Location.R3));\n }", "public int move_diagonally(Square[][] squares, int [] move, Boolean turn) {\n\n /* going down and right = f4 h2 [4,5,6,7] */\n if (move[2] > move[0] && move[3] > move[1]) {\n ////System.out.println(\"Down right\");\n int x = move[0];\n int y = move[1];\n x++;\n y++;\n while (x < move[2] && y < move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x++;\n y++;\n }\n }\n /* going down and left */\n else if (move[2] > move[0] && move[3] < move[1]){\n ////System.out.println(\"Down Left\");\n int x = move[0];\n int y = move[1];\n x++;\n y--;\n while (x < move[2] && y > move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x++;\n y--;\n }\n }\n /* going up and left */\n else if (move[2] < move[0] && move[3] < move[1]){\n ////System.out.println(\"Up Left\");\n int x = move[0];\n int y = move[1];\n x--;\n y--;\n while (x > move[2] && y > move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x--;\n y--;\n }\n }\n /* going up and right c1 f4 [7,2,4,5] */\n else if (move[2] < move[0] && move[3] > move[1]){\n ////System.out.println(\"Up right\");\n int x = move[0];\n int y = move[1];\n x--;\n y++;\n while (x > move[2] && y < move[3]) {\n if (squares[x][y] instanceof Piece) {\n ////System.out.println(\"Piece in between \"+x + \" \" + y);\n return -1;\n }\n x--;\n y++;\n }\n }\n return 0;\n }", "private int checkCorners(int[] arr, int[] availableMoves) {\n for (int i = 0; i <= 6; i += 6) {\n int sum = arr[i] + arr[i + 1] + arr[i + 2];\n System.out.println(sum);\n if (sum == -1 && contains(availableMoves,i)) { \n return i;\n } \n }\n\n // Check verticals\n for (int i = 0; i < 3; i+=2) {\n int sum = arr[i] + arr[i + 3] + arr[i + 6];\n System.out.println(sum);\n if (sum == -1 && contains(availableMoves,i)) {\n return i;\n } \n }\n \n return -1;\n }", "public void checkMoveOrPass(){\n if (this.xTokens.size() > 0) {\n this.diceRoller = false;} \n else { //if no tokens to move, pass and let player roll dice\n this.turn++;\n //System.out.println(\"next turn player \" + this.players[currentPlayer].getColor());\n }\n this.currentPlayer = this.xPlayers.get(this.turn % this.xPlayers.size());\n }", "public static int generateMoves(BoardState bs, long[] moves) {\n int count = 0;\n //int from, int to, int special, int movPiece, int content, int pawnStart\n int piece, tmp_piece, pIndex, index;\n int sq, tmp_sq, pieceNum, dir;\n\n int turn = bs.turn;\n int opponent = turn ^ 1;\n int pawn = PAWN_BY_COLOR[turn];\n\n //PAWNS\n for (pieceNum = 0; pieceNum < bs.pieceNum[pawn]; pieceNum++) {\n sq = bs.pieceArray[pawn][pieceNum];\n assert (isOnboard(sq));\n\n tmp_sq = sq + MOVES_PAWN_STRAIGHT[turn];\n if (bs.pieces[tmp_sq] == EMPTY) {\n count = addPawnMove(bs, sq, tmp_sq, 0, 0, turn, moves, count);\n tmp_sq += MOVES_PAWN_STRAIGHT[turn];\n if (((RANKS_MAP[sq] == RANK_7 && turn == BLACK)\n || (RANKS_MAP[sq] == RANK_2 && turn == WHITE))\n && bs.pieces[tmp_sq] == EMPTY) {\n count = addPawnMove(bs, sq, tmp_sq, 0, 1, turn, moves, count);\n }\n }\n\n tmp_sq = sq + MOVES_PAWNS[turn][0];\n if (isOnboard(tmp_sq) && PIECE_COLORS[bs.pieces[tmp_sq]] == opponent) {\n count = addPawnMove(bs, sq, tmp_sq, bs.pieces[tmp_sq], 0, turn, moves, count);\n }\n if (isOnboard(bs.enPas) && bs.enPas == tmp_sq) { //En passant check\n int move = Moves.generateMove(sq, tmp_sq, 1, pawn, EMPTY, 0);\n count = addMove(move, moves, count, 105);\n }\n\n tmp_sq = sq + MOVES_PAWNS[turn][1];\n if (isOnboard(tmp_sq) && PIECE_COLORS[bs.pieces[tmp_sq]] == opponent) {\n count = addPawnMove(bs, sq, tmp_sq, bs.pieces[tmp_sq], 0, turn, moves, count);\n }\n if (isOnboard(bs.enPas) && bs.enPas == tmp_sq) { //En passant check\n int move = Moves.generateMove(sq, tmp_sq, 1, pawn, EMPTY, 0);\n count = addMove(move, moves, count, 105);\n }\n }\n\n //Bishops, Rooks & Queens\n pIndex = SLIDERS_INDEX[turn];\n piece = SLIDERS[pIndex++];\n while (piece != -1) {\n for (pieceNum = 0; pieceNum < bs.pieceNum[piece]; pieceNum++) {\n sq = bs.pieceArray[piece][pieceNum];\n for (index = 0; index < MOVES_ALL[piece].length; index++) {\n dir = MOVES_ALL[piece][index];\n tmp_sq = sq;\n\n //Slide loop\n while (isOnboard(tmp_sq += dir)) {\n tmp_piece = bs.pieces[tmp_sq];\n if (tmp_piece != EMPTY) {\n if (PIECE_COLORS[tmp_piece] == opponent) {\n int move = Moves.generateMove(sq, tmp_sq, 0, piece, tmp_piece, 0);\n count = addCaptureMove(bs, move, moves, count);\n }\n break; //Stop sliding\n } else {\n int move = Moves.generateMove(sq, tmp_sq, 0, piece, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n }\n }\n }\n piece = SLIDERS[pIndex++];\n }\n //Kings & Knights\n pIndex = MOVERS_INDEX[turn];\n while ((piece = MOVERS[pIndex]) != -1) {\n for (pieceNum = 0; pieceNum < bs.pieceNum[piece]; pieceNum++) {\n sq = bs.pieceArray[piece][pieceNum];\n for (index = 0; index < MOVES_ALL[piece].length; index++) {\n dir = MOVES_ALL[piece][index];\n tmp_sq = sq + dir;\n if (isOnboard(tmp_sq)) {\n tmp_piece = bs.pieces[tmp_sq];\n if (tmp_piece != EMPTY) {\n if (PIECE_COLORS[tmp_piece] == opponent) {\n int move = Moves.generateMove(sq, tmp_sq, 0, piece, tmp_piece, 0);\n count = addCaptureMove(bs, move, moves, count);\n }\n } else {\n int move = Moves.generateMove(sq, tmp_sq, 0, piece, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n }\n }\n }\n pIndex++;\n }\n\n //Castling\n if (turn == WHITE) {\n if ((bs.castlePerms & WKCA) != 0\n && bs.pieces[F1] == EMPTY\n && bs.pieces[G1] == EMPTY\n && !bs.isSquareThreatened(E1, BLACK)\n && !bs.isSquareThreatened(F1, BLACK)) {\n int move = Moves.generateMove(E1, G1, 1, W_KING, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n if ((bs.castlePerms & WQCA) != 0\n && bs.pieces[D1] == EMPTY\n && bs.pieces[C1] == EMPTY\n && bs.pieces[B1] == EMPTY\n && !bs.isSquareThreatened(E1, BLACK)\n && !bs.isSquareThreatened(D1, BLACK)) {\n int move = Moves.generateMove(E1, C1, 1, W_KING, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n } else {\n if ((bs.castlePerms & BKCA) != 0\n && bs.pieces[F8] == EMPTY\n && bs.pieces[G8] == EMPTY\n && !bs.isSquareThreatened(E8, WHITE)\n && !bs.isSquareThreatened(F8, WHITE)) {\n int move = Moves.generateMove(E8, G8, 1, B_KING, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n if ((bs.castlePerms & BQCA) != 0\n && bs.pieces[D8] == EMPTY\n && bs.pieces[C8] == EMPTY\n && bs.pieces[B8] == EMPTY\n && !bs.isSquareThreatened(E8, WHITE)\n && !bs.isSquareThreatened(D8, WHITE)) {\n int move = Moves.generateMove(E8, C8, 1, B_KING, EMPTY, 0);\n count = addMove(bs, move, moves, count);\n }\n }\n\n return count;\n }", "@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 }", "@Override\n\tpublic void makeMove(Game game) \n\t{\n\t\t\n\t\tint row1,col1,row2,col2;\n\t\tCheckers tttGame = (Checkers) game;\n\t\t\n\t\tboolean first = true;\n\n\t\t\tcorrectmove= false;\n\t\t\tSystem.out.println(\"Insert target (row,column) and destination (row, column) ([0,7])\");\n\n\t\t\trow1 = tttGame.x1;\n\t\t\tcol1 = tttGame.y1;\n\t\t\trow2 = tttGame.x2;\n\t\t\tcol2 = tttGame.y2;\n\t\t\tSystem.out.println(row1 + \" \" + col1 + \" \" + row2 + \" \" + col2 + \" \" + role);\n\t\t\t\n\t\t\tfirst=false;\n\t\tcorrectmove= tttGame.isValidCell(row1, col1, row2, col2,role);\n\t\tSystem.out.println(correctmove);\n\n\t\tif(correctmove)\n\t\t{\n\t\t\ttttGame.board[row2][col2]= tttGame.board[row1][col1];\n\t\t\tif(row2==0 && role==0) \n\t\t\t{\n\t\t\t\tif(role==0) tttGame.board[row2][col2]= 2;\n\t\t\t\telse tttGame.board[row2][col2]= -2;\n\t\t\t}\n\t\t\telse if(row2==7 && role==1) \n\t\t\t{\n\t\t\t\tif(role==0) tttGame.board[row2][col2]= 2;\n\t\t\t\telse tttGame.board[row2][col2]= -2;\n\t\t\t}\n\t\t\ttttGame.board[row1][col1]=0;\n\t\t\tif(abs(row1-row2)==2)\n\t\t\t{\n\t\t\t\tint x= (row1+ row2)/2;\n\t\t\t\tint y= (col1+ col2)/2;\n\t\t\t\ttttGame.board[x][y]=0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"invalid move!\");\n\t\t}\n\t\t\n//\t\ttttGame.board[row][col] = role;\n\t}", "public int[] getAllPossibleMoves(boolean ignore) {\n int[] validMoves;\n int[] validMovesResized;\n int validMovesIndex = 0;\n int startRow = this.getRow();\n int startCol = this.getCol();\n \n validMoves = new int[28]; // For a bishop, there are a maximum of 14 possible squares it could move to\n\n // First move from the bishops spot up diagonally to the right (ie col++, row++)\n for (int i = startCol+1, j = startRow+1; i<=8 && j<8; i++,j++) {\n validMoves[validMovesIndex] = i; // the col\n validMoves[validMovesIndex + 1] = j; // the row\n validMovesIndex = validMovesIndex + 2;\n }\n\n // Next move from the bishops start spot down diagonally to the right (ie col++, row--)\n for (int i = startCol+1, j = startRow-1; i<=8 && j>0; i++,j--) {\n validMoves[validMovesIndex] = i;\n validMoves[validMovesIndex + 1] = j;\n validMovesIndex = validMovesIndex + 2;\n }\n\n // Next move from the bishops start spot down diagonally to the left (ie col--, row--)\n for (int i = startCol-1, j = startRow-1; i>0 && j>0; i--,j--) {\n validMoves[validMovesIndex] = i;\n validMoves[validMovesIndex + 1] = j;\n validMovesIndex = validMovesIndex + 2;\n }\n // Next move from the bishops start spot up diagonally to the left (ie col--, row++)\n for (int i = startCol-1, j = startRow+1; i>0 && j<=8; i--,j++) {\n validMoves[validMovesIndex] = i;\n validMoves[validMovesIndex + 1] = j;\n validMovesIndex = validMovesIndex + 2;\n }\n \n // depending on the position of the bishop, the final array of possible moves may not have 14 squares\n // although that is the maximum. Create a new array of the actual size and copy into it.\n validMovesResized = Arrays.copyOf(validMoves, validMovesIndex);\n return validMovesResized;\n }", "private static boolean canMoveUpLeft(ItalianBoard board, int posR, int posC) {\n try {\n return board.getBoard()[posR - 1][posC - 1].getPlace() == PlaceType.EMPTY;\n } catch (ArrayIndexOutOfBoundsException ignored) {\n }\n return false;\n }", "public boolean playerOneWin()\n\t{\n\t\tif( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") ) \n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t}// end of if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\treturn false;\n\t}", "public boolean attemptMove(Move move, int color) {\n //ArrayList<Move> jumps = canJump(color);\n //make sure the to and from values don't go out of bounds\n if (move.xFrom > 7 || move.yFrom > 7 || move.xTo > 7 || move.yTo > 7 ||\n \tmove.xFrom < 0 || move.yFrom < 0 || move.xTo < 0 || move.yTo < 0 ){\n// System.out.println(\"out of bounds\");\n return false;\n }\n int stateOfFrom = gameState.getStateOfSquare(move.xFrom, move.yFrom);\n int stateOfTo = gameState.getStateOfSquare(move.xTo, move.yTo);\n \n\n //if there in no piece in the \"from\" location return false\n if (stateOfFrom == 0){\n// System.out.println(\"no piece at 'from'\");\n return false;\n }\n \n //if there is a piece in the \"to\" location return false\n if (!(stateOfTo == 0)){\n// System.out.println(\"'to' is not empty\");\n return false;\n }\n \n //if the \"from\" piece is not the correct color return false\n if (!(gameState.getStateOfSquare(move.xFrom, move.yFrom)%2 == color))\n {\n// System.out.println(\"that is not your piece\");\n return false;\n }\n \n //check if the \"from\" piece is moving in the right direction\n \n /*if (jumps.isEmpty() == false) //if there are jumps.\n {\n System.out.println(\"there are jumps\");\n //for every possible jump\n for (int i=0; i<jumps.size(); i++){\n \t//if this move matches a possible jump then it is valid\n \tSystem.out.println(\"is this jump \"+ i + \"?\");\n \tif ((move.xFrom == jumps.get(i).xFrom)&&\n \t\t\t(move.yFrom == jumps.get(i).yFrom)&&\n \t\t\t(move.xTo == jumps.get(i).xTo)&&\n \t\t\t(move.yTo == jumps.get(i).yTo)){\n \t\tSystem.out.println(\"yes\");\n \t\treturn true;\n \t}\n \telse{\n \t\tSystem.out.println(\"there are possible jumps\");\n \t}\n \t\t\n \t\n }\n //return false;\n \n //handle jumps\n }\n */\n //moving diagonally\n else{\n if (move.xTo == move.xFrom + 1 || move.xTo == move.xFrom - 1){\n //if (stateOfFrom >= 3) \n //if piece is king it can move both forward and back\n if (stateOfFrom >= 3 && (move.yTo == move.yFrom + 1 || move.yTo == move.yFrom - 1)){\n \treturn true;\n }\n //red can only move up\n else if(color == 0 && (move.yTo == move.yFrom + 1)){\n \treturn true;\n }\n //black can only move down\n else if(color == 1 && (move.yTo == move.yFrom - 1)){\n \treturn true;\n }\n else{\n// System.out.println(\"wrong way\");\n return false;\n }\n }\n else{\n// System.out.println(\"too far away\");\n return false;\n }\n }\n //return true;\n \n \n }", "public void updateMoveRocks(int index) {\n\n\t\tfor (int x = 0; x < 14; x++) {\n\t\t\tbucket[x].setPrevNumOfRocks();\n\t\t}\n\n\t\t// Keep turn if click an empty pit.\n\t\tif (bucket[index].getnumOfRocks() == 0) {\n\t\t\tint player;\n\t\t\tif (index > 7) {\n\t\t\t\tplayer = 2;\n\t\t\t} else {\n\t\t\t\tplayer = 1;\n\t\t\t}\n\t\t\tif (player == 1) {\n\t\t\t\tb.setTurn(false);\n\t\t\t\ta.setTurn(true);\n\t\t\t\ta.resetUndoIncrement();\n\t\t\t} else {\n\t\t\t\ta.setTurn(false);\n\t\t\t\tb.setTurn(true);\n\t\t\t\tb.resetUndoIncrement();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tint sIndex = index;\n\t\tint count = bucket[sIndex].getnumOfRocks();\n\t\tbucket[sIndex].setnumOfRocks(0, c);\n\t\tint eIndex = 0;\n\n\t\tif (sIndex == 0 || sIndex == 7)\n\t\t\treturn;\n\n\t\tint i = sIndex - 1;\n\t\twhile (!(count == 0)) {\n\t\t\tif (i == 7 && (sIndex == 1 || sIndex == 2 || sIndex == 3 || sIndex == 4 || sIndex == 5 || sIndex == 6)) {\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tif (i == 0\n\t\t\t\t\t&& (sIndex == 13 || sIndex == 12 || sIndex == 11 || sIndex == 10 || sIndex == 9 || sIndex == 8)) {\n\t\t\t\ti = 13;\n\t\t\t}\n\n\t\t\tint t = bucket[i].getnumOfRocks() + 1;\n\t\t\tbucket[i].setnumOfRocks(t, c);\n\t\t\tcount--;\n\t\t\tif (count == 0) {\n\t\t\t\teIndex = i; // Gets the ending index so it can be checked for\n\t\t\t\t\t\t\t// capture and not reset if ends on 0.\n\t\t\t}\n\t\t\tif (i == 0) {\n\t\t\t\ti = 14;\n\t\t\t}\n\t\t\ti--;\n\n\t\t}\n\n\t\t// extra turn logic\n\t\tcheckIfFreeTurn(index, eIndex);\n\n\t\t// Capture Stone function\n\t\tcheckCaptureRock(eIndex, sIndex);\n\n\t\t// end game scenario, when one side is out of stones.\n\t\tcheckEndGame();\n\n\t}", "public static boolean diagonalJudge(String playerMarker, int row, int column){\n\n boolean victoryFlag = false;\n\n int subRow = 0;\n int subColumn = 0;\n int victoryCounter = 0;\n\n // Checking first Diagonal\n // North West\n\n subRow = row;\n subColumn = column;\n\n // Store the player's latest move's coordinates\n\n winList.add(subColumn);\n winList.add(subColumn);\n\n while ( subRow >= 0 && subColumn >= 0 && !victoryFlag ){\n\n subRow--;\n subColumn--;\n\n if ( subRow >= 0 && subColumn >= 0 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n // South East\n\n subRow = row;\n subColumn = column;\n\n while ( subRow < 6 && subColumn < 7 && !victoryFlag ){\n\n subRow++;\n subColumn++;\n\n if ( subRow < 6 && subColumn < 7 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n if ( !victoryFlag ){\n winList.clear(); // reset the list, if no one won\n }\n else{\n winDirection = \"Left Diagonal\";\n }\n\n // Checking the other diagonal\n // North East\n\n victoryCounter = 0;\n subRow = row;\n subColumn = column;\n winList.add(subRow);\n winList.add(subColumn);\n\n while ( subRow >= 0 && subColumn < 7 && !victoryFlag ){\n\n subRow--;\n subColumn++;\n\n if ( subRow >= 0 && subColumn < 7 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n winDirection = \"Right Diagonal\";\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n // South East\n\n subRow = row;\n subColumn = column;\n\n while ( subRow < 6 && subColumn >= 0 && !victoryFlag ){\n\n subRow++;\n subColumn--;\n\n if ( subRow <= 5 && subColumn >= 0 ){\n\n if ( gameBoard[subRow][subColumn].equals(playerMarker) ){\n winList.add(subRow);\n winList.add(subColumn);\n victoryCounter++;\n\n if ( victoryCounter == 3){\n winDirection = \"Right Diagonal\";\n victoryFlag = true;\n }\n }\n\n else{\n break;\n }\n }\n }\n\n if ( !victoryFlag ){\n winList.clear();\n }\n\n return victoryFlag;\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 }", "private boolean winCheck(int x, int y, char symbol){\n\t\t/* Horizontal */\n\t\tif(y>=2 && board[x][y-2]==symbol && board[x][y-1]==symbol && board[x][y]==symbol)\n\t\t\treturn true;\n\t\tif(y>=1 && y+1<size && board[x][y-1]==symbol && board[x][y]==symbol && board[x][y+1]==symbol)\n\t\t\treturn true;\n\t\tif(y+2<size && board[x][y]==symbol && board[x][y+1]==symbol && board[x][y+2]==symbol)\n\t\t\treturn true;\n\t\t\n\t\t/* Vertical */\n\t\tif(x>=2 && board[x-2][y]==symbol && board[x-1][y]==symbol && board[x][y]==symbol)\n\t\t\treturn true;\n\t\tif(x>=1 && x+1<size && board[x-1][y]==symbol && board[x][y]==symbol && board[x+1][y]==symbol)\n\t\t\treturn true;\n\t\tif(x+2<size && board[x][y]==symbol && board[x+1][y]==symbol && board[x+2][y]==symbol)\n\t\t\treturn true;\n\t\t\n\t\t/* Main Diagonal */\n\t\tif(x>=2 && y>=2 && board[x-2][y-2]==symbol && board[x-1][y-1]==symbol && board[x][y]==symbol)\n\t\t\treturn true;\n\t\tif(x>=1 && x+1<size && y>=1 && y+1<size && board[x-1][y-1]==symbol && board[x][y]==symbol && board[x+1][y+1]==symbol)\n\t\t\treturn true;\n\t\tif(x+2<size && y+2<size && board[x][y]==symbol && board[x+1][y+1]==symbol && board[x+2][y+2]==symbol)\n\t\t\treturn true;\n\t\t\n\t\t/* Anti Diagonal */\n\t\tif(x>=2 && y+2<size && board[x-2][y+2]==symbol && board[x-1][y+1]==symbol && board[x][y]==symbol)\n\t\t\treturn true;\n\t\tif(x>=1 && x+1<size && y>=1 && y+1<size && board[x+1][y-1]==symbol && board[x][y]==symbol && board[x-1][y+1]==symbol)\n\t\t\treturn true;\n\t\tif(x+2<size && y>=2 && board[x][y]==symbol && board[x+1][y-1]==symbol && board[x+2][y-2]==symbol)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "private boolean canMoveDown()\n {\n // runs through column first, row second\n for ( int column = 0; column < grid[0].length ; column++ ) {\n for ( int row = grid.length-2; row >=0; row-- ) {\n // looks at tile directly below the current tile\n int compare = row + 1;\n if ( grid[row][column] != 0 ) {\n if ( grid[compare][column] == 0 || grid[row][column] ==\n grid[compare][column] ) {\n return true;\n }\n }\n }\n } \n return false;\n }", "private void checkForConversions() {\n\n for(int r=0; r<COLUMN_ROW_COUNT; r++) {\n for(int c=0; c<COLUMN_ROW_COUNT; c++) {\n Piece p = cells[r][c];\n if(p == null) continue;\n\n if (p.getType().equals(Type.GUARD)) {\n int surroundingDragons = 0;\n Piece piece;\n\n if ((c - 1) >= 0) {\n piece = cells[r][c - 1];\n if (piece != null && piece.getType().equals(Type.DRAGON)) surroundingDragons++;\n }\n if ((r- 1) >= 0) {\n piece = cells[r- 1][c];\n if (piece != null && piece.getType().equals(Type.DRAGON)) surroundingDragons++;\n }\n if ((c + 1) < COLUMN_ROW_COUNT) {\n piece = cells[r][c + 1];\n if (piece != null && piece.getType().equals(Type.DRAGON)) surroundingDragons++;\n }\n if ((r+ 1) < COLUMN_ROW_COUNT) {\n piece = cells[r+ 1][c];\n if (piece != null && piece.getType().equals(Type.DRAGON)) surroundingDragons++;\n }\n\n if (surroundingDragons >= 3) {\n cells[r][c].changeType(Type.DRAGON);\n }\n }\n\n /*\n if(p.getType().equals(Type.KING)) {\n int blockedDirections = 0;\n Piece piece;\n\n if ((c - 1) >= 0) {\n piece = cells[r][c - 1];\n if (piece != null) {\n if (piece.getType().equals(Type.DRAGON)) {\n blockedDirections++;\n } else if (piece.getType().equals(Type.GUARD) && (c - 2) >= COLUMN_ROW_COUNT && cells[r][c-2] != null) {\n blockedDirections++;\n }\n }\n } else blockedDirections++;\n\n if ((r- 1) >= 0) {\n piece = cells[r- 1][c];\n if (piece != null) {\n if (piece.getType().equals(Type.DRAGON)) {\n blockedDirections++;\n } else if (piece.getType().equals(Type.GUARD) && (r - 2) >= COLUMN_ROW_COUNT && cells[r-2][c] != null) {\n blockedDirections++;\n }\n }\n } else blockedDirections++;\n\n if ((c + 1) < COLUMN_ROW_COUNT) {\n piece = cells[r][c+1];\n if (piece != null) {\n if (piece.getType().equals(Type.DRAGON)) {\n blockedDirections++;\n } else if (piece.getType().equals(Type.GUARD) && (c + 2) < COLUMN_ROW_COUNT && cells[r][c+2] != null) {\n blockedDirections++;\n }\n }\n } else blockedDirections++;\n\n if ((r+ 1) < COLUMN_ROW_COUNT) {\n piece = cells[r+1][c];\n if (piece != null) {\n if (piece.getType().equals(Type.DRAGON)) {\n blockedDirections++;\n } else if (piece.getType().equals(Type.GUARD) && (r + 2) < COLUMN_ROW_COUNT && cells[r+2][c] != null) {\n blockedDirections++;\n }\n }\n } else blockedDirections++;\n\n if(blockedDirections == 4) {\n //gameOver = true;\n }\n }*/\n }\n }\n }", "@Test\n void testAllLegalMoves() {\n \tplayer1 = new HumanPlayer(\"Arnold\");\n player2 = new HumanPlayer(\"Intelligent Twig\");\n gameState = new GameState(Arrays.asList(player1, player2));\n board = gameState.getBoard();\n \n Set<PlayableMove> moves = Move.allLegalMoves(gameState);\n\n assertTrue(moves.stream().allMatch(e -> e.isLegal()));\n assertEquals(44, moves.size());\n }", "@Test\r\n public void callingMovePossibleOnTakingAPieceWhenYouAlreadyHaveAZeroShouldReturnFalse() {\n player1.movePiece(12, 11, board);\r\n\r\n // moving piece to zero\r\n player2.movePiece(13, 25, board);\r\n // give 2 move\r\n player2.movesLeft.moves.add(2);\r\n\r\n // Then\r\n assertFalse(player2.isMovePossible(13, 11, board));\r\n }", "public void calculateLegalMoves() {\n //Gets the row and column and call the checkDiagonalMoves method to find what are the piece's legal movements.\n int currentRow = this.getSquare().getRow();\n int currentCol = this.getSquare().getCol();\n checkDiagonalMoves(currentRow, currentCol);\n }", "boolean checkLegalMove(int posx, int posy) {\n\t\tBoolean bool;\n\t\tint change;\n\t\tchange = curPlayer > 1 ? (change = 1) : (change = -1);\n\t\tif (kingJumping(posx, posy, change)){\n\t\t\tbool = true;\n\t\t} else if (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\tSystem.out.println(\"Normal move\");\n\t\t\tbool = true;\n\t\t} else if (jump(posx, posy, prevPiece) && (prevPosX == posx + (change * 2) && (prevPosY == posy - 2 || prevPosY == posy + 2))) {\n\t\t\tbool = true;\n\t\t} else if (((JLabel)prevComp).getIcon().equals(Playboard.rKing) || ((JLabel)prevComp).getIcon().equals(Playboard.bKing) || ((JLabel)prevComp).getIcon().equals(Playboard.blackSKing) || ((JLabel)prevComp).getIcon().equals(Playboard.redSKing)){\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\t\tbool = true;\n\t\t\t} else\n\t\t\t\tbool = false;\n\t\t} else if (prevPiece == 4 && (prevPosX == posx + 1 || prevPosX == posx -1) && (prevPosY == posy - 1 || prevPosY == posy +1)) { // King moves\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1))\n\t\t\t\tbool = true;\n\t\t\telse\n\t\t\t\tbool = false;\n\t\t} else {\n\t\t\tbool = false;\n\t\t}\n\t\treturn bool;\n\t}", "public void oneTurn(){\n Integer[] previousTurn = Arrays.copyOf(this.board, this.board.length);\n\n // itero su previousTurn per costruire il board successivo\n for (int i=0;i<previousTurn.length;i++){\n\n // mi salvo la situazione della casella sx, se i==0 prendo l'ultima\n int left = previousTurn[previousTurn.length-1];\n if (i!=0)\n left = previousTurn[i-1];\n\n // mi salvo la situazione della casella dx, se i==ultima prendo zero\n int right = previousTurn[0];\n if (i!=previousTurn.length-1)\n right = previousTurn[i+1];\n \n // se a sx e dx c'è 0, metto 0\n // caso fine sottopopolazione (010->000)\n if (left == 0 && right == 0){\n this.board[i] = 0;\n \n // se a sx e dx c'è 1, metto 1 se c'era 0 e viceversa\n // caso nascita (101->111) e fine sovrappopolazione (111->101)\n } else if (left == 1 && right == 1)\n if (this.board[i] == 1)\n this.board[i] = 0;\n else\n this.board[i] = 1;\n \n // tutte le altre casistiche, lascio invariata la situazione\n \n }\n\n this.turn += 1;\n }", "private boolean isNextMoveRochade(Move move)\r\n\t{\r\n\t\tif (!(move.from.piece instanceof King)) return false;\r\n\t\tint xDiffAbs = Math.abs(move.to.coordinate.x - move.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}", "@Override\n public boolean canMove(List<ICrosser> crossers, boolean fromLeftToRightBank) {\n return false;\n }", "@Override\n public Collection<Move> calculateLegalMoves(Board board) {\n System.out.println(\"INSIDE Knight: calculateLegalMoves()\");\n System.out.println(\"------------------------------>\\n\");\n\n //ArrayList of moves used to store all possible legal moves.\n final List<Move> legalMoves = new ArrayList<>();\n\n //Iterate the constant class array of piece offsets.\n for(final int currentCandidate : CANDIDATE_MOVE_COORDS){\n //Add the current coordinate of the piece to each offset, storing as a destination coordinate.\n final int candidateDestinationCoord = this.piecePosition + currentCandidate;\n\n //If the destination coordinate is within legal board bounds (between 0 and 64)...\n if(BoardUtils.isValidCoord(candidateDestinationCoord)){\n //Check to see if the piece is in the first column and its destination would move it outside the board.\n if(isfirstColumnExclusion(this.piecePosition, currentCandidate) ||\n isSecondColumnExclusion(this.piecePosition, currentCandidate) ||\n isSeventhColumnExclusion(this.piecePosition, currentCandidate) ||\n isEighthColumnExclusion(this.piecePosition, currentCandidate)){\n continue; //Continue the loop if any of these methods return true\n }\n\n //Store the tile of the destination coordinate.\n final Tile candidateDestinationTile = board.getTile(candidateDestinationCoord);\n\n //If the tile is not marked as occupied by the Tile class...\n if(!candidateDestinationTile.isOccupied()){\n //Add the move to the list of legal moves as a non-attack move.\n legalMoves.add(new MajorMove(board, this, candidateDestinationCoord));\n }\n else{\n //Otherwise, get the type and alliance of the piece at the destination.\n final Piece pieceAtDestination = candidateDestinationTile.getPiece();\n final Alliance pieceAlliance = pieceAtDestination.getPieceAlliance();\n\n //If the piece at the occupied tile's alliance differs...\n if(this.pieceAlliance != pieceAlliance){\n //Add the move to the list of legal moves as an attack move.\n legalMoves.add(new MajorAttackMove(board, this, candidateDestinationCoord, pieceAtDestination));\n }\n }\n }\n }\n\n //Return the list of legal moves.\n return legalMoves;\n }", "public boolean validMove(int playerID, Card selectedCard){\n // turn == playerID\n if(gameStage == 3){\n if(numPlays == 0){\n if(playerID == 0){\n player1Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player1Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player2Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player3Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player4Play.getSuit();\n }\n numPlays++;\n turn = 0;\n return true;\n }\n }\n else if(numPlays < 3){\n if(playerID == 0){\n player1Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n numPlays++;\n turn = 0;\n return true;\n }\n }\n // if three cards have been played this is the last card\n else if(numPlays == 3){\n if(playerID == 0){\n player1Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n }\n }\n return false;\n }", "static List<Move> generateLegalMoves(Position pos) {\n\t\tList<Move> moves = new ArrayList<>();\n\n\t\t// for (int square : pos.pieces) {\n\t\t// \tif (pos.pieces.size() > 32) {\n\t\t// \t\tSystem.out.println(\"problem\" + pos.pieces.size());\n\t\t// \t}\n\t\t// \tif (pos.at(square) != 0 && Piece.isColor(pos.at(square), pos.toMove)) {\n\t\t// \t\tint piece = pos.at(square);\n\t\t// \t\tint name = Piece.name(piece);\n\t\t// \t\tif (name == Piece.Pawn) {\n\t\t// \t\t\tint step = pos.toMove == 'w' ? MoveData.Up : MoveData.Down;\n\t\t// \t\t\tif (square + step >= 0 && square + step < 64) {\n\t\t// \t\t\t\t// 1 square\n\t\t// \t\t\t\tif (pos.board.squares[square + step] == 0) {\n\t\t// \t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'q'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'b'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'n'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'r'));\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step));\n\t\t// \t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\t// 2 squares\n\t\t// \t\t\t\tif ((square < 16 && pos.toMove == 'w') || square > 47 && pos.toMove == 'b') {\n\t\t// \t\t\t\t\tif (pos.board.squares[square + 2*step] == 0 && pos.board.squares[square + step] == 0) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + 2*step));\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\t\n\t\t// \t\t\t\t// capture\n\t\t// \t\t\t\t// right\n\t\t// \t\t\t\tif (MoveData.DistanceToEdge[square][3] > 0) {\n\t\t// \t\t\t\t\tint target = square + step + 1;\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'q'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'b'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'n'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'r'));\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\telse {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\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\telse if (target == pos.enPassantTarget) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\t// left\n\t\t// \t\t\t\tif (MoveData.DistanceToEdge[square][2] > 0) {\n\t\t// \t\t\t\t\tint target = square + step - 1;\n\t\t// \t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'q'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'b'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'n'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'r'));\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\telse {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\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\telse if (target == pos.enPassantTarget) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\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\n\t\t// \t\t\t}\t\t\t\t\t\t\t\t\n\t\t// \t\t}\n\t\t// \t\telse if (name == Piece.Knight) {\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\tfor (int offset : MoveData.KnightOffsets.get(square)) {\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\tif (!Piece.isColor(pos.board.squares[square + offset], pos.toMove)) {\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tMove move = new Move(square, square + offset);\n\t\t// \t\t\t\t\tmoves.add(move);\t\t\t\t\t\t\t\n\t\t// \t\t\t\t}\t\n\t\t// \t\t\t}\t\t\t\t\t\n\t\t// \t\t}\n\t\t// \t\telse {\n\t\t// \t\t\tint dirStart = name == Piece.Bishop ? 4 : 0;\n\t\t// \t\t\tint dirEnd = name == Piece.Rook ? 4 : 8;\n\t\t// \t\t\tfor (int dir = dirStart; dir < dirEnd; dir++) {\n\t\t// \t\t\t\tint maxDist = MoveData.DistanceToEdge[square][dir];\n\t\t// \t\t\t\tint dist = name == Piece.King ? Math.min(1, maxDist) : maxDist;\n\n\t\t// \t\t\t\tfor (int steps = 1; steps <= dist; steps++) {\n\t\t// \t\t\t\t\tint squareIdx = square + steps * MoveData.Offsets[dir];\t\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tif (!Piece.isColor(pos.board.squares[squareIdx], pos.toMove)) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, squareIdx));\n\t\t// \t\t\t\t\t\tif (Piece.isColor(pos.board.squares[squareIdx], Opposite(pos.toMove))) {\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\telse {\n\t\t// \t\t\t\t\t\tbreak;\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\t\t\t\t\t\t\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t\t// \t}\n\t\t// }\n\n\t\tfor (int i = 0; i < 64; i++) {\n\t\t\tif (pos.board.squares[i] != 0 && Piece.isColor(pos.board.squares[i], pos.toMove)) {\n\t\t\t\tint piece = pos.board.squares[i];\n\t\t\t\tint name = Piece.name(piece);\n\t\t\t\tif (name == Piece.Pawn) {\n\t\t\t\t\tint step = pos.toMove == 'w' ? MoveData.Up : MoveData.Down;\n\t\t\t\t\tif (i + step >= 0 && i + step < 64) {\n\t\t\t\t\t\t// 1 square\n\t\t\t\t\t\tif (pos.board.squares[i + step] == 0) {\n\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'q'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'b'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'n'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'r'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step));\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// 2 squares\n\t\t\t\t\t\tif ((i < 16 && pos.toMove == 'w') || i > 47 && pos.toMove == 'b') {\n\t\t\t\t\t\t\tif (pos.board.squares[i + 2*step] == 0 && pos.board.squares[i + step] == 0) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + 2*step));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t// capture\n\t\t\t\t\t\t// right\n\t\t\t\t\t\tif (MoveData.DistanceToEdge[i][3] > 0) {\n\t\t\t\t\t\t\tint target = i + step + 1;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'q'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'b'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'n'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'r'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\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\telse if (target == pos.enPassantTarget) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// left\n\t\t\t\t\t\tif (MoveData.DistanceToEdge[i][2] > 0) {\n\t\t\t\t\t\t\tint target = i + step - 1;\n\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'q'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'b'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'n'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'r'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\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\telse if (target == pos.enPassantTarget) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\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\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if (name == Piece.Knight) {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor (int offset : MoveData.KnightOffsets.get(i)) {\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (!Piece.isColor(pos.board.squares[i + offset], pos.toMove)) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tMove move = new Move(i, i + offset);\n\t\t\t\t\t\t\tmoves.add(move);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint dirStart = name == Piece.Bishop ? 4 : 0;\n\t\t\t\t\tint dirEnd = name == Piece.Rook ? 4 : 8;\n\t\t\t\t\tfor (int dir = dirStart; dir < dirEnd; dir++) {\n\t\t\t\t\t\tint maxDist = MoveData.DistanceToEdge[i][dir];\n\t\t\t\t\t\tint dist = name == Piece.King ? Math.min(1, maxDist) : maxDist;\n\t\t\t\t\t\tfor (int steps = 1; steps <= dist; steps++) {\n\t\t\t\t\t\t\tint squareIdx = i + steps * MoveData.Offsets[dir];\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!Piece.isColor(pos.board.squares[squareIdx], pos.toMove)) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, squareIdx));\n\t\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[squareIdx], Opposite(pos.toMove))) {\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\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// castling\t\t\n\t\tif (pos.toMove == 'w' && !underAttack(pos, pos.whiteKing, 'b')) {\t\t\t\n\t\t\tif (pos.castlingRights.whiteKingSide && pos.at(Board.H1) == (Piece.Rook | Piece.White)) {\n\t\t\t\tif (pos.at(Board.F1) == Piece.Empty && pos.at(Board.G1) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.F1, 'b') && !underAttack(pos, Board.G1, 'b')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E1, Board.G1));\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\tif (pos.castlingRights.whiteQueenSide && pos.at(Board.A1) == (Piece.Rook | Piece.White)) {\t\t\t\t\n\t\t\t\tif (pos.at(Board.B1) == Piece.Empty && pos.at(Board.C1) == Piece.Empty && pos.at(Board.D1) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.D1, 'b') && !underAttack(pos, Board.C1, 'b')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E1, Board.C1));\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\telse if (pos.toMove == 'b' && !underAttack(pos, pos.blackKing, 'w')){\n\t\t\tif (pos.castlingRights.blackKingSide && pos.at(Board.H8) == (Piece.Rook | Piece.Black)) {\n\t\t\t\tif (pos.at(Board.F8) == Piece.Empty && pos.at(Board.G8) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.F8, 'w') && !underAttack(pos, Board.G8, 'w')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E8, Board.G8));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pos.castlingRights.blackQueenSide && pos.at(Board.A8) == (Piece.Rook | Piece.Black)) {\n\t\t\t\tif (pos.at(Board.B8) == Piece.Empty && pos.at(Board.C8) == Piece.Empty && pos.at(Board.D8) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.D8, 'w') && !underAttack(pos, Board.C8, 'w')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E8, Board.C8));\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// filter illegal moves\n\t\tList<Move> legalMoves = new ArrayList<>();\n\t\tchar color = pos.toMove;\n\t\tfor (Move move : moves) {\n\t\t\tpos.makeMove(move);\n\t\t\tif (!kingInCheck(pos, color)) {\n\t\t\t\tlegalMoves.add(move);\n\t\t\t}\t\t\t\n\t\t\tpos.undoMove();\n\t\t}\n\n\t\treturn legalMoves;\n\t}", "public void moveDown()\n {\n // runs through column first, row second\n for ( int column = 0; column < grid[0].length; column++) {\n\n // check is set to false, meaning no combinations have been made\n boolean check = false;\n for ( int row = grid.length-2; row >= 0; row--) {\n int compare = row;\n if ( grid[compare][column] != 0 ) { \n\n // loop continues whiel there are still zero values below the current\n // tile\n while ( grid[compare+1][column] == 0 ) {\n\n // switches places of the current tile with the zero tile\n grid[compare+1][column] = grid[compare][column];\n grid[compare][column] = 0;\n compare ++;\n\n // if you reach the bottom of your board, break from the loop\n if ( compare == grid.length-1 ){\n break;\n }\n }\n // if a combination was made on the previous loop, set check to false\n if ( check == true ){\n check = false;\n }\n // if a combination wasn't made on the previous loop and two tiles \n // next to each other have the same value, combine them\n else if ( compare != grid.length-1 &&\n grid[compare+1][column] == grid[compare][column]) {\n grid[compare+1][column] = 2*grid[compare+1][column];\n grid[compare][column] = 0;\n\n // sets check to true to indicate a combination was made\n check = true;\n\n // increases your score by the value of the combined tile\n score+= grid[compare+1][column];\n } \n }\n }\n } \n }", "public void ValidSwitch(int x, int y) {\n\n SaveState();\n int temp = pictures[x][y - 1];\n pictures[x][y - 1] = pictures[previousX][previousY - 1];\n pictures[previousX][previousY - 1] = temp;\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n pictures2[i][j] = pictures[i][j];\n }\n }\n\n combinationValid = 0;\n LabelingCandiesToDestroy();\n\n if (combinationValid == 0) { //if there's no combination from the switch, it resets it to the original state\n ResetState();\n } else {\n if (InsideMovesRemainingExists == 0) {//checks if there is a playable move left\n combinationValid = 0;\n MovesRemainingExists();\n }\n }\n }", "@Test\n\t/*\n\t * Checking Stalemate by \n\t * deleteing all pieces of Player 2 except 1 pawn but keeping it trapped.\n\t * Moving the King of Player 2 to such a positon that its not a check but cannot move.\n\t * here we are using the Queen of Player 1 to achieve that situation.\n\t */\n\tvoid testCheckStalemate() {\n\t\tm_oBoard.getPositionAgent(\"a8\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"b8\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"c8\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"d8\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"j8\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"k8\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"l8\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"a7\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"c7\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"d7\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"i7\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"j7\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"k7\").getPiece().setPosition(null);\n\t\tm_oBoard.getPositionAgent(\"l7\").getPiece().setPosition(null);\n\n\t\tm_oBoard.getPositionAgent(\"a8\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"b8\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"c8\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"d8\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"j8\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"k8\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"l8\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"a7\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"c7\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"d7\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"i7\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"j7\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"k7\").setPiece(null);\n\t\tm_oBoard.getPositionAgent(\"l7\").setPiece(null);\n\t\t\t\t\n\t\t// Setting Player 1 Pawn from b2 to b4\n\t\tIPositionAgent oSourcePositionOfPawnWhite = m_oBoard.getPositionAgent(\"b2\");\n\t\tIPositionAgent oDestinationPositionOfPawnWhite = m_oBoard.getPositionAgent(\"b4\");\n\t\t\n\t\tIRuleAgent oRulepawnWhite= (IRuleAgent)m_oBoardFactory.createRule();\t\t\n\t\toRulepawnWhite.getRuleData().setRuleType(RuleType.MOVE);\n\t\toRulepawnWhite.getRuleData().setDirection(Direction.EDGE);\n\t\toRulepawnWhite.getRuleData().setMaxRecurrenceCount(Integer.MAX_VALUE);\n\t\toRulepawnWhite.getRuleData().setFile(File.SAME);\n\t\toRulepawnWhite.getRuleData().setRank(Rank.FORWARD);\n\t\toRulepawnWhite.getRuleData().setFamily(Family.IGNORE);\n\t\toRulepawnWhite.getRuleData().setManoeuvreStrategy(Manoeuvre.FILE_AND_RANK);\n\t\toRulepawnWhite.getRuleData().setName(\"MOVE\");\n\t\toRulepawnWhite.getRuleData().setCustomName(\"\");\n\t\t\n\t\tIMoveCandidate oMoveCandidatePawnWhite = new MoveCandidate(oRulepawnWhite, oSourcePositionOfPawnWhite.getPiece(), oSourcePositionOfPawnWhite, oDestinationPositionOfPawnWhite);\n\t\tm_oRuleEngine.tryExecuteRule(m_oBoard, oMoveCandidatePawnWhite);\n\t\t\n\t\t// Setting Player 2 Pawn from b7 to b5\n\t\tIPositionAgent oSourcePositionOfPawnBlack = m_oBoard.getPositionAgent(\"b7\");\n\t\tIPositionAgent oDestinationPositionOfPawnBlack = m_oBoard.getPositionAgent(\"b5\");\n\t\t\n\t\tIRuleAgent oRulepawnBlack= (IRuleAgent)m_oBoardFactory.createRule();\t\t\n\t\toRulepawnBlack.getRuleData().setRuleType(RuleType.MOVE);\n\t\toRulepawnBlack.getRuleData().setDirection(Direction.EDGE);\n\t\toRulepawnBlack.getRuleData().setMaxRecurrenceCount(Integer.MAX_VALUE);\n\t\toRulepawnBlack.getRuleData().setFile(File.SAME);\n\t\toRulepawnBlack.getRuleData().setRank(Rank.FORWARD);\n\t\toRulepawnBlack.getRuleData().setFamily(Family.IGNORE);\n\t\toRulepawnBlack.getRuleData().setManoeuvreStrategy(Manoeuvre.FILE_AND_RANK);\n\t\toRulepawnBlack.getRuleData().setName(\"MOVE\");\n\t\toRulepawnBlack.getRuleData().setCustomName(\"\");\n\t\t\n\t\tIMoveCandidate oMoveCandidatePawnBlack = new MoveCandidate(oRulepawnWhite, oSourcePositionOfPawnBlack.getPiece(), oSourcePositionOfPawnBlack, oDestinationPositionOfPawnBlack);\n\t\tm_oRuleEngine.tryExecuteRule(m_oBoard, oMoveCandidatePawnBlack);\n\t\t\t\t\n\t\t// Setting Player 2 king from i8 to l8\n\t\tIPositionAgent oSourcePositionOfKing = m_oBoard.getPositionAgent(\"i8\");\n\t\tIPositionAgent oDestinationPositionOfKing = m_oBoard.getPositionAgent(\"l8\");\n\t\t\n\t\tIRuleAgent oRuleKing= (IRuleAgent)m_oBoardFactory.createRule();\t\t\n\t\toRuleKing.getRuleData().setRuleType(RuleType.MOVE);\n\t\toRuleKing.getRuleData().setDirection(Direction.EDGE);\n\t\toRuleKing.getRuleData().setMaxRecurrenceCount(Integer.MAX_VALUE);\n\t\toRuleKing.getRuleData().setFile(File.SAME);\n\t\toRuleKing.getRuleData().setRank(Rank.FORWARD);\n\t\toRuleKing.getRuleData().setFamily(Family.IGNORE);\n\t\toRuleKing.getRuleData().setManoeuvreStrategy(Manoeuvre.FILE_AND_RANK);\n\t\toRuleKing.getRuleData().setName(\"MOVE\");\n\t\toRuleKing.getRuleData().setCustomName(\"\");\n\t\t\n\t\tIMoveCandidate oMoveCandidateKing = new MoveCandidate(oRuleKing, oSourcePositionOfKing.getPiece(), oSourcePositionOfKing, oDestinationPositionOfKing);\n\t\tm_oRuleEngine.tryExecuteRule(m_oBoard, oMoveCandidateKing);\n\t\t\n\t\t// Setting Player 1 queen from d1 to j7\n\t\tIPositionAgent oSourcePositionOfQueen = m_oBoard.getPositionAgent(\"d1\");\n\t\tIPositionAgent oDestinationPositionOfQueen = m_oBoard.getPositionAgent(\"j7\");\n\t\t\n\t\tIRuleAgent oRuleQueen= (IRuleAgent)m_oBoardFactory.createRule();\t\t\n\t\toRuleQueen.getRuleData().setRuleType(RuleType.MOVE);\n\t\toRuleQueen.getRuleData().setDirection(Direction.VERTEX);\n\t\toRuleQueen.getRuleData().setMaxRecurrenceCount(Integer.MAX_VALUE);\n\t\toRuleQueen.getRuleData().setFile(File.SAME);\n\t\toRuleQueen.getRuleData().setRank(Rank.FORWARD);\n\t\toRuleQueen.getRuleData().setFamily(Family.IGNORE);\n\t\toRuleQueen.getRuleData().setManoeuvreStrategy(Manoeuvre.FILE_AND_RANK);\n\t\toRuleQueen.getRuleData().setName(\"MOVE\");\n\t\toRuleQueen.getRuleData().setCustomName(\"\");\n\t\t\n\t\tIMoveCandidate oMoveCandidateQueen = new MoveCandidate(oRuleQueen, oSourcePositionOfQueen.getPiece(), oSourcePositionOfQueen, oDestinationPositionOfQueen);\n\t\tm_oRuleEngine.tryExecuteRule(m_oBoard, oMoveCandidateQueen);\n\t\t\n\t\tBoolean bExpected = true;\n\t\tBoolean bActual = m_oRuleProcessor.checkStalemate(m_oBoard, oDestinationPositionOfKing.getPiece().getPlayer());\n\n\t\tassertEquals(bExpected, bActual);\n\t\t\n\t}", "private boolean canMoveUp()\n {\n // runs through column first, row second\n for ( int column = 0; column < grid[0].length ; column++ ) {\n for ( int row = 1; row < grid.length; row++ ) {\n // looks at tile directly above the current tile\n int compare = row-1;\n if ( grid[row][column] != 0 ) {\n if ( grid[compare][column] == 0 || grid[row][column] ==\n grid[compare][column] ) {\n return true;\n }\n }\n }\n } \n return false;\n }", "private int checkWin(int x) {\n for (int row = 0; row < 8; row++) {\n for (int col = 0; col < 9; col++) {\n //Black = 1, Red = 0\n\n //Checks Vertically\n if ((buttons[row][col].getText() == \"O\") && (buttons[row][col+1].getText() == \"O\") && (buttons[row][col+2].getText() == \"O\") && (buttons[row][col+3].getText() == \"O\")) {\n return 0;\n }\n if ((buttons[row][col].getText() == \"X\") && (buttons[row][col+1].getText() == \"X\") && (buttons[row][col+2].getText() == \"X\") && (buttons[row][col+3].getText() == \"X\")) {\n return 1;\n }\n\n //Checks Vertically\n if ((buttons[row][col].getText() == \"O\") && (buttons[row+1][col].getText() == \"O\") && (buttons[row+2][col].getText() == \"O\") && (buttons[row+3][col].getText() == \"O\")) {\n return 0;\n }\n\n if ((buttons[row][col].getText() == \"X\") && (buttons[row+1][col].getText() == \"X\") && (buttons[row+2][col].getText() == \"X\") && (buttons[row+3][col].getText() == \"X\")) {\n return 1;\n }\n\n //Diagonal Top left to bottom right checker\n if((buttons[row][col].getText() == \"O\") && (buttons[row+1][col+1].getText() == \"O\") && (buttons[row+2][col+2].getText() == \"O\") && (buttons[row+3][col+3].getText() == \"O\")) {\n return 0;\n }\n if((buttons[row][col].getText() == \"X\") && (buttons[row+1][col+1].getText() == \"X\") && (buttons[row+2][col+2].getText() == \"X\") && (buttons[row+3][col+3].getText() == \"X\")) {\n return 1;\n }\n\n //Diagonal Bottom left to top right checker\n if((buttons[row][col].getText() == \"O\") && (buttons[row-1][col+1].getText() == \"O\") && (buttons[row-2][col+2].getText() == \"O\") && (buttons[row-3][col+3].getText() == \"O\")) {\n return 0;\n }\n if((buttons[row][col].getText() == \"X\") && (buttons[row-1][col+1].getText() == \"X\") && (buttons[row-2][col+2].getText() == \"X\") && (buttons[row-3][col+3].getText() == \"X\")) {\n return 1;\n }\n }\n }\n return 2;\n }", "public void setValidMoves(Board board, int x, int y, int playerType) {\n\t\tmoves.clear();\n\t\t// if this is pawn's first move, it can move two squares forward\n\t\tif (firstMove == true)\n\t\t{\n\t\t\t// white moves forward with y++\n\t\t\tif(this.getPlayer() == 1)\n\t\t\t{\n\t\t\t\tPoint firstMove = new Point(x + 0, y + 2);\n\t\t\t\tif (board.getPiece(x, y + 1) == null && board.getPiece(x, y + 2) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(firstMove);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// black moves forward with y--\n\t\t\telse\n\t\t\t{\n\t\t\t\tPoint firstMove = new Point(x + 0, y - 2);\n\t\t\t\tif (board.getPiece(x, y - 1) == null && board.getPiece(x, y - 2) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(firstMove);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.getPlayer() == 1)\n\t\t{\n\t\t\t// if a piece is occupying a square diagonal from pawn, it can capture\n\t\t\tif (x + 1 < 8 && y + 1 < 8 && x + 1 >= 0 && y + 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 1, y + 1);\n\t\t\t\tif (board.getPiece(x + 1, y + 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x+1,y+1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x - 1 < 8 && y + 1 < 8 && x - 1 >= 0 && y + 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x - 1, y + 1);\n\t\t\t\tif (board.getPiece(x - 1, y + 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x - 1, y + 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// if no piece is in front of pawn, it can move forward one square\n\t\t\tif (x < 8 && y + 1 < 8 && x >= 0 && y + 1 >=0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 0, y + 1);\n\t\t\t\tif (board.getPiece(x, y + 1) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if a piece is occupying a square diagonal from pawn, it can capture\n\t\t\tif (x + 1 < 8 && y - 1 < 8 && x + 1 >= 0 && y - 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 1, y - 1);\n\t\t\t\tif (board.getPiece(x + 1, y - 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x + 1,y - 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x - 1 < 8 && y - 1 < 8 && x - 1 >= 0 && y - 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x - 1, y - 1);\n\t\t\t\tif (board.getPiece(x - 1, y - 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x - 1, y - 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// if no piece is in front of pawn, it can move forward one square\n\t\t\tif (x < 8 && y - 1 < 8 && x >= 0 && y - 1 >=0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 0, y - 1);\n\t\t\t\tif (board.getPiece(x, y - 1) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public int[][] getMovesRook(Piece p) {\n x = p.getX();\n y = p.getY();\n int legalMoves[][] = new int[8][8];\n\n for (int i = x + 1; i < 8; i++) {//Traversing from piece coords, right till end of board.\n if (b.getPieceAt(y, i) != null) {\n if (p.isWhite() == b.getPieceAt(y, i).isWhite()) {\n break;\n } else {\n legalMoves[y][i] = 1;\n break;\n }\n } else {\n legalMoves[y][i] = 1;\n }\n }\n for (int i = x - 1; i > -1; i--) {//Traversing from piece coords, left till end of board.\n if (b.getPieceAt((y), i) != null) {\n if (p.isWhite() == b.getPieceAt((y), i).isWhite()) {\n break;\n } else {\n legalMoves[(y)][i] = 1;\n break;\n }\n } else {\n legalMoves[y][i] = 1;\n }\n }\n for (int i = y - 1; i > -1; i--) { //Traversing from piece coords, downwards till end of board.\n if (b.getPieceAt((i), x) != null) {\n if (p.isWhite() == b.getPieceAt(i, x).isWhite()) {\n break;\n } else {\n legalMoves[i][x] = 1;\n break;\n }\n } else {\n legalMoves[i][x] = 1;\n }\n }\n for (int i = y + 1; i < 8; i++) { //Traversing from piece coords, upwards till end of board.\n if (b.getPieceAt((i), x) != null) {\n if (p.isWhite() == b.getPieceAt(i, x).isWhite()) {\n break;\n } else {\n legalMoves[i][x] = 1;\n break;\n }\n } else {\n legalMoves[i][x] = 1;\n }\n }\n return legalMoves;\n }", "private int playMove(int[] board, int move) {\n boolean direction = false;\n boolean player1Move = isPlayer1Move(move);\n if ((move > 1) && (move < 8)) {\n direction = true;\n }\n if (move == 10) {\n move = 2;\n }\n if (move == 11) {\n move = 7;\n }\n int numberOfMarbleBalls = board[move];\n if (numberOfMarbleBalls < 2) {\n return -1;\n }\n board[move] = 0;\n while (numberOfMarbleBalls > 0) {\n move = goToNext(move, direction);\n board[move] = board[move] + 1;\n numberOfMarbleBalls = numberOfMarbleBalls - 1;\n }\n int takenMarbleBalls = 0;\n if (player1Move) {\n while (true) {\n if (move < 5) break;\n if (!((board[move] == 2) || (board[move] == 4))) break;\n takenMarbleBalls = takenMarbleBalls + board[move];\n board[move] = 0;\n move = goToNext(move, !(direction));\n }\n } else {\n while (true) {\n if (move > 4) break;\n if (!((board[move] == 2) || (board[move] == 4))) break;\n takenMarbleBalls = takenMarbleBalls + board[move];\n board[move] = 0;\n move = goToNext(move, !(direction));\n }\n }\n return takenMarbleBalls;\n }", "@Test\n public void onlyStartPlayerMoves() {\n assertTrue(game.move(Location.R1, Location.R3));\n assertEquals(1, game.getCount(Location.R3));\n assertEquals(1, game.getCount(Location.R1));\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}", "void makeMove(int row, int col, int nextRow, int nextCol) {\r\n int temp = checks[row][col];\r\n checks[nextRow][nextCol] = temp;\r\n checks[row][col] = 0;\r\n if (Math.abs(nextRow - row) == 2){\r\n removePiece(nextRow, nextCol,row, col);\r\n }\r\n checkKing(nextRow,nextCol);\r\n }" ]
[ "0.6375459", "0.63641626", "0.6279337", "0.6233056", "0.6209589", "0.61921394", "0.6185494", "0.61742616", "0.6167036", "0.61406684", "0.61247796", "0.60934854", "0.60744977", "0.6037396", "0.60201114", "0.6006333", "0.59886587", "0.59871495", "0.59805703", "0.59535867", "0.59507173", "0.59402555", "0.5933754", "0.5924515", "0.5904766", "0.5904202", "0.5893077", "0.58833236", "0.5880789", "0.58684695", "0.58670926", "0.5862427", "0.58496803", "0.58432096", "0.5837404", "0.5831794", "0.58247083", "0.5819239", "0.5812563", "0.58060837", "0.5805391", "0.58031887", "0.58029884", "0.5800473", "0.57952553", "0.57905954", "0.57780457", "0.5774631", "0.5771072", "0.5765425", "0.57487404", "0.5745308", "0.5743534", "0.5740777", "0.5740575", "0.57328016", "0.57310903", "0.57267326", "0.57225204", "0.57216245", "0.57211596", "0.57185423", "0.5717946", "0.571528", "0.57147187", "0.5714441", "0.57126284", "0.5712029", "0.57117534", "0.570689", "0.56984234", "0.5696947", "0.5695573", "0.56952095", "0.5694049", "0.569096", "0.56841767", "0.5680671", "0.567859", "0.5675612", "0.56751937", "0.5674747", "0.5668922", "0.5666673", "0.5664164", "0.5663627", "0.56618756", "0.5661365", "0.5660354", "0.56601197", "0.5657758", "0.56569624", "0.5653457", "0.5650962", "0.5649997", "0.5649199", "0.56460106", "0.56454086", "0.56445277", "0.5631387" ]
0.6991228
0
it resets the original state if the switch is not valid
public void ResetState() { for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { pictures[i][j] = temp_pictures[i][j]; pictures2[i][j] = pictures[i][j]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resetState() {\n \ts = State.STRAIGHT;\n }", "@Override\n\tpublic void adjust() {\n\t\tstate = !state;\n\t}", "public void resetState();", "protected void resetState()\n {\n // Nothing to do by default.\n }", "private void breakSpecialState() {\n this.inSpecialState = false;\n this.resetXMovement();\n }", "private ScanState switchState(ScanState desired,EnumSet<ScanState> allowed) {\n final ScanState old;\n final long timestamp;\n final long sequence;\n synchronized(this) {\n old = state;\n if (!allowed.contains(state))\n throw new IllegalStateException(state.toString());\n state = desired;\n timestamp = System.currentTimeMillis();\n sequence = getNextSeqNumber();\n }\n LOG.fine(\"switched state: \"+old+\" -> \"+desired);\n if (old != desired)\n queueStateChangedNotification(sequence,timestamp,old,desired);\n return old;\n }", "public void changeState()\r\n\t{\r\n\t\tfailedNumber=0;\r\n\t\tif(state.equalsIgnoreCase(\"IN PREPARATION\"))\r\n\t\t\tsetState(\"IN TRANSIT\");\r\n\t\telse if(state.equalsIgnoreCase(\"IN TRANSIT\"))\r\n\t\t{\r\n\t\t\tfailedNumber=Math.random();\r\n\t\t\tif(failedNumber<=0.2) setState(\"FAILED\");\r\n\t\t\telse setState(\"RECEIVED\");\r\n\t\t}\r\n\t}", "public abstract Op resetStates();", "public void transitionStates () {\n myCurrentState = myNextState;\n myNextState = null;\n }", "@Override\n\tpublic void reset(){\n\t\tstate.reset();\n\t\toldState.reset();\n\t\treturnAction = new boolean[Environment.numberOfButtons]; \n\t\trewardSoFar = 0;\n\t\tcurrentReward = 0;\n\t}", "private ScanState switchState(ScanState desired,String forOperation) {\n return switchState(desired,allowedStates.get(forOperation));\n }", "public void setState(PlayerState newPlayerState) {\n\n this.playerState = newPlayerState;\n\n closeWindows();\n\n\n switch (newPlayerState) {\n\n case CHOOSE_BONUS_TILE:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(false);\n\n setEndTurn(false);\n\n setUseLeader(false);\n\n\n break;\n\n\n case THROWDICES:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(true);\n\n setSkipAction(false);\n\n setEndTurn(false);\n\n setUseLeader(false);\n\n try {\n throwDices();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n break;\n\n\n\n case DOACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(true);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n try {\n yourTurn();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n\n break;\n\n case BONUSACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n try {\n bonusAction();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n break;\n\n\n case CHOOSEACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(true);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n break;\n\n\n case CHOOSEWORKERS:\n case ACTIVATE_PAY_TO_OBTAIN_CARDS:\n case CHOOSE_EFFECT:\n case CHOOSECOST:\n case CHOOSE_COUNCIL_PRIVILEGE:\n case PRAY:\n case WAITING:\n\n noButtonsAble();\n\n setLeaderButtons(false);\n\n setUseLeader(false);\n\n break;\n\n case ENDTURN:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(false);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n break;\n\n case LEADER:\n\n noButtonsAble();\n\n setUseLeader(true);\n break;\n\n\n case SUSPENDED:\n\n noButtonsAble();\n\n setLeaderButtons(false);\n\n setUseLeader(false);\n\n suspendedPane.setVisible(true);\n\n break;\n\n\n }\n\n }", "public void changeState() {\n if (!isDead) {\n Bitmap temp = getBitmap();\n setBitmap(stateBitmap);\n stateBitmap = temp;\n }\n }", "public void changeTurn(){\r\n model.setCheckPiece(null);\r\n model.swapPlayers();\r\n }", "private void preSwitchPanel()\n {\n switchPanel = true;\n configureNext = true;\n configurePrevious = true;\n }", "public void ValidSwitch(int x, int y) {\n\n SaveState();\n int temp = pictures[x][y - 1];\n pictures[x][y - 1] = pictures[previousX][previousY - 1];\n pictures[previousX][previousY - 1] = temp;\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n pictures2[i][j] = pictures[i][j];\n }\n }\n\n combinationValid = 0;\n LabelingCandiesToDestroy();\n\n if (combinationValid == 0) { //if there's no combination from the switch, it resets it to the original state\n ResetState();\n } else {\n if (InsideMovesRemainingExists == 0) {//checks if there is a playable move left\n combinationValid = 0;\n MovesRemainingExists();\n }\n }\n }", "protected abstract int newState();", "@Test\n //checks for state switching (on/off)\n void SwitchStates() {\n Assertions.assertFalse(machine.isTurnedOn());\n\n //then, switch on and check if on\n machine.setTurnedOn(true);\n Assertions.assertTrue(machine.isTurnedOn());\n\n //switch off to see if turned off correctly\n machine.setTurnedOn(false);\n Assertions.assertFalse(machine.isTurnedOn());\n\n //and now check the inversion\n machine.flipSwitch();\n\n Assertions.assertTrue(machine.isTurnedOn());\n }", "public void enterNormalState() {\n\n\t}", "public void reset(){\n if (isValidated()) resetAndUnblock();\n }", "private void softReset() {\n // variables\n lapMap.clear();\n // ui\n sessionTView.setText(\"\");\n positionTView.setText(\"-\");\n currentLapTView.setText(\"--:--:---\");\n lastLapTView.setText(\"--:--:---\");\n bestLapTView.setText(\"--:--:---\");\n currentLapNumberTView.setText(\"-\");\n gapTView.setText(\" -.---\");\n fastestDriver = Float.MAX_VALUE;\n fastestDriverName = null;\n fastestDriverTView.setText(\"--:--:---\");\n fastestDriverNameTView.setText(\"Fastest lap\");\n Log.d(TAG, \"SOFT Reset: between game states\");\n }", "@Override\n protected void incrementStates() {\n\n }", "@Override\n public final void switchBack() {\n }", "@Override\n public void onRestate() {\n }", "protected void SwitchState(StateID state)\n {\n targetID = state;\n\n //This sets this ID to the restart state if you try and switch to this state, meaning that if you try and switch to this state, the state will reload.\n if(targetID == state)\n {\n this.ID = StateID.RESTART_STATE;\n }\n }", "protected abstract boolean reset();", "@Override\n public void reset()\n {\n state = \"initial state\";\n nbChanges = 0;\n nbResets++;\n }", "private void switchBtnActionPerformed(ActionEvent evt) {\r\n if(switchBtn.isSelected()) {\r\n switchBtn.setText(\"MIPS -> C\");\r\n switchBtnState = 1;\r\n }\r\n else {\r\n switchBtn.setText(\"C -> MIPS\");\r\n switchBtnState = -1;\r\n }\r\n }", "public void reset() {\n this.state = null;\n }", "public void change() {\r\n this.mode = !this.mode;\r\n }", "public void revert()\n\t{\n\t\tswingingWay1 = !swingingWay1;\n\t}", "public void reset(){\n currentStage = 0;\n currentSide = sideA;\n }", "public void checkState() {\r\n\t\tout.println(state);\r\n\t\tif(getEnergy() < 80 && getOthers() > 5) {\r\n\t\t\tstate = 1;\r\n\t\t\tturnLeft(getHeading() % 90);\r\n\t\t\tahead(moveAmount);\r\n\t\t}\r\n\t\telse if(getEnergy() < 80 && getOthers() < 5) {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\t\tprotected void doCurrentState() {\n\t\t\tswitch(currentState) {\n\t\t\t\n\t\t\t// follow operator commands, but respect limit switches\n\t\t\tcase manual:\n\t\t\t\tcd.gearLeftOpen.set(rd.gearManualLeftOpen && !rd.leftOpenSwitch, rd.gearManualLeftClose && !rd.leftCloseSwitch );\n\t\t\t\tcd.gearRightOpen.set(rd.gearManualRightOpen && !rd.rightOpenSwitch, rd.gearManualRightClose && !rd.rightCloseSwitch);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t// close each motor until fully closed, if one motor is closed stop that motor\n\t\t\tcase autoClose:\n\t\t\t\tcd.gearLeftOpen.set(false, !rd.leftCloseSwitch );\n\t\t\t\tcd.gearRightOpen.set(false, !rd.rightCloseSwitch);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// open each motor until fully open, if one motor is open stop that motor\t\n\t\t\tcase autoOpen:\n\t\t\t\tcd.gearLeftOpen.set(!rd.leftOpenSwitch, false);\n\t\t\t\tcd.gearRightOpen.set(!rd.rightOpenSwitch, false);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "synchronized void revertState()\n {\n state = state.revert();\n notifyAll();\n }", "public void reset(){\n active = false;\n done = false;\n state = State.invisible;\n curX = 0;\n }", "public void reset(){\r\n \tdefaultFlag = false;\r\n }", "private void setCurrentState(StateEnum state)\n {\n m_CurrentState = state;\n m_DoneInit = false;\n switch(m_CurrentState)\n {\n case QB:\n m_A1Label.setText( \"PS\");\n m_A2Label.setText( \"PC\");\n m_A3Label.setText( \"ACC\");\n m_A4Label.setText( \"APB\");\n m_Sim1Label.setText( \"Sim Run\");\n m_Sim2Label.setText( \"Sim Pass\");\n m_Sim3Label.setText( \"Sim Pocket\");\n m_Sim4Label.setText( \"\");\n m_Sim1UpDown.setEnabled( true);\n m_Sim2UpDown.setEnabled( true);\n m_Sim3UpDown.setEnabled( true);\n m_Sim4UpDown.setEnabled( false);\n \n m_Sim1UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim2UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim3UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim4UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_PS_BC_PI_KABox.setEnabled( true);\n m_PC_REC_QU_KABox.setEnabled( true);\n m_ACCBox.setEnabled( true);\n m_APBBox.setEnabled( true);\n break;\n case SKILL:\n m_A1Label.setText( \"BC\");\n m_A2Label.setText( \"REC\");\n m_A3Label.setText( \"\");\n m_A4Label.setText( \"\");\n m_Sim1Label.setText( \"Sim Rush\");\n m_Sim2Label.setText( \"Sim Catch\");\n m_Sim3Label.setText( \"<HTML> Sim Punt<br>return</HTML>\");\n m_Sim4Label.setText( \"<HTML> Sim Kick<br>return</HTML>\");\n m_Sim1UpDown.setEnabled( true);\n m_Sim2UpDown.setEnabled( true);\n m_Sim3UpDown.setEnabled( true);\n m_Sim4UpDown.setEnabled( true);\n m_Sim1UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim2UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim3UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim4UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_PS_BC_PI_KABox.setEnabled( true);\n m_PC_REC_QU_KABox.setEnabled( true);\n m_ACCBox.setEnabled( false);\n m_APBBox.setEnabled( false);\n break;\n case OLINE:\n m_A1Label.setText( \"\");\n m_A2Label.setText( \"\");\n m_A3Label.setText( \"\");\n m_A4Label.setText( \"\");\n m_Sim1Label.setText( \"\");\n m_Sim2Label.setText( \"\");\n m_Sim3Label.setText( \"\");\n m_Sim4Label.setText( \"\");\n m_Sim1UpDown.setEnabled( false);\n m_Sim2UpDown.setEnabled( false);\n m_Sim3UpDown.setEnabled( false);\n m_Sim4UpDown.setEnabled( false);\n m_PS_BC_PI_KABox.setEnabled( false);\n m_PC_REC_QU_KABox.setEnabled( false);\n m_ACCBox.setEnabled( false);\n m_APBBox.setEnabled( false);\n break;\n case DEFENSE:\n m_A1Label.setText( \"PI\");\n m_A2Label.setText( \"QU\");\n m_A3Label.setText( \"\");\n m_A4Label.setText( \"\");\n m_Sim1Label.setText( \"<HTML> Sim Pass<br>rush </HTML>\");\n m_Sim2Label.setText( \"Sim Coverage\");\n m_Sim3Label.setText( \"\");\n m_Sim4Label.setText( \"\");\n m_Sim1UpDown.setEnabled( true);\n m_Sim2UpDown.setEnabled( true);\n m_Sim3UpDown.setEnabled( false);\n m_Sim4UpDown.setEnabled( false);\n m_Sim1UpDown.setModel(new SpinnerNumberModel(0, 0, 255, 1));\n m_Sim2UpDown.setModel(new SpinnerNumberModel(0, 0, 255, 1));\n m_Sim3UpDown.setModel(new SpinnerNumberModel(0, 0, 255, 1));\n m_Sim4UpDown.setModel(new SpinnerNumberModel(0, 0, 255, 1));\n m_PS_BC_PI_KABox.setEnabled( true);\n m_PC_REC_QU_KABox.setEnabled( true);\n m_ACCBox.setEnabled( false);\n m_APBBox.setEnabled( false);\n break;\n case KICKER:\n m_A1Label.setText( \"KA\");\n m_A2Label.setText( \"AKB\");\n m_A3Label.setText( \"\");\n m_A4Label.setText( \"\");\n m_Sim1Label.setText( \"Sim KA\");\n m_Sim2Label.setText( \"\");\n m_Sim3Label.setText( \"\");\n m_Sim4Label.setText( \"\");\n m_Sim1UpDown.setEnabled( true);\n m_Sim2UpDown.setEnabled( false);\n m_Sim3UpDown.setEnabled( false);\n m_Sim4UpDown.setEnabled( false);\n m_Sim1UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim2UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim3UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_Sim4UpDown.setModel(new SpinnerNumberModel(0, 0, 15, 1));\n m_PS_BC_PI_KABox.setEnabled( true);\n m_PC_REC_QU_KABox.setEnabled( true);\n m_ACCBox.setEnabled( false);\n m_APBBox.setEnabled( false);\n break;\n }\n m_DoneInit = true;\n }", "public void changeState() {\r\n if(state == KioskState.CLOSED) {\r\n state = KioskState.OPEN;\r\n } else {\r\n state = KioskState.CLOSED;\r\n }\r\n }", "void finishSwitching();", "private void updateSwitchState() {\n this.mDisabled = !MiuiStatusBarManager.isShowNetworkSpeedForUser(this.mContext, -2);\n }", "public void restart() {\n ReadOnlyAssignmentList currentState = assignmentListStateList.get(currentStatePointer);\n assignmentListStateList.clear();\n assignmentListStateList.add(currentState);\n currentStatePointer = 0;\n }", "@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}", "private void postSwitchPanel()\n {\n switchPanel = false;\n }", "@Override\r\n\tpublic void resetState() {\r\n\t\t// what to do for a tape device??\r\n\t}", "public void setOff(){\n state = false;\n //System.out.println(\"El requerimiento esta siendo atendido!\");\n }", "public void setStateToActive() {\n state = VALID_STATES[0];\n }", "@Override\r\n public void onChange(SwitchButton sb, boolean state) {\n Log.d(\"switchButton\", state ? \"锟斤拷\":\"锟斤拷\");\r\n mImgView.setImageBitmap(null);\r\n //defreckle\r\n if(qubanSBtn.isSwitchOn())\r\n mImgView.setImageBitmap(mFaceEditor.BFDefreckleAuto());//));\r\n else\r\n mImgView.setImageBitmap(mFaceEditor.getBaseImage());\r\n }", "private void resetValidMove()\n {\n validMoves = null;\n setToValidMoveColor = false;\n validMoveFlag = false;\n }", "public void enterHatchingState() {\n\n\t}", "public void onRestorePendingState() {\n }", "public void unsubscribeSwitchState() {\n\t\t\n\t}", "public void clearState() {\n // if the user press the wrong cells, aka path, etc.\n // set state back to grass\n for (int i = 0; i < cells.size(); i++) {\n if (cells.get(i) == CellState.Chosen) {\n cells.set(i, CellState.Tower);\n } else if (cells.get(i) == CellState.ToPlaceTower) {\n cells.set(i, CellState.Grass);\n }\n\n }\n }", "public void Power() {\n if (Estado == false){\r\n Estado = true;\r\n } else if (Estado == true){\r\n Estado = false;\r\n }\r\n }", "private void resetActionPerformed(ActionEvent evt) {\n\t\t//if the reels are nor spinning perform the the action\n\t\tif (!isSpining) {\n\t\t\tint betAm = obj.getBet();\n\t\t\t//reset the bet amount and return the credit amount and update the labels and buttons\n\t\t\tobj.setCredit(obj.getCredit() + betAm);\n\t\t\tobj.setBet(0);\n\t\t\tupdateLabels();\n\t\t\tupdateDisabledButtons();\n\t\t}\n\t\t//restart\n//\t\tobj.setBet(0);\n//\t\tobj.setWin(0);\n//\t\tobj.setLoses(0);\n//\t\tobj.setCredit(10);\n//\t\tdispose();\n//\t\tstart();\n\t}", "public void steady(){\n if(steady){\n if(!bellySwitch.get()) {\n leftMotor.set(-.3);\n rightMotor.set(-.3);\n }else {\n leftMotor.set(0);\n rightMotor.set(0);\n } \n }\n }", "public void switchLight(){\r\n _switchedOn = !_switchedOn;\r\n }", "private void dealWithState(FindPairLogic.State state) {\n buttons[state.getI()][state.getJ()].setText(Integer.toString(state.getN()));\n buttons[state.getI()][state.getJ()].setDisable(true);\n if (state.hasResult()) {\n if (!state.isSuccess()) {\n isGameEnable.set(false);\n threadPool.schedule(() -> Platform.runLater(() -> {\n buttons[state.getI()][state.getJ()].setText(\"\");\n buttons[state.getI()][state.getJ()].setDisable(false);\n buttons[state.getPreviousI()][state.getPreviousJ()].setText(\"\");\n buttons[state.getPreviousI()][state.getPreviousJ()].setDisable(false);\n isGameEnable.set(true);\n }), 1, TimeUnit.SECONDS);\n }\n }\n if (state.isEndGame()) {\n endGame();\n }\n }", "public void Switch()\n {\n if(getCurrentPokemon().equals(Pokemon1))\n {\n // Change to pokemon2\n setCurrentPokemon(Pokemon2);\n }\n // if my current pokemon is the same as pokemon2\n else if(getCurrentPokemon().equals(Pokemon2))\n {\n // swap to pokemon1\n setCurrentPokemon(Pokemon1);\n }\n }", "private void handleSwitchChange() {\n Switch onOffSwitch = findViewById(R.id.toggBtn);\n onOffSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n AddEditActivity.this.time1.post(new Runnable() {\n public void run() {\n timePicker1.removeClickListener();\n time1.setText(\"\");\n }\n });\n\n AddEditActivity.this.time2.post(new Runnable() {\n public void run() {\n timePicker2.removeClickListener();\n time2.setText(\"\");\n }\n });\n mIsAllDay = 1;\n } else {\n mIsAllDay = 0;\n setDateTime();\n }\n }\n\n });\n }", "public void changeState(){\n\t\t//red - Green\n\t\tif (lights[0].isOn()){\n\t\t\tlights[0].turnOff();\n\t\t\tlights[2].turnOn();\n\t\t}\n\t\t\n\t\t//Green -yellow\n\t\telse if(lights[2].isOn()){\n\t\t\tlights[2].turnOff();\n\t\t\tlights[1].turnOn();\n\t\t}\n\t\t//yellow to red\n\t\telse if (lights[1].isOn()){\n\t\t\tlights[1].turnOff();\n\t\t\tlights[0].turnOn();\n\t\t}\n\t\t\n\t}", "void restoreFormState();", "public void stateChanged() {\r\n if (nextBigStepButton != null) {\r\n nextBigStepButton.setEnabled(!automata.isAtEnd());\r\n }\r\n if (prevBigStepButton != null) {\r\n prevBigStepButton.setEnabled(!automata.isAtStart());\r\n }\r\n\r\n nextStepButton.setEnabled(!automata.isAtEnd());\r\n prevStepButton.setEnabled(!automata.isAtStart());\r\n restartButton.setEnabled(!automata.isAtStart());\r\n\r\n autoButton.setState(controller.getExecutionMode());\r\n autoButton.setEnabled(!automata.isAtEnd());\r\n }", "public void reset() {\n // stop motors\n Motor.A.stop();\t\n Motor.A.setPower(0);\t\n Motor.B.stop();\n Motor.B.setPower(0);\t\n Motor.C.stop();\n Motor.C.setPower(0);\t\n // passivate sensors\n Sensor.S1.passivate();\n Sensor.S2.passivate();\n Sensor.S3.passivate();\n for(int i=0;i<fSensorState.length;i++)\n fSensorState[i] = false;\n }", "private static void setNormalState() {\n InitialClass.arduino.serialWrite('0');\n InitialClass.arduino.serialWrite('6');\n InitialClass.arduino.serialWrite('2');\n InitialClass.arduino.serialWrite('8');\n InitialClass.arduino.serialWrite('C');\n InitialClass.arduino.serialWrite('A');\n InitialClass.arduino.serialWrite('4');\n /// hide animated images of scada\n pumpForSolutionOn.setVisible(false);\n pumpForTitrationOn.setVisible(false);\n mixerOn.setVisible(false);\n valveTitrationOpened.setVisible(false);\n valveSolutionOpened.setVisible(false);\n valveWaterOpened.setVisible(false);\n valveOutOpened.setVisible(false);\n\n log.append(\"Клапана закрыты\\nдвигатели выключены\\n\");\n\n }", "public void setSwitchOn() throws UnavailableDeviceException, ClosedDeviceException, IOException{\n\t\tswitch1.setValue(false);\n\t\tthis.switchState = true; \n\t}", "protected void reset(){\n inited = false;\n }", "private void updateState() {\n\t while(!isGoodState()) {\n\t\t updateStateOnce();\n\t }\n }", "public void updateSwitches(){\r\n if(this.ar){\r\n this.augmentedReality.setChecked(true);\r\n }else{\r\n this.augmentedReality.setChecked(false);\r\n }\r\n\r\n if(this.easy){\r\n this.easyMode.setChecked(true);\r\n }else{\r\n this.easyMode.setChecked(false);\r\n }\r\n }", "public void reset() {\r\n\t\tsuper.reset();\r\n\t\tfor (TransitionMode mode : transitionModes) {\r\n\r\n\t\t\tmode.reset();\r\n\t\t}\r\n\r\n\t}", "private void checkStateChange() {\n\t\tif(previousState == null){\n\t\t\tpreviousState = getOrientation();\n\t\t}\n\t\telse{\n\t\t\tif(previousState != getOrientation()){\n\t\t\t\tif(isTurningLeft){\n\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t}\n\t\t\t\tif(isTurningRight){\n\t\t\t\t\tisTurningRight = false;\n\t\t\t\t}\n\t\t\t\tpreviousState = getOrientation();\n\t\t\t}\n\t\t}\n\t}", "private void resetActionButtonsState()\n {\n // Actions\n GameAction fpAction = firstPlayer.getLastAction();\n GameAction spAction = secondPlayer.getLastAction();\n\n // First player reset state\n if (fpAction instanceof RockAction)\n {\n animateSelectedButton(firstPlayerRock, false);\n }\n else if (fpAction instanceof PaperAction)\n {\n animateSelectedButton(firstPlayerPaper, false);\n }\n else if (fpAction instanceof ScissorsAction)\n {\n animateSelectedButton(firstPlayerScissors, false);\n }\n\n // Second player reset state\n if (spAction instanceof RockAction)\n {\n animateSelectedButton(secondPlayerRock, true);\n }\n else if (spAction instanceof PaperAction)\n {\n animateSelectedButton(secondPlayerPaper, true);\n }\n else if (spAction instanceof ScissorsAction)\n {\n animateSelectedButton(secondPlayerScissors, true);\n }\n }", "public void restoreState() {\n\t\tsuper.restoreState();\n\t}", "public boolean switchOff(){\n if(!this.is_Switched_On){\n return false;\n }\n this.is_Switched_On = false;\n return true;\n }", "protected void updateState( int newMode)\n {\n if (newMode == mode) return;\n mode = newMode;\n port.controlMotor(power, newMode);\n }", "public void restoreState() \n\t{\n\t\tsuper.restoreState();\n\t}", "public void reset() {\n\t\tmCycleFlip = false;\n\t\tmRepeated = 0;\n\t\tmMore = true;\n //mOneMoreTime = true;\n \n\t\t// 추가\n\t\tmStarted = mEnded = false;\n\t\tmCanceled = false;\n }", "void changed(State state, Exception e);", "public void reset()\n {\n m_fCorrectEvent = false;\n }", "public void reset() {\r\n\r\n b1.setText(\"\");\r\n b1.setEnabled(true);\r\n\r\n b2.setText(\"\");\r\n b2.setEnabled(true);\r\n\r\n b3.setText(\"\");\r\n b3.setEnabled(true);\r\n\r\n b4.setText(\"\");\r\n b4.setEnabled(true);\r\n\r\n b5.setText(\"\");\r\n b5.setEnabled(true);\r\n\r\n b6.setText(\"\");\r\n b6.setEnabled(true);\r\n\r\n b7.setText(\"\");\r\n b7.setEnabled(true);\r\n\r\n b8.setText(\"\");\r\n b8.setEnabled(true);\r\n\r\n b9.setText(\"\");\r\n b9.setEnabled(true);\r\n\r\n win = false;\r\n count = 0;\r\n }", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "public void switchOn();", "private void handleTrackingSwitchUnChecked() {\n mSwitchTracking.setText(R.string.switchStartTracking);\n if (mListener != null) {\n mListener.onStartFragmentStopTracking();\n }\n }", "private void changeTurn(){ \r\n\t\tif (currentTurn == 1)\r\n\t\t\tcurrentTurn = 0; \r\n\t\telse\r\n\t\t\tcurrentTurn = 1; \r\n\t}", "private void switchGameState(GameState newMode) \n {\n switch(newMode)\n {\n case NOT_AVAIL:\n /* probably won't ever switch TO this mode, but still: */\n GAME_RUNNING = false;\n timTimer.stop(); //stop timer\n break;\n case EDITING:\n GAME_RUNNING = false;\n timTimer.stop(); //stop timer\n timWorld.reset(); //reset world\n canvas.repaint(); //repaint canvas\n break;\n case RUNNING:\n GAME_RUNNING = true;\n timWorld.prepare(); //prepare world\n timTimer.start(); //start timer\n break;\n case COMPLETE:\n GAME_RUNNING = false;\n timTimer.stop(); //stop timer\n fireTimEvent(new TimEvent(this,TimEvent.WIN), TimEvent.TIMGUI); //fire win event\n break;\n\n }\n }", "protected abstract void reset();", "public void change () {\n\t\tswitch (setting) {\n\t\tcase OFF:\n\t\t\tsetting=possibleSettings.LOW;\n\t\tcase LOW:\n\t\t\tsetting=possibleSettings.MEDIUM;\n\t\tcase MEDIUM:\n\t\t\tsetting=possibleSettings.HIGH;\n\t\tcase HIGH:\n\t\t\tsetting=possibleSettings.OFF;\n\t\t\n\t\t}\n\t\t//assert setting()==OFF || setting()==LOW || setting()==MEDIUM || setting()==HIGH;\n\t\t//setting = (setting + 1) % 4;\n\t}", "@Override\n public void restoreState(Map<String, Object> state) {\n\n }", "public void reset() {\r\n this.x = resetX;\r\n this.y = resetY;\r\n state = 0;\r\n }", "void unsetState();", "synchronized void advanceState()\n {\n state = state.advance();\n notifyAll();\n }", "public void SetState(int s) {\n this.state=LS[s];\n }", "public void switchOff();", "@Override\n\tprotected void initStateMachine() {\n\t\t\n\t\tsuper.initStateMachine();\n\n\t\tAbortingState aborted = new AbortingState(\"aborted\"); //$NON-NLS-1$\n\t\taddState(aborted);\n\n\t\tnew EscapeButtonPressureTransition(pressed, aborted);\n\n\t\tList<ITransition> ts = pressed.getTransitions();\n\t\tboolean ok = false;\n\t\tint i=0, size = ts.size();\n\t\tITransition t;\n\n\t\twhile(!ok && i<size) {\n\t\t\tt = ts.get(i);\n\n\t\t\tif(t instanceof ReleaseTransition && t.getOutputState()==released) {\n\t\t\t\tok = true;\n\t\t\t\tts.remove(t);\n\t\t\t}\n\t\t\telse i++;\n\t\t}\n\t}", "protected abstract boolean resetcontrols();", "public void setSwitchOff() throws UnavailableDeviceException, ClosedDeviceException, IOException {\n\t\tswitch1.setValue(true);\n\t\tthis.switchState = false; \n\t}", "void nullInputSwitch(SNodeReference _switch) throws GenerationCanceledException, GenerationFailureException;", "@Override\r\n\tpublic void disable() {\n\t\tcurrentState.disable();\r\n\t}", "void beforeState();", "@Override\r\n\tpublic void reset()\r\n\t{\r\n\t}", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}" ]
[ "0.7059974", "0.69173646", "0.68087745", "0.6731838", "0.66933084", "0.6646969", "0.66361636", "0.6632558", "0.65306795", "0.64208627", "0.6406266", "0.6384592", "0.6361587", "0.63102925", "0.6310054", "0.6252022", "0.62239486", "0.6222278", "0.61928564", "0.61879045", "0.61702776", "0.61553407", "0.6097139", "0.60879874", "0.60876876", "0.60844415", "0.60818094", "0.6067137", "0.6066181", "0.60593224", "0.6055195", "0.6015337", "0.6008216", "0.5992588", "0.5975795", "0.5965298", "0.59602183", "0.5959153", "0.59568405", "0.5949903", "0.59486973", "0.5945199", "0.59404814", "0.59252286", "0.5924026", "0.5918383", "0.59182495", "0.59061944", "0.5901076", "0.58886635", "0.5883855", "0.5877263", "0.5876471", "0.5861799", "0.5856039", "0.585544", "0.58480275", "0.58380413", "0.5823854", "0.58202523", "0.58006895", "0.5799295", "0.579573", "0.5790836", "0.57896495", "0.5787211", "0.57865065", "0.57835275", "0.57736623", "0.57728297", "0.57632536", "0.57613057", "0.5759652", "0.5758498", "0.57570904", "0.57484746", "0.5746442", "0.5740647", "0.5717145", "0.571457", "0.57127285", "0.5712118", "0.5710629", "0.5701387", "0.5698687", "0.5694915", "0.5693855", "0.5687546", "0.5680549", "0.5678961", "0.56789476", "0.5678413", "0.5671935", "0.5667929", "0.5666119", "0.5661737", "0.5658068", "0.5657464", "0.5656978", "0.56553006", "0.5649693" ]
0.0
-1
it saves the state to be used for the reset state
public void SaveState() { for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { temp_pictures[i][j] = pictures[i][j]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void saveState() {\n\t\tsuper.saveState();\n\t}", "public void saveState() \n\t{\n\t\tsuper.saveState();\n\t}", "public void saveState() { }", "private void saveState() {\n // Increase capacity if necessary\n if (nSaved == savedC.length) {\n Object tmp;\n tmp = savedC;\n savedC = new int[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedC,0,nSaved);\n tmp = savedCT;\n savedCT = new int[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedCT,0,nSaved);\n tmp = savedA;\n savedA = new int[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedA,0,nSaved);\n tmp = savedB;\n savedB = new int[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedB,0,nSaved);\n tmp = savedDelFF;\n savedDelFF = new boolean[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedDelFF,0,nSaved);\n }\n // Save the current sate\n savedC[nSaved] = c;\n savedCT[nSaved] = cT;\n savedA[nSaved] = a;\n savedB[nSaved] = b;\n savedDelFF[nSaved] = delFF;\n nSaved++;\n }", "void save() {\r\n if (actionCompleted) {\r\n forget();\r\n } else {\r\n AccountSettings.stateStored = new Bundle();\r\n save(AccountSettings.stateStored);\r\n }\r\n }", "private void storeViewState()\n\t{\n\t\tCommand lastCmd = project.getLastCommand();\n\t\tif (lastCmd != null)\n\t\t{\n\t\t\tlastCmd.setOptionalState(view.toJSONString(lastCmd.getProjectState()));\n\t\t}\n\t}", "public void saveState() {\n savedPen.setValues(pm.pen);\n }", "void save() {\n File file = new File(main.myPath + \"state.xml\");\n Framework.backup(main.myPath + \"state.xml\");\n Framework.transform(stateDoc, new StreamResult(file), null);\n setDirty(false);\n }", "protected void resetState()\n {\n // Nothing to do by default.\n }", "public void resetState() {\n \ts = State.STRAIGHT;\n }", "public void restoreState() {\n\t\tsuper.restoreState();\n\t}", "public void saveState(IMemento memento) {\n\t\t\r\n\t}", "public void resetState();", "public void restoreState() \n\t{\n\t\tsuper.restoreState();\n\t}", "private void saveState() throws IOException {\n speakerManager.saveState();\n roomManager.saveState();\n organizerManager.saveState();\n eventManager.saveState();\n chatManager.saveState();\n attendeeManager.saveState();\n\n }", "@Override\n public void reset()\n {\n state = \"initial state\";\n nbChanges = 0;\n nbResets++;\n }", "@PreDestroy\n public void saveStates() {\n if(getShopId() != 0) {\n log.info(\"Interrupt matching for shop {} during phase {} at {} \", getShopId(), getPhase(), new Date());\n getRemainingStates().add(new State(getShopId(), getPhase(), getPictureIds()));\n }\n getMatcherStateRepository().saveAllStates(getRemainingStates());\n }", "private void saveState() {\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n\n // Store our count..\n editor.putInt(\"count\", this._tally);\n\n // Save changes\n editor.commit();\n }", "public void reset () {\n lastSave = count;\n count = 0;\n }", "protected void restoreLastState() {\n\t\tInteger ii = Accessors.INT_ACCESSOR.get(\"numberOfFiles\");\n\t\tif(ii == null)\n\t\t\tii = 0;\n\t\tint jj = 0;\n\t\t\n\t\tFile file;\n\t\twhile(jj < ii) {\n\t\t\tfile = new File(Preference.PREFERENCES_NODE.get(\"editSession\" + ++jj, \"\"));\n\t\t\topen(file);\n\t\t}\n\t}", "public void restoreState(IMemento memento) {\n\t\t\r\n\t}", "@Override\n public void restoreState(Map<String, Object> state) {\n\n }", "public void saveState() {\n mementos = new ArrayList<>(mementos.subList(0, statePointer + 1));\n Notebook notebookToAdd = new Notebook(this.notebook);\n notebookToAdd.setCurrentClassroom(this.notebook.getCurrentClassroom());\n Memento mementoToAdd = new Memento(notebookToAdd);\n mementos.add(mementoToAdd);\n statePointer++;\n }", "public void unReset () {\n count = lastSave;\n }", "@Override\n\t\tpublic Parcelable saveState() {\n\t\t\treturn null;\n\t\t}", "public void saveState() {\n table.saveState(store);\n }", "private void currentStateSaveToSharedPref() {\n sharedPreferences = getPreferences(Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"nameOfActiveChallenge\", nameOfCurrentChallenge);\n editor.putInt(\"key1OfActiveChallenge\", key1OfActiveChallenge);\n editor.putString(\"dateOfLastEdit\", dateOfLastEdit);\n editor.putFloat(\"goal\", goal);\n editor.putFloat(\"carry\", carry);\n editor.putInt(\"challengeDaysRunning\", challengeDaysRunning);\n editor.commit();\n }", "private void saveState() {\r\n \tSharedPreferences settings = getSharedPreferences(TEMP, 0);\r\n \tEditor editor = settings.edit();\r\n \tif (mRowId != null)\r\n \t\teditor.putLong(DbAdapter.KEY_ROWID, mRowId);\r\n \teditor.putLong(DbAdapter.KEY_DATE, mTime);\r\n \teditor.putString(DbAdapter.KEY_PAYEE, mPayeeText != null && \r\n \t\t\tmPayeeText.getText() != null ? mPayeeText.getText().toString() : null);\r\n \teditor.putString(DbAdapter.KEY_AMOUNT, mAmountText != null && \r\n \t\t\tmAmountText.getText() != null ? mAmountText.getText().toString() : null);\r\n \teditor.putString(DbAdapter.KEY_CATEGORY, mCategoryText != null && \r\n \t\t\tmCategoryText.getText() != null ? mCategoryText.getText().toString() : null);\r\n \teditor.putString(DbAdapter.KEY_MEMO, mMemoText != null && \r\n \t\t\tmMemoText.getText() != null ? mMemoText.getText().toString() : null);\r\n \teditor.putString(DbAdapter.KEY_TAG, mTagText != null && \r\n \t\t\tmTagText.getText() != null ? mTagText.getText().toString() : null);\r\n \teditor.commit();\r\n }", "@Override\n public void saveState(Bundle outBundle) {\n }", "public void onRestorePendingState() {\n }", "private void restoreState() {\n if (savedState != null) {\n// For Example\n//tv1.setText(savedState.getString(\"text\"));\n onRestoreState(savedState);\n }\n }", "@Override\r\n\tpublic GameState save() {\n\t\treturn null;\r\n\t}", "private void backupState(BPState curState) {\n\t\tprogram.generageCFG(\"/asm/cfg/\" + program.getFileName() + \"_test\");\n\t\tprogram.getResultFileTemp().appendInLine(\n\t\t\t\tprogram.getDetailTechnique() + \" Nodes:\" + program.getBPCFG().getVertexCount() + \" Edges:\"\n\t\t\t\t\t\t+ program.getBPCFG().getEdgeCount() + \" \");\n\t}", "@Override\n public void restore() {\n // Rather than copying the stored stuff back, just swap the pointers...\n int[] iTmp1 = m_iCurrentMatrices;\n m_iCurrentMatrices = m_iStoredMatrices;\n m_iStoredMatrices = iTmp1;\n\n int[] iTmp2 = m_iCurrentPartials;\n m_iCurrentPartials = m_iStoredPartials;\n m_iStoredPartials = iTmp2;\n\n// int[] iTmp3 = m_iCurrentStates;\n// m_iCurrentStates= m_iStoredStates;\n// m_iStoredStates = iTmp3;\n }", "@Override\n public void restore() {\n }", "private void saveCurrentState(Bundle outState){\n outState.putInt(PLAYER_COUNT_STATE_KEY,playerScore);\n outState.putSerializable(VIEW_MAP_STATE_KEY,globalViewMap);\n outState.putSerializable(CHILD_TEXT_CONTAINER_STATE_KEY,globalChildTextContainer);\n outState.putSerializable(PRIME_RECORD_MAP_KEY,primeRecorderMap);\n outState.putSerializable(CURRENT_SCREEN_GAME_STATE_KEY,currentScreenGameState);\n outState.putLong(GAME_TIME_LEFT_STATE_KEY,gameTimeLeftYet);\n }", "@Override\n\tpublic void reset(){\n\t\tstate.reset();\n\t\toldState.reset();\n\t\treturnAction = new boolean[Environment.numberOfButtons]; \n\t\trewardSoFar = 0;\n\t\tcurrentReward = 0;\n\t}", "private void saveStateToArguments() {\n if (getView() != null)\n savedState = saveState();\n if (savedState != null) {\n Bundle b = getArguments();\n if (b != null)\n b.putBundle(\"internalSavedViewState8954201239547\", savedState);\n }\n }", "public final void reset(){\n\t\tthis.undoStack = new GameStateStack();\n\t\tthis.redoStack = new GameStateStack();\n\t\t\n\t\tthis.currentBoard = currentRules.createBoard(currentSize);\n\t\tthis.currentRules.initBoard(currentBoard, currentInitCells, currentRandom);\n\t}", "private void backupState(BPState curState, FileProcess fileState) {\n\n\t\tprogram.generageCFG(\"/asm/cfg/\" + program.getFileName() + \"_test\");\n\t\tprogram.getResultFileTemp().appendInLine(\n\t\t\t\tprogram.getDetailTechnique() + \" Nodes:\" + program.getBPCFG().getVertexCount() + \" Edges:\"\n\t\t\t\t\t\t+ program.getBPCFG().getEdgeCount() + \" \");\n\t\t//System.out.println();\n\t}", "static void setNotSaved(){saved=false;}", "public void saveState(ObjectOutput out) throws IOException {\n\t\t// save deikto values\n\t\tdk.saveState(out);\n\t\t// save interpreter values\n\t\tout.writeFloat(interpreter.globalActorBox);\n\t\tout.writeFloat(interpreter.globalPropBox);\n\t\tout.writeFloat(interpreter.globalStageBox);\n\t\tout.writeFloat(interpreter.globalEventBox);\n\t\tout.writeFloat(interpreter.globalVerbBox);\n\t\tout.writeFloat(interpreter.globalBNumberBox);\n\n\t\t// save ticks\n\t\tout.writeInt(cMoments);\n\t\t// save inactivity counter\n\t\tout.writeInt(cInactivity);\n\t\t// save player inactivity\n\t\tout.writeInt(playerInactivity);\n\t\t// save storyIsOver\n\t\tout.writeBoolean(storyIsOver);\n\t\tout.writeBoolean(isEpilogueNow);\n\t\tout.writeBoolean(isHappilyDone);\n\t\tout.writeBoolean(isPenultimateDone);\n\n\t\t// save historyBook\n\t\tout.writeInt(historyBook.size());\n\t\tfor(Sentence s:historyBook)\n\t\t\tout.writeObject(s);\n\t\t// save random seeds\n\t\tout.writeObject(random);\n\t\tout.writeLong(interpreter.scriptRandom.getSeed());\n\t\t// save alarms\n\t\tout.writeInt(alarms.size());\n\t\tfor(Alarm a:alarms)\n\t\t\tout.writeObject(a);\n\t\tout.writeInt(storybook.size());\n\t\tfor(String s:storybook)\n\t\t\tout.writeUTF(s);\n\t}", "public void reset() {\n this.state = null;\n }", "@Override\n\tpublic void setLastState(STATE state) {\n\n\t}", "public Memento saveStateToMemento() {\r\n\t\treturn new Memento(this.state);\r\n\t}", "public abstract void restore();", "public abstract Op resetStates();", "public void save() {\r\n try {\r\n FileOutputStream fos = new FileOutputStream(REPO_STATE_FILE_NAME);\r\n fos.write(CodecUtils.toJson(this).getBytes());\r\n fos.close();\r\n } catch (Exception e) {\r\n Logging.logError(e);\r\n }\r\n }", "public void saveState() throws RemoteException {\r\n server.unbind(this.agentID);\r\n try {\r\n ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(\"agent.dat\"));\r\n oos.writeObject(this);\r\n oos.close();\r\n } catch (Exception e) {\r\n System.out.println(\"Object not saved correctly.\");\r\n } finally {\r\n System.exit(0);\r\n }\r\n }", "public void saveCurrentUserState(){\n\t\tCurrentUserState currState = new CurrentUserState();\n\t\tcurrState.setBatchOutput(batchState.getBatchOutput());\n\t\tcurrState.setCurrFields(batchState.getFields());\n\t\tcurrState.setCurrProject(batchState.getProject());\n\t\tcurrState.setCurrScale(display.getScale());\n\t\tcurrState.setCurrSelectedCell(batchState.getSelectedCell());\n\t\tcurrState.setErrorCells(batchState.getErrors());\n\t\t\n\t\tcurrState.setHighlight(display.isToggleOn());\n\t\tcurrState.setInverted(display.isInverted());\n\t\t\n\t\tcurrState.setCurrWindowPos(getLocationOnScreen());\n\t\tcurrState.setCurrWindowSize(getSize());\n\t\t\n\t\tcurrState.setHorizontalDiv(bottomPanel.getDividerLocation());\n\t\tcurrState.setVertivalDiv(centerPanel.getDividerLocation());\n\t\t\n\t\tcurrState.setOriginX(display.getW_originX());\n\t\tcurrState.setOriginY(display.getW_originY());\n\t\t\n\t\tcurrState.setValues(batchState.getValues());\n\t\t\n\t\t//put to xstream\n\t\tXStream xstream = new XStream(new DomDriver());\n\t\ttry {\n\t\t\n\t\t\txstream.toXML(currState, new FileOutputStream(new File(info.getUsername() + \".xml\")));\n\t\t\tSystem.out.println(\"current state is saved!\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"file not found/ couldn't go to xml\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private Bundle saveState() {\n Bundle state = new Bundle();\n // For Example\n //state.putString(\"text\", tv1.getText().toString());\n onSaveState(state);\n return state;\n }", "public void restoreState() {\n\tMachine.processor().setPageTable(pageTable);\n }", "StateClass() {\r\n restored = restore();\r\n }", "private void storeState() throws IOException {\n for (File outputFile : processedOutputs.keySet()) {\n if (state.outputs.get(outputFile) == null) {\n state.outputs.put(outputFile, new FileState(outputFile));\n }\n }\n\n File parent = stateFile.getParentFile();\n if (!parent.isDirectory() && !parent.mkdirs()) {\n throw new IOException(\"Could not create direcotyr \" + parent);\n }\n\n ObjectOutputStream os =\n new ObjectOutputStream(new GZIPOutputStream(new BufferedOutputStream(new FileOutputStream(\n stateFile))));\n try {\n os.writeObject(state);\n } finally {\n try {\n os.close();\n } catch (IOException e) {\n // ignore secondary exception\n }\n }\n }", "public void storeState() {\n if (best == null || best.getCost() > path.getCost()) {\n best = new IterativeState(path);\n }\n }", "public void setState(DiagramModel state) {\r\n for (Element e : state) {\r\n savedState_.add(0, e.makeCopy());\r\n }\r\n }", "public void saveState() throws IOException {\n\t\tFile f = new File(workingDirectory() + File.separator + id() + FILE_EXTENSION);\n\t\t\n\t\t// create new file if it doesnt exist\n\t\tf.createNewFile();\n\t\t\n\t\t// dump client state into file\n\t\tObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(f));\n\t\tos.writeObject(this);\n\t\tos.close();\n\t}", "protected void reset(){\n inited = false;\n }", "private void saveAppState(Context context) {\n LogHelper.v(LOG_TAG, \"Saving state.\");\n }", "public void reset(){\r\n barn.setVisited(Boolean.FALSE);\r\n turkeyTalk.setVisited(Boolean.FALSE);\r\n pigginOut.setVisited(Boolean.FALSE);\r\n seeTheLight.setVisited(Boolean.FALSE);\r\n theGobbling.setVisited(Boolean.FALSE);\r\n youDied1.setVisited(Boolean.FALSE);\r\n threeLittlePigs.setVisited(Boolean.FALSE);\r\n forTheGreaterGood.setVisited(Boolean.FALSE);\r\n farmHouseTurkey.setVisited(Boolean.FALSE);\r\n youWin.setVisited(Boolean.FALSE);\r\n }", "@Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n currentStateSaveToSharedPref();\n }", "public void initialState() {\n\t\t//empty\n\t}", "private void currentStateRestoreFromSharedPref() {\n sharedPreferences = getPreferences(MODE_PRIVATE);\n int key1DeffaultValue = -1;\n key1OfActiveChallenge = sharedPreferences.getInt(\"key1OfActiveChallenge\", key1DeffaultValue);\n nameOfCurrentChallenge = sharedPreferences.getString(\"nameOfActiveChallenge\", nameOfCurrentChallenge);\n\n dateOfLastEdit = sharedPreferences.getString(\"dateOfLastEdit\", dateOfLastEdit);\n\n goal = sharedPreferences.getFloat(\"goal\", goal);\n carry = sharedPreferences.getFloat(\"carry\", carry);\n\n challengeDaysRunning = sharedPreferences.getInt(\"challengeDaysRunning\", challengeDaysRunning);\n }", "public boolean saveState(String _filename) {\r\n\t\treturn saveVariables(_filename, stateVariablesList);\r\n\t}", "public void save() {\n\t\tthis.setState(Constants.CWorld.STATE_SAVING);\n\t\tthis.getWorld().saveAll();\n\t\tthis.setState(Constants.CWorld.STATE_ONLINE);\n\t}", "public void saveBack() {\n\t\tmodified = false;\n\n\t\t// set basics\n\t\tRubyHelper.setNum(object, \"@code\", id);\n\t\tRubyHelper.setNum(object, \"@indent\", indent);\n\n\t\t// set parameters\n\t\tRubyArray para = (RubyArray) object.getInstanceVariable(\"@parameters\");\n\t\tpara.clear();\n\n\t\tfor (IRubyObject r : parameters) {\n\t\t\tpara.add(r);\n\t\t}\n\t}", "public void reset() {\n context.reset();\n state = State.NAME;\n }", "void storeFormState();", "void restoreFormState();", "protected void reset() {\n\t\t}", "private void reset() {\n ms = s = m = h = 0;\n actualizar();\n }", "@Override\n public void onSaveInstanceState(Bundle savedInstanceState)\n {\n savedInstanceState.putIntArray(\"board\", tttGame.getBoard());\n savedInstanceState.putBoolean(\"turn\", tttGame.getTurn());\n savedInstanceState.putBoolean(\"mode\", tttGame.getAIMode());\n\n savedInstanceState.putInt(\"p1Count\", pOneCounter);\n savedInstanceState.putInt(\"p2Count\", pTwoCounter);\n savedInstanceState.putInt(\"pAICount\",pAICounter);\n savedInstanceState.putInt(\"tieCount\", tieCounter);\n\n boolean[] enabled = getState();\n savedInstanceState.putBooleanArray(\"state\", enabled);\n }", "protected void storeCurrentValues() {\n }", "private void reset() {\n }", "protected void serializeState() {\n\t\tint ii = 0;\n\t\t\n\t\tfor(GEditorPanel gep : editorPanels) {\n\t\t\tif(gep.getFilePath() != null && gep.getFilePath().length() > 0) {\n\t\t\t\tPreference.PREFERENCES_NODE.put(\"editSession\" + ++ii, gep.getFilePath());\n\t\t\t}\n\t\t}\n\t\t\n\t\tAccessors.INT_ACCESSOR.put(\"numberOfFiles\", ii);\n\t}", "public void reset() {\r\n this.x = resetX;\r\n this.y = resetY;\r\n state = 0;\r\n }", "@Override\n\tpublic void doSaveState ()\n\t{\n for (AbstractSideBar sb : this.sideBars.values ())\n {\n\n String id = sb.getId ();\n\n if (id == null)\n {\n\n continue;\n\n }\n\n UserProperties.set (\"sidebarState-\" + id,\n sb.getSaveState ());\n\n }\n\n\t}", "@Override\n\tpublic void restoreState() {\n // Rather than copying the stored stuff back, just swap the pointers...\n int[] tmp1 = currentMatricesIndices;\n currentMatricesIndices = storedMatricesIndices;\n storedMatricesIndices = tmp1;\n\n int[] tmp2 = currentPartialsIndices;\n currentPartialsIndices = storedPartialsIndices;\n storedPartialsIndices = tmp2;\n\n\n }", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "public SaveGame() {\n\t\tlives = 0;\n\t\tscore = 0;\n\t\tbrainX = 0;\n\t\tbrainY = 0;\n\t\tzombieX = 0;\n\t}", "public void save() {\n settingService.saveMaxScore(score);\r\n// powerUpCount = 0;\r\n// powerDownCount = 0;\r\n// purplePowerCount = 0;\r\n// yellowMadnessCount = 0;\r\n// shapeCount = 0;\r\n }", "private void saveState(final Bundle state)\n {\n logEnter(LOG_TAG, \"saveState\", state);\n\n state.putSerializable(BUNDLE_FIELD_INSTANCE, instance);\n state.putSerializable(BUNDLE_FIELD_ENTRIES, entries);\n }", "public void saveState() {\n\t\tFileOutputStream fos = null;\n\t\tObjectOutputStream out = null;\n\t\ttry {\n\t\t\tFile savefile = new File(getServletContext().getRealPath(\"/WEB-INF/\"), SAVED_RECEPTOR_FILE_NAME);\n\t\t\tfos = new FileOutputStream(savefile);\n\t\t\tout = new ObjectOutputStream(fos);\n\t\t\tout.writeObject(pgtMap);\n\t\t\tout.close();\n\t\t} catch (IOException ex) {\n\t\t\tSystem.err.println(\"IO Exception saving proxyTicket cache\");\n\t\t\tex.printStackTrace();\n\t\t} catch (Exception e) { //don't think this is possible, but I'm seeing some goofy behavior, so...\n\t\t\tSystem.err.println(\"Non-IO Exception saving proxyTicket cache\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void reset () {}", "synchronized void saveDhtState() {\n if (dhtTracker != null) {\n saveDhtEntries(dhtTracker.getTrackerState());\n }\n }", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}", "public int[] reset() {\n return store;\n }", "@Override\n public void reset() \n {\n\n }", "public void reset()\n\t{\n\t}", "public void reset()\n\t{\n\t}", "public void reset() {\n\t\t\t\t\r\n\t\t\t}", "protected abstract boolean reset();", "public void reset() {\n\n\t}", "void reset() ;", "private void restorePreviousState() {\n\n\t\tif (StoreAnalysisStateApplication.question1Answered) {\n\t\t\tfirstImageVievQuestion\n\t\t\t\t\t.setImageResource(R.drawable.swipegestureenabled);\n\t\t}\n\n\t\tif (StoreAnalysisStateApplication.question2Answered) {\n\t\t\tsecondImageVievQuestion\n\t\t\t\t\t.setImageResource(R.drawable.swipegestureenabled);\n\t\t}\n\n\t\tif (StoreAnalysisStateApplication.question3Answered) {\n\t\t\tthirdImageVievQuestion\n\t\t\t\t\t.setImageResource(R.drawable.swipegestureenabled);\n\t\t}\n\n\t\tif (StoreAnalysisStateApplication.stageCleared) {\n\t\t\tfirstImageVievDescription\n\t\t\t\t\t.setImageResource(R.drawable.swipegestureenabled);\n\t\t}\n\n\t\tif (StoreDesignStateApplication.stageCleared) {\n\t\t\tsecondImageVievDescription\n\t\t\t\t\t.setImageResource(R.drawable.voicereadingenabled);\n\t\t}\n\n\t\tif (StoreImplementationStateApplication.stageCleared) {\n\t\t\tthirdImageVievDescription\n\t\t\t\t\t.setImageResource(R.drawable.microphonenabled);\n\t\t}\n\n\t}", "public void restore() {\n this.prefs.edit().putBoolean(PREFKEY_IS_KIOSK, tempIsKiosk).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_TABLET, tempIsTablet).apply();\n this.prefs.edit().putBoolean(PREFKEY_HTTP_SSL, tempSSL).apply();\n this.prefs.edit().putBoolean(PREFKEY_RES_FETCHED, tempFetched).apply();\n this.prefs.edit().putString(PREFKEY_HTTP_PORT, tempHttpPort).apply();\n this.prefs.edit().putString(PREFKEY_HTTP_HOST, tempHttpHost).apply();\n this.prefs.edit().putString(PREFKEY_PASSWORD, temppassword).apply();\n this.prefs.edit().putString(PREFKEY_USERNAME, tempUsername).apply();\n this.prefs.edit().putString(PREFKEY_BOOTSTRAP, tempBootstrap).apply();\n this.prefs.edit().putString(PREFKEY_ROOM_SELECTED, roomSelected).apply();\n this.prefs.edit().putString(PREFKEY_TO_IGNORE, toIgnore).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_IMAGE_DOWNLOADED, isImageDownloaded).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_IMAGE_LAN, isImageLan).apply();\n }", "private void saveStateSnapshot(State state){\n\t\ttry{\n\t\t\tif(saveStateSnapshot){\n\t\t\t\t//System.out.println(Utils.treeDesc(state, 2, Tags.Role, Tags.Desc, Tags.Shape, Tags.Blocked));\n\t\t\t\tTaggable taggable = new TaggableBase();\n\t\t\t\ttaggable.set(SystemState, state);\n\t\t\t\tLogSerialiser.log(\"Saving state snapshot...\\n\", LogSerialiser.LogLevel.Debug);\n\t\t\t\tFile file = Util.generateUniqueFile(settings.get(ConfigTags.OutputDir), \"state_snapshot\");\n\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)));\n\t\t\t\toos.writeObject(taggable);\n\t\t\t\toos.close();\n\t\t\t\tsaveStateSnapshot = false;\n\t\t\t\tLogSerialiser.log(\"Saved state snapshot to \" + file.getAbsolutePath() + \"\\n\", LogSerialiser.LogLevel.Info);\n\t\t\t}\n\t\t}catch(IOException ioe){\n\t\t\tthrow new RuntimeException(ioe);\n\t\t}\n\t}" ]
[ "0.7874834", "0.7761095", "0.7641857", "0.7313699", "0.71581835", "0.70955807", "0.7082394", "0.70330334", "0.6999341", "0.6939999", "0.69205016", "0.6911713", "0.68394977", "0.683384", "0.6779901", "0.6771297", "0.67688155", "0.676108", "0.67384547", "0.67249686", "0.6722748", "0.6681576", "0.66656256", "0.6658032", "0.6657845", "0.66359705", "0.66275465", "0.6577077", "0.6565229", "0.65505344", "0.6528508", "0.651381", "0.6508793", "0.6498297", "0.64721906", "0.64718884", "0.64558977", "0.64263815", "0.64246553", "0.640148", "0.63947576", "0.6377901", "0.63761926", "0.63422525", "0.6334843", "0.6330524", "0.6330194", "0.6325524", "0.6320425", "0.62882316", "0.6280193", "0.6274588", "0.6266631", "0.6256104", "0.6231039", "0.6225357", "0.62126744", "0.61955047", "0.6187313", "0.61843204", "0.6183741", "0.61700326", "0.6160726", "0.6155828", "0.61490184", "0.6135138", "0.61197793", "0.6118646", "0.61099976", "0.60951", "0.609143", "0.6086308", "0.60792977", "0.60792303", "0.60707635", "0.606567", "0.60569286", "0.6055822", "0.6050932", "0.6050932", "0.6050932", "0.6050932", "0.60393417", "0.6039098", "0.60382813", "0.6023075", "0.60192686", "0.6019239", "0.6015844", "0.6008371", "0.59953487", "0.59865737", "0.59865737", "0.5985324", "0.5977742", "0.5976954", "0.5974551", "0.596725", "0.5962992", "0.59606993" ]
0.61855966
59
Constructor for the poem generator object. Creates scanner and a list for PoetAndThemeobjects
public SecretPoemGenerator(){ scanner = new Scanner(System.in); poetsAndThemesList = new ArrayList<>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readPoemFiles(){\n try (Scanner fileScan = new Scanner(new File(\"poems.txt\"))) {\n //Poems.txt consist of a header (poet and theme) plus verse lines.\n //First loop reads the header and creates object 'PoetAndTheme'.\n while (fileScan.hasNextLine()){\n String themeAndPoet = fileScan.nextLine();\n PoetAndTheme addToList = new PoetAndTheme(themeAndPoet);\n //Second loop reads verse lines and adds them to object 'PoetAndTheme'.\n while(fileScan.hasNextLine()){\n String verseLine = fileScan.nextLine();\n if (verseLine.isEmpty()){\n break;\n }\n addToList.addVerseLine(verseLine);\n }\n poetsAndThemesList.add(addToList);\n }\n \n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public Poem(){}", "private Parser() {\n objetos = new ListaEnlazada();\n }", "public OrotParser() {\n createPackagesJson();\n }", "public PoissonGenerator() {\n\t}", "public PrologPartitionScanner() {\r\n\t\tsuper();\r\n\r\n\t\tIToken prologComment = new Token(PROLOG_COMMENT);\r\n\t\tIToken prologList = new Token(PROLOG_LIST);\r\n\r\n\t\tPrologListRule list = new PrologListRule(prologList);\r\n\t\tMultiLineRule comment = new MultiLineRule(\"/*\", \"*/\", prologComment,\r\n\t\t\t\t(char) 0, true);\r\n\t\tEndOfLineRule comment2 = new EndOfLineRule(\"%\", prologComment);\r\n\r\n\t\tIPredicateRule[] rules = new IPredicateRule[] { list, comment, comment2 };\r\n\t\tsetPredicateRules(rules);\r\n\t}", "public PoetryWriter() {\n mainList = null;\n previousWord = null;\n total = 0;\n }", "public PCLParser(java_cup.runtime.Scanner s) {super(s);}", "public OnionooParser() {\n\n\t}", "private void initialize() {\n toDoList = new ToDoList(\"To-Do List\");\n scanner = new Scanner(System.in);\n }", "public Stemmer ()\n {\n AllWords = new HashMap<String,String>();\n dictionary = Dictionary.getInstance();\n p = PointerUtils.getInstance();\n\n try\n {\n // JWNL.initialize(new FileInputStream(\"file_properties.xml\"));\n JWNLConnecter.initializeJWNL();\n dic = Dictionary.getInstance();\n morph = dic.getMorphologicalProcessor();\n // ((AbstractCachingDictionary)dic).\n //\tsetCacheCapacity (10000);\n IsInitialized = true;\n }\n catch (Exception e){\n System.err.println(e.getMessage());\n }\n /*catch ( FileNotFoundException e )\n {\n System.out.println ( \"Error initializing Stemmer: JWNLproperties.xml not found\" );\n }\n catch ( JWNLException e )\n {\n System.out.println ( \"Error initializing Stemmer: \"\n + e.toString() );\n }*/\n\n }", "public PjxParser()\r\n {\r\n LOG.info(this + \" instantiated\");\r\n }", "private void prepareScanner() {\r\n\t\tbcLocator = new BCLocator();\r\n\t\tbcGenerator = new BCGenerator();\r\n\t}", "private CandidateGenerator() {\n\t}", "@PostConstruct\n public void init() {\n for (GithubParser parser : getBeans()) {\n List<String> events = parser.getEvents();\n for (String eventType : events) {\n this.parsers.put(eventType, parser);\n }\n }\n }", "public PinboardMaker()\r\n {\r\n pictures = new ArrayList<String>();\r\n pinboardObject = new Pinboard();\r\n }", "public OpenOfficeXMLDocumentParser() {\r\n }", "public ImportCommandParser() {\n persons = new ArrayList<>();\n }", "public Parser(Scanner scanner) {\n this.scanner = scanner;\n scan();\n }", "public ObjectFactory() {\n super(grammarInfo);\n }", "public MetadataScanner()\n {\n this(\"\");\n }", "public CoolParser(java_cup.runtime.Scanner s) {super(s);}", "public PARiverDataGenerator() {\n }", "private PokemonIDList() {\n }", "public Pokedex() {\n pokedex = new ArrayList<PokemonSpecies>();\n }", "public FeedParsers() {\n super(FEED_PARSERS_KEY);\n }", "public PageList() { \n// fileIO = new CharFileIO(\"utf-8\");\n// We are not currently using this to extract 'title' because it doesn't work \n// for whose title and meta-description tags are not explicitly specified;\n// Such as pages written in scripting languages like .jsp, .asp etc \n// parseJob = new ParseJob();\n }", "private ConsoleScanner() {}", "public Parser() {\n\t\tpopulateMaps();\n\t}", "public LexicalScanner() throws IOException {\n this.codesMap = new CodesMap();\n this.keyWords = loadKeywords();\n this.specialCharacters = loadSpecialCharacters();\n this.identifierAutomata = new FA(IDENTIFIER_AUTOMATA_FILE);\n this.constantAutomata = new FA(CONSTANT_AUTOMATA_FILE);\n }", "private void init(){\r\n\t\t// already checked that this is a valid file and reader\r\n\t\ttokenizer = new StreamTokenizer(reader);\r\n\t\ttokenizer.slashSlashComments(true);\r\n\t\ttokenizer.slashStarComments(true);\r\n\t\ttokenizer.wordChars('_', '_');\r\n\t\ttokenizer.wordChars('.', '.');\r\n\t\ttokenizer.ordinaryChar('/');\r\n\t\ttokenizer.ordinaryChar('-');\r\n\t\tfillKeywords();\r\n\t\t//tokenChoose = new TokenChooser();\r\n\t}", "public ClassCreator(){\n\n\n\t\tScanner fin = null;\n\n\t\ttry {\n\t\t\tString[] nameHandler = fileName.split(\"\\\\.\");\n\n\t\t\tString className = nameHandler[0].replaceAll(\" |_|\\\\s$|0|1|2|3|4|5|6|7|8|9\", \"\");\n\n\n\t\t\t//Setting Up Scanners/PrintWriter\n\t\t\tfin = new Scanner(new File(fileName));\n\n\n\t\t\tPrintWriter pw = new PrintWriter(className + \".java\");\n\n\n\t\t\tString[] prop = fin.nextLine().split(\"\\t\");\n\t\t\tString[] data = fin.nextLine().split(\"\\t\");\n\n\t\t\tfor(int i = 0; i<prop.length; i++) {\n\t\t\t\tpropertyList.add(new Properties(prop[i].replaceAll(\"\\\\s\", \"\"), getDataType(data[i])));\n\t\t\t}\n\n\t\t\t//Imports\n\t\t\tpw.println(\"import java.util.Scanner;\\n\\n\");\n\t\t\t\n\t\t\t//Class Line\n\t\t\tpw.println(\"\\npublic class \" + className + \" {\");\n\n\t\t\t//Properties\n\t\t\tpw.println(\"\\n\\t//======================================================= Properties\\n\");\n\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateProperty());\n\t\t\t}\n\n\t\t\t//Constructors\n\t\t\tpw.println(\"\\n\\t//======================================================= Constructors\\n\");\n\n\t\t\t//================= Workhorse Constructor\n\t\t\tpw.print(\"\\tpublic \" + className + \"(\");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).getDataType() + \" \" + propertyList.get(i).getFieldName() + \", \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).getDataType() + \" \" \n\t\t\t\t\t+ propertyList.get(propertyList.size()-1).getFieldName() + \"){\\n\");\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateSetCall(p));\n\t\t\t}\n\t\t\tpw.println(\"\\t}\\n\");\n\n\t\t\t//================= Scanner Constructor\n\t\t\tpw.print(\"\\tpublic \" + className + \"(Scanner fin) throws Exception {\\n\");\n\t\t\tpw.println(\"\\t\\tString[] parts = fin.nextLine().split(\\\"\\\\t\\\");\");\n\t\t\tint arrayCount = 0;\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tif(p.getDataType().equals(\"int\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Integer.parseInt(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"double\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Double.parseDouble(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"long\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Long.parseLong(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"boolean\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Boolean.parseBoolean(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpw.println(p.generateSetCall(\"parts[\" + arrayCount + \"]\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tpw.println(\"\\n\\t}\");\n\n\t\t\t//Methods\n\t\t\tpw.println(\"\\n\\t//======================================================= Methods\\n\");\n\n\t\t\t\t//Equals\n\t\t\tpw.println(\"\\tpublic boolean equals(Object obj) {\");\n\t\t\tpw.println(\"\\t\\tif(!(obj instanceof \" + className + \")) return false;\");\n\t\t\tpw.println(\"\\t\\t\" + className + \" \" + className.substring(0,1).toLowerCase() + \" = (\" + className + \")obj;\");\n\t\t\tpw.println(\"\\t\\treturn getEqualsString().equals(\" + className.substring(0,1).toLowerCase() + \".getEqualsString());\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\t//EqualsHelper\n\t\t\tpw.println(\"\\n\\tprivate String getEqualsString() {\");\n\t\t\tpw.print(\"\\t\\treturn \");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).getFieldName() + \" + \\\"~\\\" + \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).getFieldName() + \";\\n\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\t//toString\n\t\t\tpw.println(\"\\n\\tpublic String toString() {\");\n\t\t\tpw.print(\"\\t\\treturn \\\"\");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).generateUpperCase() + \": \\\" + \" + propertyList.get(i).getFieldName() + \" + \\\", \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).generateUpperCase() + \": \\\" + \" + propertyList.get(propertyList.size()-1).getFieldName() + \";\\n\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\n\t\t\t//Getters/Setters\n\t\t\tpw.println(\"\\n\\t//======================================================= Getters/Setters\\n\");\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateGetter());\n\t\t\t}\n\t\t\tpw.println();\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateSetter());\n\t\t\t}\n\n\t\t\t//End of the file code\n\t\t\tpw.print(\"\\n\\n}\");\n\t\t\tfin.close();\n\t\t\tpw.close();\n\n\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error: \" + e.getMessage());\n\t\t} finally { //Checked Last after try\n\t\t\ttry {fin.close();} catch (Exception e) {} //Just Double Checking\n\n\t\t}\n\n\n\n\n\t}", "public WordList() {\t\t//Default constructor\n\t}", "private TemplateReader() {\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 PListParser() {\n logger = AppRegistryBridge.getInstance().getLoggingBridge();\n }", "private void init() {\n\t\tMvcs.scanPackagePath = analyseScanPath();\n\t\tif(StringHandler.isEmpty(Mvcs.scanPackagePath))\n\t\t\tthrow new RuntimeException(\"No scan path has been set! you need to setup ScanPackage annotation\");\n\t\t\n\t\t//put all class into the list\n\t\tList<String> allClassNames = scanAllClassNames();\n\t\tif(StringHandler.isEmpty(allClassNames)) //some loader may have no return value \n\t\t\treturn ;\n\t\t\n\t\tfor(String pkgPath : allClassNames){\n\t\t\tlist.add(ClassUtil.getClass(pkgPath));\n\t\t}\n\t}", "public PertFactory() {\n for (Object[] o : classTagArray) {\n addStorableClass((String) o[1], (Class) o[0]);\n }\n }", "public void init() {\n\t\tfor(int i = 0; i < 5; i++) {\n\t\t\tpageLists.add(new Page(i));\n\t\t}\n\t}", "public XMLPartitionScanner() {\n\n IToken xmlComment = new Token(XML_COMMENT);\n IToken tag = new Token(XML_TAG);\n\n IPredicateRule[] rules = new IPredicateRule[2];\n\n rules[0] = new MultiLineRule(\"<!--\", \"-->\", xmlComment);\n rules[1] = new TagRule(tag);\n\n setPredicateRules(rules);\n }", "public Application() {\r\n monster1 = new Monster();\r\n treasure1 = new Treasure();\r\n in = new Scanner(System.in);\r\n }", "public FractalParser(java_cup.runtime.Scanner s) {super(s);}", "public RepositoryParser() {\n pageElementsMap = new HashMap<String, Map<String, PageElement>>();\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);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public ProgramParser(ProgramParserTokenManager tm) {\n token_source = tm;\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 }", "public AnnotationScanner() {\n File rootDir = this.getClassRootDirectory();\n\n if (rootDir != null) {\n this.allClass = getDirClassList(rootDir, null);\n } else {\n this.initJar();\n }\n }", "public Plato(){\n\t\t\n\t}", "protected PhraseTree() {}", "public ItemGenerator()\n {\n itemList = new ArrayList<Item>();\n try\n {\n Scanner read = new Scanner(new File (\"ItemList.txt\"));\n while (read.hasNext())\n {\n String line = read.nextLine();\n Item i = new Item(line);\n itemList.add(i);\n }\n read.close();\n }\n catch (FileNotFoundException fnf)\n {\n System.out.println(\"File not found\");\n }\n }", "public void startPoemGenerator(){\n PoemWindow win = new PoemWindow();\n System.out.println(\"\\nYou found a Secret Poem Generator.\");\n System.out.println(\"Welcome, Friend!\");\n System.out.println(\"\\n **************************************\");\n System.out.println();\n readPoemFiles();\n askPoets();\n try{\n fetchVerseLines();\n }catch(Exception e){\n System.out.println(\"Invalid input. Please, try again!\");\n }\n }", "public ContentScanner(\n IContentContext contentContext\n )\n {this(contentContext.getContents());}", "public NesCDocScanner( IMultiPreferenceProvider preferences ) {\r\n super();\r\n \r\n this.preferences = preferences;\r\n \r\n buildRules();\r\n }", "public ContentScanner(\n Contents contents\n )\n {\n this.parentLevel = null;\n this.objects = this.contents = contents;\n\n moveStart();\n }", "public \n PipedObjectReader() \n {}", "public MJParser(java_cup.runtime.Scanner s) {super(s);}", "public CompParser(java_cup.runtime.Scanner s) {super(s);}", "public PKGParserCore(TokenManager tm) {\r\n token_source = tm;\r\n token = new Token();\r\n jj_ntk = -1;\r\n jj_gen = 0;\r\n for (int i = 0; i < 28; i++) jj_la1[i] = -1;\r\n for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r\n }", "public NedDocColorizerScanner() {\n super();\n // this is the default token for a comment\n setDefaultReturnToken(SyntaxHighlightHelper.docDefaultToken);\n\n List<IRule> list = new ArrayList<IRule>();\n\n // Add rules for supported HTML tags\n list.add(new XmlTagRule(SyntaxHighlightHelper.highlightDocTags, SyntaxHighlightHelper.docTagToken));\n\n // Add word rule for keywords\n WordRule keywordRule = new WordRule(new SyntaxHighlightHelper.NedAtWordDetector(), Token.UNDEFINED);\n for (String keyword : SyntaxHighlightHelper.highlightDocKeywords)\n keywordRule.addWord(\"@\" + keyword, SyntaxHighlightHelper.docKeywordToken);\n list.add(keywordRule);\n\n IRule[] result = new IRule[list.size()];\n list.toArray(result);\n setRules(result);\n }", "private void initialize() {\n this.docTypeList = new ArrayList<>();\n this.problemTypeList = new ArrayList<>();\n\n // The add() function should be called in the order specified since together\n // they form a mapping mechanism,\n // for example 'ENCAPSULATED' before 'POSTSCRIPT' and 'RICH' before 'TEXT'.\n\n this.docTypeList.add(\"ENCAPSULATED\");\n this.problemTypeList.add(ProblemType.NON_ENCAPSULATED_POSTSCRIPT_FILE);\n\n this.docTypeList.add(\"EXCEL\");\n this.problemTypeList.add(ProblemType.NON_MSEXCEL_FILE);\n\n this.docTypeList.add(\"GIF\");\n this.problemTypeList.add(ProblemType.NON_GIF_FILE);\n\n this.docTypeList.add(\"HTML\");\n this.problemTypeList.add(ProblemType.NON_HTML_FILE);\n\n this.docTypeList.add(\"LATEX\");\n this.problemTypeList.add(ProblemType.NON_LATEX_FILE);\n\n this.docTypeList.add(\"MPEG\");\n this.problemTypeList.add(ProblemType.NON_MP4_FILE);\n\n this.docTypeList.add(\"POSTSCRIPT\");\n this.problemTypeList.add(ProblemType.NON_POSTSCRIPT_FILE);\n\n this.docTypeList.add(\"TIFF\");\n this.problemTypeList.add(ProblemType.NON_TIFF_FILE);\n\n this.docTypeList.add(\"WORD\");\n this.problemTypeList.add(ProblemType.NON_MSWORD_FILE);\n\n this.classInitialized = true;\n\n LOG.debug(\"initialize:this.docTypeList.size {}\", this.docTypeList.size());\n LOG.debug(\"initialize:this.problemTypeList.size {}\", this.problemTypeList.size());\n }", "public WordGenerator()\n {\n adjective1a = new ArrayList<String>();\n adjective1b = new ArrayList<String>();\n adjective1c = new ArrayList<String>();\n adjective2a = new ArrayList<String>();\n adjective2b = new ArrayList<String>();\n adjective2c = new ArrayList<String>();\n fillAdjectives();\n noun = \"\";\n adj1 = \"\";\n adj2 = \"\";\n }", "public PosTagger() {\n\t\ttry {\n\t\t\t//Load pos model only if it has not been loaded before\n\t\t\tif (posModel == null) {\n\t\t\t\tInputStream modelIn = PosTagger.class\n\t\t\t\t\t\t.getResourceAsStream(POSTAGGING_MODEL_PATH);\n\t\t\t\tposModel = new POSModel(modelIn);\n\t\t\t\tmodelIn.close();\n\t\t\t}\n\t\t\t//Load multiword model only if it has not been loaded before\n\t\t\tif (multiwordModel == null) {\n\t\t\t\tInputStream modelIn = PosTagger.class\n\t\t\t\t\t\t.getResourceAsStream(MULTIWORD_MODEL_PATH);\n\t\t\t\tmultiwordModel = new POSModel(modelIn);\n\t\t\t\tmodelIn.close();\n\t\t\t}\n\t\t\t//set the instances for both tagging tools\n\t\t\tpostagger = new POSTaggerME(posModel);\n\t\t\tmultiwordTagger = new POSTaggerME(multiwordModel);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private VP_Theme() {\n }", "protected StreamParser()\n {\n }", "public BPELGeneratorImpl() {\r\n \t\tsuper(GENERATOR_NAME);\r\n \t}", "public Pippo(Context context) {super(context);}", "public PropertyParser(Properties props)\n\t{\n\t\t_props = props;\n\t}", "public parserCapas(java_cup.runtime.Scanner s) {super(s);}", "public static synchronized void Initialize() throws FileNotFoundException, UnsupportedEncodingException {\n fileReaderInit(fLocation);\n \n pbr = new PushbackReader(reader, 5);\n \n \n File currentDirFile = new File(\".\");\n String helper = currentDirFile.getAbsolutePath();\n outLocation = \"src/parser_resources/\" + outFile;\n /*scan.nextLine();*/\n \n File f = new File(outLocation);\n\n if (f.exists() && !f.isDirectory()) {\n fWriter = new PrintWriter(outLocation, \"Ascii\");\n System.out.println(\"\\nOutput file initialized for Scanner\");\n System.out.println(\"Scanning output to: \" + helper + \"/\" + outLocation);\n } else {\n System.out.println(\"Error: output file missing please \\\"touch\"\n + \"scanner.out\\\" in parser_resources directory.\");\n }\n }", "private SpTreeMan() {\n }", "private PerksFactory() {\n\n\t}", "public HPOParser() throws PhenoteFxException {\n File dir = Platform.getPhenoteFXDir();\n String basename=\"hp.obo\";\n this.hpoPath = new File(dir + File.separator + basename);\n this.hpoMap=new HashMap<>();\n hpoName2IDmap=new HashMap<>();\n this.hpoSynonym2PreferredLabelMap=new HashMap<>();\n inputFile();\n }", "public PostOffice() {\n }", "public MTPostEditDistanceReportGenerator()\n {\n\n }", "private PitchParser() {\n\n }", "public LuaGrammarCup(java_cup.runtime.Scanner s) {super(s);}", "public static void main(String[] args) {\n\n\t\tScanner in = new Scanner(System.in);\n\t\tScanner inInt = new Scanner(System.in);\n\t\t\n\t\t\n\t\tString opcion = \"\";\n\t\tString categoria = \"\";\n\t\tString descripcion = \"\";\n\t\tString beneficio = \"\";\n\t\tString nombreABuscar = \"\";\n\t\tint posicion = 0;\n\t\tString nombre = \"\";\n\t\t\n\t\tPoliza listaPoliza[] = new Poliza[50];\n\t\t\n\t\n\t\tdo {\n\t\t\tSystem.out.println(\"Elija una Opcion: \");\n\t\t\tSystem.out.println(\"1. Ingresar Poliza \");\n\t\t\tSystem.out.println(\"2. Buscar Poliza \");\n\t\t\tSystem.out.println(\"3. SALIR \");\n\t\t\topcion = in.nextLine();\n\n\t\t\tswitch (opcion) {\n\n\t\t\tcase \"1\":\n\t\t\t\tSystem.out.println(\"****************************\");\n\t\t\t\tSystem.out.println(\"Ingresar Nombre: \");\n\t\t\t\tnombre = in.nextLine();\n\t\t\t\tSystem.out.println(\"Ingrese la Categoria: \");\n\t\t\t\tSystem.out.println(\"1. Economico\");\n\t\t\t\tSystem.out.println(\"2. DE Vida\");\n\t\t\t\tcategoria = in.nextLine();\n\t\t\t\tif (categoria.equals(\"1\")) {\n\t\t\t\t\tSystem.out.println(\"Ingrese Codigo de Descuento: \");\n\t\t\t\t\tString descuento = in.next();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Ingrese Codigo de Salud: \");\n\t\t\t\t\tString codigo = in.next();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"3. Ingrese descripcion: \");\n\t\t\t\tdescripcion = in.next();\n\t\t\t\tSystem.out.println(\"4. Ingresar el beneficio: \");\n\t\t\t\tbeneficio = in.nextLine();\n\t\t\t\tSystem.out.println(\"****************************\");\n\n\t\t\t\tPoliza poliza1 = new Poliza(\"nombre=\" + nombre + \", categoria=\" + categoria + \", descripcion=\"\n\t\t\t\t\t\t+ descripcion + \", beneficio=\" + beneficio);\n\t\t\t\tpoliza1.setNombre(nombre);\n\t\t\t\tpoliza1.setCategoria(categoria);\n\t\t\t\tpoliza1.setDescripcion(descripcion);\n\t\t\t\tpoliza1.setBeneficio(beneficio);\n\n\t\t\t\tlistaPoliza[posicion] = poliza1;\n\t\t\t\tposicion++;\n\t\t\t\tSystem.out.println(Arrays.toString(listaPoliza));\n\t\t\t\tSystem.out.println(\"La informacion ha sido guardada exitosamente\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"2\":\n\t\t\t\tSystem.out.println(\"****************************\");\n\t\t\t\tSystem.out.println(\"Ingresar el nombre: \");\n\t\t\t\tnombreABuscar = in.nextLine();\n\t\t\t\tfor (int i = 0; i<50; i++) {\n\t\t\t\t\tPoliza poliza = listaPoliza[i];\n\t\t\t\t\t\n\t\t\t\t\tnombreABuscar.equals(nombre);\n\t\t\t\t\t\n\t\t\t\tboolean resultado = poliza.contains(nombreABuscar);\n\t\t\t\tSystem.out.println(\"Poliza Encontrada: \" + Arrays.toString(listaPoliza));\n\t\t\t\t\n//\t\t\t\t\tif(nombreABuscar.equals(listaPoliza)){\n//\t\t\t\t\t\tSystem.out.println(\"Poliza Encontrada: \");\n//\t\t\t\t\t\tSystem.out.println(Arrays.toString(listaPoliza));\n//\t\t\t\t\n//\t\t\t\t\t\t}else {\n//\t\t\t\t\t\t\tSystem.out.println(\"Nombre no encontrado\");\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\n\t\t}while(!opcion.equals(\"3\"));\n\t\tSystem.out.println(\"Usted ha salido del sistema\");\n\t\tSystem.out.println(\"BUEN DIA\");\n\t\t\n\t\t}", "public Produto() {}", "public Programa(ProgramaTokenManager tm) {\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 token_source = tm;\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 Parser() {}", "public PoisonPillXMLChunk() {\n\t\t}", "public PostBibTeXParser() {\n\t\tthis.resourceFactory = new ResourceFactory();\n\t}", "public ProvinceScanner() {\n\t\tthis(false);\n\t}", "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 FastBarcodeScannerPlugin() {\r\n\t}", "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 Scanner(String program) {\n\t\tthis.program=program;\n\t\tpos=0;\n\t\ttoken=null;\n\t\tinitWhitespace(whitespace);\n\t\tinitDigits(digits);\n\t\tinitLetters(letters);\n\t\tinitLegits(legits);\n\t\tinitKeywords(keywords);\n\t\tinitOperators(operators);\n }", "public Lex()\n {\n num_tags = Tags.num_tags;\n }", "public ConfigMetadataProcessor() {\n }" ]
[ "0.61604387", "0.5826526", "0.5756371", "0.5542798", "0.5498588", "0.54418856", "0.537471", "0.5349563", "0.530934", "0.5305058", "0.5295868", "0.52899534", "0.5286523", "0.5279725", "0.520978", "0.5196911", "0.51966774", "0.51932377", "0.5191816", "0.51889527", "0.5182899", "0.5181473", "0.5166659", "0.5128823", "0.512862", "0.5127188", "0.5120771", "0.5120634", "0.51195014", "0.51181793", "0.5115214", "0.5114723", "0.50753456", "0.5060337", "0.50302094", "0.50302094", "0.50302094", "0.50302094", "0.50302094", "0.50302094", "0.50225455", "0.50124514", "0.49986225", "0.4983731", "0.4982088", "0.4974795", "0.49631286", "0.49566093", "0.49440095", "0.49440095", "0.49440095", "0.49440095", "0.49440095", "0.49440095", "0.49440095", "0.49440095", "0.49393737", "0.49344853", "0.4926522", "0.4911654", "0.49054605", "0.49024773", "0.49006802", "0.48981494", "0.48959264", "0.4889482", "0.48887426", "0.48792377", "0.48781234", "0.48724815", "0.48698166", "0.48668018", "0.4866601", "0.48644775", "0.4864135", "0.48614538", "0.48539644", "0.4840837", "0.48325336", "0.48293385", "0.4824712", "0.4818887", "0.48074737", "0.48041657", "0.48036334", "0.48024768", "0.4798246", "0.47924528", "0.47862005", "0.47813362", "0.47674435", "0.47661564", "0.4760546", "0.47590688", "0.47506598", "0.47502363", "0.47499827", "0.4749749", "0.47466394", "0.47460005" ]
0.71542716
0
Starts poem generator. Presents welcome message, calls methods readPoemFiles, askPoets and fetchVerseLines.
public void startPoemGenerator(){ PoemWindow win = new PoemWindow(); System.out.println("\nYou found a Secret Poem Generator."); System.out.println("Welcome, Friend!"); System.out.println("\n **************************************"); System.out.println(); readPoemFiles(); askPoets(); try{ fetchVerseLines(); }catch(Exception e){ System.out.println("Invalid input. Please, try again!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void start() {\n\t\tFile splashFile = new File(\"Splash\", \"title\");\r\n\t\tsplashString = TextFileReader.getContents(splashFile);\r\n\t\tsendOutput(splashString);\r\n\t\tsendOutput(\"Version \" + versionNum);\r\n\t\tsendOutput(\"by \" + author);\r\n\t\tprintMenu();\r\n\t}", "public void startProgram() {\n this.displayBanner();\n// prompt the player to enter their name Retrieve the name of the player\n String playersName = this.getPlayersName();\n// create and save the player object\n User user = ProgramControl.createPlayer(playersName);\n// Display a personalized welcome message\n this.displayWelcomeMessage(user);\n// Display the Main menu.\n MainMenuView mainMenu = new MainMenuView();\n mainMenu.display();\n }", "public void startProgram()\r\n\t{\r\n\t\tview.displayPlayerNames();\r\n\t\tview.loadGameData();\r\n\t\tview.displayGame();\r\n\t}", "public void runProgram()\n\t{\n\t\tintro();\n\t\tfindLength();\n\t\tguessLetter();\n\t\tguessName();\n\t}", "public RunMe() throws IOException {\n\n\t\t// Load data\n\t\tloadDataMap();\n\t\t\n\t\t// Start server\n\t\tcfg = createFreemarkerConfiguration();\n\t\tsetPort(8081);\n\t\tinitializeRoutes();\n\t}", "public void readPoemFiles(){\n try (Scanner fileScan = new Scanner(new File(\"poems.txt\"))) {\n //Poems.txt consist of a header (poet and theme) plus verse lines.\n //First loop reads the header and creates object 'PoetAndTheme'.\n while (fileScan.hasNextLine()){\n String themeAndPoet = fileScan.nextLine();\n PoetAndTheme addToList = new PoetAndTheme(themeAndPoet);\n //Second loop reads verse lines and adds them to object 'PoetAndTheme'.\n while(fileScan.hasNextLine()){\n String verseLine = fileScan.nextLine();\n if (verseLine.isEmpty()){\n break;\n }\n addToList.addVerseLine(verseLine);\n }\n poetsAndThemesList.add(addToList);\n }\n \n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public void start() {\n io.println(\"Welcome to 2SAT-solver app!\\n\");\n String command = \"\";\n run = true;\n while (run) {\n while (true) {\n io.println(\"\\nType \\\"new\\\" to insert an CNF, \\\"help\\\" for help or \\\"exit\\\" to exit the application\");\n command = io.nextLine();\n if (command.equals(\"new\") || command.equals(\"help\") || command.equals(\"exit\")) {\n break;\n }\n io.println(\"Invalid command. Please try again.\");\n }\n switch (command) {\n case \"new\":\n insertNew();\n break;\n case \"help\":\n displayHelp();\n break;\n case \"exit\":\n io.println(\"Thank you for using this app.\");\n run = false;\n }\n\n }\n }", "static void startJavaTrainer() {\n initializeMap();\n promptUser();\n startProgram();\n }", "public void start(){\n\t\tdo{\n\t\t\tMessage<T> msg= input.read();\n\t\t\tif (!msg.getQuit() && !msg.getFail() ){\n\t\t\t\tconsume(msg.getContent());\n\t\t\t}\n\t\t\tif (msg.getQuit()){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}while(true);\n\t\t\n\t}", "public void start()\n {\n uploadDataFromFile();\n menu.home();\n home();\n }", "public void mainPart(){\n this.speakerMessageScreen.prompt();\n String choice = this.scanner.nextLine();\n switch (choice) {\n case \"0\":\n this.programController.goToPreviousScreenController();\n break;\n case \"1\":\n this.reply();\n this.mainPart();\n return;\n case \"2\":\n this.broadCast();\n this.mainPart();\n return;\n case \"3\":\n this.programController.setNewScreenController(new InboxScreenController(programController));\n break;\n default:\n this.speakerMessageScreen.invalidInput(choice);\n this.mainPart();\n return;\n }\n this.end();\n }", "public void load() {\n mapdb_ = DBMaker.newFileDB(new File(\"AllPoems.db\"))\n .closeOnJvmShutdown()\n .encryptionEnable(\"password\")\n .make();\n\n // open existing an collection (or create new)\n poemIndexToPoemMap_ = mapdb_.getTreeMap(\"Poems\");\n \n constructPoems();\n }", "@Override\n\tprotected void setup() {\n\t\t{\n\t\t\tKeyPairGenerator kpg = null;\n\t\t\ttry {\n\t\t\t\tkpg = KeyPairGenerator.getInstance(\"RSA\");\n\t\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t\te.printStackTrace(); // There is such an algorithm\n\t\t\t}\n\t\t\tkpg.initialize(GlobalPreferences.getKeysize(), new SecureRandom());\n\t\t\tkeys = kpg.genKeyPair();\n\t\t\t\n\t\t\tMLoginInitiate loginInitiate = new MLoginInitiate(keys.getPublic());\n\t\t\tputMessage(loginInitiate);\n\t\t}\n\t\t\n\t\twhile(!loginCompleted)\n\t\t{\n\t\t\ttry {\n\t\t\t\tThread.sleep(50); // Wait a bit for response\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tputMessage(new MLoginCompleted(loginSuccess, -2, \"admin\", \"admin\", false));\n\t}", "public void run() {\n\t\tprepareVariables(true);\n\t\t\n\t\t// Prepares Map Tables for Song and Key Info.\n\t\tprepareTables();\n\t\t\n\t\t// Selects a Random Song.\n\t\tchooseSong(rgen.nextInt(0, songlist.size()-1));\n\t\t\n\t\t// Generates layout.\n\t\tgenerateLabels();\n\t\tgenerateLines();\n\t\t\n\t\t// Listeners\n\t\taddMouseListeners();\n\t\taddKeyListeners();\n\t\t\n\t\t// Game Starts\n\t\tplayGame();\n\t}", "public void run() {\n\t\tsetupReadline();\n\n\t\tif (Options.cmdFilename != null) {\n\t\t\tcmdOpen(Options.cmdFilename);\n\t\t} else {\n\t\t\tLog.verbose(\"Enter `help' for a list of available commands.\");\n\t\t\t\n\t\t\tif (Options.doPLUGIN) {\n\t\t\t\tLog.verbose(\"Enter `plugins' for a list of available plugin commands.\");\n\t\t\t}\n\t\t}\n\n while (!fFinished) {\n Thread.yield();\n Log.resetOutputFlag();\n\n String line = \"\";\n\n // get current readline (may be e.g. console or file)\n fReadline = fReadlineStack.getCurrentReadline();\n try {\n if (fMultiLineMode) {\n while (true) {\n // use special prompt to emphasize multi-line input\n String oneLine = fReadline.readline(CONTINUE_PROMPT);\n // end of input or a single dot terminates the input\n // loop\n if (oneLine == null || oneLine.equals(\".\"))\n break;\n line += oneLine + Options.LINE_SEPARATOR;\n }\n fMultiLineMode = false;\n } else {\n line = fReadline.readline(PROMPT);\n }\n } catch (IOException ex) {\n Log.error(\"Cannot read line: \" + ex.getMessage());\n }\n if (line != null) {\n \tif (!fReadline.doEcho())\n \t\tUSEWriter.getInstance().protocol(line);\n \t\n processLineSafely(line);\n } else {\n fFinished = fReadlineStack.popCurrentReadline();\n setFileClosed();\n \n if (fFinished && Options.quiet)\n processLineSafely(\"check\");\n }\n }\n cmdExit();\n }", "public void runProgram() {\n\n\t\tSystem.out.println(\"\\n Time to start the machine... \\n\");\n\n\t\tpress.pressOlive(myOlives);\n\n\t\tSystem.out.println(\"Total amount of oil \" + press.getTotalOil());\n\t}", "public void start(){\n CoffeeMakerHelper coffeeMakerHelper = new CoffeeMakerHelper(inputArgs[0]);\n coffeeMakerService = coffeeMakerHelper.parseJsonFile();\n computeCoffeeMaker();\n }", "public void run() {\n //Moved Observers NOV 15\n if (messagingSystem.speakerMessengerController != null) {\n this.addObserver(messagingSystem.speakerMessengerController); //would be created\n }\n if (messagingSystem.speakerMessengerController != null) {\n this.addObserver(messagingSystem.speakerMessengerController.userInfo);\n }\n CSVReader fileReader = new CSVReader(\"phase1/src/Resources/Talks.csv\");\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\n for(ArrayList<String> talkData: fileReader.getData()){\n this.talkManager.createTalk(talkData.get(0), talkData.get(1), talkData.get(2),\n talkData.get(3), LocalDateTime.parse(talkData.get(4), formatter));\n }\n setTalkManager();\n messagingSystem.run();\n scheduleSystem.run();\n createSignUpAttendees();\n if (this.user instanceof Attendee) {\n userScheduleController.setSignUpMap(signUpMap);\n }\n if (this.user instanceof Organizer) {\n orgScheduleController.setSignUpMap(signUpMap);\n }\n }", "private void runApp() {\n parkinglots = new ArrayList<>();\n accounts = new ArrayList<>();\n input = new Scanner(System.in);\n loadParkingLots();\n loadAccounts();\n\n processLoginCommand();\n processMainMenuCommand();\n\n saveAccounts();\n System.out.println(\"\\ngoodbye!\");\n }", "public void run()\n\t{\n\t\tMSetup ms = new MSetup(Env.getCtx(), m_WindowNo);\n\t\tm_frame.setBusyTimer(45);\n\t\t// Step 1\n\t\tboolean ok = ms.createClient(fClientName.getText(), fOrgName.getText(),\n\t\t\tfUserClient.getText(), fUserOrg.getText());\n\t\tString info = ms.getInfo();\n\n\t\tif (ok)\n\t\t{\n\t\t\t// Generate Accounting\n\t\t\tKeyNamePair currency = (KeyNamePair)fCurrency.getSelectedItem();\n\t\t\tif (!ms.createAccounting(currency,\n\t\t\t\tfProduct.isSelected(), fBPartner.isSelected(), fProject.isSelected(),\n\t\t\t\tfMCampaign.isSelected(), fSRegion.isSelected(),\n\t\t\t\tm_file))\n\t\t\t{\n\t\t\t\tADialog.error(m_WindowNo, this, \"AccountSetupError\");\n\t\t\t\tdispose();\n\t\t\t}\n\t\t\t// Generate Entities\n\t\t\tKeyNamePair p = (KeyNamePair)fCountry.getSelectedItem();\n\t\t\tint C_Country_ID = p.getKey();\n\t\t\tp = (KeyNamePair)fRegion.getSelectedItem();\n\t\t\tint C_Region_ID = p.getKey();\n\t\t\tms.createEntities(C_Country_ID, fCity.getText(), C_Region_ID, currency.getKey());\n\t\t\tinfo += ms.getInfo();\n\t\t\t//\tCreate Print Documents\n\t\t\tPrintUtil.setupPrintForm(ms.getAD_Client_ID());\n\t\t}\n\n\t\tADialog.info(m_WindowNo, this, \"VSetup\", info);\n\t\tdispose();\n\t}", "public void setup() {\r\n\t\tthis.greet(\"Hello, my name is \" + this.name + \", this message is brought to you from the AI.java file under the greet method!\");\r\n\t\t//TODO ask for name\r\n\t\t// check if setup file exists and make sure nothing is invalid\r\n\t\t/*if(!(fileManager.getFile(\"settings.cy\").exists())) { // TODO finish this\r\n\t\t\tFile settings = fileManager.createFile(\"settings\");\r\n\t\t\tint i = 0;\r\n\t\t\tfileManager.writeToFile(settings, \"color: red\", i++);\r\n\t\t\t// no other settings at the moment\r\n\t\t}*/\r\n\t}", "public static void main(String[] args) {\n // Interact\n System.out.println(\"Welcome to my terrain checker:\");\n loadPgm(); actionPrompt();\n System.out.println(\"Bye.\");\n }", "public SecretPoemGenerator(){\n scanner = new Scanner(System.in);\n poetsAndThemesList = new ArrayList<>();\n }", "@Override\n\tprotected void start() {\n\t\tif (Cfg.DEBUG) {\n\t\t\tCheck.log(TAG + \" (actualStart)\");\n\t\t}\n\t\treadChatMessages();\n\t}", "public void start(){\n this.speakerMessageScreen.printScreenName();\n mainPart();\n }", "public static void proManMain(){\n\n //Displaying the menu options by using the system out method\n System.out.println(\"1 - Create a new Project Manager Profile\");\n System.out.println(\"2 - Search for Project Manager Profile\\n\");\n\n System.out.println(\"0 - Continue\");\n }", "public static void startProcessBots(boolean visualize) {\n\t\tConfig config = new Config();\n\t\t\n\t\tconfig.bot1Init = \"process:java -cp bin conquest.bot.BotStarter\";\n\t\tconfig.bot2Init = \"dir;process:./bin;java conquest.bot.BotStarter\";\n\t\t\t\t\n\t\tconfig.visualize = visualize;\n\t\t\n\t\tconfig.replayLog = new File(\"./replay.log\");\n\t\t\n\t\tRunGame run = new RunGame(config);\n\t\tGameResult result = run.go();\n\t\t\n\t\tSystem.exit(0);\n\t}", "public void run() throws TException, IOException\n {\n System.out.println(\"API version: \"+extension.apiVersion());\n\n // Send a message to the SP log\n extension.info(\"Hello Smart Pendant, I'm MyExtension\");\n\n\n // read YML text from the file\n String yml = new String(Files.readAllBytes(Paths.get(\"MyUtility.yml\")), StandardCharsets.UTF_8);\n // and register it with the pendant\n var errors = pendant.registerYML(yml);\n\n // Register it as a Utility window\n pendant.registerUtilityWindow(\"myutil\",true,\"MyUtility\",\n \"YML Util\", \"YML Util\",\n UtilityWindowWidth.FullWidth, UtilityWindowHeight.HalfHeight,\n UtilityWindowExpansion.expandableNone);\n\n // run 'forever' (or until API service shutsdown) \n extension.run(() -> false);\n }", "public Poem(){}", "public void run() {\r\n\t\tSystem.out.println(\"Welcome \" + this.name);\r\n\r\n\t\ttry {\r\n\t\t\tPrintWriter out_stream = new PrintWriter(this.client.getOutputStream());\r\n\t\t\tInputStream in_stream = this.client.getInputStream();\r\n\t\t\tScanner in = new Scanner(in_stream);\r\n\r\n\t\t\twhile(!this.client.isClosed()) {\r\n\t\t\t\tif (in_stream.available() > 0 && in.hasNextLine()) {\r\n\t\t\t\t\tif(board.getpt().equals(\"B\")){\r\n\t\t\t\t\t\t//board.incBlackScore();\r\n\t\t\t\t\t\tboard.resetpt();\r\n\t\t\t\t\t} else if (board.getpt().equals(\"W\")){\r\n\t\t\t\t\t\t//board.incWhiteScore();\r\n\t\t\t\t\t\tboard.resetpt();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tString line = in.nextLine();\r\n\t\t\t\t\t\tint index = line.indexOf(\" \");\r\n\t\t\t\t\t\tint x = Integer.parseInt(line.substring(0, index));\r\n\t\t\t\t\t\tint y = Integer.parseInt(line.substring(index + 1));\r\n\t\t\t\t\t\tboard.newmove(x , y);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this.messages.isEmpty()) {\r\n\t\t\t\t\tString next = null;\r\n\t\t\t\t\tsynchronized(this.messages) {\r\n\t\t\t\t\t\tnext = (String) this.messages.pop();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tout_stream.println(next);\r\n\t\t\t\t\tout_stream.flush();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException var8) {\r\n\t\t\tvar8.printStackTrace();\r\n\t\t}\r\n\t}", "public void startUp() {\n\t\twhile (startupSettings.getContinue()) {\n\t\t\tstartView.showLogo();\n\t\t\tthis.setupNewMatch();\n\t\t\tstartView.showNewMatchStarting();\n\t\t\tcurrentMatch.start();\n\t\t\tstartupSettings = startView.askNewStartupSettings();\n\t\t}\n\t\tthis.ending();\n\t}", "@Test \n\tpublic void generateParagraphsTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\n\t\t// select 'paragraphs' radio button \n\t\thomePage.selectContentType(\"paragraphs\");\n\n\t\t// enter '10' in the count field \n\t\thomePage.inputCount(\"10\");\n\n\t\t// click \"Generate Lorum Ipsum\" button\n\t\thomePage.generateLorumIpsum();\n\t\tGeneratedPage generatedPage = new GeneratedPage(driver);\n\n\t\t// validate the number of text paragraphs generated \n\t\tint paragraphCount = generatedPage.getActualGeneratedCount(\"paragraphs\");\n\t\tAssert.assertTrue(paragraphCount == 10);\n\n\t\t// validate the report text // ex: \"Generated 10 paragraphs, 1106 words, 7426 bytes of Lorem Ipsum\"\n\t\tAssert.assertEquals(\"Generated \" + generatedPage.getReport(\"paragraphs\") + \n\t\t\t\t\" paragraphs, \" + generatedPage.getReport(\"words\") + \n\t\t\t\t\" words, \" + generatedPage.getReport(\"bytes\") + \n\t\t\t\t\" bytes of Lorem Ipsum\", generatedPage.getCompleteReport());\n\t}", "public void run() {\n // attempt to load Vending Machine Items\n try {\n service.loadItems();\n } catch (FailedLoadOfVendingItemsException ex) {\n view.displayErrorLine(\n \"Warning: Unable to load vending items into memory\"\n );\n }\n \n boolean active = true;\n \n String[] mainMenuOptions = {\n \"1. Add Funds\",\n \"2. Purchase an Item\",\n \"3. List Items\",\n \"4. Exit\"\n };\n \n view.displayVendingItems(service.getAllItems());\n view.displayLine(\"\");\n while(active) {\n view.displayMainMenuOptions(mainMenuOptions);\n\n view.displayInformationalLine(\n \"Funds in Machine: $\" + service.getFundsAvailable()\n );\n \n int choice = view.intSupplier(\n \"Pick an option\",\n val -> (1 <= val) && (val <= 4), \n \"The input must be some integer in the domain [1, 4]\"\n ).get();\n \n switch (choice) {\n case 1:\n addFunds();\n break;\n case 2:\n purchaseItem();\n break;\n case 3:\n listItems();\n break;\n case 4:\n active = false;\n break;\n default:\n view.displayErrorLine(\"UNKNOWN COMMAND\");\n break;\n }\n }\n \n // attempt to save items\n try {\n service.saveItems();\n } catch (FailedSaveOfVendingItemsException ex) {\n view.displayErrorLine(\"Warning: Unable to save vending items\");\n }\n \n // free all resources\n view.close();\n service.close();\n }", "public void start() {\n\n String pathFile = mainMenu.menuTakePathFile();\n int countThreads = mainMenu.menuCountThreads();\n int downloadSpeed = mainMenu.menuDownloadSpeed();\n String folderForDownload = mainMenu.menuPathDownload();\n\n List<String> urls = null;\n try {\n urls = bootPreparation.parsingFileForUrls(pathFile);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n List<String> fileNames = bootPreparation.parsingListUrlsForNames(urls);\n\n multiThreadedDownloader.startDownloading(countThreads, urls.size(), urls, fileNames, downloadSpeed, folderForDownload);\n\n }", "public void start() {\n\t\tSystem.out.println(\"BMW.........start!!!.\");\n\t}", "public void run() {\n ui.printStartingMessage();\n boolean isExit = false;\n\n while (!isExit) {\n isExit = parser.determineCommand();\n }\n\n storage.saveToFile(taskList);\n }", "public static void main(String[] args) {\n //Milestone 2\n //create a scanner for reading user input and a random number\n //generator with Config.SEED as the seed\n Scanner sc = new Scanner( System.in );\n Random rdm = new Random( Config.SEED );\n\n \n\n\n //Milestone 3\n //How the program starts depends on the command-line arguments.\n // Command-line arguments can be names of therapists for example:\n // Eliza Joe Laura\n // If no command-line arguments then the therapists name is Eliza\n // and this reads a file with that name and the Config.RESPONSE_FILE_EXTENSION.\n // Example filename: Eliza.rsp\n // If only one command-line argument, then read the responses from \n // the corresponding file with Config.RESPONSE_FILE_EXTENSION. \n // If there is more than one command-line argument then offer them\n // as a list of people to talk with. For the three therapists above the prompt is\n // \"Would you like to speak with Eliza, Joe, or Laura?\"\n // When a user types a name then read the responses from the file which\n // is the selected name and Config.RESPONSE_FILE_EXTENSION extension.\n // Whatever name the user types has the extension appended and\n // is read using loadResponseTable. If loadResponseTable can't load\n // the file then it will report an error.\n String tName = \"Eliza\";\n String usrRes = \"\";\n ArrayList<String> rsp = new ArrayList<String>();\n String r = \"\";\n if( args.length > 0 )\n {\n\t\t\tr = \"Would you like to speak with\";\n\t\t\tfor( int i = 0 ; i < args.length - 1 ; i++ )\n\t\t\t\tr = r + \" \" + args[i] +\",\";\n\t\t\tr = r + \" or \" + args[args.length-1] + \"?\"; \n\t\t\tSystem.out.println( r );\n\t\t\trsp.add( r );\n\t\t\tr = \"\";\n\t\t\t\n\t\t\tusrRes = sc.nextLine();\n\t\t\trsp.add(usrRes);\n\t\t\ttName = usrRes;\n\t\t}\n\t\t\n\t\t\n\t\tString fName = tName + Config.RESPONSE_FILE_EXTENSION;\n\t\t//System.out.println( tName );\n\t\tArrayList<ArrayList<String>> rspTable = loadResponseTable( fName );\n\n\n //Milestone 2\n //name prompt\n \n r = \"Hi I'm \" + tName + \", what is your name?\";\n System.out.println( r );\n rsp.add( r );\n r = \"\";\n\t\tusrRes = sc.nextLine();\n\t\trsp.add(usrRes);\n\t\t\n String usrName = usrRes;\n \n //Milestone 2\n //welcome prompt\n\t\t\n\t\tr = \"Nice to meet you \" + usrName + \". What is on your mind?\";\n\t\tSystem.out.println( r );\n\t\trsp.add( r );\n\t\tr = \"\";\n \n \n //Milestone 2\n //begin conversation loop\n\t\twhile( true )\n\t\t{\n //Milestone 2\n //obtain user input\n\t\t\tusrRes = sc.nextLine();\n\t\t\trsp.add( usrRes );\n\t\t\t//System.out.println( usrRes );\n\t\t\t\n //Milestone 2\n //prepareInput\n String[] prepedUsrRes = prepareInput(usrRes);\n\n //Milestone 3\n //if no quit words then prepareResponse\n \n \n\n\n //Milestone 2\n //end loop if quit word\n \n /*\n\t\t\tfor( String str : prepedUsrRes )\n\t\t\t\tSystem.out.println( str ); \n ArrayList<String> temp = separatePhrases( usrRes );\n System.out.println( temp.get(0) );\n for( String str : temp )\n\t\t\t\tSystem.out.println( str );\n\t\t\t\t* */\n\t\t\t\n\n if( foundQuitWord( separatePhrases( usrRes ) ) )\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tr = prepareResponse( prepedUsrRes , rdm , rspTable );\n rsp.add( r );\n System.out.println( r );\n r = \"\";\n\t\t}\n\n\n //Milestone 2\n //ending prompt\n r = \"Goodbye \" + usrName + \".\";\n System.out.println( r );\n rsp.add( r );\n r = \"\";\n\n \n //Milestone 3\n //Save all conversation (user and system responses) starting\n //with this program saying \"Hi I'm...\" and concludes with\n //\"Goodbye <name>.\".\n //Always prompt the user to see if they would like to save a \n //record of the conversation. If the user enters a y or Y as the \n //first non-whitespace character then prompt for filename and save, \n //otherwise don't save dialog. After successfully saving a dialog \n //print the message \"Thanks again for talking! Our conversation is saved in: <filename>\".\n //If saveDialog throws an IOException then catch it, print out the error:\n // \"Unable to save conversation to: \" <name of file> \n //Repeat the code prompting the user if they want to save the dialog.\n\t\tSystem.out.println( \"Would you like to save a copy of this dialog? [y/n]\" );\n\t\tusrRes = sc.nextLine();\n\t\tboolean done = false;\n\t\twhile( !done )\n\t\t{\n\t\t\tif ( usrRes.charAt(0) == 'Y' || usrRes.charAt(0) == 'y' )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tsaveDialog( rsp , tName + \"_dialog.txt\" );\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t\tcatch( IOException e )\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println( \"Unable to save conversation to: <\" + tName + \"_dialog.txt>. Would you like to try again?[y/n]\" );\n\t\t\t\t\tusrRes = sc.nextLine();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t \n }", "public static void main(String[] args) throws Exception{\n locations = World.getInstance();\n player = Player.getInstance();\n\n startMessage();\n\n try(BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))){\n playerName = reader.readLine();\n printConstantMessage(Constants.HELLO_MSG, playerName);\n System.out.println();\n\n player.moveTo(locations.stream().findFirst().get());\n\n while(runGame){\n System.out.print(Constants.PRE_INPUT_TEXT);\n parseInput(reader.readLine());\n }\n }\n }", "public void play() throws FileNotFoundException, IOException, Throwable {\n Time time = new Time();\n initGame();\n printWelcome();\n time.start();\n data.logWrite(System.lineSeparator() + System.lineSeparator() + \" >>> Starting new game <<< \" + System.lineSeparator() + System.lineSeparator());\n\n boolean finished = false;\n\n while (!finished) {\n Command command = parser.getCommand();\n finished = processCommand(command);\n }\n time.stopTime();\n System.out.println(\"Thank you for playing. Good bye.\" + \"\\n\" + \"You spend: \" + Time.getSecondsPassed() + \" seconds playing the game\");\n //added to shutdown\n System.exit(0);\n }", "public void startreading() {\n\t\tSystem.out.println(\"You are reading a book written by \" + getAuthor() + \" and it's title is \" + title);\n\t}", "@Override\n public void start(){\n // Retrieve the configuration, and init the verticle.\n JsonObject config = config();\n init(config);\n // Every `period` ms, the given Handler is called.\n vertx.setPeriodic(period, l -> {\n mining();\n send();\n });\n }", "public void play()//Method was given\n { \n createRooms();\n createItems();\n printWelcome();\n \n // Enter the main command loop. Here we repeatedly read commands and\n // execute them until the game is over.\n \n finished = false;\n while (! finished)\n {\n Command command = parser.getCommand();\n finished = processCommand(command);\n if (currentRoom == exitRoom)\n {\n finished = true;\n }\n }\n System.out.println(\"Thank you for playing. Goodbye.\");\n }", "public void startPage() {\n\t\tthis.dataComposer.startPage();\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tMinetunes.writeChatMessage(mc.theWorld, twd\n\t\t\t\t\t\t.downloadExampleWorld(beQuiet,\n\t\t\t\t\t\t\t\tTDConfig.MC_CURRENT_VERSION));\n\t\t\t}", "void doRun() throws IOException\n\t{\n\t\tif (m_session != null)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"sessionInProgress\")); //$NON-NLS-1$\n\t\t\treturn;\n\t\t}\n\n\t\tSessionManager mgr = Bootstrap.sessionManager();\n\n\t\tif (hasMoreTokens())\n\t\t{\n\t\t\tif (!setLaunchURI(restOfLine()))\n\t\t\t\treturn;\n\t\t}\n\n\t\tif (m_connectPort == null)\n\t\t\tmgr.startListening();\n\n\t\ttry\n\t\t{\n\t\t\tif (m_connectPort != null) {\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"waitingToConnectToPlayer\")); //$NON-NLS-1$\n\t\t\t\tm_session = mgr.connect(Integer.valueOf(m_connectPort), null);\n\t\t\t}\n\t\t\telse if (m_launchURI == null)\n\t\t\t{\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"waitingForPlayerToConnect\")); //$NON-NLS-1$\n\t\t\t\tm_session = mgr.accept(null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"launchingWithUrl\") + m_newline + m_launchURI); //$NON-NLS-1$\n\t\t\t\tm_session = mgr.launch(m_launchURI, null, true, null, null);\n\t\t\t}\n\n\t\t\t// now see what happened\n\t\t\tif (m_session == null)\n\t\t\t{\n\t\t\t\t// shouldn't have gotten here\n\t\t\t\tthrow new SocketTimeoutException();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"playerConnectedSessionStarting\")); //$NON-NLS-1$\n\t\t\t\tinitSession(m_session);\n\n\t\t\t\t// pause for a while during startup, don't let exceptions ripple outwards\n\t\t\t\ttry { waitTilHalted(); } catch(Exception e) {}\n\n\t\t\t\t// pause for a while during startup, don't let exceptions ripple outwards\n\t\t\t\ttry { waitForMetaData(); } catch(Exception e) {}\n\n\t\t\t\tsetInitialSourceFile();\n\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"setBreakpointsThenResume\")); //$NON-NLS-1$\n\n\t\t\t\t// now poke to see if the player is good enough\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (m_session.getPreference(SessionManager.PLAYER_SUPPORTS_GET) == 0 )\n\t\t\t\t\t\terr(m_newline + getLocalizationManager().getLocalizedTextString(\"warningNotAllCommandsSupported\")); //$NON-NLS-1$\n\t\t\t\t}\n\t\t\t\tcatch(Exception npe) {}\n\t\t\t}\n\t\t}\n\t\tcatch (FileNotFoundException fnf)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"uri\", fnf.getLocalizedMessage()); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"fileDoesNotExist\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch (SocketTimeoutException ste)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"failedToConnect\")); //$NON-NLS-1$\n\t\t}\n\t\tcatch (IOException io)\n\t\t{\n\t\t\terr(io.getLocalizedMessage());\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\t// turn off listening, to allow other session to connect\n\t\t\tif (m_connectPort == null)\n\t\t\t\tmgr.stopListening();\n\t\t}\n\t}", "public void init() throws IOException {\n try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter log = new BufferedWriter(new FileWriter(new File(\"./log.txt\")))) {\n int countLine = generatorAnswersList();\n String text;\n String answer;\n do {\n text = bufferedReader.readLine();\n if (text.equalsIgnoreCase(stop)) {\n setStop(true);\n log.write(String.format(\"user: %s%s\", text, System.getProperty(\"line.separator\")));\n System.out.println(text);\n }\n if (text.equalsIgnoreCase(contin)) {\n setStop(false);\n log.write(String.format(\"user: %s%s\", text, System.getProperty(\"line.separator\")));\n System.out.println(text);\n answer = generatorResponse(countLine);\n log.write(String.format(\"bot: %s%s\", answer, System.getProperty(\"line.separator\")));\n System.out.println(answer);\n continue;\n }\n if (text.equalsIgnoreCase(end)) {\n log.write(String.format(\"user: %s%s\", text, System.getProperty(\"line.separator\")));\n System.out.println(text);\n }\n if (!isStop() && !text.equalsIgnoreCase(end)) {\n log.write(String.format(\"user: %s%s\", text, System.getProperty(\"line.separator\")));\n System.out.println(text);\n answer = generatorResponse(countLine);\n log.write(String.format(\"bot: %s%s\", answer, System.getProperty(\"line.separator\")));\n System.out.println(answer);\n }\n }\n while (!text.equalsIgnoreCase(end));\n }\n }", "public void run() {\n // Initialize\n imports = new HashSet<>();\n lines = new ArrayList<>();\n\n // Read and merge source files\n final File folder = new File(\"src\");\n recurseOverFolder(folder);\n\n // Output to file\n outputFile();\n }", "public void start() {\n\t\tstartFilesConfig(true);\n\t\tstartSpamFilterTest(false);\n\t}", "private void start() throws IOException{\n\t\tprintMainMenu();\n\t\t//get a valid input from the user and if it is 2, then exit\n\t\tif (getValidInput(validMainMenuInputs) == 2) {\n\t\t\tprint(\"Goodbye!\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\t//else we try to login\n\t\tlogin();\n\t}", "public ProgramManager() {\n display = new DisplayManager();\n fileName = \"resources/aLargeFile\";\n try {\n fileReader = new BufferedReader(new FileReader(fileName));\n } catch (FileNotFoundException e) {\n logger.error(e.getMessage());\n }\n wordStorage = new WordStorage();\n }", "public void doProgram() throws LexemeException {\n\t\tlogMessage(\"<program>-->{<class>}\");\n\t\tfunctionStack.push(\"<program>\");\n\t\t// while(lexAnalyser.peekToken().getType() != \"EOSTREAM_\")\n\t\twhile (ifPeek(\"CLASS_\")) {\n\t\t\tdoClass(\"<program>\");\n\t\t}\n\t\t// else exit program\n\t\twhile (!ifPeek(\"EOSTREAM_\")) {\n\t\t\tlogErrorMessage(peekToken.getType(), \"EOSTREAM_\");\n\t\t\tpeekToken.setType(\"EOSTREAM_\");\n\t\t}\n\t\tSystem.out.println(\"Parser Finished with no errors found\");\n\t\tlog.logMsg(\"Parser Finished with no errors found\");\n\t\tlog.closeLog();\n\t\tfunctionStack.pop();\n\t}", "public static void ATMStartScreen() throws FileNotFoundException, IOException, InterruptedException {\r\n\t\tSystem.out.println(\"Welcome to Maze Bank Automated Teller Machine!\");\r\n\t\tSystem.out.println(\"1 = Open a new account.\" + \"\\n2 = Log In to a current account.\" + \"\\n3 = Exit.\");\r\n\t\tint select = 0;\r\n\r\n\t\tdo {\r\n\t\t\tselect = userInput.nextInt();\r\n\t\t\tswitch (select) {\r\n\t\t\tcase 1:\r\n\t\t\t\tATMAccount accountNew = createAccount();\r\n\t\t\t\tparseAccountDB(accountNew);\r\n\t\t\t\tuserChoice(accountNew);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tATMAccount accountExisting = LogIn();\r\n\t\t\t\tuserChoice(accountExisting);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\t\t} while (select != 3);\r\n\t}", "public void start()\n\t{\n\t\taskUser();\n\t\tloop();\n\n\t}", "public Main()\n {\n createUsers();\n createFriendships();\n createMessages();\n\n }", "@BeforeMethod\n\tpublic void openAppp() throws IOException\n\t{\n\t\tSystem.out.println(\"Monefy Application launched successfully:\");\n\t\n\t}", "public static void Welcome (){ //this method outputs welcome information and possibly other relevant information to user\r\n System.out.println(\"Welcome to the Maze Pathfinder Program! \\n\\nThis program can either create a random maze or accept input from a file to create one. Then the program will find a path from the start point to the end point in the maze.\\nEnjoy! \");\r\n System.out.println(\"\\n\");\r\n }", "public void startGame() {\n\t\tinitChips();\n\t\tassignAndStartInitialProjects();\n\t}", "@Override\n\tpublic void onStart()\n\t{\n\t\ttry{\n\t\t\tFile f = new File(getDirectoryData() + \"\\\\\" + getParameters() + \".bot\");\n\t\t\tlog(\"creating file \" + getDirectoryData() + \"\\\\\" + getParameters() + \".bot\");\n\t\t\tf.deleteOnExit();\n\t\tPrintWriter out = new PrintWriter(f);\n\t\tout.println(myPlayer().getName());\n\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void startDocument ()\n\t\t{\n\t\t\t//System.out.println(\"Start document\");\n\t\t}", "public static void main(String[] args) {\n\n\t\tConfigurationUtils.loadConfigurationFile();\n\t\tFbBotMillContext.getInstance().setup(\n\t\t\t\tConfigurationUtils.getConfiguration().getProperty(\n\t\t\t\t\t\tFB_BOTMILL_PAGE_TOKEN),\n\t\t\t\tConfigurationUtils.getConfiguration().getProperty(\n\t\t\t\t\t\tFB_BOTMILL_VALIDATION_TOKEN));\n\n\t\tFbBotMillThreadSettingsConfiguration\n\t\t\t\t.setGetStartedButton(\"get_started\");\n\t\tFbBotMillThreadSettingsConfiguration\n\t\t\t\t.setGreetingMessage(\"Hello, I'm a simple BotMill-based bot!\");\n\t}", "public static void main(String[] args)\n {\n Pokeball pokeball = new Pokeball();\n Pokeball greatball = new Greatball();\n Pokeball ultraball = new Ultraball();\n Pokeball masterball = new Masterball();\n ArrayList<AbstractPokemon> ashPokemon = new ArrayList<AbstractPokemon>();\n ashPokemon.add(new Charmander());\n ashPokemon.add(new Squirtle());\n ashPokemon.add(new Bulbasaur());\n PokemonTrainer ash = new PokemonTrainer(\"Ash\", ashPokemon, AbstractPokemon.Type.ANY_TYPE, masterball);\n ActorWorld world = new ActorWorld();\n AbstractPokemon charmander = new Charmander();\n AbstractPokemon squirtle = new Squirtle();\n AbstractPokemon bulbasaur = new Bulbasaur();\n AbstractPokemon vulpix = new Vulpix();\n AbstractPokemon poliwhirl = new Poliwhirl();\n AbstractPokemon sunkern = new Sunkern();\n AbstractPokemon magby = new Magby();\n AbstractPokemon magikarp = new Magikarp();\n AbstractPokemon oddish = new Oddish();\n String[] worldChoices = {\"Randomly Generated\", \"Blank\", \"Cancel\"};\n int worldSelection = JOptionPane.showOptionDialog(null, \"Please select the world template:\", \"World Selection\",\n JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, worldChoices, worldChoices[0]);\n if (worldSelection == 2)\n {\n JOptionPane.showMessageDialog(null, \"No world chosen. Program will terminate.\", \"World Selection\", JOptionPane.PLAIN_MESSAGE);\n System.exit(0);\n }\n else if (worldSelection == 0)\n {\n spawn(charmander, world);\n spawn(squirtle, world);\n spawn(bulbasaur, world);\n spawn(vulpix, world);\n spawn(poliwhirl, world);\n spawn(sunkern, world);\n spawn(magby, world);\n spawn(magikarp, world);\n spawn(oddish, world);\n spawn(ash, world);\n }\n world.show();\n }", "public void start()\n\t{\n\t\tChatbotPanel myAppPanel = (ChatbotPanel) baseFrame.getContentPane();\n\t\tmyAppPanel.displayTextToUser(startMessage);\n\t\t\n\t\t\n//\t\tString result = applicationView.showChatbot(startMessage);\n\t\t\t\n//\t\twhile(!mySillyChatbot.quitChecker(result))\n//\t\t{\n//\t\t\tresult = mySillyChatbot.processText(result);\n//\t\t\tresult = applicationView.showChatbot(result);\n//\t\t}\n//\t\tquit();\n\t}", "protected void program() {\n m_errorHandler.startNonT(NonT.PROGRAM);\n match(TokenCode.CLASS);\n match(TokenCode.IDENTIFIER);\n match(TokenCode.LBRACE);\n variableDeclarations();\n if (m_errorHandler.errorFree()) {\n m_generator.generate(TacCode.GOTO, null, null, new SymbolTableEntry(\"main\"));\n }\n methodDeclarations();\n match(TokenCode.RBRACE);\n m_errorHandler.stopNonT();\n if (m_errorHandler.errorFree()) {\n m_generator.print();\n }\n }", "public static void start() {\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\t\tDate dtnow = new Date();\r\n\t\t\t//Verify email queue\r\n\t\t\tIterator<Mailtogo> it = new MailtogoDAO().getQueue().iterator();\r\n\t\t\twhile(it.hasNext())\r\n\t\t\t{\r\n\t\t\t\tMailtogo mtg = (Mailtogo)it.next();\r\n\t\t\t\tmtg.setMtg_status(\"P\");\r\n\t\t\t\tmtg.save();\r\n\t\t\t\tdtnow = new Date();\r\n\t\t\t\tSystem.out.println(format.format(dtnow) + \" -> Sending message \" + mtg.getMtg_id());\r\n\t\t\t\tsend(mtg);\r\n\t\t\t}\r\n\t\t} catch (Exception e)\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void start3()\n\t{\n\t\tSystem.out.println();\n\t\tEnigmaFile file = new EnigmaFile();\n\t\tfile.encodeTextFromFile();\n\t}", "public void run(){\n\t\tinputStreamReader = new InputStreamReader(System.in);\r\n\t\tin = new BufferedReader( inputStreamReader );\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\" + Application.APPLICATION_VENDOR + \" \" + Application.APPLICATION_NAME + \" \" + Application.VERSION_MAJOR + \".\" + Application.VERSION_MINOR + \".\" + Application.VERSION_REVISION + \" (http://ThreatFactor.com)\");\r\n\t\t//System.out.println(\"We are here to help, just go to http://ThreatFactor.com/\");\r\n\t\t\r\n\t\tif( application.getNetworkManager().sslEnabled() )\r\n\t\t{\r\n\t\t\tif( application.getNetworkManager().getServerPort() != 443 )\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Web server running on: https://127.0.0.1:\" + application.getNetworkManager().getServerPort());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Web server running on: https://127.0.0.1\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif( application.getNetworkManager().getServerPort() != 80 )\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Web server running on: http://127.0.0.1:\" + application.getNetworkManager().getServerPort());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Web server running on: http://127.0.0.1\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Interactive console, type help for list of commands\");\r\n\t\t\r\n\t\tcontinueExecuting = true;\r\n\t\twhile( continueExecuting ){\r\n\r\n\t\t\tSystem.out.print(\"> \");\r\n\r\n\t\t\ttry{\r\n\t\t\t\t\r\n\t\t\t\tString text = in.readLine();\r\n\t\t\t\t\r\n\t\t\t\tif( continueExecuting && text != null ){\r\n\t\t\t\t\tcontinueExecuting = runCommand( text.trim() );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(AsynchronousCloseException e){\r\n\t\t\t\t//Do nothing, this was likely thrown because the read-line command was interrupted during the shutdown operation\r\n\t\t\t\tcontinueExecuting = false;\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\t//Catch the exception and move on, the console listener must not be allowed to exit\r\n\t\t\t\tSystem.err.println(\"Operation Failed: \" + e.getMessage());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\t\r\n\t\t\t\t//Stop listening. Otherwise, an exception loop may occur. \r\n\t\t\t\tcontinueExecuting = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void startDocument ()\n {\n\tSystem.out.println(\"Start document\");\n }", "public void start() {\n\t\tSystem.out.println(\"BMW start method\");\n\t}", "protected void createPages() {\n\t\tcreateIntroEditor();\n\t\tcreatePageMainEditor();\n\t\tcreatePageController();\n\t\tcreateCssEditor();\n\t\tcreatePageTextEditor();\n\t\trefreshPageMainEditor();\n\t\trefreshPageControllerEditor();\n\t\trefreshCssEditor();\n\t\tsetDirty(false);\n\t}", "public void prepare() {\n // make sure the user didn't hide the sketch folder\n ensureExistence();\n\n current.setProgram(editor.getText());\n\n // TODO record history here\n //current.history.record(program, SketchHistory.RUN);\n\n // if an external editor is being used, need to grab the\n // latest version of the code from the file.\n if (Preferences.getBoolean(\"editor.external\")) {\n // history gets screwed by the open..\n //String historySaved = history.lastRecorded;\n //handleOpen(sketch);\n //history.lastRecorded = historySaved;\n\n // set current to null so that the tab gets updated\n // http://dev.processing.org/bugs/show_bug.cgi?id=515\n current = null;\n // nuke previous files and settings, just get things loaded\n load();\n }\n\n // in case there were any boogers left behind\n // do this here instead of after exiting, since the exit\n // can happen so many different ways.. and this will be\n // better connected to the dataFolder stuff below.\n cleanup();\n\n// // handle preprocessing the main file's code\n// return build(tempBuildFolder.getAbsolutePath());\n }", "public void OnRun()\r\n {\r\n try\r\n {\r\n Init();\r\n }\r\n catch(Exception ex)\r\n {\r\n eventLogger.error(ex);\r\n }\r\n \r\n try\r\n {\r\n this.types = this.config.getTypes();\r\n \r\n// this.checkList = dao.CheckLastRun();\r\n \r\n// if (checkList.size()>0)\r\n// {\r\n// Vector<Integer> checkListLastRun = checkList;\r\n// \r\n// checkList = new Vector<Integer>();\r\n// \r\n// CollectInvitees(true);\r\n// CollectInvitees(false);\r\n// \r\n// // lasttime missing some mails\r\n// RemoveSearched(checkListLastRun);\r\n// }\r\n// else\r\n// {\r\n dao.CleanChecklist();\r\n \r\n CollectInvitees(true);\r\n CollectInvitees(false);\r\n \r\n for(Integer id : this.checkList)\r\n {\r\n dao.BuildChecklist(id);\r\n }\r\n// }\r\n \r\n SendEmails();\r\n }\r\n catch(Exception ex)\r\n {\r\n eventLogger.warn(ex);\r\n }\r\n }", "@Override\n\tpublic void start() {\n\t\t\tSystem.out.println(\"BMW --- strart\");\n\t}", "public void start() {\n\t\tinitializeComponents();\r\n\r\n\t\tint userChoice;\r\n\r\n\t\tdo {\r\n\t\t\t// Display start menu\r\n\t\t\tview.displayMainMenu();\r\n\r\n\t\t\t// Get users choice\r\n\t\t\tuserChoice = view.requestUserChoice();\r\n\r\n\t\t\t// Run the respective service\r\n\t\t\tswitch (userChoice) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tservice.register();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tservice.login();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tservice.forgotPassword();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\tservice.logout();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tservice.displayAllUserInfo(); // Secret method\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tSystem.out.println(\"Invalid choice\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} while (userChoice != 4);\r\n\t}", "@Override\n\tpublic void start()\n\t{\n\t\tarena = \"scenarios/boxpushing/arena/pioneer.controller.arena.txt\"; \n\n\t\t\n\t\tschedule.reset();\n\n\t\tsuper.start();\n\n\t\tresetBehavior();\n\n\t}", "public void launch() throws NotBoundException, IOException\n\t{\n\t\t//call method to connect to server\t\t\n\t\tServerManager serverConnect = initialConnect();\t\n\t\n\t\t//get Setup menu from server\n\t\tSetUpMenu newSetup = new SetUpMenu(serverConnect);\n\t\tnewSetup.welcomeMenu();\n\t}", "@Override\n public void run() {\n sketch = mEditor.getSketch();\n printSketchFolder();\n \n// writeLn(\"Now executing run() method. Has run() been called already?: \" + mRunWasCalledAlredy);\n try {\n\n if ( mSketchModder == null) {\n mSketchModder = initModder(); // and adds listeners\n }\n\n mSketchModder.setVisible(true); // hopefull this one is not blocking.\n \n }\n catch( ServiceLocator.ServiceLocatorException ex){\n JOptionPane.showMessageDialog(mEditor, \"When loading sketch modder, we got the following error: \" + ex.getMessage());\n }\n }", "public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void execute() throws MojoExecutionException {\n CodeGeneratorLoggerFactory.setLogger(getLog());\n\n // iff baseFolder is null or empty, reset it to the default value\n baseFolder = StringUtils.defaultIfEmpty(baseFolder, \"GUIData\");\n\n // create the helper with our config\n CodeGeneratorHelper helper = new CodeGeneratorHelper(toCodeGeneratorConfig());\n\n if (CodeGeneratorLoggerFactory.getLogger().isDebugEnabled()) {\n helper.displayProjectInformation();\n }\n\n // register all custom element classes\n helper.registerCustomElements();\n\n // create the generated page details file\n helper.createSeLionPageDetailsFile();\n\n // process the files.\n helper.processFiles();\n }", "public void run() {\n\t\trichiediProdotti();\n\t}", "private void consoleWelcome()\n {\n welcomePartOne();\n\n Scanner reader = new Scanner(System.in);\n String playerName = reader.nextLine();\n player.playerName = playerName;\n \n welcomePartTwo();\n }", "public void startDemo() {\n // Welcoming display\n this.view.displayMenu();\n\n // State of the inventory and the users\n this.view.displaySystem(this.system);\n\n this.view.displayExampleMessage();\n\n // Example with a student\n Student s = this.system.getStudents().get(0);\n\n Calendar startDate = Calendar.getInstance();\n Calendar endDate = Calendar.getInstance();\n endDate.setTimeInMillis(endDate.getTimeInMillis() + 6*24*60*60*1000);\n\n Loan l = s.book(Model.IPAD3, new Period(startDate, endDate));\n this.system.checkLoan(l);\n\n this.view.displayBorrow(s, l);\n this.system.putAway(l);\n this.view.displayReturn(s, l);\n\n // Example with a teacher\n\n Teacher t = this.system.getTeachers().get(0);\n\n Loan l2 = s.book(Model.XPERIAZ, new Period(startDate, endDate));\n this.system.checkLoan(l2);\n\n this.view.displayBorrow(t, l2);\n this.system.putAway(l2);\n this.view.displayReturn(t, l2);\n\n }", "private void standByForMessages() throws IOException {\n if (reader.readLine() != null) {\n try {\n JSONObject j = (JSONObject) jps.parse(reader.readLine());\n sequence = Integer.valueOf(j.get(\"sequence\").toString());\n String cmd = (String) j.get(\"command\");\n JSONArray parameter = (JSONArray) j.get(\"parameter\");\n cmdHandler(parameter, cmd);\n } catch (ParseException ex) {\n }\n }\n }", "@Override\n\tpublic void start() {\n\t\tSystem.out.println(\"BMW -- start\");\n\t}", "void run() {\n System.out.println(\"PC Visual application run\");\n data = new Data(this);\n window = new Window(this);\n window.setup();\n mote = new MoteIF(PrintStreamMessenger.err);\n mote.registerListener(new OscilloscopeMsg(), this);\n }", "public static void run() {\n try {\n //recreating tables added to update csv data without application restart\n new SqlUtility().setConnection().dropAllTables().createPersonTable().createRecipientTable();\n new CsvPersonParser().run();\n new CsvReсipientParser().run();\n\n List<Person> list;\n list = new SqlUtility().setConnection().grubData();\n String result = \"\";\n result = ListToMessage.converter(list);\n if(!\"\".equals(result)) {\n NotificationSender.sender(result, email, pass, addressList);\n }\n } catch (ClassNotFoundException e){e.printStackTrace();}\n catch (SQLException ee){ee.printStackTrace();}\n catch (ParseException eee) {eee.printStackTrace();}\n\n }", "public static void main( String[] args )\n { \n \t\n \t\n \tString endPoint;\n \tif (args[0].equals(\"H\"))\n \t{\n \t\tplayer = new Hunter(timetoWall,maxWalls);\n \t endPoint = hunterEndpoint;}\n \t\n \telse\n \t{\n \t\tplayer= new Prey();\n \t\t endPoint = preyEndpoint;}\n \t\n \ttimetoWall = Integer.parseInt(args[1]);\n \tmaxWalls = Integer.parseInt(args[2]);\n\t\tSession session;\n try {\n messageLatch = new CountDownLatch(100);\n\n final ClientEndpointConfig cec = ClientEndpointConfig.Builder.create().build();\n\n ClientManager client = ClientManager.createClient();\n ClientManager client2 = ClientManager.createClient();\n \n Endpoint playersocket = new Endpoint() {\n\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onOpen(Session session, EndpointConfig arg1) {\n\t\t\t\t//\ttry {\n session.addMessageHandler(new MessageHandler.Whole<String>() {\n public void onMessage(String message) {\n System.out.println(\"Received message: \"+message);\n process(message);\n \n messageLatch.countDown();\n }\n });\n\n// }\n\t\t\t\t\t\n\t\t\t\t}\n };\n \n \n Endpoint publisher = new Endpoint() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onOpen(Session session, EndpointConfig arg1) {\n\t\t\t\t//\ttry {\n session.addMessageHandler(new MessageHandler.Whole<String>() {\n public void onMessage(String message) {\n System.out.println(\"Received message: \"+message);\n //System.out.println(\"Prey.java pos:\" + getpreypos(message));\n messageLatch.countDown();\n }\n });\n // SENT_MESSAGE = getPositionsCommand();\n // session.getBasicRemote().sendText(SENT_MESSAGE);\n // SENT_MESSAGE = getWallsCommand();\n // session.getBasicRemote().sendText(SENT_MESSAGE);\n // } catch (IOException e) {\n // e.printStackTrace();\n // }\n\n\t\t\t\t}\n };\n\n \n \t session= client.connectToServer(playersocket, cec, new URI(endPoint));\n \n\n\n client2.connectToServer(publisher, cec, new URI(publisherEndpoint));\n messageLatch.await(100, TimeUnit.SECONDS);\n\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tSENT_MESSAGE = getPositionsCommand();\n\t\t\t\ttry {\n\t\t\t\t\tsession.getBasicRemote().sendText(SENT_MESSAGE);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tSENT_MESSAGE = player. makeMove(hunterPos,preyPos);\n\t\t\t\ttry {\n\t\t\t\t\tsession.getBasicRemote().sendText(SENT_MESSAGE);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n \n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n\n\n \n }", "public void start()\n\t{\n\t\tloopy();\n\t}", "public void create() {\n PDDocument document = new PDDocument();\n PDPage page = new PDPage();\n document.addPage(page);\n\n // Create a new font object selecting one of the PDF base fonts\n PDFont font = PDType1Font.HELVETICA_BOLD;\n try (document) {\n // Start a new content stream which will \"hold\" the to be created content\n writeDataToDocument(document, page, font);\n // Save the results and ensure that the document is properly closed:\n document.save(\"Hello World.pdf\");\n } catch (IOException ioException) {\n ioException.printStackTrace();\n }\n }", "public void managerMenu() {\n try {\n do {\n System.out.println(EOL + \" ---------------------------------------------------\");\n System.out.println(\"| Manager Screen - Type one of the options below: |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 1. Add an employee |\");\n System.out.println(\"| 2. Remove an employee |\");\n System.out.println(\"| 3. View all employees |\");\n System.out.println(\"| 4. View employees' total salary cost |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 5. View total rent profit |\");\n System.out.println(\"| 6. View most profitable item |\");\n System.out.println(\"| 7. View most frequent rented item |\");\n System.out.println(\"| 8. View best customer |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 9. Load user, product data file |\");\n System.out.println(\"| 10. Load rental history file |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 11. Save DART data file |\");\n System.out.println(\"| 12. Save Rental history file |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 13. Return to Main Menu |\");\n System.out.println(\" ---------------------------------------------------\");\n String[] menuAcceptSet = new String[]{\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\"}; // Accepted responses for menu options\n String userInput = getInput.getMenuInput(\"menuOptionPrompt\", menuAcceptSet); // Calling Helper method\n\n DartController dart = new DartController();\n\n switch (userInput.toLowerCase()) {\n case \"1\" -> userController.addEmployee();\n case \"2\" -> userController.deleteEmployee();\n case \"3\" -> userController.displayEmployees(false);\n case \"4\" -> userController.calculateSalary();\n case \"5\" -> dart.viewRentalTotalProfit();\n case \"6\" -> dart.viewRentalProfitable();\n case \"7\" -> dart.viewRentalFrequency();\n case \"8\" -> dart.viewRentalBestCustomer();\n case \"9\" -> dart.loadProductData();\n case \"10\" -> dart.loadRentalData();\n case \"11\" -> dart.saveProductData();\n case \"12\" -> dart.saveRentalData();\n case \"13\" -> mainMenu();\n\n default -> printlnInterfaceLabels(\"menuOptionNoMatch\");\n }\n } while (session);\n } catch (Exception e) {\n printlnInterfaceLabels(\"errorExceptionMainMenu\", String.valueOf(e));\n }\n }", "@Override\n \t\t\tpublic void run() {\n \t\t\t\tMessage msg = new Message();\n \t\t\t\tmsg.what = 0;\n \t\t\t\t\n \t\t\t\t// Retrieve the seeds list\n \t\t\t\tmsg.obj = getList();\n \t\t\t\thandler.sendMessage(msg);\n \t\t\t}", "public void start() {\n String command = \"\";\n boolean exitCommandIsNotGiven = true;\n System.out.println(\"\\nSorting Algorithms Demonstration\\n\");\n\n while (exitCommandIsNotGiven) {\n command = initialMenu(command);\n exitCommandIsNotGiven = handleStartMenuCommands(command);\n }\n }", "@Test\n\tpublic void testGenerateWarAndPeace() throws IOException {\n\t\tfinal MarkovChainLanguageModel model = new MarkovChainLanguageModel();\n\t\tmodel.train(Locale.ENGLISH,\n\t\t\t\tMarkovChainLanguageModel.class.getResourceAsStream(\"/org/openimaj/text/nlp/warandpeace.txt\"));\n\t\tmodel.train(Locale.CHINESE,\n\t\t\t\tMarkovChainLanguageModel.class.getResourceAsStream(\"/org/openimaj/text/nlp/TouPengHsienHua.txt\"));\n\t}", "public static void main(String[] args) throws IOException {\n //Later, we could use a different config for this\n //and even allow config to specify a different Guice\n //mockModule here\n final MsjsModule msjsModule = new MsjsModule(BasicConfiguration.getConfiguration());\n final Module mockModule = Modules.override(msjsModule).with(new MockModule());\n Injector injector = Guice.createInjector(mockModule);\n MsjsConfiguration config = injector.getInstance(MsjsConfiguration.class);\n \n String outLocation = config.getMsjsRoot() + \"/out/dotfile.dot\";\n \n PageContextProvider provider = injector.getInstance(PageContextProvider.class);\n DotRenderer renderer = new DotRenderer(provider);\n FileWriter writer = new FileWriter(new File(outLocation));\n writer.write(renderer.render(args[0]));\n writer.flush();\n System.exit(0);\n }", "private static void menu()\r\n\t{\r\n\t\tSystem.out.println(\"0. ** FOR INSTRUCTOR **\");\r\n\t\tSystem.out.println(\" Seed 5 URLs, set 3 keywords, creates 1000 Producers and 10 Consumers\");\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"1. Add seed url\");\r\n\t\tSystem.out.println(\"2. Add consumer (Parser)\");\r\n\t\tSystem.out.println(\"3. Add producer (Fetcher)\");\r\n\t\tSystem.out.println(\"4. Add keyword search\");\r\n\t\tSystem.out.println(\"5. Print stats\");\r\n\t}", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "@Override\n public void preStart() {\n greeter = getContext().actorOf(Props.create(Greeter.class), \"greeter\");\n System.out.println(\"Greeter actor path:\" + greeter.path());\n // tell it to perform the greeting\n greeter.tell(new Message(2, Arrays.asList(\"2\", \"dsf\")), getSelf());\n }", "public Polipara() {\n // Iniciar el programa cargando el archivo de propiedades si existe.\n\n if (this.validarSerializacion()) {\n int response = JOptionPane.showConfirmDialog(null, \"Hay una versión anterior de una copa,\\n\"\n + \"¿Desea cargar esa versión? (Al seleccionar \\\"No\\\", se eliminará el avance anterior y se cargará una copa nueva.)\");\n if (response == 0) {\n this.cargarSerializacion();\n } else {\n this.iniciarCopa();\n }\n } else {\n this.iniciarCopa();\n }\n }", "public static void main(String[] args) {\n Pigman pigman = new Pigman(\"dongle\");\n pigman.speak();\n pigman.speakParentLanguage();\n pigman.speak(3);\n }", "public static void main(String[] args)throws Exception{\n\t\tPropertyBO bo = new PropertyBO();\n\t\tProperty objProperty = new Property();\n\t\t\t\t\n\t\ttry{\n\t\t\twhile(JOptionPane.showConfirmDialog(null, \"Do you want create a new property?\", \"New Property\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == 0){\n\t\t\t\tobjProperty = new Property();\n\t\t\t\tobjProperty.setId(integer(\"Id: \"));\n\t\t\t\tobjProperty.setTitle(text(\"Title: \"));\n\t\t\t\tobjProperty.setPrice(real(\"Price: \"));\n\t\t\t\tobjProperty.setDescription(text(\"Description: \"));\n\t\t\t\tobjProperty.setX(integer(\"X: \"));\n\t\t\t\tobjProperty.setY(integer(\"Y: \"));\n\t\t\t\tobjProperty.setBeds(integer(\"Beds: \"));\n\t\t\t\tobjProperty.setBaths(integer(\"Baths: \"));\n\t\t\t\tobjProperty.setSquareMeters(real(\"Square Meters: \"));\t\n\t\t\t\tbo.create(objProperty);\n\t\t\t}\n\t\t\t\n\t\t\tbo.read();\n\t\t}catch(Exception e){\n\t\t\tthrow new Excep(\"Error\", e);\n\t\t}\n\t}", "public void run() {\n if (myProject.isDisposed() || myProject.isDefault()) return;\n getOrCreateConsoleContent(getContentManager());\n myEditorAdapter.appendString(message, attributes);\n }" ]
[ "0.54188055", "0.51491797", "0.5083735", "0.5066377", "0.50655735", "0.5046163", "0.5005249", "0.49987802", "0.4963723", "0.49524763", "0.49294722", "0.4902641", "0.4893258", "0.48921078", "0.48554268", "0.48368683", "0.4832176", "0.4828823", "0.48165128", "0.48126727", "0.47881415", "0.47741488", "0.47452694", "0.47377816", "0.47330007", "0.4732919", "0.47283462", "0.47260076", "0.47248852", "0.47073555", "0.47003552", "0.46987572", "0.46912137", "0.46814194", "0.46638831", "0.46572506", "0.4652622", "0.46491778", "0.46469554", "0.46058065", "0.46056864", "0.46033454", "0.4602993", "0.4599595", "0.45954713", "0.45940998", "0.4591499", "0.45843047", "0.45743188", "0.4574017", "0.45576602", "0.45570645", "0.45539173", "0.4546758", "0.454157", "0.45379272", "0.45265055", "0.45147282", "0.45120868", "0.45099336", "0.4507919", "0.45074812", "0.45071304", "0.44986066", "0.447323", "0.44487017", "0.44462425", "0.4440929", "0.44406626", "0.44400927", "0.44396973", "0.44284356", "0.44197124", "0.44184968", "0.4417798", "0.44175184", "0.44165224", "0.4414956", "0.44093454", "0.44025707", "0.44016317", "0.43976453", "0.43942067", "0.43889254", "0.43847138", "0.4384035", "0.43796512", "0.4378105", "0.43716145", "0.4369975", "0.43633774", "0.43574935", "0.4353843", "0.43515083", "0.43478268", "0.43449417", "0.4342315", "0.43404183", "0.43352306", "0.43344155" ]
0.7975337
0
Ask user input for two poets and a theme. Print out summary of user's picks.
public void askPoets(){ System.out.println("Walt Whitman William Shakespeare John Keats Emily Dickinson"); System.out.println("Pick a poet and press enter: "); String poet1_input = scanner.nextLine(); if (poet1_input.toLowerCase().contains("whitman") || poet1_input.toLowerCase().contains("withman")){ poet1 = "Whitman"; }else if (poet1_input.toLowerCase().contains("shakespeare") || poet1_input.toLowerCase().contains("shakespear")){ poet1 = "Shakespeare"; }else if (poet1_input.toLowerCase().contains("keats")){ poet1 = "Keats"; }else if (poet1_input.toLowerCase().contains("dickinson") || poet1_input.toLowerCase().contains("dikcinson")){ poet1 = "Dickinson"; } System.out.println("Pick another poet: "); String poet2_input = scanner.nextLine(); if (poet2_input.toLowerCase().contains("whitman") || poet2_input.toLowerCase().contains("withman")){ poet2 = "Whitman"; }else if (poet2_input.toLowerCase().contains("shakespeare") || poet2_input.toLowerCase().contains("shakespear")){ poet2 = "Shakespeare"; }else if (poet2_input.toLowerCase().contains("keats")){ poet2 = "Keats"; }else if (poet2_input.toLowerCase().contains("dickinson") || poet2_input.toLowerCase().contains("dikcinson")){ poet2 = "Dickinson"; } System.out.println(); System.out.println("Choose a theme [Love / Death]: "); String theme_input = scanner.nextLine(); if(theme_input.toLowerCase().contains("love")){ theme = "Love"; }else if(theme_input.toLowerCase().contains("death")){ theme = "Death"; } System.out.println("\n(" + poet1 + " + " + poet2 + ") * " + theme + ". Coming right up! [Press Enter]" ); String ignore = scanner.nextLine(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String userInputToPoet(String poet, String theme) throws IncorrectInput{\n String returnable = \"\";\n if(poet.equals(\"Whitman\")){\n if(theme.equals(\"Love\")){\n returnable = \"love Whitman\";\n }else{\n returnable = \"death Whitman\";\n }\n }else if(poet.equals(\"Shakespeare\")){\n if(theme.equals(\"Love\")){\n returnable = \"love Shakespeare\";\n }else{\n returnable = \"death Shakespeare\";\n }\n }else if(poet.equals(\"Keats\")){\n if(theme.equals(\"Love\")){\n returnable = \"love Keats\";\n }else{\n returnable = \"death Keats\";\n }\n }else if(poet.equals(\"Dickinson\")){\n if(theme.equals(\"Love\")){\n returnable = \"love Dickinson\";\n }else{\n returnable = \"death Dickinson\";\n }\n }else{\n IncorrectInput e = new IncorrectInput();\n throw e;\n }\n return returnable;\n }", "public void Prompt(){\n System.out.println(\"Enter information about the topping: \\n\\n\");\n super.Prompt();\n System.out.println(\"Enter any topping: \");\n this.Topping = new String(this.read.next());\n this.read.nextLine();\n System.out.println(\"Density:\\n 1. Heavy\\n 2. Standard\\n 3. Light\\n(Enter corresponding number): \");\n this.Density = this.read.nextInt();\n System.out.println(\"Is it vegetarian? (true or false): \");\n this.Vegetarian = this.read.nextBoolean();\n System.out.println(\"\\n\");\n }", "private void choosePrompt() {\r\n\t\tfor (int i = 0; i < mustChoose.size(); i++) {\r\n\t\t\tString prompt = \"**[Choose]** \";\r\n\t\t\t// Find the correct text to display\r\n\t\t\tif (mustChoose.get(i).contentEquals(\"Shrine\")) {\r\n\t\t\t\tprompt += \"**1** :moneybag: ~OR~ **1** :heart:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Dragon Shrine\")) {\r\n\t\t\t\tprompt += \"**2** :moneybag: ~OR~ **1** :wastebasket:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Treasure Hunter\")) {\r\n\t\t\t\tprompt += \"a card to replace in the dungeon row (4-9)\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Underworld Dealing\")) {\r\n\t\t\t\tprompt += \"**1** :moneybag: ~OR~ **BUY 2** __Secret Tome__ **FOR 7** :moneybag:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\tprompt += \"**3** :crossed_swords: **~OR~** **2** :moneybag: **~OR~** **1** :heart:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Mister Whiskers\")) {\r\n\t\t\t\tprompt += \"**Dragon Attack** ~OR~ **-2** :warning:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Wand of Wind\")) {\r\n\t\t\t\tif (GlobalVars.teleportRoomsPerRoom.length > 0) {\r\n\t\t\t\t\tprompt += \"**1** :crystal_ball: ~OR~ Take a **SECRET** from an adjacent room ``\"+\r\n\t\t\t\t\t\tUtils.arrayToString(GlobalVars.adjacentRoomsPerRoom[currentPlayer.getCurrentRoom()])+\" ┃ \"+\r\n\t\t\t\t\t\tUtils.arrayToString(GlobalVars.teleportRoomsPerRoom[currentPlayer.getCurrentRoom()])+\"``\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprompt += \"**1** :crystal_ball: ~OR~ Take a **SECRET** from an adjacent room ``\"+\r\n\t\t\t\t\t\t\tUtils.arrayToString(GlobalVars.adjacentRoomsPerRoom[currentPlayer.getCurrentRoom()])+\"``\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tgameChannel.sendMessage(prompt).queue();\r\n\t\t}\r\n\t}", "public void welcomeUser(String[] vegetables, String[] fruits) {\n System.out.println(\"Please enter vegetable or fruit.\");\n System.out.println(\"Vegetable=>\" + Arrays.toString(vegetables));\n System.out.println(\"Fruit=>\" + Arrays.toString(fruits));\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Do you want food or drink? \");\n System.out.println(\"If your answer is food you want meal or snack? \");\n System.out.println(\"If your answer is drink you want soda or juice? \");\n String mainOption= scan.next();\n String secondaryOption = scan.next();\n\n if(mainOption.equalsIgnoreCase(\"food\")){\n System.out.println(\"You have selected food\");\n if(secondaryOption.equalsIgnoreCase(\"meal\")){\n System.out.println(\"You have selected meal\");\n }else if (secondaryOption.equalsIgnoreCase(\"snack\")) {\n System.out.println(\"You have selected snack\");\n }else if(mainOption.equalsIgnoreCase(\"drink\")){\n System.out.println(\"You have selected drink\");\n }else if(secondaryOption.equalsIgnoreCase(\"soda\")) {\n System.out.println(\"You have selected soda\");\n }else if(secondaryOption.equalsIgnoreCase(\"juice\")) {\n System.out.println(\"You have selected juice\");\n\n }\n\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "public static void main(String [] args){\n String userInput;\n userInput = JOptionPane.showInputDialog(null, \"Enter an integer number\", \"I'm going to turn into dollars\");\n int intUI = Integer.parseInt(userInput);\n \n //at this point im unsure what im supposed to do\n //does the textbook want me to tell the user how many\n //20s represent the inputed #? (And then same thing\n //for 10s, 5s, 1s) Or does it want me to display the input\n //# in the least number of bills possible?\n \n //intialize int vars \n int twenties = 0;\n int tens = 0;\n int fives = 0;\n int ones = 0;\n \n //logic chain to get the right bill numbers\n twenties = intUI / 20;\n if(intUI%20 > 0){\n intUI = intUI - twenties * 20;\n tens = intUI / 10;\n if(intUI%10 > 0){\n intUI = intUI - tens * 10;\n fives = intUI / 5;\n if(intUI%5 > 0){\n intUI = intUI - fives * 5;\n ones = intUI / 1;\n }//close if\n }//close if\n }//close if chain\n \n //show the bill numbers to user\n JOptionPane.showConfirmDialog(null, twenties + \" 20s, \"\n + tens + \" 10s, \"\n + fives + \" 5s, \"\n + ones + \" 1s, \",\n \"This is your number in the least amount of bills\",\n JOptionPane.YES_OPTION,\n JOptionPane.INFORMATION_MESSAGE);\n }", "public static void main(String[] args) {\n\tString anyColors =\tJOptionPane.showInputDialog(\"What color would you like?\");\n\tString anyShape= JOptionPane.showInputDialog(\"What Shape would you like?\"); \n\t\t//4. use an if/else statement to set the pen color that the user requested\nif (anyColors.equalsIgnoreCase(\"Red\")) \n{\n\tTortoise.setPenColor(Color.red);\n}\nif (anyColors.equalsIgnoreCase(\"Blue\")) \n{\n\tTortoise.setPenColor(Color.blue);\n}\nif (anyColors.equalsIgnoreCase(\"Green\")) \n{\n\tTortoise.setPenColor(Color.green);\n}if (anyColors.equalsIgnoreCase(\"Gray\")) \n{\n\tTortoise.setPenColor(Color.GRAY);\n}if (anyColors.equalsIgnoreCase(\"orange\")) \n{\n\tTortoise.setPenColor(Color.orange);\n}if (anyColors.equalsIgnoreCase(\"yellow\")) \n{\n\tTortoise.setPenColor(Color.yellow);\n}\nif (anyColors.equalsIgnoreCase(\"\")) \n{\n\tTortoise.setPenColor(Color.MAGENTA);\t\n} \n\n//if(anyShape.equalsIgnoreCase(\"Triangle\"))\n//{\n//Tortoise.turn(40);\n//Tortoise.move(50);\n//Tortoise.turn(40);\n//Tortoise.move(40);\n//Tortoise.turn(40);\n//}\n\n\n//5. if the user doesn’t enter anything, choose a random color\n\n//6. put a loop around your code so that you keep asking the user for more colors & drawing them\n\t\t\n\t\t//2. set the pen width to 10\n\t\tTortoise.setPenWidth(5);\n\t//1. make the tortoise draw a shape (this will take more than one line of code)\n\t\tTortoise.getBackgroundWindow();\n\t\tTortoise.setSpeed(10);\n\t\tfor (int i = 0; i < 20; i++) \n\t\t{\n\t\tTortoise.move(50);\n\t\tTortoise.turn(60);\n\t\tTortoise.move(100);\n\t\tTortoise.turn(+120);\n\t\t\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\n\t\tScanner input = new Scanner(System.in);\n\n\t\tString responseColor;\n\t\t do {\n\t\t\t System.out.println(\"What is your favorite ROYGBIV color?.\");\n\t\t\t System.out.println(\"Type \\\"help\\\" to list options.\");\n\t\t\t responseColor = input.nextLine();\n\t\t\t if(responseColor.toLowerCase().equals(\"help\")) {\n\t\t\t System.out.println(\"Options: red, orange, yellow, green, blue, indigo, violet\");\n\t\t\t }\n\t\t\t } while(responseColor.equals(\"help\"));\n\t\t\t input.close();\n\t\t \n\t\t String car = (\"\"); {\n\t\t } if (responseColor.toLowerCase().equals(\"red\")) {\n\t\t car = \"a Yugo\";\n\t\t } else if (responseColor.toLowerCase().equals(\"orange\")){\n\t\t car = \"public transportation\";\n\t\t } else if (responseColor.toLowerCase().equals(\"yellow\")) {\n\t\t car = \"a VW bus\";\n\t\t } else if (responseColor.toLowerCase().equals(\"green\")) {\n\t\t car = \"a Lamborghini\";\n\t\t } else if (responseColor.toLowerCase().equals(\"blue\")) {\n\t\t car = \"a Mitsubishi Eclipse\";\n\t\t } else if (responseColor.toLowerCase().equals(\"indigo\")){\n\t car = \"a rusty bicycle\";\n\t } else if (responseColor.toLowerCase().equals(\"violet\")){\n\t car = \"a 1977 Chrysler LeBaron\";\n\t\t }\n\t\t {\n\t\t System.out.println(car);\n\t} \n\t}", "public static void main(String[] args) {\n\t\r\nString Bob = \"You make great jokes!\";\r\nString Amie = \"Your art is beautiful!\";\r\nString Grace = \"You're clever!\";\r\n\r\n\t\t// 2. Ask the user to enter a name. Store their answer in a variable.\r\n\r\nString name = JOptionPane.showInputDialog(\"Enter a name.\");\r\n\r\n\t\t// 3. In a pop-up, tell the user what is remarkable about that person. \r\n\r\nif (name.equalsIgnoreCase(\"Bob\")) {\r\n\t\r\nJOptionPane.showMessageDialog(null, Bob); }\r\n\r\n\r\nelse if (name.equalsIgnoreCase(\"Amie\")) {\r\n\r\nJOptionPane.showMessageDialog(null, Amie);\r\n}\r\n\r\nelse if (name.equalsIgnoreCase(\"Grace\")) {\r\n\r\nJOptionPane.showMessageDialog(null, Grace); \r\n}\r\n}", "public static void main(String[] args) {\n\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString input1 = \"\";\r\n\t\tString input2 = \"\";\r\n\t\twhile (true) {\r\n\t\t\tSystem.out.println(\"is the item an animal, vegetable, or mineral?\");\r\n\t\t\tinput1 = scan.next();\r\n\t\t\tif (input1.equals(\"animal\") || input1.equals(\"vegetable\") || input1.equals(\"mineral\")) {\r\n\t\t\t\tSystem.out.println(\"is the \" + input1 + \" bigger or smaller than your laptop?\");\r\n\t\t\t\tinput2 = scan.next();\r\n\t\t\t\tif (input2.equals(\"bigger\") || input2.equals(\"smaller\")) {\r\n\t\t\t\t\tSystem.out.println(\"is your \" + input1 + \" a...\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.println(\"Enter bigger or smaller\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Enter animal, vegetable, or mineral\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif (input1.equals(\"animal\") && input2.equals(\"bigger\"))\r\n\t\t\tSystem.out.println(\"horse?\");\r\n\t\tif (input1.equals(\"animal\") && input2.equals(\"smaller\"))\r\n\t\t\tSystem.out.println(\"rabbit?\");\r\n\t\tif (input1.equals(\"vegetable\") && input2.equals(\"bigger\"))\r\n\t\t\tSystem.out.println(\"cabbage?\");\r\n\t\tif (input1.equals(\"vegetable\") && input2.equals(\"smaller\"))\r\n\t\t\tSystem.out.println(\"potato?\");\r\n\t\tif (input1.equals(\"mineral\") && input2.equals(\"bigger\"))\r\n\t\t\tSystem.out.println(\"car?\");\r\n\t\tif (input1.equals(\"mineral\") && input2.equals(\"smaller\"))\r\n\t\t\tSystem.out.println(\"phone?\");\r\n\r\n\t}", "public static void main(String[] args) {\nString whatPet= JOptionPane.showInputDialog(\"What pet do you want?\");\n\t\t// 7. REPEAT steps 3 - 6 enough times to make your pet happy!\n\t\tfor (int i= 0; happinessLevel < 7; ) {\n\t\t\t\n\t\t\n\t\t\t// 3. Use showOptionDialog to ask the user what they want to do to make their pet happy\n\t\t\t// (eg: cuddle, food, water, take a walk, groom, clean up poop).\n\t\t\t// Make sure to customize the title and question too.\n\t\t\tint task = JOptionPane.showOptionDialog(null, \"What do yu want to do to make your \"+whatPet+\" happy?\", \"Things to do for yor \"+whatPet, 0, JOptionPane.INFORMATION_MESSAGE, null,\n\t\t\t\t\tnew String[] { \"Cuddle\", \"Food/Water\", \"Take it for a walk\" }, null);\n\n\t\t\t// 5. Use user input to call the appropriate method created in step 4.\nif(task == 0) {\n\tcuddle(whatPet);\n}if(task == 1) {\n\tfoodOrWater(whatPet);\n}if(task == 2) {\n\twalk(whatPet);\n}\n\t\t\t// 6. If you determine the happiness level is large enough, tell the\n\t\t\t// user that he loves his pet and use break; to exit for loop.\n\t\t}\n\t JOptionPane.showMessageDialog(null, \"Good job, you love your \"+whatPet+\".\");\n\n\t}", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint t=sc.nextInt();\n\t\tint pike=sc.nextInt();\n\t\tint pick=sc.nextInt();\n\t\tint total=sc.nextInt();\n\t\tint out=0;\n\t\tfor(int count=0;count*t<=total;count++) {\n\t\t\tfor(int count2=0;count2*pike<=total;count2++) {\n\t\t\t\tfor(int count3=0;count3*pick<=total;count3++) {\n\t\t\t\t\tif(count!=0||count2!=0||count3!=0) {\n\t\t\t\t\t\tif(count*t+count2*pike+count3*pick<=total) {\n\t\t\t\t\t\t\tSystem.out.println(count+\" Brown Trout, \"+count2+\" Northern Pike, \"+count3+\" Yellow Pickerel\");\n\t\t\t\t\t\t\tout++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Number of ways to catch fish: \"+out);\n\t\tsc.close();\n\t\t\n\t}", "private void screenWithGivenValues(int promptString1, int promptString2, int optionString1, int optionString2, int optionString3, int inputString1, int inputString2) {\n //clears the screen of previous, unnecessary text\n display.drawBlankDialog();\n\n display.setDialogWindowPrompt(getPromptStrings(promptString1), getPromptStrings(promptString2), getShipsStatus());\n display.setDialogWindowOption1(getOptionStrings(optionString1));\n display.setDialogWindowOption2(getOptionStrings(optionString2));\n display.setDialogWindowOption3(getOptionStrings(optionString3));\n display.setDialogWindowUserInput(getInputStrings(inputString1), getInputStrings(inputString2));\n\n showDisplay();\n }", "private static String displayItemFromBag(String[] inventory, String option){\r\n String itemToDoAction;\r\n int counter = 1;\r\n if(option.equals(\"Equip\")){\r\n for(int i = 0; i < inventory.length; i++){\r\n if(inventory[i].equals(\"Short Sword\") || inventory[i].equals(\"Leather Helmet\") || inventory[i].equals(\"Leather Chest Plate\")\r\n || inventory[i].equals(\"Long Sword\") || inventory[i].equals(\"Great Sword\") || inventory[i].equals(\"Iron Helmet\") \r\n ||inventory[i].equals(\"Iron Chest Plate\") || inventory[i].equals(\"Iron Boots\") || inventory[i].equals(\"Iron Gloves\")){\r\n System.out.println(\"\\t\" + counter + \") \" + inventory[i]);\r\n counter++;\r\n }\r\n }\r\n System.out.println(\"\\t\" + counter + \") Exit\");\r\n itemToDoAction = getUserInput(\"Which item would you like to equip? \\n(Type the name of the item) \");\r\n }else if(option.equals(\"Sell\")){\r\n for(int i = 0; i < inventory.length; i++){\r\n if(inventory[i].equals(\"Short Sword\") || inventory[i].equals(\"Leather Helmet\") || inventory[i].equals(\"Leather Chest Plate\")\r\n || inventory[i].equals(\"Long Sword\") || inventory[i].equals(\"Great Sword\") || inventory[i].equals(\"Iron Helmet\") \r\n ||inventory[i].equals(\"Iron Chest Plate\") || inventory[i].equals(\"Iron Boots\") || inventory[i].equals(\"Iron Gloves\")){\r\n System.out.println(\"\\t\" + counter + \") \" + inventory[i]);\r\n counter++;\r\n }\r\n }\r\n System.out.println(\"\\t\" + counter + \") Exit\");\r\n itemToDoAction = getUserInput(\"Which item would you like to sell? \\n(Type the name of the item) \");\r\n }else if(option.equals(\"Use\")){\r\n System.out.println(\"we here\");\r\n for(int i = 0; i < inventory.length; i++){\r\n if(inventory[i].equals(\"Healing Potion\") || inventory[i].equals(\"Greater Healing Potion\") || inventory[i].equals(\"Scroll of Fireball\")){\r\n System.out.println(\"\\t\" + counter + \") \" + inventory[i]);\r\n counter++;\r\n }\r\n }\r\n System.out.println(\"\\t\" + counter + \") Exit\");\r\n itemToDoAction = getUserInput(\"Which item would you like to use? \\n(Type the name of the item) \");\r\n }else{\r\n itemToDoAction = \"\";\r\n }\r\n return itemToDoAction;\r\n }", "public static void main(String[] args)\n\t{\n\t\tTortoise.show();\n\t\tTortoise.setSpeed(10);\n\t\tString Color = JOptionPane.showInputDialog(\"What Color do you want. Pink, red, orange, yellow, green, blue, or purple?\");\n\t\t// 4. use an if/else statement to set the pen color that the user requested (minimum of 2 colors)\n\t\tif (Color .equals(\"Pink\")) {\n\t\t\tTortoise.setPenColor(Pinks.Pink);\n\t\t}\n\t\telse if (Color .equals(\"Red\")) {\n\t\t\tTortoise.setPenColor(Reds.Crimson);\n\t\t}\n\t\telse if (Color .equals(\"Orange\")) {\n\t\t\tTortoise.setPenColor(Oranges.DarkOrange);\n\t\t}\n\t\telse if (Color .equals(\"Yellow\")) {\n\t\t\tTortoise.setPenColor(Yellows.Gold);\n\t\t}\n\t\telse if (Color .equals(\"Green\")) {\n\t\t\tTortoise.setPenColor(Greens.ForestGreen);\n\t\t}\n\t\telse if (Color .equals(\"Blue\")) {\n\t\t\tTortoise.setPenColor(Blues.CornflowerBlue);\n\t\t}\n\t\telse if (Color .equals(\"Purple\")) {\n\t\t\tTortoise.setPenColor(Purples.MediumPurple);\n\t\t}\n\t\t// 2. set the pen width to 10\n\t\tTortoise.setPenWidth(10);\n\t\t// 1. make the tortoise draw a shape\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tTortoise.move(100);\n\t\t\tTortoise.turn(40);\n\t\t}\n\t}", "public void benefitLayout() {\n Scanner stdin = new Scanner(System.in);\n System.out.println(\"Please state which benefit to check (Bonus or Pension): \");\n String benefitToCheck = stdin.next();\n\n while ((!benefitToCheck.equals(\"Pension\")) && (!benefitToCheck.equals(\"Bonus\"))) {\n System.out.println(\"Please state which benefit to check (Bonus or Pension): \");\n benefitToCheck = stdin.next();\n }\n\n if (benefitToCheck.equals(\"Pension\")) {\n System.out.println(\"Please state Name of Employee (format: \\\"FirstName_LastName\\\"): \");\n calculateEmployeePension(employeeSalaryForBenefits(stdin.next()));\n }\n if (benefitToCheck.equals(\"Bonus\")) {\n System.out.println(\"Please state Name of Employee (format: \\\"FirstName_LastName\\\"): \");\n calculateEmployeeBonus(employeeSalaryForBenefits(stdin.next()), 0, null);\n }\n stdin.close();\n }", "private static void pickNumOfPlayers()\n\t{\n\t\tprintBorder();\n\t\tSystem.out.print(\"Enter 1 for one player or 2 for two player: \");\n\t\tnumOfPlayers = input.nextInt(); // Throws error if input is not an int\n\t\tif (numOfPlayers == 2) isMultiplayer = true;\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\n String selection = \"drink\"; // Snack\n String drinkItems = \"tea\"; // coke\n String snackItems = \"chips\"; // candy\n\n if(selection.equals(\"drink\")){\n System.out.println(\"drink option is selected\");\n if(drinkItems.equals(\"tea\")){\n System.out.println(\"tea is selected\");\n }\n else{\n System.out.println(\"coke is selected\");\n }\n }\n else if(selection.equals(\"snack\")){\n System.out.println(\"snack option is selected\");\n if(snackItems.equals(\"chips\")){\n System.out.println(\"chips item is selected\");\n }\n else{\n System.out.println(\"candy item is selected\");\n }\n }\n }", "public static void take_inputs(){\n\t\tScanner in = new Scanner(System.in);\n\t\tSystem.out.println(\"Input the ideal restaurant attributes:\");\n\t\tSystem.out.print(\"Cheap: \"); cheap = in.nextFloat();\n\t\tSystem.out.print(\"Nice: \"); nice = in.nextFloat();\n\t\tSystem.out.print(\"Traditional: \"); traditional = in.nextFloat();\n\t\tSystem.out.print(\"creative: \"); creative = in.nextFloat();\n\t\tSystem.out.print(\"Lively: \"); lively = in.nextFloat();\n\t\tSystem.out.print(\"Quiet: \"); quiet = in.nextFloat();\n\t\t\n\t\tSystem.out.println(\"Input the attributes weights:\");\n\t\tSystem.out.print(\"Weight for Cheap: \"); wt_cheap = in.nextFloat();\n\t\tSystem.out.print(\"Weight for Nice: \"); wt_nice = in.nextFloat();\n\t\tSystem.out.print(\"Weight for Traditional: \"); wt_traditional = in.nextFloat();\n\t\tSystem.out.print(\"Weight for creative: \"); wt_creative = in.nextFloat();\n\t\tSystem.out.print(\"Weight for Lively: \"); wt_lively = in.nextFloat();\n\t\tSystem.out.print(\"Weight for Quiet: \"); wt_quiet = in.nextFloat();\n\t}", "public static void main(String[] args) {\n\t\tScanner reader=new Scanner(System.in);\n\t\tSystem.out.println(\"please enter what type of ticket buying? :\");\n\t\tString typeticket=reader.nextLine();\n\t System.out.println(typeticket);\n\t int totPrice=0;\n\t System.out.println(typeticket.toLowerCase());\n if(typeticket.toLowerCase().equals(\"silver\"))\n {\n \ttotPrice=2*150;\n \tSystem.out.println(typeticket +\" Price for 2 is :\"+totPrice);\n }\n else if(typeticket.toLowerCase().equals(\"golden\"))\n {\n \ttotPrice=2*200;\n \tSystem.out.println(typeticket +\" Price for 2 is :\"+totPrice);\n }\n \n \n\t}", "public void printTheCatalog() {\n System.out.println(\"choose an option:\\n1)print all sorting by title\");\n System.out.println(\"2)print all sorting by author\\n3)print all sorting by Subject\");\n int option1 = input.nextInt();\n if (option1 == 1) {\n Collections.sort(cards, Card.OrderByTitle);\n System.out.println(\"books ordered by title: \" + cards);\n } else if (option1 == 2) {\n Collections.sort(cards, Card.OrderByAuthor);\n System.out.println(\"books ordered by Author: \" + cards);\n } else if (option1 == 3) {\n Collections.sort(cards, Card.OrderBySubject);\n System.out.println(\"books ordered by Subject: \" + cards);\n }\n }", "public static void main(String[] args) {\nString Arshia=\"Super Cool\";\r\nString Ashay=\"Hard-working\";\r\nString Devin=\"Positive\";\r\nString Andrew=\"Helpful\";\r\nString Darren=\"Kind and Nice\";\r\n\t\t// 2. Ask the user to enter a name. Store their answer in a variable.\r\nString input= JOptionPane.showInputDialog(null, \"Enter a name\");\r\nif(input.equalsIgnoreCase(\"Arshia\")) {\r\nJOptionPane.showMessageDialog(null, Arshia);\r\n\r\n}else if( input.equalsIgnoreCase(\"Ashay\")){\r\n\tJOptionPane.showMessageDialog(null, Ashay);\r\n\tif(input.equalsIgnoreCase(\"Devin\")) {\r\n\t\tJOptionPane.showMessageDialog(null, Devin);\r\n\t\tif(input.equalsIgnoreCase(\"Andrew\")) {\r\n\t\t\tJOptionPane.showMessageDialog(null, Andrew);\r\n\t\t\tif(input.equalsIgnoreCase(\"Darren\")) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, Darren);\r\n\t\t\r\n\r\n// 3. In a pop-up, tell the user what is remarkable about that person. \r\n}\r\n\t}\r\n}\r\n}\r\n}", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tSystem.out.println(\"How many libraries you bought?\");\r\n\t\tint sales = in.nextInt();\r\n\t\tswitch(sales){\r\n\t\tcase 6: System.out.println(\"You Won $1000\");\r\n\t\tcase 5: System.out.println(\"You Won A Motorcycle\");\r\n\t\tcase 4: System.out.println(\"You won A Smart Phone\");\r\n\t\tcase 3: System.out.println(\"You Won A Nintendo\");\r\n\t\tcase 2: System.out.println(\"You Won A Car\");\r\n\t\tcase 1: System.out.println(\"You won A watch\");\r\n\t\tbreak;\r\n\t\tdefault: System.out.println(\"no Price\");\r\n\r\n\t}\r\n\t}", "public void fetchVerseLines() throws IncorrectInput{\n String strObject1 = \"\";\n PoetAndTheme object1 = poetsAndThemesList.get(0);\n String strObject2 = \"\";\n PoetAndTheme object2 = poetsAndThemesList.get(0);\n strObject1 = userInputToPoet(poet1, theme);\n strObject2 = userInputToPoet(poet2, theme);\n\n for(PoetAndTheme object: poetsAndThemesList){\n if (object.getNameAndTheme().equals(strObject1)){\n object1 = object;\n }\n if (object.getNameAndTheme().equals(strObject2)){\n object2 = object;\n }\n }\n //Poems length is a random number between 5 and 10\n int poemLength = getRandomPoemLength();\n\n if(poemLength % 2 == 0){\n for (int i=0; i < (poemLength/2); i++){\n if(i != (poemLength/2 - 1)){\n System.out.println(object1.getRandomVerseLine());\n System.out.println(object2.getRandomVerseLine());\n }else{\n System.out.println(object1.getRandomVerseLine());\n\n //Checking if the last verse line ends with period or question mark.\n //If not, get a new verse line.\n System.out.println(getLastPoemLine(object2));\n }\n }\n }else{\n for (int i=0; i < (poemLength/2 - 1); i++){\n System.out.println(object1.getRandomVerseLine());\n System.out.println(object2.getRandomVerseLine());\n }\n //Checking if the last verse line ends with period or question mark.\n //If not, get a new verse line.\n System.out.println(getLastPoemLine(object1));\n }\n }", "public static void main(String[] args) {\n\t\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tPets pet1 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet2 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet3 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet4 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet5 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet6 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet7 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet8 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet9 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet10 = new Pets(null, null, 0, null, null, 0);\n\t\t\n\t\tPets[] allPets = {pet1,pet2,pet3,pet4,pet5,pet6,pet7,pet8,pet9,pet10};\n\t\tint i = 0;\n\t\tfor (Pets individualPets : allPets) {\n\t\t\ti++;\n\t\t\tSystem.out.println(\"Enter the data for the \" + i + \" pet\");\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"Enter the name\");\n\t\t\t\tindividualPets.name = bufferedReader.readLine();\n\t\t\t\tSystem.out.println(\"Enter the type\");\n\t\t\t\tindividualPets.type = bufferedReader.readLine();\n\t\t\t\tSystem.out.println(\"Enter the age\");\n\t\t\t\tString age = bufferedReader.readLine();\n\t\t\t\tindividualPets.age = Integer.parseInt(age);\n\t\t\t\tSystem.out.println(\"Enter the gender\");\n\t\t\t\tindividualPets.gender = bufferedReader.readLine();\n\t\t\t\tSystem.out.println(\"Enter the color\");\n\t\t\t\tindividualPets.color = bufferedReader.readLine();\n\t\t\t\tSystem.out.println(\"Enter the size\");\n\t\t\t\tString size = bufferedReader.readLine();\n\t\t\t\tindividualPets.size = Integer.parseInt(size);\n\t\t\t} \n\t\t\t\tcatch(IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (Pets individualPets : allPets) {\n\t\t\tSystem.out.println(\"-------------------\");\n\t\t\tSystem.out.println(\"name: \" + individualPets.name);\n\t\t\tSystem.out.println(\"type:\" + individualPets.type);\n\t\t\tSystem.out.println(\"age:\" + individualPets.age);\n\t\t\tSystem.out.println(\"gender:\" + individualPets.gender);\n\t\t\tSystem.out.println(\"color:\" + individualPets.color);\n\t\t\tSystem.out.println(\"size:\" + individualPets.size);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\t// create a Scanner for user input\n\t\tScanner input = new Scanner(System.in);\n\t\t//sets the variables for the labour and energy cost\n\t\tfinal double labour = 0.75;\n\t\tfinal double POWER_COST = 0.99;\n\t\tfinal double SIZE_COST = 0.50;\n\t\t//Prompt the user for what size of pizza they want \n\t\tSystem.out.println(\"What is the size of the pizza (in cm):\");\n\t\t//gets the size of pizza from user \n\t\tint pizzaSize = input.nextInt();\n\t\t//calculates the subtotal of the pizza\n\t\tdouble subtotal = pizzaSize * SIZE_COST + labour + POWER_COST;\n\t\t//outputs the message to the user about their subtotal\n\t\tSystem.out.println(\"Subtotal: $\" + subtotal);\n\t\t//calculates the tax \n\t\tdouble tax = subtotal * 0.13;\n\t\t//outputs the taxes to the user\n\t\tSystem.out.println(\"Taxes: $\" + tax);\n\t\t//calculates the total of the user\n\t\tdouble total = subtotal + tax;\n\t\t//outputs the total to the user\n\t\tSystem.out.println(\"Total: $\" + total);\n\t\t//according to the size of the pizza it outputs a specific message \n\t\tif (pizzaSize <= 20 && pizzaSize >= 1){\n\t\t\t//outputs this message if the pizza size is between 1 and 20cm\n\t\t\tSystem.out.println(\"We are going to make you a cute little pizza!\");\n\t\t\t} else if (pizzaSize <= 40 && pizzaSize > 20) {\n\t\t\t//outputs this message if the pizza size is between 40 and 20cm\n\t\t\tSystem.out.println(\"This will be delicious!\");\n\t\t\t} else if (pizzaSize > 40) {\n\t\t\t//outputs this message if the pizza sice is greater than 40\n\t\t\tSystem.out.println(\"Whoa, big pizza! You might need a truck to get this home!\");\n\t\t\t} else {\n\t\t\t//outputs this message if value is in negative or 0\n\t\t\tSystem.out.println(\"Invalid values entered please try again\");\n\t\t\t\t}\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString goringsfood = JOptionPane.showInputDialog(\"how much flour do you have\");\n\t\tint fish = Integer.parseInt(goringsfood);\n\t\t\tif(fish < 2) {\n\t\t\tSystem.out.println(\"go back to the store\");\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\n//\t\t2. Now ask them how many people they are going to give cookies to. If they are going\n//\t\tto give cookies to more than 30 people, tell them they are going to have to bake two\n//\t\tbatches of cookies! \n\t\t\n\t\tString keitel = JOptionPane.showInputDialog(\"how many people are you going to give cookies to\");\n\t\tint pooroldman = Integer.parseInt(keitel);\n\t\tif(pooroldman > 30) {\n\t\tSystem.out.println(\"bake two more batches of cookies\");\n\t\t}\n\t\t\n\t\t\n//\t\t3. Finally, ask them how many batches of cookies they baked. If they baked 2 batches\n//\t\tof cookies, tell them they are lucky to have so many friends. \n\t\t\n\t\tString gunsche = JOptionPane.showInputDialog(\"how many batches of cookies have you baked\");\n\t\tif(gunsche.equals(\"2\")) {\n\t\t\tSystem.out.println(\"your lucky to have a lot of friends\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "private String getPromptStrings(int choice) {\n //negative numbers correspond with the very first screen (not really anymore)\n //then the positive numbers go based on the choice the user makes\n switch (choice) {\n case 0: return \"\";\n //this is for the introductory screen\n case -1: return \"There is an enemy Ship! Looks like an Inter Planetary Pirate ship.\";\n case -2: return \"What would you like to do? Looks like is has a similar layout to our ship.\";\n case -3: return \"this is a dummy line for the status bar... health for you: 20, shields 1, enemy health: 20, shields 1\";\n case -4: return \"Now What?\";\n case -5: return \"Well that didn't work...\";\n case -6: return \"You are out of missiles.\";\n case -7: return \"All systems operational, and shields are up.\";\n case -8: return \"They are out of missiles...\";\n case -9: return \"Your Laser gun system is damaged, you can't shoot!\";\n case -10: return \"Your Missile system is damaged, you can't shoot!\";\n case -11: return \"Their Laser gun system is damaged, they can't shoot!\";\n case -12: return \"Their Missile system is damaged, they can't shoot!\";\n //this is for what you choose to do\n case 1: return \"You want to shot your laser gun at the enemy ship.\";\n case 2: return \"You want to shot a missile at the enemy ship.\";\n case 3: return \"You decided to wait and let your shields recharge.\";\n\n case 4: return \"Where do you want to shoot?\";\n case 5: return \"Where do you want to shoot?\";\n case 6: return \"\";\n\n case 45: return \"You damaged their Engine system!\";\n case 46: return \"You damaged their Shield system!\";\n case 47: return \"You damaged their Missile system!\";\n case 48: return \"You damaged their Laser Gun system!\";\n case 49: return \"You damaged their Piloting system!\";\n case 51: return \"You shoot at their Piloting system!\";\n case 52: return \"You shoot at their Laser gun system!\";\n case 53: return \"You shoot at their Missile system!\";\n case 54: return \"You shoot at their Shield system!\";\n case 55: return \"You shoot at their Engine system!\";\n\n case -45: return \"They damaged your Engine system!\";\n case -46: return \"They damaged your Shield system!\";\n case -47: return \"They damaged your Missile system!\";\n case -48: return \"They damaged your Laser Gun system!\";\n case -49: return \"They damaged your Piloting system!\";\n case -51: return \"They shoot at your Piloting system!\";\n case -52: return \"They shoot at your Laser gun system!\";\n case -53: return \"They shoot at your Missile system!\";\n case -54: return \"They shoot at your Shield system!\";\n case -55: return \"They shoot at your Engine system!\";\n\n case 80: return \"You decide to wait...\";\n case 81: return \"Your shields recharge and your systems are fixed.\";\n case -80: return \"They decide to wait..\";\n case -81: return \"Their shields recharge, and systems get repaired.\";\n\n case 97: return \"Their shield is down!\";\n case 98: return \"Their shield is up, your laser can't penetrate!\";\n case -98: return \"Your shields are up, their lasers can't penetrate!\";\n case 99: return \"It hit!\";\n case -99: return \"They landed the shot!\";\n case 100: return \"It missed!\";\n case -100: return \"They missed!\";\n\n case -101: return \"The laser hit!\";\n case -102: return \"The missile hit!\";\n case -103: return \"The laser missed.\";\n case -104: return \"The missile missed.\";\n }\n //if the input given is not one of the above\n return \"Error\";\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tint X, Y, food_needed;\r\n\r\n\t\tSystem.out.printf(\"X: \");\r\n\t\tX = scan.nextInt();\r\n\t\tSystem.out.printf(\"Y: \");\r\n\t\tY = scan.nextInt();\r\n\t\tscan.close();\r\n\r\n\t\tfood_needed = X * 3;\r\n\r\n\t\tif (Y >= food_needed) {\r\n\t\t\tSystem.out.printf(\"Enough food to feed all fish.\\n\");\r\n\t\t}\r\n\r\n\t\tif (!(Y >= food_needed)) {\r\n\t\t\tSystem.out.printf(\"Not enough food to feed all fish.\\n\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tLightCombination combination = new LightCombination();\n\n\t\tSystem.out.println(combination.getDescription());\n\n\t\tScanner userInput = new Scanner(System.in);\n\t\tString input = userInput.nextLine();\n\t\twhile (!input.equalsIgnoreCase(\"blue, aqua, green, purple\")) {\n\n\t\t\tSystem.out.println(\"Incorrect entry. Please try again!\");\n\t\t\tinput = userInput.nextLine();\n\t\t}\n\t\tcombination.solvingPuzzle(input);\n\n\t}", "public static void main(String[] args)\r\n {\n List<Film> films = getFilms();\r\n //Gets list of days starting from today\r\n List<String> days = getDays();\r\n //set scanner\r\n Scanner input = new Scanner(System.in);\r\n //gets film selection, end code if they pick (q)uit\r\n int film = whichFilm(input, films);\r\n if (film == -1)\r\n return;\r\n else\r\n System.out.println(\"You selected to watch \" + films.get(film) + \"\\n\");\r\n //gets day selection, end code if they pick (q)uit\r\n int day = whichDay(input, days, films.get(film));\r\n if (day == -1)\r\n return;\r\n else\r\n System.out.println(\"You selected \" + days.get(films.get(film).getShowingDays()[day]) + \"\\n\");\r\n //gets time selection, end code if they pick (q)uit\r\n int showingTime = whichTime(input, films.get(film));\r\n if (showingTime == -1)\r\n return;\r\n else\r\n System.out.println(\"You selected the time \" + films.get(film).getShowingTimes().get(showingTime) + \"\\n\");\r\n //gets number of tickets for each ticket type\r\n int[] numberOfTickets = whichTickets(input);\r\n //gets list of tickets with ticket type, ticket price, film name, showing day, showing time\r\n List<Ticket> order = assignTickets(numberOfTickets, films.get(film).getFilmName(), days.get(day), films.get(film).getShowingTimes().get(showingTime));\r\n\r\n orderSummery(order);\r\n }", "public static void main(String[]args)\n\t{\n\t\tScanner keyboard = new Scanner(System.in);\n\t\t\n\t\t//prompts for user input\n\t\tSystem.out.println(\"Please enter item 1:\");\n\t\t\n\t\tString item1 = keyboard.nextLine();\n\t\t\n\t\t\n\t System.out.println(\"Please enter the price:\");\n\t\t\tdouble price1 = keyboard.nextDouble();\n\t\t\t\n\t\t\n\t\tkeyboard.nextLine();\n\t\t System.out.println(\"Please enter item 2:\");\n\t String item2 = keyboard.nextLine();\n\t\t \n\t\t System.out.println(\"Please enter the price:\");\n\t\t\tdouble price2 = keyboard.nextDouble();\n\n\t\t\tkeyboard.nextLine();\n\t\t\n\t\t\n\t\t\n\t\t System.out.println(\"Please enter item 3:\");\n\t\tString item3 = keyboard.nextLine();\n\t\t\n\t\t\t \n\t\t System.out.println(\"Please enter the price:\");\n\t\t\tdouble price3 = keyboard.nextDouble();\n\t\t\n\t\t Lesson_04 form = new Lesson_04();\n\t\t \n form.format(item1, price1);\n form.format(item2,price2);\n form.format(item3, price3);\n\n\t\t \n\t\t \n\t\t\n\t}", "private void printGoalOptions() {\n System.out.println(ANSI_PURPLE + \"CHOOSE YOUR GOALS: \" + ANSI_RESET);\n System.out.println(\"----------------------------------------------------------------------------------------------------------------\");\n System.out.println(\"1. I can be poor - I don't care about the money but I want to be as\" + ANSI_BLUE + \" happy and\" + ANSI_RESET + \" as\" + ANSI_BLUE + \" educated\" + ANSI_RESET + \" as possible.\");\n System.out.println(\"2. I want to be \" + ANSI_BLUE + \"rich and happy!\" + ANSI_RESET + \" I don't have to be educated at all.\");\n System.out.println(\"3. I want to be well \" + ANSI_BLUE + \"educated and \" + ANSI_RESET + \"I don't want be hungry ever again. Always \" + ANSI_BLUE + \"full!\" + ANSI_RESET + \" ;) \");\n System.out.println(\"4. I want to have the \" + ANSI_BLUE + \"best job\" + ANSI_RESET + \" possible and make\" + ANSI_BLUE + \" lots of money\" + ANSI_RESET + \" even if it will make me unhappy.\");\n System.out.println(\"----------------------------------------------------------------------------------------------------------------\");\n }", "private void getPets(){\r\n\t\tfor(Player p : players){\r\n\t\t\tArrayList<Pet> currentpets = new ArrayList<>();\r\n\r\n\t\t\tSystem.out.println(\"How many pets for \" + p.getName() + \": \");\r\n\t\t\tint petnum = getNumber(1,3);\r\n\t\t\tfor(int i = 0; i < petnum; i++){\r\n\t\t\t\tSystem.out.println(\"Pet options are:\");\r\n\t\t\t\tint c = 1; //Counter for which pet, relating to which option\r\n\t\t\t\tfor(Pet option : pets){\r\n\t\t\t\t\tSystem.out.println(c + \". \" + option.getClass().getSimpleName() + \".\");\r\n\t\t\t\t\tc++;\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Please Choose Your Pet With A Number:\");\r\n\t\t\t\tint selected = getNumber(1, 6);\r\n\t\t\t\tPet selectedpet = pets.get(selected - 1);\r\n\t\t\t\tSystem.out.println(\"Please Enter A Name For Your Pet: \");\r\n\t\t\t\tString petname = sc.next();\r\n\t\t\t\tselectedpet.setPetname(petname);\r\n\t\t\t\tSystem.out.println(\"You now have a pet named \" + selectedpet.getPetname());\r\n\t\t\t\tcurrentpets.add(selectedpet);\r\n\t\t\t}\r\n\t\t\tp.setPets(currentpets);\r\n\t\t}\r\n\t}", "private void instruct() {\n\t\tif (vsComputer) {\n\t\t\tSystem.out.println(\"\"\"\n 1. Stone\n 2. Paper\n 3. Scissors\n You have to enter your choice\n \"\"\");\n\t\t}\n\t}", "public static String askUserOutputMode()\n {\n\tString mode;\n\tSystem.out.println(\"This spell checker outputs misspelled words in \" +\n\t\t\t \"your file.\"); \n\tSystem.out.println(\"Shall the results be printed out (enter \\\"\" +\n\t\t\t PRINT + \"\\\") or written to a file (enter \\\"\" +\n\t\t\t WRITE_TO_FILE + \"\\\")?\");\n\tmode = userInput.next();\n\n\twhile(!mode.equalsIgnoreCase(PRINT) &&\n\t !mode.equalsIgnoreCase(WRITE_TO_FILE))\n\t {\n\t\tSystem.out.println(\"Hey! You have to enter one of these \" +\n\t\t\t\t \"options: \" + PRINT + \" or \" +\n\t\t\t\t WRITE_TO_FILE + \". Try again:\");\n\t\tmode = userInput.next();\n\t }\n\n\treturn mode;\n }", "@Override\n\tpublic void showBeveragesMenu(int selectedPerson) {\n\t\ttry{\n System.out.println(\"Please place your order\");\n randomNum=transactionService.createRandomOrderNumber();\n OrderNum=initialOrderNum+randomNum;\n do {\n \t\n showCoffeeType();\n showCoffeeSize();\n System.out.println(\"Do you want Add-ons?\");\n subChoice=input.next();\n if(subChoice.equalsIgnoreCase(\"yes\"))\n {\n showCoffeeAddon();\n \n }\n else\n {\n \ttransactionService.createCoffeeOrder(selectedPerson,OrderNum,selectedCoffeeType,selectedCoffeeSize,selectedAddon);\n }\n System.out.println(\"Do you want to order more coffee?\");\n subChoice = input.next();\n \n \n\n }while(subChoice.equalsIgnoreCase(\"yes\"));\n showVoucher();\n\n printBill(selectedPerson,OrderNum,selectedVoucher);\n System.out.println(\"Happy Drink! Have a good day.\");\n System.out.println(\"================================\");\n\n\n\n }\n \n catch (InputMismatchException e)\n {\n System.out.println(\"Please provide a correct input\");\n }\n catch (NullPointerException en)\n {\n System.out.println(en.getMessage());\n }\n\t\t\n\t}", "public static void main(String[] args) throws IOException {\n Scanner scanner = new Scanner(System.in);\n /* Use nextInt to get user integer */\n System.out.print(\"Enter Integer:\\n\");\n try{\n int i = scanner.nextInt();\n System.out.printf(\"%d\\n\", i);\n }catch(NumberFormatException nfe){\n System.err.println(\"Invalid Format!\\n\");\n }\n /* Use next to get 3 strings from user */\n System.out.println(\"Enter 3 words:\");\n String first = scanner.next();\n String second = scanner.next();\n String third = scanner.next();\n\n System.out.printf(\"%s %s %s\\n\", first, second, third);\n\n /* Use nextLine to capture user sentence */\n System.out.println(\"Enter a sentence:\");\n try{\n String userSentence = scanner.nextLine();\n userSentence = scanner.nextLine();\n System.out.printf(\"%s\\n\", userSentence);\n }catch(NumberFormatException nfe){\n System.out.println(\"No sentence\");\n }\n\n System.out.println(\"Enter length: \");\n int length = scanner.nextInt();\n\n System.out.println(\"Enter width: \");\n int width = scanner.nextInt();\n\n System.out.printf(\"area: %d\\n\", length*width);\n System.out.printf(\"perimeter: %d\\n\", 2*length+2*width);\n\n // close the scanner\n scanner.close();\n }", "public static void main(String[] args) {\nString answer= JOptionPane.showInputDialog(\"do you like dogs\");\n\tJOptionPane.showMessageDialog(null,(answer));\n\t}", "public static void main(String[] args) {\n\t\tString input = JOptionPane.showInputDialog(\"input stuff here\");\n\t\t\n\t\tinput = input.toLowerCase();\n\t\tswitch(input) {\n\t\t\tcase \"aries\": {\n\t\t\t\tgiveHoroscope(Zodiac.ARIES);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"taurus\": {\n\t\t\t\tgiveHoroscope(Zodiac.TAURUS);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"gemini\": {\n\t\t\t\tgiveHoroscope(Zodiac.GEMINI);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"cancer\": {\n\t\t\t\tgiveHoroscope(Zodiac.CANCER);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"virgo\": {\n\t\t\t\tgiveHoroscope(Zodiac.VIRGO);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"leo\": {\n\t\t\t\tgiveHoroscope(Zodiac.LEO);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"libra\": {\n\t\t\t\tgiveHoroscope(Zodiac.LIBRA);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"scorpio\": {\n\t\t\t\tgiveHoroscope(Zodiac.SCORPIO);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"sagittarius\": {\n\t\t\t\tgiveHoroscope(Zodiac.SAGITTARIUS);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"capricorn\": {\n\t\t\t\tgiveHoroscope(Zodiac.CAPRICORN);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"aquarius\": {\n\t\t\t\tgiveHoroscope(Zodiac.AQUARIUS);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"pisces\": {\n\t\t\t\tgiveHoroscope(Zodiac.PISCES);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "static void feedPet() {\r\n\t\tJOptionPane.showMessageDialog(null, \"Your \" + pet + \" is happy and full.\");\r\n\t\thappinessLevel+=3;\r\n\t}", "public static void main(String[] args) {\n \n\t\tScanner scan=new Scanner(System.in) ;\n\t\t\tSystem.out.println(\"Are you thirsty?\");\n\t\t\tboolean bl=scan.nextBoolean();\n\t\t\tSystem.out.println(\"Are you sleepy?\");\n\t\t\tboolean sl=scan.nextBoolean();\n\t\t String drink1 =\"Coffee\";\n\t\t String drink2=\"Water\";\n\t\t String drink3=\"Tea\";\n\t\t String k=\"Nothing\";\n\t\t if(bl==true && sl==false) {\n\t\t\t System.out.println(\"Looks like you need \" + drink2);\n\t\t }else if(bl==true && sl==true) {\n\t\t\t System.out.println(\"Looks like you need \" +drink1);\n\t\t }else if(bl==false && sl==true) {\n\t\t\t System.out.println(\"Looks like you need \"+ drink3);\n\t\t }else {\n\t\t\t System.out.println(\"Looks like you need \" +k);\n\t\t }\n\t\t}", "public void printAndCheck (ArrayList<String> terms, ArrayList<String> definitions, Scanner console, Random rand, Student user) {\n \r\n\r\n int numTerms = rand.nextInt(terms.size());\r\n int numDefs = rand.nextInt(definitions.size()); \r\n System.out.println(\"Choose \\\"true\\\", \\\"false\\\", \\\"t\\\", \\\"f\\\", \\\"yes\\\", \\\"no\\\", \\\"y\\\", or \\\"n\\\"\");\r\n System.out.println(terms.get(numTerms) + \" = \" + definitions.get(numDefs) + \"?\"); //random pairing\r\n System.out.println();\r\n boolean correctAnswer = (terms.indexOf(terms.get(numTerms)) == definitions.indexOf(definitions.get(numDefs))); //the correct answer is a boolean, if the index of the term is the same as the index of the definition\r\n String response = console.next();\r\n if (response.equalsIgnoreCase(\"true\") || response.equalsIgnoreCase(\"false\") || //if the user gives a valid answer\r\n response.equalsIgnoreCase(\"t\") || response.equalsIgnoreCase(\"f\") || response.equalsIgnoreCase(\"y\") \r\n || response.equalsIgnoreCase(\"n\") || response.equalsIgnoreCase(\"yes\") || response.equalsIgnoreCase(\"no\")) {\r\n \r\n \t boolean userAnswer = (response.equalsIgnoreCase(\"true\") || response.equalsIgnoreCase(\"t\") \r\n || response.equalsIgnoreCase(\"y\") || response.equalsIgnoreCase(\"yes\"));\r\n \r\n if (userAnswer == correctAnswer) {\r\n System.out.println(\"You got it right! :)\");\r\n user.incrNumCorrect(); //for the stats method\r\n user.incrTotal(1); //for the stats method\r\n }else {\r\n System.out.println(\"You got it wrong :( \");\r\n user.incrTotal(1);\r\n user.incNumIncorrect();\r\n }\r\n \r\n }else{\r\n System.out.println(\"Always remember to only choose\\n\\\"true\\\", \\\"false\\\", \\\"t\\\", \\\"f\\\", \\\"yes\\\", \\\"no\\\", \\\"y\\\", or \\\"n\\\"!\"); //the user's response will be considered false if they do not type \"true\" or \"false\"\r\n user.incrTotal(1);\r\n }\r\n\r\n System.out.println();\r\n }", "public static void main(String[] args){\n\t\tBallotBox aBallotBox = new BallotBox();\n\t\tBagInterface<Ballot> ballots = aBallotBox.getBallots();\n\t\tboolean isDone = false;\n\t\tSystem.out.println(\"Welcome to the election! What would you like to do?\");\n\t\tSystem.out.println(\"1: Vote for a candidate\");\n\t\tSystem.out.println(\"2: Count the number of votes for a candidate\");\n\t\tSystem.out.println(\"3: Remove a vote\");\n\t\tSystem.out.println(\"4: Get number of votes in the ballot box\");\n\t\tSystem.out.println(\"5: Empty ballot box\");\n\t\tSystem.out.println(\"6: Print all votes\");\n\t\tSystem.out.println(\"7: Quit\");\n\t\twhile (isDone == false){ \n\t\tSystem.out.println(\"Enter your choice here:\");\n\t\tScanner keyboard = new Scanner(System.in); //assume the input will be an integer\n\t\tint i = keyboard.nextInt();\n\t\tswitch (i) {\n\t\tcase 1: \n\t\t\t//add a ballot\n\t\t\tSystem.out.println(\"Please type in the name of the candidate you would like to vote for: \");\n\t\t\tScanner keyboardName = new Scanner(System.in);\n\t\t\tString name = keyboardName.next();\n\t\t\tSystem.out.println(\"Please type in bribe amount: \");\n\t\t\tScanner keyboardBribeAmount = new Scanner(System.in);\n\t\t\tdouble bribeAmount = keyboardBribeAmount.nextDouble();\n\t\t\tballots.add(new Ballot(name, bribeAmount));\n\t\t\tSystem.out.println(\"Vote added successfully\");\n\t\t\tbreak;\n\t\tcase 2: \n\t\t\t// count the votes for a particular candidate\n\t\t\tSystem.out.println(\"Please type in the name of the candidate for whom the votes you would like to count: \");\n\t\t\tkeyboardName = new Scanner(System.in);\n\t\t\tname = keyboardName.next();\n\t\t\tint frequency = ballots.getFrequencyOf(new Ballot(name,1));\n\t\t\tSystem.out.println(\"The number is \" + frequency);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t//remove a vote\n\t\t\tSystem.out.println(\"1: to remove a random one\");\n\t\t\tSystem.out.println(\"2: to remove a specific one\");\n\t\t\tScanner keyboardRemove = new Scanner(System.in);\n\t\t\tint m = keyboardRemove.nextInt();\n\t\t\tif (m==1) {\n\t\t\t\t\tBallot ballotRemoved = ballots.remove();\n\t\t\t\t\tSystem.out.println(\"You have removed the vote: \" + ballotRemoved);\n\t\t\t}\n\t\t\telse if (m==2){\n\t\t\t\t\tSystem.out.println(\"Please enter the name of the person whose vote you want to remove\");\n\t\t\t\t\tScanner keyboardNameRemove = new Scanner(System.in);\n\t\t\t\t\tString nameRemove = keyboardNameRemove.next();\n\t\t\t\t\tboolean done = false; \n\t\t\t\t\tint q = 0;\n\t\t\t\t\tObject[] arr = ballots.toArray();\n\t\t\t\t\twhile ( done == false){\n\t\t\t\t\t\tif (arr[q].equals(new Ballot(nameRemove, 1)))\n\t\t\t\t\t\t\t\tballots.remove((Ballot) arr[q]);\n\t\t\t\t\t\t\t\tSystem.out.println(\"A vote for \" + arr[q] + \" has been removed\");\t\n\t\t\t\t\t\t\t\tdone = true;}\n\t\t\t}\n\t\t\telse System.out.println(\"Sorry your input is not valid\");\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\t//getCurrentSize()\n\t\t\tSystem.out.println(\"We have \" + ballots.getCurrentSize() + \" votes right now\");\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\t//clear();\n\t\t\tballots.clear();\n\t\t\tSystem.out.println(\"The ballot box is empty now\");\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\t//print; \n\t\t\tObject[] ballotArray = ballots.toArray();\n\t\t\tfor (Object occur:ballotArray){\n\t\t\t\tSystem.out.println(occur);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 7: \n\t\t\t//quit\n\t\t\tisDone = true;\n\t\t\tSystem.out.println(\"Thank you!\");\n\t\t\tbreak;\t\n\t\tdefault: System.out.println(\"Please enter a valid number:\");\n\t\t}}\n\t}", "public static void main(String[] args) {\n\t\n\tScanner myScanner = new Scanner(System.in);\n\t\n\tSystem.out.println(\"What Country are you from?\");\n\tString country = myScanner.nextLine();\n\t\n\tString favoriteFood;\n\t\n\tswitch (country) {\n\t\n\tcase \"USA\":\n\t\tfavoriteFood=\"Burger\";\n\t\tbreak;\n\tcase \"Afghanistan\":\n\t\tfavoriteFood= \"Palau\";\n\t\tbreak;\n\tcase \"Russia\":\n\t\tfavoriteFood= \"Pelmeni\";\n\t\tbreak;\n\tcase \"Colombia\":\n\t\tfavoriteFood= \"Arepas\";\n\t\tbreak;\n\tcase \"Italy\":\n\t\tfavoriteFood= \"Pasta\";\n\t\tbreak;\n\tcase \"Pakistan\":\n\t\tfavoriteFood= \"Biryani\";\n\t\tbreak;\n\tdefault:\n\t\tfavoriteFood= \"Unkown\";\n\t\tbreak;\n\t\t\n\t}\n\tSystem.out.println(\"favorite food is \"+favoriteFood);\n\t}", "private void printRecommendation(){\n\t\t\n\t\tSystem.out.println( \"\\n\\nRecommendations for you to save money......\");\n\t\t\n\t\tSystem.out.println( \"\\n\\n\\tBest restaurants ......\");\n\t\tfor(int i = 0 ; i < 3 ; i++){\n\t\t\tif(restaurantTransactions.size() > 0){\n\t\t\t\tSystem.out.println( \"\\t\\t\"+(i+1) +\".\"+ restaurantTransactions.pollFirst().getName());\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println( \"\\n\\tBest markets ......\");\n\t\tfor(int i = 0 ; i < 3 ; i++){\n\t\t\tif(marketTransactions.size() > 0){\n\t\t\t\tSystem.out.println( \"\\t\\t\"+(i+1) +\".\"+ marketTransactions.pollFirst().getName());\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println( \"\\n\\tBest housing options ......\");\n\t\tfor(int i = 0 ; i < 3 ; i++){\n\t\t\tif(stayTransactions.size() > 0){\n\t\t\t\tSystem.out.println( \"\\t\\t\"+(i+1) +\".\"+ stayTransactions.pollFirst().getName().substring(0,42));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println( \"\\n\\tBest gas pump stations ......\");\n\t\tfor(int i = 0 ; i < 3 ; i++){\n\t\t\tif(gaspumpTransactions.size() > 0){\n\t\t\t\tSystem.out.println( \"\\t\\t\"+(i+1) +\".\"+ gaspumpTransactions.pollFirst().getName());\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\nTIPS and Strategies for you to save more money........\");\n\t\t\n\t\tint counter = 1;\n\t\t\n\t\tfloat totalAmountTaxi = 0;\n\t\tint numTimesToMarket = 0;\n\t\tint numTimesToRestaurant = 0;\n\t\t\n\t\t\n\t\tfor(String transactionKey: userData.keySet()){\n\t\t\t\n\t\t\tif(userData.get(transactionKey).getCategory() == 'T'){\n\t\t\t\ttotalAmountTaxi += userData.get(transactionKey).getTotalAmountSpend();\n\t\t\t}\n\t\t\telse if(userData.get(transactionKey).getCategory() == 'M'){\n\t\t\t\tnumTimesToMarket += userData.get(transactionKey).getFrequency();\n\t\t\t}\n\t\t\telse if(userData.get(transactionKey).getCategory() == 'R'){\n\t\t\t\tnumTimesToRestaurant += userData.get(transactionKey).getFrequency();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(totalAmountTaxi > 1500){\n\t\t\tSystem.out.println( \"\\n\\t\" + counter++ +\".Plan to buy a vehicle.\"\n\t\t\t\t\t+ \"\\n\\n\\t It would be better if you buy a car for the time being\"\n\t\t\t\t\t+ \"\\n\\t as the average expense for taxis are more.\"\n\t\t\t\t\t+ \"Also once you are done with the trip you\\n\\t can sell it off.\");\n\t\t}\n\t\t\n\t\tif(totalAmountTaxi < 1500)\n\t\t{\t\tSystem.out.println( \"\\n\\t\" + counter++ +\".Prefer taxi over buying a car.\"\n\t\t\t\t\t+ \"\\n\\n\\t It would be better if you prefer taxi instead of buying a car\"\n\t\t\t\t\t+ \"\\n\\t as the average expense for travel are comparitively less.\");\n\t\t}\n\t\t\n\t\tif(numTimesToMarket > 48){\n\t\t\tSystem.out.println( \"\\n\\t\" + counter++ +\".Switch to online shopping.\"\n\t\t\t\t\t+ \"\\n\\n\\t It would be better if you prefer online shopping \"\n\t\t\t\t\t+ \"instead of going market\\n\\t which saves time also for you\");\n\t\t}\n\t\t\n\t if(numTimesToRestaurant > 300){\n\t\t System.out.println( \"\\n\\t\" + counter++ +\".Prefer cooking instead going restaurants.\"\n\t\t\t\t\t+ \"\\n\\n\\t It would be better if you prefer cooking \"\n\t\t\t\t\t+ \"instead of going resturants / pubs\\n\\t which saves more money for you\");\n\t\t\n\t }\n\t \n\t System.out.println(\"\\n\\n\\nGenerating file \\\"Report_Unknown_Transactions.txt\\\" \"\n\t \t\t+ \"for unknown transactions .... Please check....\");\n\t \n\t try{\n\t \tPrintWriter writer = new PrintWriter(\"Report_Unknown_Transactions.txt\", \"UTF-8\");\n\n\t \t writer.println(\"\\n\\nList of the unknown transactions .. \\n\\n\");\n\t\t for(TransactionData unknownData :unknownTransactions ){\n\t\t\t\twriter.println(unknownData.getName());\n\t\t\t}\n\t\t writer.println(\"\\n\\nPlease check README/TransactionDataInfokey.txt to know how can you\"+\n\t\t \t\t\t\" help me to identify the unknown transactions .. \");\n\t\t writer.close();\n\t }\n\t catch(Exception e){\n\t \tSystem.out.println(\"Unable to create the report . Please check permission \"\n\t \t\t\t+ \"or ensure disk space..\");\n\t }\n\t\t\n\t\t\n\t}", "public static void main(String[] args)\n\t\t\t{\n\t\t\t\tScanner enter = new Scanner(System.in);\n\t\t\t\tSystem.out.println(\"Please enter your condominium selection:\\n1 - Park View\\n2 - Golf \" +\n\t\t\t\t \"Course View\\n3 - Lake View\");\n\t\t\t\tcondoSelection = enter.nextInt();\n\t\t\t\tboolean invalidResponse = (condoSelection > 3 || condoSelection < 0);\n \n \n\t\t\t\tif (condoSelection == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tsalesPrice = PARKVIEW_PRICE;\n\t\t\t\t\t\tSystem.out.println(park + String.format( \"%.2f\", salesPrice ));\n\t\t\t\t\t}\n\t\t\t\telse if (condoSelection == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\tsalesPrice = GOLFVIEW_PRICE;\n\t\t\t\t\t\tSystem.out.println(golf + String.format( \"%.2f\", salesPrice ));\n\t\t\t\t\t}\n\t\t\t\telse if (condoSelection == 3)\n\t\t\t\t\t{\n\t\t\t\t\t\tsalesPrice = LAKEVIEW_PRICE;\n\t\t\t\t\t\tSystem.out.println(lake + String.format( \"%.2f\", salesPrice ));\n\t\t\t\t\t}\n\t\t\t\telse if (invalidResponse)\n\t\t\t\t\t{\n\t\t\t\t\t\tsalesPrice = 0;\n\t\t\t\t\t\tSystem.out.println(invalidSelection + String.format( \"%.2f\", salesPrice ));\n\t\t\t\t\t}\n\t\t\t}", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\n\t\t// Prompt the user to create a savings or a checking account\n\t\t//*** Start #1 ***//\n\t\tint type = 0;\n\t\tdo {\n\t\t\tSystem.out.println(\"What kind of account do you wish to create?\");\n\t\t\tSystem.out.print(\"Enter 1 for savings and 2 for checking: \");\n\t\t\ttype = input.nextInt();\n\t\t}\n\t\twhile (type != 1 && type != 2);\n\n\t\tAccount account;\n\t\tif (type == 1) account = new SavingsAccount();\n\t\telse account = new CheckingAccount();\n\n\t\t// Prompt the user to enter the account id, balance, and annual interest rate\n\t\tSystem.out.print(\"\\nEnter the account id (int): \");\n\t\tint id = input.nextInt();\n\t\taccount.setId(id);\n\n\t\tSystem.out.print(\"Enter the account balance (double): \");\n\t\tdouble balance = input.nextDouble();\n\t\taccount.setBalance(balance);\n\n\t\tSystem.out.print(\"Enter the annual interest rate (double): \");\n\t\tdouble annualInterestRate = input.nextDouble();\n\t\tAccount.setAnnualInterestRate(annualInterestRate);\n\t\t//*** End #1 ***//\n\t\t\n\t\tdo {\n\t\t\t// Display options to users\n\t\t\t//*** Start #2 ***//\n\t\t\tdisplayOptions(account);\n\n\t\t\tint option = input.nextInt();\n\t\t\tif (option == 0)\n\t\t\t\tbreak; \n\n\t\t\tswitch (option) {\n\t\t\tcase 1: \n\t\t\t\tSystem.out.println(\"\\n\\tThe id is: \" + account.getId());\n\t\t\t\tSystem.out.println(\"\\tThe account was created on: \" + account.getDateCreated());\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.printf(\"\\n\\tThe balance is: %.2f\\n\", account.getBalance());\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.printf(\"\\n\\tThe monthly interest is: %.2f\\n\", account.getMonthlyInterest());\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tSystem.out.print(\"\\n\\tEnter the amount to withdraw: \");\n\t\t\t\tdouble withdrawAmount = input.nextDouble();\n\t\t\t\taccount.withdraw(withdrawAmount);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tSystem.out.print(\"\\n\\tEnter the amount to deposit: \");\n\t\t\t\tdouble depositAmount = input.nextDouble();\n\t\t\t\taccount.deposit(depositAmount);\n\t\t\t\tbreak;\t\n\t\t\tcase 6:\n\t\t\t\tif (account instanceof CheckingAccount)\n\t\t\t\t\tSystem.out.printf(\"\\n\\tThe overdraft limit is: %.2f\\n\", ((CheckingAccount)account).getOverdraftLimit());\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"\\n\\tOption not available\");\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tif (account instanceof CheckingAccount) {\n\t\t\t\t\tSystem.out.print(\"\\n\\tEnter the new overdraft limit: \");\n\t\t\t\t\tdouble limit = input.nextDouble();\n\t\t\t\t\t((CheckingAccount)account).setOverdraftLimit(limit);\n\t\t\t\t} else\n\t\t\t\t\tSystem.out.println(\"\\n\\tOption not available\");\n\t\t\t\tbreak;\t\n\t\t\tdefault: \n\t\t\t\tSystem.out.println(\"\\n\\tInvalid option. Try again.\");\n\t\t\t//*** End #2 ***//\n\t\t\t};\n\t\t} while (true);\n\n\t\t// Display a final message\n\t\tSystem.out.println(\"\\nGoodbye\");\n\n\t\t// Close the Scanner\n\t\tinput.close();\n\t}", "public static void farewell(int num1, int num2, int num3){\n \n JOptionPane.showMessageDialog(null,\"The player won \"+ num2+ \"time(s).\"+\n \"\\nThe computer won \"+ num3+ \"time(s).\"+\n \"\\nYou tied with the computer \"+ num1+ \"time(s).\");\n \n }", "public static void main(String[] args) {\n\tScanner snacks= new Scanner(System.in);\n\t\n\tSystem.out.println(\"Write down your favorite snacks:\");\n\tString mySnacks=snacks.nextLine();\n\n\tif (mySnacks.equalsIgnoreCase(\"Chip\")) \n\t\tSystem.out.println(\"Chip is great\");\n\t\n //System.out.println(mySnacks + chip);\n\telse if(mySnacks.equals(\"HUI\")) \n\tSystem.out.println(\"Stupid Hui\");\n\t\n\telse if(mySnacks.equals(\"Abc\"))\n\tSystem.out.println(\"What is it\");\n\t\n\telse\n\tSystem.out.println(\"Do yo have more?\");\n\t}", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tNumberFormat money = NumberFormat.getCurrencyInstance(Locale.US); //Currency\n\n\t\tdouble bankBalance = 150.00;\n\t\tSystem.out.println(\"Bank Balance: \" + money.format(bankBalance));\n\n\t\tSystem.out.println(\"Enter your age\");\n\t\tString age = input.nextLine();\n\n\t\tString retirement = null; // null versus \"\" == same\n\t\ttry {\n\t\t\t// try catch - if user tries anything other then what is needed, we can prevent\n\t\t\t// that with Try Catch\n\t\t\tif (age.equals(\"Quit\")) {\n\t\t\t\tSystem.out.println(\"No-one likes a quitter.\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tif (Integer.parseInt(age) % 2 == 0) {\n\t\t\t\tretirement = \"12\";\n\t\t\t} else if (Integer.parseInt(age) % 2 == 1) {\n\t\t\t\tretirement = \"14\";\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.out.println(\"Invalid input!\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tSystem.out.println(\"You will retire in \" + retirement + \" years.\");\n\n\t\tinput.close();\n\t}", "public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tSystem.out.println(\"Input your bithday: \\n (ex:0528)\");\n\t\tint val = scn.nextInt();\n\t\tif (val <= 119) {\n\t\t\tSystem.out.println(\"Capricorn\");\n\t\t}\n\t\tif (120 <= val && val < 218) {\n\t\t\tSystem.out.println(\"Aquarius\");\n\t\t}\n\t\tif (219 <= val && val <= 320) {\n\t\t\tSystem.out.println(\"Pisces\");\n\t\t}\n\t\tif (321 <= val && val <= 419) {\n\t\t\tSystem.out.println(\"Aries\");\n\t\t}\n\t\tif (420 <= val && val <= 520) {\n\t\t\tSystem.out.println(\"Taurus\");\n\t\t}\n\t\tif (521 <= val && val <= 621) {\n\t\t\tSystem.out.println(\"Gemini\");\n\t\t}\n\t\tif (622 <= val && val <= 722) {\n\t\t\tSystem.out.println(\"Cancer\");\n\t\t}\n\t\tif (723 <= val && val <= 822) {\n\t\t\tSystem.out.println(\"Leo\");\n\t\t}\n\t\tif (823 <= val && val <= 922) {\n\t\t\tSystem.out.println(\"Virgo\");\n\t\t}\n\t\tif (923 <= val && val <= 1023) {\n\t\t\tSystem.out.println(\"Libra\");\n\t\t}\n\t\tif (1024 <= val && val <= 1122) {\n\t\t\tSystem.out.println(\"Scorpio\");\n\t\t}\n\t\tif (1123 <= val && val < 1221) {\n\t\t\tSystem.out.println(\"Sagittarius\");\n\t\t}\n\t\tif (1222 <= val && val < 1230) {\n\t\t\tSystem.out.println(\"Capricorn\");\n\t\t}\n\t}", "private void promptForSomething() {\n userInputValue = prompt(\"Please enter something: \", true);\n System.out.println(\"Thank you. You can see your input by choosing the Display Something menu\");\n }", "public void consoleGetOptions(){\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tString input;\n\t\tint diff=0,first=0;\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.print(\"Who starts first (0-Player, 1-Computer): \");\n\t\t\t\tinput=in.readLine();\n\t\t\t\tfirst = Integer.parseInt(input);\n\t\t\t\tif (first<0 || first>1) throw new IllegalArgumentException();\n\t\t\t\tif (first==1) ttt.switchPlayer();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\t}\n\t\t}while(true);\t\t\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.print(\"Enter AI level (0-Noob, 1-Normal, 2-God Mode): \");\n\t\t\t\tinput=in.readLine();\n\t\t\t\tdiff = Integer.parseInt(input);\n\t\t\t\tif (diff<0 || diff>2) throw new IllegalArgumentException();\n\t\t\t\tttt.setDifficulty(diff);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\t}\n\t\t}while(true);\t\t\n\t}", "public static int getUserChoice(){\r\n return Input.getInt(\"Enter 1 to add a song, 2 to display all songs, or 3 to quit the program: \");\r\n }", "public static void main(String[]args)\n\t{\n\t\tScanner keyboard = new Scanner(System.in);\n\t\t\n\t\t//prompt for user input\n\t\tSystem.out.println(\"What is your name?\");\n\t\t\n\t\tString name = keyboard.next();\n\t\t\n\t\tSystem.out.println(\"Seriously? \" + name + \" is kind of a lame name\");\n\t\t\n\n\t\t\n\t\t//prompt for user imput\n\t\tSystem.out.println(\"How old are you\" +\" \"+ name);\n\t\t\n\t\tString old = keyboard.next();\n\t\t\n\t\tSystem.out.println( old + \"!!\" +\"\"+ \"That's terrible!\");\n\t\t\n\t\t//prompt for user input\n\t\tSystem.out.println(\"What do you like to do for fun?\");\n\t\t\n\t\tString like = keyboard.next();\n\t\t\n\t\tSystem.out.println(like + \" sounds really boring. I kinda feel bad for you\");\n\t\t\n\t\tSystem.out.println(\"What instrument do you play?\");\n\t\t\n\t\tString instrument = keyboard.next();\n\t\t\n\t\tSystem.out.println(\"I bet you're dreadful at\" +\" \"+ instrument +\" \"+ \".Please don't ever play the\" +\" \"+ instrument +\" \"+ \"when you're near me\");\n\t\t\n\t\tSystem.out.println(\"What do you want to be when you grow up?\");\n\t\t\n\t\tString be = keyboard.next();\n\t\t\n\t\tSystem.out.println(\"Really?\" +\" \"+\"Aren't you a little bit underqualified to be a\" +\" \"+ be +\"?\");\n\t\t\n\t\tSystem.out.println(\"So\" +\" \"+ name +\" \"+ \"you're\" +\" \"+ old +\"...\" + \"\\n\" + \"You like to play\" +\" \"+ like + \"...\" +\"\\n\"+ \"Good luck on becoming a\" +\" \"+ be + \".\" + \"\\n\" + \"I'm only kiddin'\" +\" \"+ name + \"!\");\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args)\n {\n Scanner input2 = new Scanner(System.in);\n boolean cond = true;\n while (cond)\n {\n calculateTips();\n System.out.print(\"Another bill? (y/n)\\n\");\n String answer = input2.nextLine();\n \n if (new String(answer).equals(\"n\") || new String(answer).equals(\"N\"))\n {\n System.out.print(\"See ya later. \");\n cond = false;\n }\n else if (answer != \"y\" || answer != \"Y\")\n {\n } \n }\n }", "public static void main(String[] args) {\n\n\t\tboolean bool1, bool2;\n\t\tString drink = null ;\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Are you thirsty?\");\n\t\tbool1 = input.nextBoolean();\n\t\tSystem.out.println(\"Are you sleepy?\");\n\t\tbool2 = input.nextBoolean();\n\n\t\tif (bool1 && !bool2) {\n\t\t\t\n\t\t\t\n\t\t\t\tdrink = \"Water\";\n\n\t\t\t\n\n\t\t} else if (bool1 && bool2) {\n\t\t\t\n\t\t\t\tdrink = \"Coffee\";\n\n\t\t\t\n\t\t} else if (!bool1 && bool2) {\n\t\t\t\n\t\t\t\tdrink = \"Tea\";\n\n\t\t\t\n\t\t} else {\n\t\t\tdrink = \"Nothing\";\n\n\t\t\n\t\t\n\t\t\n\t\t}\n\t\tSystem.out.println(\"Looks like you need \" + drink);\n\t}", "public static void main(String[] args) {\n\n\t\tScanner myScanner;\n\t\tint heights;\n\n\t\tmyScanner = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter your heights\");\n\t\theights = myScanner.nextInt();\n\n\t\tif (heights < 5) {\n\t\t\tSystem.out.println(\"short\");\n\t\t} else if (heights == 5 && heights == 6) {\n\n\t\t\tSystem.out.println(\"medium\");\n\n\t\t} else if (heights >= 6) {\n\n\t\t\tSystem.out.println(\"tall\");\n\n\t\t} else {\n\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tScanner sc =new Scanner(System.in);\n\t\tArrayList<Chocolates> chocolates=new ArrayList<Chocolates>(); \n\t\tArrayList<Sweets> sweets=new ArrayList<Sweets>(); \n\t\tint giftCount=0;\n\t\tint candiesCount=0;\n\t\t//I have considered gifts greater than weight 10 as sweets and less than 10 as chocolates\n\t\t//and if weight is less than 5 it is under chocolates only but will be counted as candy also.\n\t\tSystem.out.println(\"Enter weight of the gifts\");\n\t\tint weightOfTheGift=sc.nextInt();\n\t\twhile(weightOfTheGift!=0)\n\t\t{\n\t\t\tif(weightOfTheGift<10)\n\t\t\t{\n\t\t\t\tgiftCount++;\n\t\t\t\tchocolates.add(new Chocolates(weightOfTheGift,giftCount)); \n\t\t\t\t if(weightOfTheGift<5)\n\t\t\t\t\t candiesCount++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgiftCount++;\n\t\t\t\t sweets.add(new Sweets(weightOfTheGift,giftCount)); \n\n\t\t\t}\n\t\t\tSystem.out.println(\"Enter weight of the gifts\");\n\t\t\tweightOfTheGift=sc.nextInt();\n\t\t}\n\t\t//sorting chocolates by their weight\n\t\tCollections.sort(chocolates);\n\t\tSystem.out.println(\"The smallest to biggest chocolate is as follows along with their gift number\");\n\t\tfor(Chocolates choco: chocolates)\n\t\t{\n\t\t\tSystem.out.println(\"Weight : \"+ choco.weight+\" Gift number: \"+choco.giftNumber);\n\t\t}\n\t\tif(candiesCount!=0)\n\t\t{\n\t\t\tSystem.out.println(\"There are \"+ candiesCount+\" candies.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"There are no candies.\");\n\t\t}\n\t\tsc.close();\n\n\t}", "public void pickSandwhich() {\n includedIngredients.clear();\n if(selectSandwhich.getValue().equals(\"Chicken\")){\n includedIngredients.appendText(\"Fried Chicken\\nSpicy Sauce\\nPickles\");\n sandwhich = new Chicken();\n\n }\n\n if(selectSandwhich.getValue().equals(\"Fish\")){\n includedIngredients.appendText(\"Grilled Snapper\\nCilantro\\nLime\");\n sandwhich = new Fish();\n }\n\n if(selectSandwhich.getValue().equals(\"Beef\")){\n includedIngredients.appendText(\"Roast Beef\\nProvolone Cheese\\nMustard\");\n sandwhich = new Beef();\n }\n orderPrice.clear();\n String price = new DecimalFormat(\"#.##\").format(sandwhich.price());\n orderPrice.appendText(\"$\"+price);\n }", "private void createPickBox() {\n\t\tfinal Coin[] coins = CHFStore.getSortedCoinTab();\n\t\tString coinsStr[] = new String[coins.length];\n\t\tint i = 0;\n\t\tfor (Coin c : coins) {\n\t\t\tcoinsStr[i++] = c.getDisplay();\n\t\t}\n\t\tbuilder = new AlertDialog.Builder(this);\n\t\tbuilder.setTitle(\"Value of coin\");\n\t\tbuilder.setItems(coinsStr, new OnClickListener() {\n\n\t\t\t// as soon as a value is selected for a coin\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tif (circleIndex >= 0) {\n\t\t\t\t\tCoin selected = coins[which];\n\t\t\t\t\tMyCircle selectedCircle = circlesList.get(circleIndex);\n\t\t\t\t\t// launch calculation process and display it in a toast\n\t\t\t\t\t double monneySum = calculateMonneySum(selected, selectedCircle);\n\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\tgetApplicationContext(),\n\t\t\t\t\t\t\t\"You own \" + String.format(\"%.2f\", monneySum)\n\t\t\t\t\t\t\t\t\t+ \" CHF\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public static void main(String[] args) {\n\t// 1. Ask for an initial password, and store it in a variable\n String answer1 = JOptionPane.showInputDialog(null, \"What is the secret message?\"); \n\t// 2. Ask for a message and store it in a variable\n String answer2 = JOptionPane.showInputDialog(null, \"What is your password?\");\n\t// 3. Ask your friend for the password and store it in a variable\n String answer3 = JOptionPane.showInputDialog(\"Do you know the password?\");\n\t// 4. If the password matches,\n if (answer1.equals(answer3))\n {\n\tJOptionPane.showMessageDialog(null, \"\" + answer2);\t\n\t}\n else\n {\n \tJOptionPane.showMessageDialog(null, \"Your wrong.\");\n }\n\t\t// show the secret message\n\t// *5. OPTIONAL: let your friend keep guessing even if they are wrong\n\n}", "public static void main(String[] args) {\n\t\tRandom rand = new Random();\n\n\t\t// ask user if they want to play\n\t\tint confirm = JOptionPane.showConfirmDialog(null, \"Would you like to play the color guessing game?\", \"YES/NO\",\n\t\t\t\tJOptionPane.YES_NO_OPTION);\n\n\t\t// user chose yes\n\t\tif (confirm == JOptionPane.YES_OPTION) {\n\n\t\t\t//loop until the user no longer wants to play\n\t\t\twhile (confirm == JOptionPane.YES_OPTION) {\n\t\t\t\t\n\t\t\t\t//create the random number (0-5)\n\t\t\t\tint randomNum = rand.nextInt(6);\n\t\t\t\t\n\t\t\t\t// pass the randomNum into chooseColor() and set the color to colorPicked\n\t\t\t\tColor colorPicked = chooseColor(randomNum);\n\t\t\t\t\n\t\t\t\t// pass colorPicked into guessColor() to determine who won\n\t\t\t\tguessColor(colorPicked);\n\t\t\t\t\n\t\t\t\t// ask user if they want to play again\n\t\t\t\tconfirm = JOptionPane.showConfirmDialog(null, \"Would you like to play the color guessing game again?\",\n\t\t\t\t\t\t\"YES/NO\", JOptionPane.YES_NO_OPTION);\n\n\t\t\t}\n\n\t\t\t//end the program\n\t\t\tSystem.exit(0);\n\n\t\t//user chose no\n\t\t} else {\n\n\t\t\t//end the program\n\t\t\tSystem.exit(0);\n\n\t\t}\n\t}", "public static void main(String[] args) {\r\n\t\tPaintBrush brush=new PaintBrush();\r\n\t\tScanner scan=new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter choice of color 1=red 2=blue 3=green 4=pink\");\r\n\t\tint choice = scan.nextInt();\r\n\t\tbrush.doPaint(choice);\r\n\t}", "public static void main(String[] args) {\n\n\t\tString cont;\n\t\tdo {\n\n\t\t\tMarketsProducts m = new MarketsProducts();\n\n\t\t\tSystem.out.println(\"\\n\" + \"\\n\" + \"Would you like continue adding Products, press [yes] or [no]\");\n\t\t\tcont = input.next();\n\t\t} while (cont.equalsIgnoreCase(\"yes\"));\n\n\t\tSystem.out.println(\"Thanks for choosing us!\");\n\n\t}", "public static void main(String[] args) {\r\n\r\n\t\tScanner scan = new Scanner(System.in);\r\n\r\n\t\tSystem.out.print(\"You weight in pounds:\");\r\n\t\tint weight = scan.nextInt();\r\n\r\n\t\tSystem.out.print(\"Your height in feet and inches:\");\r\n\t\tdouble height = scan.nextFloat();\r\n\r\n\t\tdouble lbsInKg = weight / 2.2046; // lbs to kg\r\n\r\n\t\tdouble feetInInch = height * 12; // all the inches\r\n\r\n\t\tdouble heightInchToMeter = feetInInch * 0.0254; // all the meters\r\n\r\n\t\tdouble bmi = lbsInKg / (heightInchToMeter * heightInchToMeter);\r\n\r\n\t\tSystem.out.println(\"Your BMI is \" + bmi);\r\n\r\n\t\tif (bmi < 18.5) {\r\n\t\t\tSystem.out.println(\"Your risk factory Underweight\");\r\n\t\t} else if (bmi >= 18.5 && bmi < 25) {\r\n\t\t\tSystem.out.println(\"Normal Weight\");\r\n\t\t} else if (bmi >= 25 && bmi < 30) {\r\n\t\t\tSystem.out.println(\"Overweight\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Obese\");\r\n\t\t}\r\n\r\n\t}", "public static void main(String args[]) {\n\t\tSystem.out.println(\"-----Select the traffic light----\");\n\t\tSystem.out.println(\"1.Red\");\n\t\tSystem.out.println(\"3.Yellow\");\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"\\nEnter your choice : \");\n\t\t/**\n\t\t * Display text according to the color of the traffic light\n\t\t */\n\t\tint choice = sc.nextInt();\n\t\tif (choice == 1) {\n\t\t\tSystem.out.println(\"\\n STOP\");\n\t\t}\n\t\tif (choice == 2) {\n\t\t\tSystem.out.println(\"\\nGo\");\n\t\t}\n\t\tif (choice == 3) {\n\t\t\tSystem.out.println(\"\\n1READY\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tIBeverage beverage = new Base();\n\t\t\n\t\tboolean done = false;\n\t\t\n\t\twhile( !done ) {\n\t\t\tSystem.out.println(\"Current beverage price : \" + beverage.getTotalPrice());\n\t\t\tSystem.out.println(\"Please select... 1:Shot of Espresso | 2:Milk | Ener nothing if youe dink are all set.\");\n\t\t\t\n\t\t\tswitch(sc.nextInt()) {\n\t\t\t\tcase 1:\n\t\t\t\t\tSystem.out.println(\"1 Shot of espresso is added\");\n\t\t\t\t\tbeverage = new Espresso(beverage);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tSystem.out.println(\"Milk is added\");\n\t\t\t\t\tbeverage = new Milk(beverage);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Your drink is set now. Thank you!\");\n\t\t\t\t\tdone = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Total Beverage Price : \" + beverage.getTotalPrice());\n\t\tsc.close();\n\t\t\n\t\t}", "private void storeTrip(Player p){\r\n\t\tSystem.out.println(\"Welcome to the store!\");\r\n\t\tSystem.out.println(\"Just a reminder, you have $\" + p.getMoney() + \" to spend!\");\r\n\t\tSystem.out.println(\"Please Select An Option: \");\r\n\t\tSystem.out.println(\"1. Buy Food\");\r\n\t\tSystem.out.println(\"2. Buy Toys\");\r\n\t\tSystem.out.println(\"3. Leave the store\");\r\n\t\tArrayList<Toy> storetoys = store.getToys();\r\n\t\tArrayList<Food> storefood = store.getFoods();\r\n\t\tint[] toyamounts = store.getToyamounts();\r\n\t\tint[] foodamounts = store.getFoodamounts();\r\n\t\tint buyoption; //The buying option\r\n\t\tint c; //Counter\r\n\r\n\t\tint selectedoption = getNumber(1, 3);\r\n\t\tswitch(selectedoption){\r\n\t\t//Buy food\r\n\t\tcase 1:\r\n\t\t\tc = 1;\r\n\t\t\tfor(Food f : storefood){\r\n\t\t\t\tSystem.out.println(c + \". \" + f.getName() + \"\\nPrice: $\" + f.getValue() + \" Stock: \" + foodamounts[c-1]);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\tbuyoption = getNumber(1, storefood.size());\r\n\t\t\tFood selectedfood = storefood.get(buyoption -1);\r\n\t\t\tif(p.getMoney() > selectedfood.getValue() && foodamounts[buyoption-1] > 0){\r\n\t\t\t\tp.setMoney(p.getMoney() - selectedfood.getValue());\r\n\t\t\t\tfoodamounts[buyoption -1]--; //Take one away, as it has been sold.\r\n\t\t\t\tp.addFood(selectedfood);\r\n\t\t\t\tstore.setFoodamounts(foodamounts);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\t//Buy toys\r\n\t\tcase 2:\r\n\t\t\tc = 1;\r\n\t\t\tfor(Toy t : storetoys){\r\n\t\t\t\tSystem.out.println(c + \". \" + t.getName() + \"\\nPrice: $\" + t.getPrice() + \" Stock: \" + toyamounts[c-1]);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\tbuyoption = getNumber(1, storetoys.size());\r\n\t\t\tToy selectedtoy = storetoys.get(buyoption -1);\r\n\t\t\tif(p.getMoney() > selectedtoy.getPrice() && toyamounts[buyoption-1] > 0){\r\n\t\t\t\tp.setMoney(p.getMoney() - selectedtoy.getPrice());\r\n\t\t\t\ttoyamounts[buyoption -1]--; //Take one away, as it has been sold.\r\n\t\t\t\tp.addToy(selectedtoy);\r\n\t\t\t\tstore.setToyamounts(toyamounts);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"\\n\\n\\n\\n\\n\\nError. Either the store was out of stock for the selected product or the player was out of money.\");\r\n\t\t\t}\r\n\t\tcase 3:\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"ERROR\");\r\n\t\t}\r\n\t}", "public static void main(String[] args)\n\t{\n\t\t\n\t\tString answer = JOptionPane.showInputDialog(null,\"Are you happy? or is your name bob?\"); //IS THESE CORRECT?????\n\t\t\n\t\t\n\t\t/*\n\t\t * no, yes, bob\n\t\t */\n\t\t\n\t\t/*\n\t\t * psudo code.. \n\t\t * if - else statements are conditional dependent clauses.\n\t\t * As soon as the first if/else-if evaluates to true.. it will run its \n\t\t * block, and then drop out of the entire if-else block..\n\t\t * \n\t\t * int i = 1;\n\t\t * \n\t\t * if(i == 0) -> i is 1 NOT 0.. therefore false.\n\t\t * {\n\t\t * \t\n\t\t * \n\t\t * } else if (i == 1 ) { it is 1 therefore true\n\t\t * \n\t\t * System.out.println(\"ITS TRUE!\");\n\t\t * \n\t\t *\n\t\t * } else if (i == 2) {\n\t\t * \n\t\t * \n\t\t * \n\t\t * } else if (i >=3 ) {\n\t\t * \n\t\t * \t\n\t\t * } else {\n\t\t * \n\t\t * \t\t//Default catch all!\n\t\t * }\n\t\t * \n\t\t * if - statements are not dependent clauses. Each one is evaluated \n\t\t * separate from the previous if statement. if one evalutates to true,\n\t\t * the next statement will be evaluated independently as well.\n\t\t * \n\t\t * if(i == 0) {\n\t\t * \t\tSystem.out.println(\"its 0\");\n\t\t * }\n\t\t * \n\t\t * if(i == 1) {\n\t\t * \t\tSystem.out.println(\"its 1\");\n\t\t * }\n\t\t * \n\t\t * if(i == 2) {\n\t\t * \t\tSystem.out.println(\"its 2\");\n\t\t * }\n\t\t * \n\t\t * if(i == 1 || i ==2) {\n\t\t * \n\t\t * \t\tSystem.out.println(\"its 1 or 2\");\n\t\t * }\n\t\t */\n\t\t\n\t\tif(answer.contentEquals(\"no\"))\n\t\t{\n\t\t\t//Stuff when answer is no happens here.\n\t\t\tString answer2 = JOptionPane.showInputDialog(null,\"Do you want to be happy\");\n\t\t\t\n\t\t\tif(answer2.contentEquals(\"no\"))\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(null,\"Keep on doing what you are doing\");\n\t\t\t\t\n\t\t\t} else if(answer2.contentEquals(\"yes\")) {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Change something\");\n\t\t\t}\n\t\t} else if(answer.contentEquals(\"yes\")) {\n\t\t\t\n\t\t\tJOptionPane.showMessageDialog(null, \"Keep on doing what you are doing\");\n\t\t} else if(answer.contentEquals(\"bob\")) {\n\t\t\n\t\t\tJOptionPane.showMessageDialog(null,\"Nice you like bob too!!!\");\n\n\t\t} else {\n\t\t\t\n\t\t\tJOptionPane.showMessageDialog(null, \"THEY ANSWERED ANYTHING OTHER THAN NO, YES, and BOB\");\n\t\t}\n\t\t\n\t}", "public void display() {\r\n String kind;\r\n if (profit == true) {\r\n kind = \"profit\";\r\n }\r\n\r\n else kind = \"non-profit\";\r\n System.out.println(name + \" is a \" + kind + \" organization that has\" + \" \" + revenue + \" dollars in revenue\" );\r\n }", "static int askProductType() {\n\n int choice; // initialize return variable\n\n choice = Validate.readInt(ASK_PRODUCT_TYPE, 2); // display options to user for products and store result if valid choice\n\n return choice; // return users choice\n }", "private void feed(Player p){\r\n\t\tSystem.out.println(\"What pet would you like to feed?\");\r\n\t\tArrayList<Food> foodlist = p.getFood();\r\n\r\n\t\tint c = 1;\r\n\t\tfor(Pet pet : p.getPets()){\r\n\t\t\tSystem.out.println(c + \". \" + pet.getPetname());\r\n\t\t\tc++;\r\n\t\t}\r\n\r\n\t\tint selectedpetindex = getNumber(1, p.getPets().size());\r\n\t\tPet selectedpet = p.getPets().get(selectedpetindex - 1);\r\n\t\tSystem.out.println(\"What food do you want to feed \" + selectedpet.getPetname() + \" with?\");\r\n\r\n\t\tc = 1;\r\n\t\tfor(Food f : foodlist){\r\n\t\t\tSystem.out.println(c + \". \" + f.getName());\r\n\t\t\tc++;\r\n\t\t}\r\n\r\n\t\tint foodindex = getNumber(1, foodlist.size());\r\n\t\tFood selectedfood = foodlist.get(foodindex);\r\n\r\n\t\tselectedpet.feed(selectedfood);\r\n\t\tfoodlist.remove(foodindex);\r\n\t\tp.setFood(foodlist);\r\n\r\n\t\tp.setActions(p.getActions() - 1);\r\n\t}", "public static void main (String [] args) {\n Scanner input = new Scanner(System.in);\n \n // Ask the user for their age\n System.err.print(\"How old are you? \");\n int age = input.nextInt();\n \n // Ask the user if they have a coupon\n System.err.print(\"Do you have a coupon? [true/false] \");\n \n boolean coupon = input.nextBoolean();\n \n // Print the cost of a movie ticket\n if (age <= 13 || age >= 65) {\n \tif (coupon == true) { \n \t\tSystem.out.println(\"Your ticket costs $9.5.\"); \t\n \t}\n \telse {\n \t\tSystem.out.println(\"Your ticket costs $11.5.\");\n \t}\n }\n if ((age > 13 && age < 65) && coupon == true) {\n \tSystem.out.println(\"Your ticket costs $12.5.\");\n }\n if ((age > 13 && age < 65) && coupon == false) {\n \tSystem.out.println(\"Your ticket costs $14.5.\");\n }\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int threeD1 = scan.nextInt();\n int luxury1 = scan.nextInt();\n int numSeats = scan.nextInt();\n boolean threeD = false;\n boolean luxury = false;\n if(threeD1 == 1)\n threeD = true;\n if(luxury1 == 1)\n luxury = true;\n Theater t = new Theater(threeD, luxury, numSeats);\n\n String dummy = scan.nextLine(); // throw away new line character\n String title = scan.nextLine();\n t.setTitle(title);\n\n int basePrice = scan.nextInt();\n t.setBasePrice(basePrice);\n\n int N = scan.nextInt();\n for(int i = 0; i < N; ++i) {\n int numberOfSeats = scan.nextInt();\n int seatNumber = scan.nextInt();\n int totalPrice;\n if(numberOfSeats == 1)\n totalPrice = t.reserveOne(seatNumber);\n else\n totalPrice = t.reserveMultiple(numberOfSeats, seatNumber);\n if(totalPrice > 0)\n System.out.println(totalPrice);\n }\n\n t.printInfo();\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString genero=\"\";\r\n\t\t\r\n\t\tdo{\r\n\t\t\tgenero=JOptionPane.showInputDialog(\"Introduce tu genero (MASCULINO/FEMENINO)\");\r\n\t\t\t\r\n\t\t}while (genero.equalsIgnoreCase(\"M\")==false && genero.equalsIgnoreCase(\"F\")==false);\r\n\t\t\r\n\t\tint altura=Integer.parseInt(JOptionPane.showInputDialog(\"Introduce tu altura en cm por favor\"));\r\n\t\t\r\n\t\tint pesoideal = 0;\r\n\t\t\r\n\t\tif(genero.equalsIgnoreCase(\"M\")){\r\n\t\t\t\r\n\t\t\tpesoideal=altura-110;\r\n\t\t}\r\n\t\t\r\n\t\telse if (genero.equalsIgnoreCase(\"F\")){\r\n\t\t\t\r\n\t\t\tpesoideal=altura-120;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Tu peso ideal es \" + pesoideal);\r\n\r\n\t}", "public static void main(String [] args)\n {\n //create Scanner to obtain input from command window\n Scanner input = new Scanner(System.in);\n \n double item1 = 239.99;// item 1 price \n double item2 = 129.75;// item 2 price\n double item3 = 99.95;// item 3 price\n double item4 = 350.89;// item 4 price\n int a;// number of item1\n int b;// number of item2\n int c;// number of item3\n int d;// number of item4\n double comm = .09;// commision rate\n double total;// total sales\n \n // # of item 1 \n System.out.print(\"Number of item 1 sold: \"); //prompt\n a = input.nextInt(); \n \n // # of item 2 \n System.out.print(\"Number of item 2 sold: \"); //prompt\n b = input.nextInt(); \n \n // # of item 3\n System.out.print(\"Number of item 3 sold: \"); //prompt\n c = input.nextInt(); \n \n // # of item 4 \n System.out.print(\"Number of item 4 sold: \"); //prompt\n d = input.nextInt(); \n \n // total of all items sold\n total = a * item1 + b * item2\n + c * item3 + d * item4;\n \n // displays total of sales done by sales person\n System.out.printf(\" Total Sales: %.2f\" , ( double ) total );\n \n // displays Earnings of Salesperson for the week\n System.out.printf( \"\\n Total weeks pay: %.2f \" , ( double ) total * comm + 200 );\n \n input.close();\n }", "public static void pizzaStats(DeluxePizza todaysPizza[]) {\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tboolean repeat = true;\n\t\tdo{\n\t\t\t// display menu\n\t\t\tSystem.out.print(\"\\nWhat information would you like to see?\" +\n\t\t\t\t\t\"\\n1. Cost and details of cheapest pizza\" +\n\t\t\t\t\t\"\\n2. Cost and details of most costly pizza\" +\n\t\t\t\t\t\"\\n3. Number of pizzas sold today\" +\n\t\t\t\t\t\"\\n4. Number of pizzas of a specific size\" +\n\t\t\t\t\t\"\\n5. Average cost of pizzas\" +\n\t\t\t\t\t\"\\n6. Quit\" +\n\t\t\t\t\t\"\\nPlease enter your choice: \");\n\t\t\t// take input for menu selection\n\t\t\tint menuChoice;\n\t\t\tmenuChoice = keyboard.nextInt();\n\t\t\t\n\t\t\twhile(menuChoice < 1 || menuChoice > 6)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"Incorrect option, please enter your choice: \");\n\t\t\t\tmenuChoice = keyboard.nextInt();\n\t\t\t}\n\t\t\t// run desired method\n\t\t\tswitch(menuChoice)\n\t\t\t{\n\t\t\tcase 1: lowestPrice(todaysPizza); break;\n\t\t\tcase 2: highestPrice(todaysPizza); break;\n\t\t\tcase 3: \n\t\t\t\tint totalPizzas = DeluxePizza.getNumberOfPizzas();\n\t\t\t\tSystem.out.println(\"You have sold \" + totalPizzas + \" pizzas today!\");\n\t\t\t\tbreak;\n\t\t\tcase 4: numberOfPizzasOfSize(todaysPizza); break;\n\t\t\tcase 5: \n\t\t\t\tdouble totalSales = 0.00;\n\t\t\t\ttotalPizzas = DeluxePizza.getNumberOfPizzas();\n\t\t\t\tif (totalPizzas == 0)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"You have not made any pizzas today!\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor(DeluxePizza x:todaysPizza)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(x == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotalSales += 0.00;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\ttotalSales += x.calcCost();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdouble averageCost = totalSales / totalPizzas;\n\t\t\t\t\tSystem.out.println(\"The average cost per pizza is $\" + averageCost + \"!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\trepeat = false;\n\t\t\t}\n\t\t}while(repeat);\n\t\treturn;\n\t}", "public Welcome() {\r\n name = askName();\r\n Scanner in = new Scanner(System.in);\r\n Hello.display(\"Well, nice to meet you \"+name+\"!\" +\r\n \"\\nWhat is your favorite kind of pet?\");\r\n Pet favoritePet = Pet.dog;\r\n Hello.display(\"\");\r\n favoritePet = Pet.valueOf(in.next());\r\n favoritePet.provideFact();\r\n Hello.display(\"\\nHey, \"+name+\"! What is your favorite kind of vehicle?\");\r\n Vehicle favoriteVehicle = Vehicle.spaceship;\r\n Hello.display(\"\");\r\n favoriteVehicle = Vehicle.valueOf(in.next());\r\n favoriteVehicle.provideFact();\r\n Hello.display(\"Alright, goodbye \"+name+\"! Until next time!\");\r\n in.close();\r\n }", "public static void main(String[] args) {\n\t\tRobot juk = new Robot();\n\t\t// 2. Set the speed to 100\n\t\tjuk.setSpeed(100);\n\t\tint colorChoice = JOptionPane.showOptionDialog(null, \"hello\", \"title\", JOptionPane.INFORMATION_MESSAGE,\n\t\t\t\tJOptionPane.DEFAULT_OPTION, null, new String[] { \"Color 1\", \"Color 2\", \"Color 3\" }, 0);\n\n\t\t// 3. Use if statements to check the the value of colorChoice and set the pen\n\t\t// color accordingly\n\t\tif (colorChoice == 2)\n\t\t\t;\n\t\t{\n\t\t\tjuk.setPenColor(255, 0, 0);\n\t\t}\n\t\tif (colorChoice == 1)\n\t\t\t;\n\t\t{\n\t\t\tjuk.setPenColor(0, 0, 255);\n\t\t}\n\t\tif (colorChoice == 3)\n\t\t\t;\n\t\t{\n\t\t\tjuk.setPenColor(0, 255, 0);\n\t\t}\n\t\t// 4. Ask the use how many polygons they want to be drawn.\n\t\tString turd = JOptionPane.showInputDialog(\"how many sided polygon would you like?\");\n\n\t\tint tuf = Integer.parseInt(turd);\n\n\t\tif (tuf <= 2) {\n\t\t\tJOptionPane.showMessageDialog(null, \"*ERROR COMPUTE MACHINE BROKE*\");\n\n\t\t}\n\t\t// 5. Use the robot to draw the number of polygons the user requested.\n\n\t\t// 6. Make it so your shapes do not overlap\n\n\t\t// 7. Challenge: add more colors to the Option Dialog.\n\t}", "public static void main(String[] args) {\n \r\n UIManager.put(\"OptionPane.minimumSize\", new Dimension(150, 150));\r\n \r\n Scanner input = new Scanner(System.in);\r\n System.out.print(\"Enter five digits number: \");\r\n number = input.next();\r\n\r\n if (number.length() != 5) {\r\n System.out.println(\"Number most be five digits! \");\r\n System.out.print(\"Enter five digits number: \");\r\n number = input.next();\r\n }\r\n firstDigit = number.charAt(0);\r\n secondDigit = number.charAt(1);\r\n thirdDigit = number.charAt(2);\r\n fouthDigit = number.charAt(3);\r\n fifthDigit = number.charAt(4);\r\n\r\n //JOptionPane.showMessageDialog(null, firstDigit + \"\\t\\t\\t\" + secondDigit + \"\\t\\t\\t\" + thirdDigit + \"\\t\\t\\t\" + fouthDigit + \"\\t\\t\\t\" + fifthDigit);\r\n System.out.println(\"input of \" + number + \" will display \" + firstDigit + \"\\t\" + secondDigit + \"\\t\" + thirdDigit + \"\\t\" + fouthDigit + \"\\t\" + fifthDigit);\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tScanner scnr = new Scanner(System.in);\n\t\t\n\t\tString [] topics = {\"Healthcare\", \"Gun Control\", \"Food Shortage\", \"Video Games\", \"Economy\"};\n\t\tint[][] responses = new int[5][10];\n\t\tint[] average = new int[5];\n\t\tint userResponse, pollCounter = 0, holder = 0;\n\t\tint highPoint = 0, lowPoint = 0;\n\t\tString highTopic = null, lowTopic = null;\n\t\tboolean run = true;\n\t\t\n\t\tSystem.out.println(\"On a scale of 1(least important) to 10(most important), how would you rate these topics? \");\n\t\t\n\t\twhile (run)\n\t\t{\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t{\n\t\t\t\tSystem.out.printf(\"How would you rate %s: \", topics[i]);\n\t\t\t\tuserResponse = scnr.nextInt();\n\t\t\t\t\n\t\t\t\t//increment responses in 2D array\n\t\t\t\tswitch (userResponse)\n\t\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\tresponses[i][userResponse - 1]++;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Invalid rating.\");\n\t\t\t\t\ti--;\t\t\t\t//resets increment so user can input proper rating without skipping a topic\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Take poll again?(Enter -1 to quit): \");\n\t\t\tuserResponse = scnr.nextInt();\t\t//reusing variable\n\t\t\t\n\t\t\tif (userResponse == -1)\n\t\t\t{\n\t\t\t\trun = false;\t//ends while loop\n\t\t\t}\n\t\t}\n\t\t//calculate avg for each topic\n\t\tfor (int l = 0; l < 5; l++)\n\t\t{\n\t\t\tfor (int m = 0; m < 10; m++)\n\t\t\t{\n\t\t\t\t//hold value from responses indexes to pass into avg array calculation\n\t\t\t\tholder = responses[l][m];\n\t\t\t\tpollCounter += holder;\t\t//used as a total count for topic to help calculate avg\n\t\t\t\taverage[l] += holder * (m + 1);\n\t\t\t}\n\t\t\t\n\t\t\tif (average[l] > highPoint)\n\t\t\t{\n\t\t\t\thighPoint = average[l];\n\t\t\t\thighTopic = topics[l];\n\t\t\t}\n\t\t\t\n\t\t\tif (lowPoint == 0 || lowPoint > average[l])\n\t\t\t{\n\t\t\t\tlowPoint = average[l];\n\t\t\t\tlowTopic = topics[l];\n\t\t\t}\n\t\t\t\n\t\t\taverage[l] /= (double)pollCounter; //actual avg being set, cast double for accuracy\n\t\t\tpollCounter = 0;\t\t\t\t//reset pollCounter for next average index\n\t\t}\n\t\t\n\t\t//print ratings on top\n\t\tSystem.out.printf(\"Rating:\\t\\t1\\t2\\t3\\t4\\t5\\t6\\t7\\t8\\t9\\t10\\tAverage\\n\");\n\t\t\n\t\t//print topics\n\t\tfor (int j = 0; j < 5; j++)\n\t\t{\n\t\t\tSystem.out.printf(\"%s:\", topics[j]);\n\t\t\tfor (int k = 0; k < 10; k++)\n\t\t\t{\n\t\t\t\tSystem.out.printf(\"\\t%d\", responses[j][k]);\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\t%d\\n\", average[j]);\n\t\t}\n\t\tSystem.out.printf(\"The topic with the highest point total of %d is %s.\\n\", highPoint, highTopic);\n\t\tSystem.out.printf(\"The topic with the lowest point total of %d is %s.\\n\", lowPoint, lowTopic);\n\t\tscnr.close();\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Do you want to try your luck with the slot machine? Type 1 for YES or 2 for NO:\");\n int answer = sc.nextInt();\n\n\n //Create If/Else based on Yes/No response\n //Create For loop to generate numbers\n //Convert int affirmation to string value\n\n if (answer == 1)\n {\n for (int i = 0; i <= 2; i++)\n {\n double j = (Math.random() *10);\n int k = (int) j;\n System.out.print(\"[\"+k+\"]\");\n }\n }\n\n else\n {\n System.out.println(\"Maybe next time!\");\n\n }\n }", "public static void main(String[] args) {\n\t\tint score = 0;\n\t\t// 2. Ask the user a question \n\t\tString answer = JOptionPane.showInputDialog(\"Who is the greatest basketball player of all time?\");\n\t\t// 3. Use an if statement to check if their answer is correct\n\t\tif (answer.equalsIgnoreCase(\"Michael Jordan\") || answer.equalsIgnoreCase(\"Jordan\") ) {\n\t\t// 4. if the user's answer was correct, add one to their score \n\t\t\tscore = score + 1; }\n\t\t// 5. Create more questions by repeating steps 1, 2, and 3 below. \n\t\tanswer = JOptionPane.showInputDialog(\"How many rings does Michael Jordan have?\");\n\t\tif (answer.equalsIgnoreCase(\"6\") || answer.equalsIgnoreCase(\"six\") ) {\n\t\tscore = score + 1; \n\t\t}\n\t\tanswer = JOptionPane.showInputDialog(\"What player scored the most points in one game?\");\n\t\tif (answer.equalsIgnoreCase(\"Wilt Chamberlain\")) {\n\t\tscore = score + 1;\n\t\t}\n\t\tanswer = JOptionPane.showInputDialog(\"Who won the most career NBA championships as a player?\");\n\t\tif (answer.equalsIgnoreCase(\"Bill Russell\")) {\n\t\tscore = score + 1;\n\t\t}\n\t\tanswer = JOptionPane.showInputDialog(\"What team drafted Kobe Brayant?\");\n\t\tif (answer.equalsIgnoreCase(\"Charlotte Hornets\") || answer.equalsIgnoreCase(\"Hornets\") ) {\n\t\tscore = score + 1;\n\t\t}\n\t\tanswer = JOptionPane.showInputDialog(\"Who is the shortest player of all-time?\");\n\t\tif (answer.equalsIgnoreCase(\"Muggsy Bogues\") || answer.equalsIgnoreCase(\"Tyrone Bogues\") ) {\n\t\tscore = score + 1;\n\t\t}\n\t\t// 6. After all the questions have been asked, print the user's score\n\t\tJOptionPane.showMessageDialog(null, \"You scored \" + score + \".\");\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner a=new Scanner(System.in);\r\n\t\t/*System.out.println(\"Enter the number\");\r\n\t\tSystem.out.println(\"1.Micro\");\r\n\t\tSystem.out.println(\"2.Prime\");\r\n\t\t\r\n\t\tint cab=a.nextInt();\r\n\t\tSystem.out.println(\"Enter the KM\");\r\n\t\tint Km=a.nextInt();\r\n\t\tif(cab==1) {\r\n\t\t\tint price=10;\r\n\t\t\tSystem.out.println(\"Drop Charge =\"+(price*Km));\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(cab==2){\r\n\t\t\tint price=20;\r\n\t\t\tSystem.out.println(\"Drop Charge =\"+(price*Km));\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Invalid\");\r\n\t\t}*/\r\n\tSystem.out.println(\"enter your choice\");\r\n\tSystem.out.println(\"bike\");\r\n\tSystem.out.println(\"car\");\r\n\tString vehicle=a.next();\r\n\t\r\n\tif(vehicle.equals(\"bike\")) {\r\n\t\trateforbike(vehicle);\r\n\t}\r\n\telse if(vehicle.equals(\"car\")) {\r\n\t\trateforcar(vehicle);\r\n\t}\r\n\t\r\n\r\n}", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tSystem.out.println(\"Enter your Choice:\\n1.red\\n2.yellow\\n3.green\");\n\t\tint number=s.nextInt();\n\t\tif(number==1)\n\t\t\tSystem.out.println(\"stop\");\n\t\telse if(number==2)\n\t\t\tSystem.out.println(\"ready\");\n\t\telse if(number==3)\n\t\t\tSystem.out.println(\"go\");\n\n\t}", "private static void printOption(){\r\n System.out.println(\"Select option what you want to do\");\r\n System.out.println(\"Input plain(default) / stylish / slide\");\r\n option = scan.nextLine();\r\n try{\r\n if(option.toLowerCase().equals(\"plain\")){\r\n }\r\n else if(option.toLowerCase().equals(\"stylish\")){\r\n }\r\n else if(option.toLowerCase().equals(\"slide\")){\r\n }\r\n else if(option.toLowerCase().equals(\"\")){\r\n option = \"plain\";\r\n }\r\n else{\r\n throw new Exception(\"Check option\\n\");\r\n }\r\n } catch(Exception e){\r\n e.printStackTrace();\r\n } finally {\r\n System.out.println(\"Option : \" + option);\r\n }\r\n }", "public void pizzaInp(){\n String[] pizzaTypes = {\"Cheese Pizza\", \"Veg Pizza\", \"Non-Veg Pizza\", \"Marghrita Pizza\"};\n\n //Looping through the array\n for(String value : pizzaTypes){\n System.out.println(value);\n }\n\n //Make a user input for pizza types\n System.out.print(\"Enter from above or \\\"F\\\" for final order or press \\\"M\\\" to get to the main menu or press \\\"C\\\" to cancel:\");\n String pizzInp = scanFoodInp.nextLine();\n\n //Make a while loop then a conditional statement\n while(true){\n\n //Conditional Statements\n\n if(pizzInp.equals(pizzaTypes[0])){\n\n System.out.println(\"Here is your Cheese Pizza! Price:\" + pizzaPrice + \"$\");\n numberOfFoodOrdered += 1;\n\n System.out.println(\"You want to order again?\");\n String userInp = scanFoodInp.nextLine();\n\n if(userInp.equals(\"Yes\") || userInp.equals(\"yes\")){\n pizzaInp();\n }else if(userInp.equals(\"No\")){\n break;\n }\n break;\n }else if(pizzInp.equals(pizzaTypes[1])){\n\n System.out.println(\"Here is your Veg Pizza! Price:\"+ pizzaPrice + \"$\");\n numberOfFoodOrdered += 1;\n\n System.out.println(\"You want to order again?\");\n String userInp1 = scanFoodInp.nextLine();\n\n if(userInp1.equals(\"Yes\") || userInp1.equals(\"yes\")){\n pizzaInp();\n }else if(userInp1.equals(\"No\")) {\n break;\n }\n break;\n }else if(pizzInp.equals(pizzaTypes[2])){\n\n System.out.println(\"Here is your Non-Veg Pizza! Price:\" + pizzaPrice + \"$\");\n numberOfFoodOrdered += 1;\n\n System.out.println(\"You want to order again?\");\n String userInp2 = scanFoodInp.nextLine();\n\n if(userInp2.equals(\"Yes\") || userInp2.equals(\"yes\")){\n pizzaInp();\n }else if(userInp2.equals(\"No\")) {\n break;\n }\n break;\n }else if(pizzInp.equals(pizzaTypes[3])){\n\n System.out.println(\"Here is your Marghrita Pizza! Price:\" + pizzaPrice + \"$\");\n numberOfFoodOrdered += 1;\n\n System.out.println(\"You want to order again?\");\n String userInp3 = scanFoodInp.nextLine();\n\n if(userInp3.equals(\"Yes\") || userInp3.equals(\"yes\")){\n pizzaInp();\n }else if(userInp3.equals(\"No\")) {\n break;\n }\n break;\n }else if(pizzInp.equals(\"F\") || pizzInp.equals(\"f\")){\n int bill = pizzaPrice * numberOfFoodOrdered;\n System.out.println(\"Here is your bill:\" + bill + \"$\");\n\n System.out.print(\"Enter amount to pay:\");\n int moneyInp = scanFoodInp.nextInt();\n\n if(moneyInp == bill){\n System.out.println(\"Thanks for the Payment!\");\n break;\n }else if(moneyInp > bill){\n System.out.println(\"Thanks for money Change:\" + (moneyInp - bill) + \"$\");\n break;\n }else {\n System.out.println(\"Wrong payment kicked you out of shop!\");\n break;\n }\n }else if(pizzInp.equals(\"M\") || pizzInp.equals(\"m\")){\n\n //Making an order object here\n Order order = new Order();\n order.loopThroughFood();\n\n }else if(pizzInp.equals(\"C\") || pizzInp.equals(\"c\")){\n break;\n }\n }\n System.exit(0);\n }", "public static void main(String[] args)\r\n\t{\n\t\tfloat lbs, heightin, kg, heightm, BMI=0;\r\n\t\tint count;\r\n\t\t\r\n\t\tSystem.out.println(\"Metric or Imperial? \\n 1. Imperial\t2. Metric\");\r\n\t\tScanner scnr = new Scanner(System.in);\r\n\t\tcount = scnr.nextInt();\r\n\t\t\r\n\t\twhile(count != 1 || count != 2)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Metric or Imperial? \\n 1. Imperial\t2. Metric\");\r\n\t\t\tcount = scnr.nextInt();\r\n\t\t\tif(count == 1 || count == 2)\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(count == 1)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Enter weight in pounds: \");\r\n\t\t\tlbs = scnr.nextFloat();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Enter height in inches: \");\r\n\t\t\theightin = scnr.nextFloat();\r\n\t\t\t\r\n\t\t\tBMI = 703*lbs / (heightin*heightin);\r\n\t\t}\r\n\t\t\r\n\t\telse if(count == 2)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Enter weight in kilograms: \");\r\n\t\t\tkg = scnr.nextFloat();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Enter height in meters: \");\r\n\t\t\theightm = scnr.nextFloat();\r\n\t\t\t\r\n\t\t\tscnr.close();\t\t\t\r\n\t\t\tBMI = kg / (heightm*heightm);\r\n\t\t}\r\n\t\t\r\n\t\t//Display BMI value for user\r\n\t\tSystem.out.println(\"Your BMI is: \" + BMI);\r\n\t\t\r\n\t\tif(BMI < 18.5)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"A BMI less than 18.5 indicates that you are underweight.\");\r\n\t\t}\r\n\t\telse if(BMI <= 24.9)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"A BMI between 18.5 and 24.9 is a healthy BMI\");\r\n\t\t}\r\n\t\telse if(BMI <= 29.9)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"A BMI between 25 and 29.9 indicates that you are overweight\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//Last case does not need an if statement\r\n\t\t\tSystem.out.println(\"A BMI greater than 30 indicates that you are obese.\");\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public static void main(String[] args) {\n\t\tPokemon firstPokemon = new Pokemon(\" P1 Typhlosion \", 1600, \" Fire \" , \" Healthy \" , \"Scratch\" , \"Bite\" , \"Fire Blast\", 300 , 375 , 450);\r\n\t\t Pokemon secondPokemon = new Pokemon(\" P2 Snorlax \", 1300, \" Normal \" , \" Healthy \" , \"Body Slam\" , \"Sleep\" , \"Swallow\", 500 , 100 , 200);\r\n\t\t System.out.println (firstPokemon.name + firstPokemon.health + firstPokemon.type + firstPokemon.status );\r\n\t\t System.out.println (secondPokemon.name + secondPokemon.health + secondPokemon.type + secondPokemon.status );\r\n\t\t Scanner myObj = new Scanner(System.in);\r\n\t\t\r\n\t\t \r\n\t\t System.out.println( \"P1 Turn. Enter number for corresponding attack! \" );\r\n\t\t System.out.println( \" 1(\" + firstPokemon.pAttack1 +\")\"+ \" 2(\" + firstPokemon.pAttack2 +\")\"+ \" 3(\" + firstPokemon.pAttack3 +\")\" );\r\n\t\t String battleCommand = myObj.nextLine();\r\n\t\t System.out.println (battleCommand);\r\n\t\t if (battleCommand.charAt(0) == '1') {\r\n\t\t\t System.out.println (firstPokemon.pAttack1);\r\n\t\t }\r\n\t\t else if (battleCommand.charAt(0) == '2') {\r\n\t\t\t System.out.println (firstPokemon.pAttack2);\r\n\t\t }\r\n\t\t else if (battleCommand.charAt(0) == '3') {\r\n\t\t\t System.out.println (firstPokemon.pAttack3);\r\n\t\t }\r\n\t\t else {\r\n\t\t\t System.out.println(\"Please enter the correct number.\");\r\n\t\t\t \r\n\t\t }\r\n\t}", "public static void main(String[] args){\r\n String[] prompts = {\"Do you want to take a survey?\",\r\n \"Do you like yes or no questions?\",\r\n \"Will you continue answering these?\",\r\n \"Are you some kind of robot?\",\r\n \"Do you have special powers?\",\r\n \"Do you use them for good or for awesome?\",\r\n \"Will you use them on me?\"};\r\n int i;\r\n for (i = 0; i <= QUESTIONS && yesNoQuestion(prompts[i]); i++); \r\n if (i < 3) System.out.println(\"You are lame.\");\r\n else System.out.println(\"You are mildly cool.\");\r\n if (i >= 4) System.out.println(\"Actually, you're a cool robot.\");\r\n if (i >= 5) System.out.println(\"...with cool powers.\");\r\n if (i >= 6) System.out.println(\"Please use your powers on me!\");\r\n if (i >= 7) System.out.println(\"Ooh, that feels good.\");\r\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"What task: \");\r\n\t\tint option = scan.nextInt();\r\n\t\tswitch (option) {\r\n\t\tcase 1:\r\n\t\t\tpositionalNumbers();\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tpassword();\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tmean();\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tbase();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint p,s,t;\n\t\tString ch1=new String();\n\t\tString ch2=new String();\n\t\tString[] myList1= {\"ACE\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"Jack\",\"Queen\",\"King\"};\n\t\tString[] myList2= {\"Clubs\",\"Diamonds\",\"Heart\",\"Spades\"};\n\t\tp=input.nextInt();\n\t\ts=p/13;\n\t\tt=p%13;\n\t\tch1=myList1[p-1];\n\t\tch2=myList2[t];\n\t\tSystem.out.print(\"The card you picked is \"+ch1+\" of \"+ch2);\n\t}", "public static void main(String[] args) {\n\t\tint score = 0;\n\n\t\t// 3. Ask the user a riddle. Here are some ideas: bit.ly/some-riddles\n\t\tString answer1 = JOptionPane.showInputDialog(\"What gets wetter and wetter the more it dries?\");\n\n\t\t// 4. If they got the answer right, pop up \"correct!\" and increase the score by one\n\t\t// 5. Otherwise, say \"wrong\" and tell them the answer\n\t\tif (answer1.equals(\"towel\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: towel.\");\n\t\t}\n\n\t\t// 6. Add some more riddles\n\n\t\tString answer2 = JOptionPane.showInputDialog(\"What kind of room has no doors or windows?\");\n\n\t\tif (answer2.equals(\"mushroom\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: mushroom.\");\n\t\t}\n\n\t\tString answer3 = JOptionPane.showInputDialog(\"Which word in the dictionary is spelled incorrectly?\");\n\n\t\tif (answer3.equals(\"incorrectly\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: incorrectly.\");\n\t\t}\n\n\t\tString answer4 = JOptionPane.showInputDialog(\"What invention lets you look right through a wall?\");\n\n\t\tif (answer4.equals(\"window\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: window.\");\n\t\t}\n\n\t\tString answer5 = JOptionPane.showInputDialog(\"What has a neck but no head?\");\n\n\t\tif (answer5.equals(\"bottle\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: bottle.\");\n\t\t}\n\n\t\t// 2. Make a pop up to show the score.\n\t\tJOptionPane.showMessageDialog(null, \"Your score is: \" + score);\n\n\t}", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter your amount of money\");\n\t\tint money = scan.nextInt();\n\t\t\n\t\tSystem.out.println(\"Enter the price of a wing\");\n\t\tint wing = scan.nextInt();\n\t\t\n\t\tSystem.out.println(\"You can buy \" + money/wing + \" wings\");\n\n\t\t\n\t\t// System.out.println((int)(money/wing)+\" Wing you can buy\");\n\n\n\t}", "public void state() {\n System.out.print(\"Enter a temperature: \");\n double temp = in.nextDouble();\n System.out.print(\"Enter a scale: \");\n in.nextLine();\n String scale = in.nextLine().toUpperCase();\n\n if (scale.equals(\"F\") || scale.equals(\"f\")) {\n if (temp <= 32) {\n System.out.println(\"\\nSolid.\\n\");\n } else if (temp < 212) {\n System.out.println(\"\\nLiquid.\\n\");\n } else {\n System.out.println(\"\\nGas.\\n\");\n }\n } else if (scale.equals(\"C\") || scale.equals(\"c\")) {\n if (temp <= 0) {\n System.out.println(\"\\nSolid.\\n\");\n } else if (temp < 100) {\n System.out.println(\"\\nLiquid.\\n\");\n } else {\n System.out.println(\"\\nGas.\\n\");\n }\n } else {\n System.out.println(\"\\nThat's not a valid scale.\\n\");\n }\n }", "public static void main(String[] args) {\n\t\tint lotteryDigit1, lotteryDigit2;\n\t\tlotteryDigit1 = (int) (Math.random() * 10);\n\n\t\tdo {\n\t\t\tlotteryDigit2 = (int) (Math.random() * 10);\n\t\t} while (lotteryDigit1 == lotteryDigit2);\n\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Tell me two distinct numbers: \");\n\t\tint guess = input.nextInt();\n\n//\t\tSeparate the digits\n\t\tint guessDigit1 = guess / 10;\n\t\tint guessDigit2 = guess % 10;\n\t\tSystem.out.println(\"The lottery num,ber is \" + lotteryDigit1 + lotteryDigit2);\n//\t\tCompare numbers\n\t\tif (lotteryDigit1 == guessDigit1 && lotteryDigit2 == guessDigit2)\n\t\t\tSystem.out.println(\"Youwill get $10,000\");\n\t\telse if (lotteryDigit1 == guessDigit2 && lotteryDigit2 == guessDigit1)\n\t\t\tSystem.out.println(\"You will get $3,000\");\n\t\telse if (lotteryDigit1 == guessDigit1 || lotteryDigit1 == guessDigit2 || lotteryDigit2 == guessDigit1\n\t\t\t\t|| lotteryDigit2 == guessDigit2)\n\t\t\tSystem.out.println(\"You will get $1,000\");\n\t\telse\n\t\t\tSystem.out.println(\"Sorry, you got nothing\");\n\t\tinput.close();\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int recomandedToSleep = scanner.nextInt();\n int oversleep = scanner.nextInt();\n int sleepHours = scanner.nextInt();\n\n if (sleepHours < recomandedToSleep) {\n System.out.println(\"Deficiency\");\n } else if (sleepHours > oversleep) {\n System.out.println(\"Excess\");\n } else {\n System.out.println(\"Normal\");\n }\n }", "public void startPoemGenerator(){\n PoemWindow win = new PoemWindow();\n System.out.println(\"\\nYou found a Secret Poem Generator.\");\n System.out.println(\"Welcome, Friend!\");\n System.out.println(\"\\n **************************************\");\n System.out.println();\n readPoemFiles();\n askPoets();\n try{\n fetchVerseLines();\n }catch(Exception e){\n System.out.println(\"Invalid input. Please, try again!\");\n }\n }" ]
[ "0.6484122", "0.626534", "0.5906632", "0.56154877", "0.5547192", "0.55216247", "0.5471261", "0.5461403", "0.5458834", "0.5401516", "0.53983104", "0.5389467", "0.5369944", "0.5333522", "0.5328146", "0.53123015", "0.53009254", "0.53009206", "0.5272101", "0.5264078", "0.5245239", "0.5241255", "0.52257", "0.5195486", "0.51897585", "0.51864195", "0.51769626", "0.51700777", "0.51686007", "0.5158331", "0.515375", "0.5142757", "0.51232946", "0.5120333", "0.5117737", "0.509069", "0.5077211", "0.50755566", "0.5070938", "0.50570947", "0.50506157", "0.504925", "0.50442314", "0.5035863", "0.5031182", "0.50207275", "0.5015332", "0.4996542", "0.49921837", "0.49713445", "0.49490145", "0.49462533", "0.49436277", "0.49416554", "0.49393824", "0.49348012", "0.49291128", "0.49192622", "0.49177444", "0.4914618", "0.49136814", "0.4909181", "0.49090046", "0.49077025", "0.4903525", "0.48907897", "0.48865846", "0.48776916", "0.48739848", "0.48679468", "0.4867478", "0.48669666", "0.48652607", "0.48522097", "0.4850917", "0.4846677", "0.48448583", "0.48421493", "0.48307467", "0.48272705", "0.48272362", "0.48195845", "0.48142442", "0.48124972", "0.48083088", "0.48006135", "0.47997242", "0.47995996", "0.47924066", "0.47923955", "0.47896498", "0.47880042", "0.47831234", "0.47827125", "0.4781822", "0.47802556", "0.47802508", "0.4778177", "0.4778157", "0.47775504" ]
0.76905924
0
Read lines in 'poems' text file (located in project root directory). Create PoetAndTheme objects from lines and add objects to an array list 'poetsAndThemesList'.
public void readPoemFiles(){ try (Scanner fileScan = new Scanner(new File("poems.txt"))) { //Poems.txt consist of a header (poet and theme) plus verse lines. //First loop reads the header and creates object 'PoetAndTheme'. while (fileScan.hasNextLine()){ String themeAndPoet = fileScan.nextLine(); PoetAndTheme addToList = new PoetAndTheme(themeAndPoet); //Second loop reads verse lines and adds them to object 'PoetAndTheme'. while(fileScan.hasNextLine()){ String verseLine = fileScan.nextLine(); if (verseLine.isEmpty()){ break; } addToList.addVerseLine(verseLine); } poetsAndThemesList.add(addToList); } } catch (Exception e) { System.out.println("Error: " + e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "private void setThemesData() {\n\t\tint index = 0;\n\t\ttry {\n\t \tString strFile = Constants.extStorageDirectory +\"/Android_SlyCool/\"+theme_file_name;\n\t\t\tBufferedReader reader = new BufferedReader( new FileReader(strFile));\n\t\t\tLineNumberReader lineReader = new LineNumberReader(reader);\n\t String line;\n\t while ((line = lineReader.readLine()) != null) {\n\t \tif(lineReader.getLineNumber()!=1){\n\t \t\tString[] RowData = Constants.parseCsvLine(line.toString());\n\t \t\tif (RowData.length==14){\n\t \t\t\tfor(int j=0; j<13;j++){\t\n\t \t\t\t\tString currentString = RowData[j];\n\t \t\t\t\tcurrentString = currentString.replaceAll(\"\\\\\\\\n\", \"\\n\");\n\t \t\t\t\tRowData[j] = currentString;\n\t \t\t\t}\n\t\t \t\tThemes currentTheme = new Themes(String.valueOf(index),RowData[0],RowData[1],RowData[2],RowData[3],RowData[4],RowData[5],RowData[6],RowData[7],RowData[8],RowData[9],RowData[10],RowData[11],RowData[12],RowData[13]);\n\t\t\t\t \tConstants.allthemes.add(currentTheme);\n\t\t\t\t \tindex++;\n\t \t\t}\n\t \t} \t\n\t }\n\t\t}catch (IOException ex) {\n\t \n\t }\n\t}", "private static void generate_potions_list(File fp) {\r\n\t\tpotions_database = new ArrayList<Potion>();\r\n\t\tString line;\r\n\t\tString[] potion_info;\r\n\t\tString[] ingredients = new String[2]; //2 ingredients per potion\r\n\t\t\r\n\t\ttry {\r\n\t\t\tScanner scnr = new Scanner(fp);\r\n\r\n\t\t\twhile(scnr.hasNextLine()) {\r\n\t\t\t\tline = scnr.nextLine();\r\n\t\t\t\tpotion_info = line.split(line,',');\r\n\t\t\t\tingredients[0] = potion_info[1];\r\n\t\t\t\tingredients[1] = potion_info[2];\r\n\t\t\t\t\r\n\t\t\t\tPotion pot = new Potion(potion_info[0], ingredients, Integer.parseInt(potion_info[3]));\r\n\t\t\t\tpotions_database.add(pot);\r\n\t\t\t}\r\n\t\t\tscnr.close();\r\n\t\t} catch(FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"The file was not located. Check file name.\");\r\n\t\t}\r\n\t\t\r\n\t\t//sort the database by potion value\r\n\t\tCollections.sort(potions_database, new PotionComparator());\r\n\t\t\r\n\t}", "public static List<Polyomino> openFile() {\n \tString basePath = new File(\"\").getAbsolutePath();\n Path path = Paths.get(basePath, \"polyominoesINF421.txt\");\n Charset charset = Charset.forName(\"UTF-8\");\n List<Polyomino> polyominos = new LinkedList<Polyomino>();\n\t\ttry {\n\t\t\tList<String> lines = Files.readAllLines(path, charset);\n\t\t\tfor (String line : lines) {\n\t\t\t\tpolyominos.add(new Polyomino(line));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n return polyominos;\n }", "ArrayList<WordListItem> addDataFromFile(){\n BufferedReader br;\n InputStream inputStream = context.getResources().openRawResource(R.raw.animal_list);\n br = new BufferedReader(\n new InputStreamReader(inputStream, Charset.forName(\"UTF-8\"))\n );\n String currentLine;\n ArrayList<WordListItem> wordListItems = new ArrayList<WordListItem>();\n try {\n while ((currentLine = br.readLine()) != null) {\n String[] tokens = currentLine.split(\";\");\n\n String word = tokens[0];\n String pronunciation = tokens[1];\n String description = tokens[2];\n\n WordListItem wordItem = new WordListItem(word, pronunciation, description);\n wordItem.setImgResNbr(setImgResFromWord(wordItem.getWord().toLowerCase()));\n wordListItems.add(wordItem);\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\n return wordListItems;\n }", "public void fetchVerseLines() throws IncorrectInput{\n String strObject1 = \"\";\n PoetAndTheme object1 = poetsAndThemesList.get(0);\n String strObject2 = \"\";\n PoetAndTheme object2 = poetsAndThemesList.get(0);\n strObject1 = userInputToPoet(poet1, theme);\n strObject2 = userInputToPoet(poet2, theme);\n\n for(PoetAndTheme object: poetsAndThemesList){\n if (object.getNameAndTheme().equals(strObject1)){\n object1 = object;\n }\n if (object.getNameAndTheme().equals(strObject2)){\n object2 = object;\n }\n }\n //Poems length is a random number between 5 and 10\n int poemLength = getRandomPoemLength();\n\n if(poemLength % 2 == 0){\n for (int i=0; i < (poemLength/2); i++){\n if(i != (poemLength/2 - 1)){\n System.out.println(object1.getRandomVerseLine());\n System.out.println(object2.getRandomVerseLine());\n }else{\n System.out.println(object1.getRandomVerseLine());\n\n //Checking if the last verse line ends with period or question mark.\n //If not, get a new verse line.\n System.out.println(getLastPoemLine(object2));\n }\n }\n }else{\n for (int i=0; i < (poemLength/2 - 1); i++){\n System.out.println(object1.getRandomVerseLine());\n System.out.println(object2.getRandomVerseLine());\n }\n //Checking if the last verse line ends with period or question mark.\n //If not, get a new verse line.\n System.out.println(getLastPoemLine(object1));\n }\n }", "private ArrayList<String> getPackagesFromFile() {\n\t\tArrayList<String> temp = new ArrayList<String>();\r\n\t\ttry {\r\n\t\t\tString path = Environment.getExternalStorageDirectory().getCanonicalPath() + \"/data/levelup/\";\r\n\r\n\r\n\t\t\t//view2_.setText(\"\");\r\n\t\t\tFile root = new File(path);\r\n\r\n\r\n\t\t\troot.mkdirs();\r\n\r\n\r\n\t\t\tFile f = new File(root, \"custom.txt\");\r\n\t\t\tif(!f.exists())\r\n\t\t\t{\r\n\t\t\t\t//view2_.setText(\"now I am here\");\r\n\t\t\t\tFileOutputStream fos = new FileOutputStream(f);\r\n\t\t\t\tfos.close();\r\n\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tFileReader r = new FileReader(f);\r\n\t\t\tBufferedReader br = new BufferedReader(r);\r\n\r\n\r\n\r\n\t\t\t// Open the file that is the first\r\n\t\t\t// command line parameter\r\n\r\n\r\n\t\t\tString strLine;\r\n\t\t\t// Read File Line By Line\r\n\r\n\r\n\r\n\t\t\twhile ((strLine = br.readLine()) != null) {\r\n\t\t\t\t// Print the content on the console\r\n\t\t\t\t//String[] allWords;\r\n\t\t\t\tif(!strLine.equals(null)) temp.add(strLine);\r\n\t\t\t\tLog.i(\"packages from file\", strLine);\r\n\t\t\t}\r\n\r\n\t\t\tr.close();\r\n\r\n\r\n\t\t} catch (Exception e) {// Catch exception if any\r\n\t\t\t//System.err.println(\"Error: \" + e.getMessage());\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "static void readRecipes() {\n\t\tBufferedReader br = null;\n\t\tString line = \"\";\n\t\tString cvsSplitBy = \",\";\n\t\ttry {\n\n\t\t\tbr = new BufferedReader(new FileReader(inputFileLocation));\n\t\t\twhile ((line = br.readLine()) != null) {\n\n\t\t\t\tString[] currentLine = line.split(cvsSplitBy);\n\t\t\t\tRecipe currentRecipe = new Recipe(currentLine[0]);\n\t\t\t\t/*\n\t\t\t\t * String[] recipe=new String[currentLine.length-1];\n\t\t\t\t * System.arraycopy(currentLine,1,recipe,0,recipe.length-2);\n\t\t\t\t */\n\t\t\t\tString[] recipe = java.util.Arrays.copyOfRange(currentLine, 1,\n\t\t\t\t\t\tcurrentLine.length);\n\t\t\t\tArrayList<String> ingredients = new ArrayList<String>();\n\t\t\t\tfor (String a : recipe) {\n\t\t\t\t\tingredients.add(a);\n\t\t\t\t}\n\t\t\t\tcurrentRecipe.setIngredients(ingredients);\n\t\t\t\tRecipes.add(currentRecipe);\n\t\t\t}\n\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} finally {\n\t\t\tif (br != null) {\n\t\t\t\ttry {\n\t\t\t\t\tbr.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\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}", "public void load() {\n mapdb_ = DBMaker.newFileDB(new File(\"AllPoems.db\"))\n .closeOnJvmShutdown()\n .encryptionEnable(\"password\")\n .make();\n\n // open existing an collection (or create new)\n poemIndexToPoemMap_ = mapdb_.getTreeMap(\"Poems\");\n \n constructPoems();\n }", "private void readFile() {\n try (BufferedReader br = new BufferedReader(new FileReader(\"../CS2820/src/production/StartingInventory.txt\"))) {\n String line = br.readLine();\n while (line != null) {\n line = br.readLine();\n this.items.add(line);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void loadPracticeListFromFile() {\n JSONParser jsonParser = new JSONParser();\n\n try (FileReader reader = new FileReader(\"src/practiceList.json\")) {\n // Read JSON file\n Object object = jsonParser.parse(reader);\n\n //Iterate over word list array\n JSONArray wordList = (JSONArray) object;\n for (Object o : wordList) {\n\n JSONObject next = (JSONObject) o;\n String extra = \"\";\n\n if (((String) next.get(\"wordType\")).equalsIgnoreCase(\"verb\")) {\n extra = \"to \";\n }\n\n Word loadedWord = new Word(extra + next.get(\"english\"), (String) next.get(\"welsh\"), (String) next.get(\"wordType\"));\n\n addIntoPracticedWords(loadedWord);\n }\n\n } catch (ParseException | IOException e) {\n System.out.println(\"PracticeList file not found, will be created on exit.\");\n }\n }", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n Gson gson = new Gson();\n Type listFeelingType = new TypeToken<ArrayList<Feeling>>(){}.getType();\n recordedFeelings.clear();\n ArrayList<Feeling> tmp = gson.fromJson(reader, listFeelingType);\n recordedFeelings.addAll(tmp);\n fis.close();\n\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n recordedFeelings = new ArrayList<Feeling>();\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private void fileToPoSTags(String filePath,int version){\n Log.log(\"Reading TreeBank file <\" + filePath +\">\");\n\n FileReader fr = null;\n BufferedReader br = null;\n\n try{\n fr = new FileReader(filePath);\n br = new BufferedReader(fr);\n\n String currentLine;\n String[] columns;\n\n Tag tag1 = null;\n Tag tag2;\n String word;\n\n Integer numRow;\n while((currentLine = br.readLine()) != null){\n columns = currentLine.split(\"\\t\");\n numRow = getIntegerString(columns[0]);\n if(numRow != null && numRow >= 1){\n if(numRow == 1) {\n tag1 = Tag.valueOf(\"START\");\n saveTag(tag1);\n }\n try{\n tag2 = Tag.valueOf(columns[3]);\n saveTag(tag2);\n word = columns[1];\n switch (version){\n case 1:\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n break;\n case 2:\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n else if(Character.isUpperCase(word.charAt(0)))\n savePoSTag(new PoSTag(word,tag2));\n break;\n case 3:\n\n if(tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word,tag2));\n else{\n if(Character.isUpperCase(word.charAt(0))){\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n }else{\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(\n word.substring(0,1).toUpperCase()\n +word.substring(1),tag2));\n }\n\n }\n\n break;\n case 4:\n\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(word,tag2));\n break;\n case 5:\n\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n savePoSTag(new PoSTag(word,tag2));\n break;\n\n }\n saveBigram(new BiGram(tag1,tag2));\n tag1 = tag2;\n }catch (IllegalArgumentException e){\n e.printStackTrace();\n }\n }\n }\n\n }catch (IOException e){\n e.printStackTrace();\n }finally {\n UtilitiesIO.closeFile(fr,br);\n }\n }", "private void readItems() {\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n // try to find items to add\n try {\n items = new ArrayList<>(FileUtils.readLines(todoFile));\n } catch (IOException e) {\n items = new ArrayList<>();\n }\n }", "private void loadData () {\n try {\n File f = new File(\"arpabet.txt\");\n BufferedReader br = new BufferedReader(new FileReader(f));\n vowels = new HashMap<String, String>();\n consonants = new HashMap<String, String>();\n phonemes = new ArrayList<String>();\n String[] data = new String[3];\n for (String line; (line = br.readLine()) != null; ) {\n if (line.startsWith(\";\")) {\n continue;\n }\n data = line.split(\",\");\n phonemes.add(data[0]);\n if (data[1].compareTo(\"v\") == 0) {\n vowels.put(data[0], data[2]);\n } else {\n consonants.put(data[0], data[2]);\n }\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void importToFile() throws IOException {\n String fileName = \"Prova.txt\";\n ArrayList<String> fileLines = new ArrayList<>();\n int libriImported = 0;\n try (BufferedReader inputStream = new BufferedReader(new FileReader(fileName))) {\n String l;\n while ((l = inputStream.readLine()) != null) {\n fileLines.add(l);\n }\n for (String s : fileLines) {\n String[] splitter = s.split(\";\");\n Libro lib = LibroConvert(splitter);\n Biblioteca.getBiblioteca().add(lib);\n libriImported++;\n }\n }\n System.out.println(\"Ho importato \" + libriImported + \"libri\");\n }", "List<ThingPackage> parseLines(List<String> line);", "public static List<Cell> parsePizza(String file) throws IOException {\n try (FileReader fileReader = new FileReader(file)) {\n BufferedReader br = new BufferedReader(fileReader);\n //skip a line with slice instructions\n br.readLine();\n //declare a pizza cells array\n List<Cell> cells = new ArrayList<>();\n int row = 0;\n String fileLine;\n while ((fileLine = br.readLine()) != null) {\n for (int column = 0; column < fileLine.length(); column++) {\n Character literal = fileLine.charAt(column);\n if (literal.toString().equals(Ingredient.TOMATO.toString())) {\n cells.add(new Cell(row, column, Ingredient.TOMATO));\n } else if (literal.toString().equals(Ingredient.MUSHROOM.toString())) {\n cells.add(new Cell(row, column, Ingredient.MUSHROOM));\n }\n }\n row++;\n }\n return cells;\n }\n }", "public void startPoemGenerator(){\n PoemWindow win = new PoemWindow();\n System.out.println(\"\\nYou found a Secret Poem Generator.\");\n System.out.println(\"Welcome, Friend!\");\n System.out.println(\"\\n **************************************\");\n System.out.println();\n readPoemFiles();\n askPoets();\n try{\n fetchVerseLines();\n }catch(Exception e){\n System.out.println(\"Invalid input. Please, try again!\");\n }\n }", "@PostConstruct\n private List<String> loadFortunesFile() {\n System.out.println(\">> FileFortuneService: inside method 'loadFortunesFile'.\");\n\n try {\n String fileName = \"src/com/luv2code/springdemo/fortune_data.txt\";\n BufferedReader reader = new BufferedReader(new FileReader(fileName));\n String line = null;\n while ( (line = reader.readLine()) != null) {\n fortunes.add(line);\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred during file-stream: \");\n e.printStackTrace();\n }\n return fortunes;\n\n }", "private void setWords() {\r\n words = new ArrayList<>();\r\n\r\n String line = null;\r\n try {\r\n // FileReader reads text files in the default encoding.\r\n FileReader fileReader = new FileReader(\"words.txt\");\r\n\r\n // Always wrap FileReader in BufferedReader.\r\n BufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\r\n while((line = bufferedReader.readLine()) != null)\r\n words.add(line);\r\n\r\n // Always close files.\r\n bufferedReader.close();\r\n }\r\n catch(Exception ex) {\r\n ex.printStackTrace();\r\n System.out.println(\"Unable to open file '\");\r\n }\r\n }", "private void loadSpaceObjects(String file){\n\t\ttry{\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tScanner sc = new Scanner(br);\n\t\t\t\n\t\t\tloadFactory(sc);\n\t\t\tloadPlanets(sc);\n\n\t\t\tsc.close();\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"File not found: SpaceProgramPlanets.txt\");\n\t\t}\n\t}", "public SecretPoemGenerator(){\n scanner = new Scanner(System.in);\n poetsAndThemesList = new ArrayList<>();\n }", "public void init() {\n\n mJokes = new ArrayList<>();\n\n StringBuilder sBuilder = new StringBuilder();\n\n try {\n\n InputStream in = getClass().getResourceAsStream(\"/jokes.json\");\n BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n String mLine = reader.readLine();\n while (mLine != null) {\n //process line\n sBuilder.append(mLine);\n mLine = reader.readLine();\n }\n\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n String jsonString = sBuilder.toString();\n\n if( jsonString != null ){\n\n JsonParser parser = new JsonParser();\n JsonObject jsonObject = parser.parse(jsonString).getAsJsonObject();\n\n JsonArray jokesArray = jsonObject.getAsJsonArray(\"jokes\");\n\n for (JsonElement element : jokesArray) {\n String joke = element.getAsJsonObject().get(\"joke\").getAsString();\n mJokes.add(joke);\n }\n }\n\n }", "@Test public void readFileTest() throws FileNotFoundException\n {\n PentagonalPyramid[] pArray = new PentagonalPyramid[100];\n PentagonalPyramid p1 = new PentagonalPyramid(\"PP1\", 1, 2);\n PentagonalPyramid p2 = new PentagonalPyramid(\"PP1\", 2, 3);\n PentagonalPyramid p3 = new PentagonalPyramid(\"PP1\", 3, 4);\n pArray[0] = p1;\n pArray[1] = p2;\n pArray[2] = p3;\n \n PentagonalPyramidList2 pList = new PentagonalPyramidList2(\"ListName\", \n pArray, 3);\n \n pList = pList.readFile(\"PentagonalPyramid_data_1.txt\");\n Assert.assertEquals(\"readFile Test\", \n \"PentagonalPyramid Test List\", pList.getName());\n }", "public void readFile() throws IOException {\n String line;\n while ((line = fileReader.readLine()) != null) {\n wordStorage.addWords(line);\n }\n }", "private void populateItems() {\n \t try {\n \t File myObj = new File(\"items.txt\");\n \t Scanner myReader = new Scanner(myObj);\n \t while (myReader.hasNextLine()) {\n\t \t String data = myReader.nextLine();\n\t \t String[] variables = data.split(\",\");\n\t \t int price = (int) Math.floor(Math.random() * 100); \n\t \t \n\t \t itemList += variables[0] + \",\"+ variables[1] +\",\" + \"0\" + \", \"+ \",\"+price + \",\";\n\t \t Item x = new Item(variables[0], 0, \"\", price, variables[1]);\n\t \t items.add(x);\n \t }\n \t myReader.close();\n \t } catch (FileNotFoundException e) {\n \t System.out.println(\"An error occurred.\");\n \t e.printStackTrace();\n \t }\n\t\t\n\t}", "private List<String> init(Path path) throws Exception {\n List<String> lines = Files.readAllLines(path);\n if (lines.size() != 0) {\n int numberOfFields = Integer.parseInt(lines.get(0));\n fillFieldsList(lines, numberOfFields);\n fillPlayersList(lines, numberOfFields);\n } else {\n throw new FileEmptyException();\n }\n return lines;\n }", "private ArrayList<Exoplanet> initExoplanets() throws IOException {\n Exoplanet e = new Exoplanet();\n ArrayList<Exoplanet> exoplanets = new ArrayList<Exoplanet>();\n for (int i = 0; i < e.getNumPlanets(); i++) {\n exoplanets.add(new Exoplanet(i));\n }\n return exoplanets;\n }", "private ArrayList<Alimento> initLista() {\n try {\n File file = new File(\"C:\\\\Users\\\\Gabri\\\\OneDrive\\\\Ambiente de Trabalho\\\\Calorie\\\\src\\\\Assets\\\\alimentos.txt\");\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n\n ArrayList<Alimento> lista = new ArrayList<>();\n\n int noLines = Integer.parseInt(br.readLine());\n for(int l=0; l<noLines; l++) {\n String[] alimTks = (br.readLine()).split(\",\");\n\n Alimento alimento = new Alimento(idAlimCounter++,alimTks[0],100,Integer.parseInt(alimTks[1]),Float.parseFloat(alimTks[2]),Float.parseFloat(alimTks[3]),Float.parseFloat(alimTks[4]));\n lista.add(alimento);\n }\n\n return lista;\n }catch (Exception e) {\n System.out.println(\"Sistema - getLista() : \"+e.toString());\n }\n return null;\n }", "public void readFromFile(){\n\t\ttry {\r\n\t\t\tFile f = new File(\"E:\\\\Study\\\\Course\\\\CSE215L\\\\Project\\\\src\\\\Railway.txt\");\r\n\t\t\tScanner s = new Scanner(f);\r\n\t\t\tpersons = new Person2 [50]; \r\n\t\t\tint i = 0;\r\n\t\t\t\r\n\t\t\twhile(s.hasNextLine()){\r\n\t\t\t\tString a = s.nextLine();\r\n\t\t\t\tString b = s.nextLine();\r\n\t\t\t\tString c = s.nextLine();\r\n\t\t\t\tString d = s.nextLine();\r\n\t\t\t\tString e = s.nextLine();\r\n\t\t\t\tString g = s.nextLine();\r\n\t\t\t\tString h = s.nextLine();\r\n\t\t\t\tString j = s.nextLine();\r\n\t\t\t\tPerson2 temp = new Person2 (a,b,c,d,e,g,h,j);\r\n\t\t\t\tpersons[i] = temp;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public void readFile() throws IOException {\r\n File file = new File(\"employee_list.txt\"); //Declaration and initialization of file object\r\n Scanner textFile = new Scanner(file); //Creates Scanner object and parse in the file\r\n\r\n while(textFile.hasNextLine()){ //Stay in a loop until there is no written line in the text file\r\n String line = textFile.nextLine(); //Read line and store in a String variable 'line'\r\n String[] words = line.split(\",\"); //Split the whole line at commas and store those in a simple String array\r\n Employee employee = new Employee(words[0],words[1],words[2]); //Create Employee object\r\n this.listOfEmployees.add(employee); //Add created Employee object to listOfEmployees ArrayList\r\n if(!this.listOfDepartments.contains(words[1])){ //This just adds all the department names to an ArrayList\r\n this.listOfDepartments.add(words[1]);\r\n }\r\n }\r\n }", "private void readPhrases() {\n\t\tphrases = new HashMap<String, String>();\n\t\tcounter = new HashMap<String, Integer>();\n\n\t\tBufferedReader br = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(input));\n\t\t\tfor (String line; (line = br.readLine()) != null;) {\n\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(line, \"|\");\n\n\t\t\t\twhile (tokenizer.hasMoreTokens()) {\n\t\t\t\t\tString phrase = tokenizer.nextToken();\n\t\t\t\t\tString key = StringUtils.getMd5Hash(phrase);\n\n\t\t\t\t\tif (phrases.containsKey(key)) {\n\t\t\t\t\t\tint count = counter.get(key);\n\t\t\t\t\t\tcounter.put(key, ++count);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tphrases.put(key, phrase);\n\t\t\t\t\t\tcounter.put(key, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalAccessError(\"Error reading input [\"\n\t\t\t\t\t+ input.getName() + \"]\");\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbr.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t}\n\t\t}\n\n\t}", "private void loadAlarms() {\n\n try {\n if (!Files.exists(Paths.get(alarmsFile))) {\n\n System.out.println(\"Alarms file not found attemping to create default\");\n Files.createFile(Paths.get(alarmsFile));\n\n } else {\n List<String> fileLines = Files.readAllLines(Paths.get(alarmsFile));\n\n for (int i = 0; i < fileLines.size() - 1; i += 4) {\n int hour = Integer.parseInt(fileLines.get(i));\n int minute = Integer.parseInt(fileLines.get(i + 1));\n int period = Integer.parseInt(fileLines.get(i + 2));\n String name = fileLines.get(i + 3);\n\n System.out.println(\"Adding new alarm from file. \" + name);\n addEntry(hour, minute, period, name);\n }\n }\n } catch (UnsupportedEncodingException ex) {\n Logger.getLogger(AlarmsEditPanel.class.getName()).log(Level.SEVERE, null, ex);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(AlarmsEditPanel.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(AlarmsEditPanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void leituraTexto() {\n try {\n Context context = getApplicationContext();\n\n InputStream arquivo = context.getResources().openRawResource(R.raw.catalogo_restaurantes);\n InputStreamReader isr = new InputStreamReader(arquivo);\n\n BufferedReader br = new BufferedReader(isr);\n\n String linha = \"\";\n restaurantes = new ArrayList<>();\n\n while ((linha = br.readLine()) != null) {\n restaurante = new Restaurante(linha);\n String id = Biblioteca.parserNome(restaurante.getId());\n String nome = Biblioteca.parserNome(restaurante.getNome());\n String descricao = Biblioteca.parserNome(restaurante.getDescricao());\n// Log.i(\"NOME\", nome);\n String rank = Biblioteca.parserNome(restaurante.getRank());\n int imagem = context.getResources().getIdentifier(nome, \"mipmap\", context.getPackageName());\n restaurante.setLogo(imagem);\n\n int imgrank = context.getResources().getIdentifier(rank, \"drawable\", context.getPackageName());\n restaurante.setRank(String.valueOf(imgrank));\n\n restaurantes.add(restaurante);\n }\n carregarListView();\n br.close();\n isr.close();\n arquivo.close();\n// Log.i(\"Quantidade\", \"\" + produtos.size());\n } catch (Exception erro) {\n Log.e(\"FRUTARIA Erro\", erro.getMessage());\n }\n\n }", "private List<Task> getTasksFromFile() throws FileNotFoundException{\n List<Task> loadedTasks = new ArrayList<>();\n Ui a=new Ui();\n try {\n List<String> lines = getLine() ;\n for (String line : lines) {\n if (line.trim().isEmpty()) { //ignore empty lines\n continue;\n }\n loadedTasks.add(createTask(line)); //convert the line to a task and add to the list\n }\n System.out.println(\"File successfully loaded\");\n } catch (DukeException e1) {\n System.out.println(\"☹ OOPS!!! Problem encountered while loading data: \" +e1.getMessage());\n }\n return loadedTasks;\n }", "private ArrayList<Book> readBookCollection() {\n File file = new File(\"books.txt\");\n ArrayList<Book> collection = new ArrayList<Book>();\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader reader = new BufferedReader(fileReader);\n while (true) {\n String line = reader.readLine();\n if (line == null) break;\n line = line.trim();\n if (line.equals(\"\")) continue; // ignore possible blank lines\n String[] bookInfo = line.split(\" :: \");\n collection.add(new Book(bookInfo[0], bookInfo[1]));\n }\n }\n catch (IOException e) {\n System.out.println(e.getMessage());\n }\n return collection;\n }", "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}", "private void createLinesArray()\n {\n //This will iterate through the lines array\n for (int i = 0; i < lines.length; i++)\n {\n //Stop at end-of-File\n if (mapScanner.hasNextLine())\n {\n //Add the current line to the lines array\n lines[i] = mapScanner.nextLine();\n }\n }\n }", "private void loadTermLoanAccounts(String termLoanAccountFileName)\n {\n try\n {\n /* Open the file to read */\n File inputFile = new File(termLoanAccountFileName);\n\n /* Create a scanner to begin reading from file */\n Scanner input = new Scanner(inputFile);\n\n while (input.hasNextLine())\n {\n //reading...\n String currentLine = input.nextLine();\n\n //parsing out on commas...\n String[] splitLine = currentLine.split(\",\");\n\n //DateFormat class to parse Date from file\n DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);\n\n //parsing out data...\n int accountId = Integer.parseInt(splitLine[0]);\n double balance = Double.parseDouble(splitLine[1]);\n String ssn = splitLine[2];\n double interestRate = Double.parseDouble(splitLine[3]);\n Date dateOpened = dateFormat.parse(splitLine[4]);\n Date dueDate = dateFormat.parse(splitLine[5]);\n Date dateNotified = dateFormat.parse(splitLine[6]);\n double currentPaymentDue = Double.parseDouble(splitLine[7]);\n Date lastPaymentDate = dateFormat.parse(splitLine[8]);\n boolean missedPayment = Boolean.parseBoolean(splitLine[9]);\n char loanType = splitLine[10].charAt(0);\n TermLoanType termLoanType;\n\n //this determines whether the loan is long or short.\n if (loanType == 'S')\n {\n termLoanType = TermLoanType.SHORT;\n }\n else\n {\n termLoanType = TermLoanType.LONG;\n }\n\n int years = Integer.parseInt(splitLine[11]);\n\n TermLoan termLoanAccount = new TermLoan(accountId,\n balance,\n ssn,\n interestRate,\n dateOpened,\n dueDate,\n dateNotified,\n currentPaymentDue,\n lastPaymentDate,\n missedPayment,\n termLoanType,\n years);\n\n ArrayList<Transaction> accountTransactions = transactionHashMap.get(accountId);\n termLoanAccount.setTransactions(accountTransactions);\n\n //adds term loan accounts\n accounts.add(termLoanAccount);\n }\n\n input.close();\n\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public void loadFromFile(String filepath) throws FileNotFoundException, PokedexException {\n if(!pokedex.isEmpty()) {\n // then Pokedex has already been loaded, do not load another one\n throw new PokedexException(Config.MULTIPLE_POKEDEX_EXCEPTION);\n }\n File infile = new File(filepath);\n Scanner sc = new Scanner(infile);\n while(sc.hasNextLine()) {\n String line = sc.nextLine();\n String[] tokens = line.split(\"\\\\s+\");\n Integer pokedexNumber = Integer.parseInt(tokens[0]);\n String name = tokens[1];\n Integer candies = Integer.parseInt(tokens[2]);\n PokemonSpecies species = new PokemonSpecies(pokedexNumber, name, candies);\n for (int i = 3; i < tokens.length; i++) {\n int cp = Integer.parseInt(tokens[i]);\n Pokemon pokemon = new Pokemon(pokedexNumber, name, cp);\n species.loadPokemon(pokemon);\n }\n pokedex.add(species);\n }\n sc.close();\n }", "public static void main(String[] args) throws IOException, ParseException {\n\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"C:\\\\Dev\\\\Demo\\\\Demo\\\\src\\\\main\\\\resources\\\\data\\\\USNationalParks.txt\"));\n\t\ttry {\n\t\t StringBuilder sb = new StringBuilder();\n\t\t String line = \"\";\n\t\t String[] lineArray;\n\t\t \n\t\t Park park = new Park();\n\t\t \n\t\t \n\t\t \n\t\t ArrayList<Park> retArray = new ArrayList<Park>();\n\t\t while ((line = br.readLine()) != null) {\n\t\t \tpark = new Park();\n\t\t\t System.out.println(line);\n\t\t\t lineArray = line.split(\">\");\n\t\t\t printArryStrings(lineArray);\n\t\t\t \n\t\t\t line = br.readLine();\n\t\t\t System.out.println(line);\n\t\t\t lineArray = line.split(\">\"); //2 Acadia\n\t\t\t park.setParkName(lineArray[2].substring(0, lineArray[2].indexOf('<')));\n\t\t\t printArryStrings(lineArray);\n\t\t\t \n\t\t\t line = br.readLine();\n\t\t\t System.out.println(line);\n\t\t\t lineArray = line.split(\">\");\n\t\t\t printArryStrings(lineArray);\n\t\t\t \n\t\t\t line = br.readLine();\n\t\t\t System.out.println(line); //2 Maine\n\t\t\t lineArray = line.split(\">\");\n\t\t\t park.setProvince(lineArray[2].substring(0, lineArray[2].indexOf('<')));\n\t\t\t printArryStrings(lineArray);\n\t\t\t \n\t\t\t line = br.readLine(); //19: \"44.35, -68.21\"\n\t\t\t System.out.println(line);\n\t\t\t lineArray = line.split(\">\");\n\t\t\t printArryStrings(lineArray);\n\t\t\t park.setLatitude(lineArray[19].substring(0, 5));\n\t\t\t park.setLongitude(lineArray[19].substring(7, lineArray[19].indexOf('<')));\n\t\t\t \n\t\t\t \n\t\t\t line = br.readLine(); //4 February 26th, 1919\n\t\t\t System.out.println(line);\n\t\t\t lineArray = line.split(\">\");\n\t\t\t printArryStrings(lineArray);\n\t\t\t park.setDateEstablished(stringToDate(lineArray[4].substring(0, lineArray[4].indexOf('<'))));\n\t\t\t \n\t\t\t line = br.readLine();\n\t\t\t System.out.println(line); //3 347,389 acres '('\n\t\t\t lineArray = line.split(\">\");\n\t\t\t printArryStrings(lineArray);\n\t\t\t park.setParkArea(NumberFormat.getNumberInstance(java.util.Locale.US).parse(lineArray[3].substring(0, lineArray[3].indexOf('a')-1)).intValue());\n\t\t\t \n\t\t\t line = br.readLine();\n\t\t\t System.out.println(line); // 1 3,303,393 <\n\t\t\t lineArray = line.split(\">\");\n\t\t\t printArryStrings(lineArray);\n\t\t\t park.setParkVisitors(NumberFormat.getNumberInstance(java.util.Locale.US).parse(lineArray[1].substring(0, lineArray[1].indexOf('<'))).intValue());\n\t\t\t \n\t\t\t line = br.readLine(); //skip for now\n\t\t\t System.out.println(line);\n\t\t\t lineArray = line.split(\">\");\n\t\t\t printArryStrings(lineArray);\n\t\t\t \n\t\t\t line = br.readLine();\n\t\t\t System.out.println(line);\n\t\t\t lineArray = line.split(\">\");\n\t\t\t printArryStrings(lineArray);\n\t\t\t \n\t\t\t \n\n\t\t \n\t\t\t retArray.add(park);\n\t\t }\n\t\t \n\t\t for(Park p: retArray){\n\t\t \tSystem.out.println(\"Insert into parks(name, country, province, latitude, longitude, dtEst, parkArea, annualVisitors)\" + \"VALUES('\"+ p.getParkName()+\"',\"+ \"'United States','\"+p.getProvince() +\"','\"+ p.getLatitude()+\"','\" + p.getLongitude() + \"','\" + dateToString(p.getDateEstablished()) + \"',\" + p.getParkArea() +\",\"+ \t\t\t\tp.getParkVisitors()+\");\");\n\t\t \t//System.out.println();\n\t\t }\n\t\t} finally {\n\t\t br.close();\n\t\t}\n\t}", "private PotCollection loadPotList(){\n SharedPreferences preferences = getSharedPreferences(SHAREDPREF_SET, MODE_PRIVATE);\n int sizeOfPotList = preferences.getInt(SHAREDPREF_ITEM_POTLIST_SIZE, 0);\n for(int i = 0; i<sizeOfPotList; i++){\n Log.i(\"serving calculator\", \"once\");\n String potName = preferences.getString(SHAREDPREF_ITEM_POTLIST_NAME+i, \"N\");\n int potWeight = preferences.getInt(SHAREDPREF_ITEM_POTLIST_WEIGHT+i, 0);\n Pot tempPot = new Pot(potName, potWeight);\n potList.addPot(tempPot);\n }\n return potList;\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 readWordList() {\n try {\n wordList = XmlStringArrayParser.parse(getAssets().open(Constant.WORDLISTFILE),\n settings.getInt(\"wordMaxLength\", 7));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Moment[] loadMomentsFile(){\n //Log.v(\"loadMain\", getApplicationContext().getFilesDir().getAbsolutePath());\n FileInputStream fin = null;\n Moment []pup = null;\n try {\n fin = openFileInput(MomentsFragment.MOMENTS_FILENAME);\n ObjectInputStream ois = new ObjectInputStream(fin);\n pup = (Moment [])ois.readObject();\n ois.close();\n fin.close();\n }catch (FileNotFoundException e) {\n //e.printStackTrace();\n Log.w(LOG_TAG, \"File not found, will be created once data is inserted\");\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }finally {\n if (pup == null)\n return new Moment[0];\n return pup;\n }\n }", "private void loadEnvironment(String filename){\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n String line;\n while ((line = reader.readLine()) != null) {\n String[] info = line.split(\",\");\n String type = info[TYPE_INDEX];\n type = type.replaceAll(\"[^a-zA-Z0-9]\", \"\"); // remove special characters\n Point coordinate = new\n Point(Double.parseDouble(info[POS_X_INDEX]), Double.parseDouble(info[POS_Y_INDEX]));\n\n switch (type) {\n case \"Player\" -> this.player = new Player(coordinate, Integer.parseInt(info[ENERGY_INDEX]));\n case \"Zombie\" -> {\n entityList.add(new Zombie(coordinate, type));\n zombieCounter++;\n }\n case \"Sandwich\" -> {\n entityList.add(new Sandwich(coordinate, type));\n sandwichCounter++;\n }\n case \"Treasure\" -> this.treasure = new Treasure(coordinate, type);\n default -> throw new BagelError(\"Unknown type: \" + type);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n System.exit(-1);\n }\n }", "public void instantiateTomes(){\n for (String tomeKey : this.getConfig().getConfigurationSection(\"tomes\").getKeys(false)){\n\n if (this.getConfig().getBoolean(\"tomes.\" + tomeKey + \".enabled\") == false){\n continue;\n }\n\n ArrayList<IQuest> questsToAddToTome = new ArrayList<IQuest>();\n for (String questKey : this.getConfig().getConfigurationSection(\"tomes.\" + tomeKey + \".quests\").getKeys(false)){\n for (IQuest quest : quests){\n if (questKey.equalsIgnoreCase(quest.getQuestName())){\n questsToAddToTome.add(quest);\n }\n }\n }\n\n //Fetch rewards of each tome\n ConfigurationSection itemsSection = Tomes.getInstance().getConfig().getConfigurationSection(\"tomes.\" + tomeKey + \".rewards.items\");\n ConfigurationSection weightsSection = Tomes.getInstance().getConfig().getConfigurationSection(\"tomes.\" + tomeKey + \".rewards.weights\");\n\n ArrayList<ItemStack> rewardsArray = new ArrayList<ItemStack>();\n\n if (itemsSection != null) {\n for (String key : itemsSection.getKeys(false)) {\n ItemStack item = itemsSection.getItemStack(key);\n\n for (int i = 0; i < Integer.parseInt(weightsSection.getString(key)); i++) {\n rewardsArray.add(item);\n }\n }\n }\n\n ConfigurationSection tomeConfig = this.getConfig().getConfigurationSection(\"tomes.\" + tomeKey);\n tomes.add(new Tome(\n tomeKey,\n tomeConfig.getString(\"displayName\"),\n tomeConfig.getInt(\"numberOfQuests\"),\n tomeConfig.getInt(\"cost\"),\n questsToAddToTome,\n rewardsArray\n ));\n\n\n }\n }", "public void createBox(Context context){\n\t\t\n\t\tLog.d(TAG, \"Begin creating recipe box\");\n\t\t\n\t\t//Open the file containing the recipes\n final Resources resources = context.getResources();\n InputStream inputStream = resources.openRawResource(R.raw.recipes);\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n\t\t\n Log.v(TAG, \"Buffered Reader Ready\");\n \n // VAriable to hold the lines as they are read\n\t\tString line;\n try {\n \t//Read in one line from the recipe file \n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tLog.v(TAG, \"Read line from buffer: \" + line);\n\t\t\t\t\n\t\t\t\t//Split the based on the pipe delimiter \"|\"\n\t\t\t\tString[] strings = TextUtils.split(line, \"\\\\|\\\\|\");\n\t\t\t\t\n\t\t\t\t//Position zero will always be the Recipe Name\n\t\t\t\tLog.v(TAG, \"Set recipe name: \" + strings[0]);\n\t\t\t\tString recipeName = strings[0];\n\t\t\t\t\n\t\t\t\t//Position zero will always be the Recipe Name\n\t\t\t\tLog.v(TAG, \"Set recipe description: \" + strings[1]);\n\t\t\t String recipeDescription = strings[1];\n\t\t\t\t\n\t\t\t String splitter = \"\\\\|\";\n\t\t\t \n\t\t\t // The array lists for the recipe\n\t\t\t ArrayList<String> recipeCategories = stringToArrayList(strings[2], splitter);\n\t\t\t\tArrayList<String> recipeIngredients = stringToArrayList(strings[3], splitter);\n\t\t\t ArrayList<String> recipeInstructions = stringToArrayList(strings[4], splitter);\n\t\t\t\t\n\t\t\t\tRECIPES.add(new Recipe(recipeName, recipeDescription, recipeCategories, recipeIngredients, recipeInstructions));\n\t\t\t\t\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n Log.d(TAG, \"Recipe box complete\");\n\t}", "private List<String> generateSquareStructureFromFile(String path) {\n Scanner scanner;\n List<String> readInput;\n InputStream inputStream = getClass().getResourceAsStream(path);\n scanner = new Scanner(inputStream);\n readInput = new ArrayList<>();\n\n while (scanner.hasNextLine()) {\n readInput.add(scanner.nextLine());\n }\n scanner.close();\n\n roomsToBuild = new ArrayList<>();\n squares = new ArrayList<>();\n spawnPoints = new ArrayList<>();\n for(int i = 0; i<readInput.size(); i++){\n if(i%2 == 0)\n squares.add(new ArrayList<>());\n }\n\n int row = 0;\n int col;\n char c;\n String s;\n while(row < readInput.size()){\n col = 0;\n while(col < readInput.get(row).length()){\n c = readInput.get(row).charAt(col);\n s = String.valueOf(c).toLowerCase();\n\n if(c=='R'||c=='B'||c=='Y'||c=='G'||c=='W'||c=='P') {\n SpawnPoint tempSquare = new SpawnPoint(row/2, col/2, Color.fromString(s));\n squares.get(row/2).add(tempSquare);\n spawnPoints.add(tempSquare);\n if(!roomsToBuild.contains(Color.fromString(s)))\n roomsToBuild.add(Color.fromString(s));\n }\n else if(c=='r'||c=='b'||c=='y'||c=='g'||c=='w'||c=='p'){\n squares.get(row/2).add(new Square(row/2, col/2, Color.fromString(s)));\n if(!roomsToBuild.contains(Color.fromString(s)))\n roomsToBuild.add(Color.fromString(s));\n }\n else if(c==' ' && row%2==0 && col%2==0){\n squares.get(row/2).add(null);\n }\n //update max\n if(row/2 + 1> numRow)\n numRow = row/2 + 1;\n if(col/2 + 1> numCol)\n numCol = col/2 + 1;\n col++;\n }\n row++;\n }\n\n return readInput;\n\n }", "public void loadItems() {\n\t\tArrayList<String> lines = readData();\n\t\tfor (int i = 1; i < lines.size(); i++) {\n\t\t\tString line = lines.get(i);\n\t\t\t\n\t\t\tString[] parts = line.split(\",\");\n\t\t\t\n//\t\t\tSystem.out.println(\"Name: \" + parts[0]);\n//\t\t\tSystem.out.println(\"Amount: \" + parts[1]);\n//\t\t\tSystem.out.println(\"Price: \" + parts[2]);\n//\t\t\tSystem.out.println(\"-------\");\n\t\t\t\n\t\t\tString name = parts[0].trim();\n\t\t\tint amount = Integer.parseInt(parts[1].trim());\n\t\t\tdouble price = Double.parseDouble(parts[2].trim());\n\t\t\t\n\t\t\tItem item = new Item(name, amount, price);\n\t\t\titemsInStock.add(item);\n\t\t}\n\t}", "public void load()\n\t{\n\t\ttry {\n\t\t\tIFile file = project.getFile(PLAM_FILENAME);\n\t\t if (file.exists()) {\n\t\t\t\tInputStream stream= null;\n\t\t\t\ttry {\n\t\t\t\t\tstream = new BufferedInputStream(file.getContents(true));\n\t\t\t\t SAXReader reader = new SAXReader();\n\t\t\t\t Document document = reader.read(stream);\n\t\t\t\t \n\t\t\t\t Element root = document.getRootElement();\n\n\t\t\t\t String url = root.elementTextTrim(\"server-url\");\n\t\t\t\t setServerURL((url != null) ? new URL(url) : null);\n\t\t\t\t \n\t\t\t\t setUserName(root.elementTextTrim(\"username\"));\n\t\t\t\t setPassword(root.elementTextTrim(\"password\"));\n\t\t\t\t setProductlineId(root.elementTextTrim(\"pl-id\"));\n \n\t\t\t\t} catch (CoreException e) {\n\t\t\t\t\t\n\t\t\t\t} finally {\n\t\t\t\t if (stream != null)\n\t\t\t\t stream.close();\n\t\t\t\t}\n\t\t }\n\t\t} catch (DocumentException e) {\n\t\t\tlogger.info(\"Error while parsing PLAM config.\", e);\n\t\t} catch (IOException e) {\n\t\t}\n\t}", "public static void readInputPropertyFile(String fileName, ArrayList<Apartment> apartments, ArrayList<House> houses, ArrayList<Villa> villas) {\n File file = new File(fileName);\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new FileReader(file));\n String tempString = null;\n int line = 1;\n // read one line every time until no text\n while ((tempString = reader.readLine()) != null) {\n // show the line number\n// System.out.println(\"line \" + line + \": \" + tempString);\n String[] line_part = tempString.split(\" \");\n int property_type = Integer.parseInt(line_part[0]);\n line++;\n\n //Initial info for Apartment\n int storey_num = 0, beds = 0;\n\n //Initial info for house\n int storey = 0; double clearing = 0;\n\n //Initial info for villa\n double tax = 0, service = 0;\n\n //Shared Initial info for all\n int number = 0, ID = 0; double cost = 0;\n String name = \"\", address = \"\";\n\n\n //Apartment\n if (property_type == 1)\n {\n number = Integer.parseInt(line_part[1]);\n ID = Integer.parseInt(line_part[2]);\n name = line_part[3];\n address = line_part[4];\n cost = Double.parseDouble(line_part[5]);\n storey_num = Integer.parseInt(line_part[6]);\n beds = Integer.parseInt(line_part[7]);\n apartments.add(new Apartment(number, ID, name, address, cost, storey_num, beds));\n\n }\n\n //House\n else if(property_type == 2)\n {\n number = Integer.parseInt(line_part[1]);\n ID = Integer.parseInt(line_part[2]);\n name = line_part[3];\n address = line_part[4];\n cost = Integer.parseInt(line_part[5]);\n storey = Integer.parseInt(line_part[6]);\n clearing = Double.parseDouble(line_part[7]);\n houses.add(new House(number, ID, name, address, cost, storey, clearing));\n }\n\n else if(property_type == 3)\n {\n number = Integer.parseInt(line_part[1]);\n ID = Integer.parseInt(line_part[2]);\n name = line_part[3];\n address = line_part[4];\n cost = Double.parseDouble(line_part[5]);\n tax = Double.parseDouble(line_part[6]);\n service = Double.parseDouble(line_part[7]);\n villas.add(new Villa(number, ID, name, address, cost, tax, service));\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 }\n }\n }\n }", "public void readHistory()throws Exception {\n int currentline = 0;\n File myObj = new File(\"order_history.txt\");\n Scanner myReader = new Scanner(myObj);\n outputHistoryObj = new Order[1];\n while (myReader.hasNextLine()) {\n Pizza[] list = new Pizza[1];\n String[] commentparts = null; //This is superstitious, sorry\n String[] fullparts = myReader.nextLine().split(\" // \");\n String[] pizzaparts = fullparts[1].split(\" , \");\n for(int i=0; i<=pizzaparts.length-1; i++){\n if(pizzaparts[i].contains(\" & \")){\n commentparts = pizzaparts[i].split(\" & \");\n list[i] = new Pizza(Menu.list[Integer.parseInt(commentparts[0])-1].getName(), Menu.list[Integer.parseInt(commentparts[0])-1].getIngredients(), commentparts[1], Integer.parseInt(commentparts[0]), Menu.list[Integer.parseInt(commentparts[0])-1].getPrice());\n } else {\n list[i] = new Pizza(Menu.list[Integer.parseInt(pizzaparts[i])-1].getName(), Menu.list[Integer.parseInt(pizzaparts[i])-1].getIngredients(), \"\", Integer.parseInt(pizzaparts[i]), Menu.list[Integer.parseInt(pizzaparts[i])-1].getPrice());\n }\n list = Arrays.copyOf(list, list.length + 1); //Resize name array by one more\n }\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n Date parsed = format.parse(fullparts[3]);\n java.sql.Timestamp timestamp = new java.sql.Timestamp(parsed.getTime());\n outputHistoryObj[currentline] = new Order(fullparts[0], Integer.parseInt(fullparts[2]), timestamp, list);\n outputHistoryObj = Arrays.copyOf(outputHistoryObj, outputHistoryObj.length + 1); //Resize name array by one more\n currentline++;\n }\n myReader.close();\n }", "public void load(){\n\t\t\tArrayList<String> entries = readEntriesFromFile(FILENAME);\n\t\t\t\n\t\t\tfor(int i = 1; i < entries.size(); i++){\n\t\t\t\tString entry = entries.get(i);\n\t\t\t\tString[] entryParts = entry.split(\",\");\n\t\t\t\tString name = entryParts[0];\n\t\t\t\tString power = entryParts[1];\n\t\t\t\tString gold = entryParts[2];\n\t\t\t\tString xp = entryParts[3];\n\t\t\t\tString location = entryParts[4];\n\t\t\t\tint powerInt = Integer.parseInt(power);\n\t\t\t\tint goldInt = Integer.parseInt(gold);\n\t\t\t\tint XPInt = Integer.parseInt(xp);\n\t\t\t\tRegion regionR = RM.getRegion(location);\n\t\t\t\tTrap trap = new Trap(name, powerInt, goldInt, XPInt, regionR);\n\t\t\t\ttrapList[i-1] = trap;\n\t\t\t}\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}", "public void parseXml(String file) {\n\n try {\n\n debug(\"\\n\\nIn the beginning God created the heaven and the world...\\n\\n\");\n\n File fXmlFile = new File(\"./levels/\" + file);\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n Document doc = dBuilder.parse(fXmlFile);\n\n doc.getDocumentElement().normalize();\n debug(\"Chosen entity: \" + doc.getDocumentElement().getNodeName());\n\n NodeList placeList = doc.getElementsByTagName(\"place\");\n NodeList passageList = doc.getElementsByTagName(\"passage\");\n NodeList furnitureList = doc.getElementsByTagName(\"furniture\");\n NodeList storyList = doc.getElementsByTagName(\"story\");\n\n // Create object arrays\n ArrayList<Place> places = new ArrayList<>();\n ArrayList<Item> items = new ArrayList<>();\n ArrayList<Passage> passages = new ArrayList<>();\n ArrayList<Furniture> furnitures = new ArrayList<Furniture>();\n\n // parse story text\n Node storyNode = storyList.item(0);\n Element storyElement = (Element) storyNode;\n debug(\"Intro: \" + storyElement.getElementsByTagName(\"introduction\").item(0).getTextContent());\n debug(\"Level: \" + storyElement.getElementsByTagName(\"name\").item(0).getTextContent());\n debug(\"Version: \" + storyElement.getElementsByTagName(\"version\").item(0).getTextContent());\n // add story elements to world\n world.setIntroduction(\n storyElement.getElementsByTagName(\"introduction\").item(0).getTextContent());\n world.setLevelName(storyElement.getElementsByTagName(\"name\").item(0).getTextContent());\n world.setLevelVersion(storyElement.getElementsByTagName(\"version\").item(0).getTextContent());\n\n // parse all existing Places\n for (int placeCounter = 0; placeCounter < placeList.getLength(); placeCounter++) {\n Node placeNode = placeList.item(placeCounter);\n\n debug(\"\\nCurrent Element: \" + placeNode.getNodeName());\n\n if (placeNode.getNodeType() == Node.ELEMENT_NODE) {\n Element placeElement = (Element) placeNode;\n\n debug(\"- Ending: \" + placeElement.getAttribute(\"end\"));\n debug(\"- id: \" + placeElement.getAttribute(\"id\"));\n debug(\"- Name: \" + placeElement.getElementsByTagName(\"name\").item(0).getTextContent());\n debug(\"- Description: \"\n + placeElement.getElementsByTagName(\"description\").item(0).getTextContent());\n\n // Create Places.\n places.add(new Place(placeElement.getElementsByTagName(\"name\").item(0).getTextContent(),\n placeElement.getElementsByTagName(\"description\").item(0).getTextContent().replace(\"\\\\n\", \"\\n\")));\n\n // add EndingPlace to World, set endingText to Places' Description\n if (placeElement.getAttribute(\"end\").equals(\"bad\")) {\n world.addBadEnding(places.get(placeCounter),\n places.get(placeCounter).getDescription());\n } else if(placeElement.getAttribute(\"end\").equals(\"good\")) {\n world.addGoodEnding(places.get(placeCounter),\n places.get(placeCounter).getDescription());\n }\n \n // parse all existing Place Items\n NodeList itemList = placeElement.getElementsByTagName(\"item\");\n\n for (int itemCounter = 0; itemCounter < itemList.getLength(); itemCounter++) {\n Node itemNode = itemList.item(itemCounter);\n\n Element itemElement = (Element) itemNode;\n\n debug(\"- Item\" + itemCounter + \":\");\n debug(\"- - Name: \" + itemElement.getElementsByTagName(\"name\").item(0).getTextContent());\n debug(\"- - Description: \"\n + itemElement.getElementsByTagName(\"description\").item(0).getTextContent());\n\n // Create items.\n items.add(new Item(itemElement.getElementsByTagName(\"name\").item(0).getTextContent(),\n itemElement.getElementsByTagName(\"description\").item(0).getTextContent()));\n // Set items in current place.\n places.get(placeCounter).addObjectToPlace(getIncludedItem(itemElement, items));\n\n }\n }\n }\n\n // parse all furniture\n for (int furnitureCounter = 0; furnitureCounter < furnitureList\n .getLength(); furnitureCounter++) {\n Node furnitureNode = furnitureList.item(furnitureCounter);\n\n Element furnitureElement = (Element) furnitureNode;\n\n debug(\"\\nCurrent Element: \" + furnitureNode.getNodeName());\n\n debug(\"- Furniture\" + furnitureCounter);\n debug(\"- - In Place: \"\n + furnitureElement.getElementsByTagName(\"in-place\").item(0).getTextContent());\n debug(\n \"- - Name: \" + furnitureElement.getElementsByTagName(\"name\").item(0).getTextContent());\n debug(\"- - Description: \"\n + furnitureElement.getElementsByTagName(\"description\").item(0).getTextContent());\n\n // Create furniture objects\n furnitures.add(\n new Furniture(furnitureElement.getElementsByTagName(\"name\").item(0).getTextContent(), // name\n furnitureElement.getElementsByTagName(\"description\").item(0).getTextContent(), // description\n furnitureElement.getElementsByTagName(\"in-place\").item(0).getTextContent()));\n\n NodeList furnitureItemList = furnitureElement.getElementsByTagName(\"content-item\");\n\n // parse all Furniture Items\n for (int furnitureItemCounter = 0; furnitureItemCounter < furnitureItemList\n .getLength(); furnitureItemCounter++) {\n Node furnitureItemNode = furnitureItemList.item(furnitureItemCounter);\n\n Element furnitureItemElement = (Element) furnitureItemNode;\n\n debug(\"- - Content Items:\");\n debug(\"- - - Name: \"\n + furnitureItemElement.getElementsByTagName(\"name\").item(0).getTextContent());\n debug(\"- - - Description: \"\n + furnitureItemElement.getElementsByTagName(\"description\").item(0).getTextContent());\n\n addItems(furnitureItemElement, furnitures, items, furnitureCounter);\n\n }\n\n NodeList furnitureObstacleList = furnitureElement.getElementsByTagName(\"obstacle\");\n\n // parse all Furniture Obstacles\n for (int furnitureObstacleCounter = 0; furnitureObstacleCounter < furnitureObstacleList\n .getLength(); furnitureObstacleCounter++) {\n Node furnitureObstacleNode = furnitureObstacleList.item(furnitureObstacleCounter);\n\n Element furnitureObstacleElement = (Element) furnitureObstacleNode;\n\n debug(\"- - Obstacle:\");\n debug(\"- - - Description: \" + furnitureObstacleElement.getElementsByTagName(\"description\")\n .item(0).getTextContent());\n debug(\"- - - Resolution: \" + furnitureObstacleElement.getElementsByTagName(\"resolution\")\n .item(0).getTextContent());\n // debug(\"- - - Requirement: \" +\n // furnitureObstacleElement.getElementsByTagName(\"requiredItem\").item(0).getTextContent());\n\n // create furniture obstacle\n if (furnitureObstacleElement.getAttribute(\"type\").equals(\"double\")) {\n // double Item obstacle\n furnitures.get(furnitureCounter)\n .setObstalce(new DoubleItemObstacle(\"\",\n furnitureObstacleElement.getElementsByTagName(\"description\").item(0)\n .getTextContent(),\n furnitureObstacleElement.getElementsByTagName(\"resolution\").item(0)\n .getTextContent(),\n getRequiredItem(items,\n furnitureObstacleElement.getElementsByTagName(\"requiredItem\").item(0)\n .getTextContent()),\n getRequiredItem(items, furnitureObstacleElement\n .getElementsByTagName(\"additionalItem\").item(0).getTextContent())));\n\n } else if (furnitureObstacleElement.getAttribute(\"type\").equals(\"riddle\")) {\n // riddle Obstacle\n furnitures.get(furnitureCounter)\n .setObstalce(new RiddleObstacle(\"\",\n furnitureObstacleElement.getElementsByTagName(\"description\").item(0)\n .getTextContent(),\n furnitureObstacleElement.getElementsByTagName(\"resolution\").item(0)\n .getTextContent(),\n furnitureObstacleElement.getElementsByTagName(\"requiredAnswer\").item(0)\n .getTextContent()));\n\n } else {\n // normal Obstacle\n furnitures.get(furnitureCounter)\n .setObstalce(new ItemObstacle(\"\",\n furnitureObstacleElement.getElementsByTagName(\"description\").item(0)\n .getTextContent(),\n furnitureObstacleElement.getElementsByTagName(\"resolution\").item(0)\n .getTextContent(),\n getRequiredItem(items, furnitureObstacleElement\n .getElementsByTagName(\"requiredItem\").item(0).getTextContent())));\n }\n // add damage points to obstacle\n if (!furnitureObstacleElement.getAttribute(\"damage\").equals(\"\")) {\n passages.get(furnitureCounter).getObstacle()\n .setDamagepoints(Integer.parseInt(furnitureObstacleElement.getAttribute(\"damage\")));\n }\n\n }\n\n }\n\n // Add current furniture to its containing Place\n setFurnitureInPlace(furnitures, places);\n\n // parse all existing passages\n for (int passageCounter = 0; passageCounter < passageList.getLength(); passageCounter++) {\n Node passageNode = passageList.item(passageCounter);\n\n debug(\"\\nCurrent Element: \" + passageNode.getNodeName());\n\n if (passageNode.getNodeType() == Node.ELEMENT_NODE) {\n Element passageElement = (Element) passageNode;\n\n debug(\"- id: \" + passageElement.getAttribute(\"id\"));\n debug(\"- Name: \" + passageElement.getElementsByTagName(\"name\").item(0).getTextContent());\n debug(\"- Description: \"\n + passageElement.getElementsByTagName(\"description\").item(0).getTextContent());\n debug(\"- Comes from: \"\n + passageElement.getElementsByTagName(\"comeFrom\").item(0).getTextContent());\n debug(\"- Connects to: \"\n + passageElement.getElementsByTagName(\"connectTo\").item(0).getTextContent());\n\n // Create Passage with connected Places.\n passages\n .add(new Passage(passageElement.getElementsByTagName(\"name\").item(0).getTextContent(),\n passageElement.getElementsByTagName(\"description\").item(0).getTextContent(),\n getFromPlace(passageElement, places), // from this Place\n getFollowPlace(passageElement, places)) // to that Place\n );\n\n // parse all existing Passage Obstacles\n NodeList obstacleList = passageElement.getElementsByTagName(\"obstacle\");\n\n for (int obstacleCounter = 0; obstacleCounter < obstacleList\n .getLength(); obstacleCounter++) {\n Node obstacleNode = obstacleList.item(obstacleCounter);\n\n Element obstacleElement = (Element) obstacleNode;\n\n debug(\"- Obstacle\" + passageCounter + \":\");\n debug(\"- - Description: \"\n + obstacleElement.getElementsByTagName(\"description\").item(0).getTextContent());\n debug(\"- - Resolution: \"\n + obstacleElement.getElementsByTagName(\"resolution\").item(0).getTextContent());\n // debug(\"- - Required Item: \" +\n // obstacleElement.getElementsByTagName(\"requiredItem\").item(0).getTextContent());\n\n // Create the obstacle for each passage.\n if (obstacleElement.getAttribute(\"type\").equals(\"double\")) {\n // double Item obstacle\n passages.get(passageCounter)\n .setObstacle(new DoubleItemObstacle(\"\",\n obstacleElement.getElementsByTagName(\"description\").item(0).getTextContent(),\n obstacleElement.getElementsByTagName(\"resolution\").item(0).getTextContent(),\n getRequiredItem(items,\n obstacleElement.getElementsByTagName(\"requiredItem\").item(0)\n .getTextContent()),\n getRequiredItem(items, obstacleElement.getElementsByTagName(\"additionalItem\")\n .item(0).getTextContent())));\n\n } else if (obstacleElement.getAttribute(\"type\").equals(\"riddle\")) {\n // riddle Obstacle\n passages.get(passageCounter).setObstacle(new RiddleObstacle(\"\",\n obstacleElement.getElementsByTagName(\"description\").item(0).getTextContent(),\n obstacleElement.getElementsByTagName(\"resolution\").item(0).getTextContent(),\n obstacleElement.getElementsByTagName(\"requiredAnswer\").item(0).getTextContent()));\n\n } else {\n // normal Obstacle\n passages.get(passageCounter)\n .setObstacle(new ItemObstacle(\"\",\n obstacleElement.getElementsByTagName(\"description\").item(0).getTextContent(),\n obstacleElement.getElementsByTagName(\"resolution\").item(0).getTextContent(),\n getRequiredItem(items, obstacleElement.getElementsByTagName(\"requiredItem\")\n .item(0).getTextContent())));\n }\n\n // add damage points to obstacle\n if (!obstacleElement.getAttribute(\"damage\").equals(\"\")) {\n passages.get(passageCounter).getObstacle()\n .setDamagepoints(Integer.parseInt(obstacleElement.getAttribute(\"damage\")));\n }\n\n\n }\n }\n }\n\n startingPlace = places.get(0);\n\n // Add Places to GameWorld\n addPlacesToWorld(places, world);\n\n // set starting Place in GameWorld\n if (world.getStartingPlace() == null) {\n world.setStartingPlace(startingPlace);\n }\n\n debug(\"\\n\\n\");\n debug(\"World has successfully been created! God saw all that he had made, and it was good.\");\n debug(\"\\n\\n\\n\\n\");\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public void stockLoad() {\n try {\n File file = new File(stockPath);\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()) {\n String data = scanner.nextLine();\n String[] userData = data.split(separator);\n Stock stock = new Stock();\n stock.setProductName(userData[0]);\n int stockCountToInt = Integer.parseInt(userData[1]);\n stock.setStockCount(stockCountToInt);\n float priceToFloat = Float.parseFloat(userData[2]);\n stock.setPrice(priceToFloat);\n stock.setBarcode(userData[3]);\n\n stocks.add(stock);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void readFromFile() {\n //reading text from file\n\n try {\n Scanner scanner = new Scanner(openFileInput(\"myTextFile.txt\"));\n\n while(scanner.hasNextLine()){\n\n String line = scanner.nextLine();\n\n String[] lines = line.split(\"\\t\");\n\n System.out.println(lines[0] + \" \" + lines[1]);\n\n toDoBean newTask = new toDoBean(lines[0], lines[1], 0);\n // System.out.println(line);\n sendList.add(newTask);\n\n }\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private static void readWineListFromFile() {\n\t\tJSONParser parser = new JSONParser();\n\n\t\ttry (Reader reader = new FileReader(\"wines.json\")) {\n\n\t\t\tJSONArray wineListJSON = (JSONArray) parser.parse(reader);\n\n\t\t\tfor (int i = 0 ; i < wineListJSON.size(); i++) {\n\t\t\t\tJSONObject wine = (JSONObject) wineListJSON.get(i);\n\t\t\t\tString name = (String) wine.get(\"name\");\n\t\t\t\tint year = Integer.valueOf(wine.get(\"year\").toString());\n\t\t\t\tString description = (String) wine.get(\"description\");\n\t\t\t\tString vine = (String) wine.get(\"vine\");\n\t\t\t\tint quantity = Integer.valueOf(wine.get(\"quantity\").toString());\n\t\t\t\tdouble price = (double) wine.get(\"price\");\n\n\t\t\t\t// Add the JSON object to the wine list\n\t\t\t\tMain.wineList.add(new Wine(name, year, description, vine, quantity, price));\n\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "protected static List<Package> convertFileItemsToPackages(String filePath) throws APIException {\n //read the file in the filepath into a Stream\n Path path = Paths.get(filePath);\n List<Package> listOfPackages = null;\n try {\n Stream<String> lines = Files.lines(path);\n // parse each line of the file into a Package object and filter out any null objects\n listOfPackages = lines.map(line -> parseLine(line))\n .filter(o -> o != null)\n .collect(Collectors.toList());\n lines.close();\n } catch (IOException ioe) {\n throw new APIException(\"Error reading the file.\");\n }\n return listOfPackages;\n }", "private void handleInit() {\n\t\ttry {\n String filePath = \"/app/FOOD_DATA.txt\";\n String line = null;\n FileReader fileReader = new FileReader(filePath);\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n while ((line = bufferedReader.readLine()) != null) {\n System.out.println(line);\n\n String[] foodData = line.split(\"\\\\^\");\n \t\tfor (int i = 2; i < foodData.length; i++) {\n \t\t\tif (foodData[i].equals(\"\")) {\n \t\t\t\tfoodData[i] = \"-1\";\n \t\t\t}\n \t\t}\n String foodName = foodData[0];\n String category = foodData[1];\n double calories = Double.parseDouble(foodData[2]);\n double sodium = Double.parseDouble(foodData[3]);\n double fat = Double.parseDouble(foodData[4]);\n double protein = Double.parseDouble(foodData[5]);\n double carbohydrate = Double.parseDouble(foodData[6]);\n Food food = new Food();\n food.setName(foodName);\n food.setCategory(category);\n food.setCalories(calories);\n food.setSodium(sodium);\n food.setSaturatedFat(fat);\n food.setProtein(protein);\n food.setCarbohydrate(carbohydrate);\n foodRepository.save(food);\n }\n bufferedReader.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n \tcategories = Categories.MAIN_MENU;\n }\n\t}", "public static ArrayList<ArrayList<Feiertag>> produceFromString(File[] f) {\n\t\tArrayList<ArrayList<Feiertag>> ret = new ArrayList<ArrayList<Feiertag>>();\n\t\tfor (int i = 0; i < f.length; i++) {\n\t\t\tArrayList<Feiertag> temp = new ArrayList<Feiertag>();\n\t\t\ttry {\n\t\t\t\tScanner myReader = new Scanner(f[i]);\n\t\t\t\twhile (myReader.hasNextLine()) {\n\t\t\t\t\tString data = myReader.nextLine();\n\t\t\t\t\ttemp.add(new Feiertag(FeiertageFactory.toDate(data), FeiertageFactory.toName(data)));\n\t\t\t\t}\n\t\t\t\tmyReader.close();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tret.add(temp);\n\t\t}\n\t\treturn ret;\n\t}", "public void criaTrolls() throws FileNotFoundException, IOException{\n \n String[] vetorNomes;\n vetorNomes = new String[20];\n int i = 0;\n String endereco = System.getProperty(\"user.dir\");\n endereco = endereco + \"/nomes/Nomes.txt\";\n Scanner leitor = new Scanner(new FileReader(endereco));\n while(leitor.hasNext() && i < 20){\n \n vetorNomes[i] = leitor.next();\n ++i;\n }\n // Atribuindo nomes aos trolls.\n Random gerador = new Random();\n int qtde = gerador.nextInt(2);\n for(i = 0; i < qtde; ++i){\n \n int rd = gerador.nextInt(20);\n setNome(vetorNomes[rd], i);\n }\n setQtdeTrolls(qtde);\n }", "public void parseFile(){\n try{\n BufferedReader br = new BufferedReader(new FileReader(\"ElevatorConfig.txt\"));\n \n String fileRead;\n \n totalSimulatedTime = 1000;\n Integer.parseInt(br.readLine());\n simulatedSecondRate = 30;\n Integer.parseInt(br.readLine());\n \n for (int onFloor = 0; onFloor< 5; onFloor++){\n \n fileRead = br.readLine(); \n String[] tokenize = fileRead.split(\";\");\n for (int i = 0; i < tokenize.length; i++){\n String[] floorArrayContent = tokenize[i].split(\" \");\n \n int destinationFloor = Integer.parseInt(floorArrayContent[1]);\n int numPassengers = Integer.parseInt(floorArrayContent[0]);\n int timePeriod = Integer.parseInt(floorArrayContent[2]);\n passengerArrivals.get(onFloor).add(new PassengerArrival(numPassengers, destinationFloor, timePeriod));\n }\n }\n \n br.close();\n \n } catch(FileNotFoundException e){ \n System.out.println(e);\n } catch(IOException ioe){\n ioe.printStackTrace();\n }\n\n }", "public static ArrayList<String> getRenglones(FileReader file) throws IOException {\n ArrayList<String> producciones = new ArrayList<>();\n BufferedReader b = new BufferedReader(file);\n\n String readedString;\n while ((readedString = b.readLine()) != null) { //cuando b.readLine() == null significa que se ha encontrado un salto de linea (retorno de carro —\\n—)\n producciones.add(readedString);\n }\n return producciones;\n }", "private static List<Objective> loadObjectives() throws IOException {\n\t\tString nextLine;\n\t\tPattern objStartPattern = Pattern.compile(\"<objective\");\n\t\tMatcher m;\n\t\tLinkedList<Objective> objectives = new LinkedList<>();\n\n\t\twhile ((nextLine = getNextLine()) != null) {\n\t\t\tif (nextLine.matches(\"\\\\s*</quest>\\\\s*\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tm = objStartPattern.matcher(nextLine);\n\t\t\tif (m.find()) {\n\t\t\t\tOptional<Objective> oo = loadObjective(nextLine);\n\t\t\t\too.ifPresent(o -> objectives.add(o));\n\t\t\t}\n\t\t}\n\t\treturn objectives;\n\t}", "public void addThemes(Properties props) {\n\t\tTheme theme = new Theme(props);\r\n\t\t// theme.setName(themeName);\r\n\t\taddThemes(theme);\r\n\t}", "public ArrayList<Room> readRoomFile(String path, HashMap<String, Item> itemStringHashMap, ArrayList<Suspect> suspectsArrayList)\n {\n // Create an empty items arrayList to be populated\n ArrayList<Room> roomsArray = new ArrayList<>();\n\n\n try(BufferedReader fileReader = new BufferedReader(new FileReader(path)))\n {\n // Reads file until the reader reaches the end of the file\n while((e = fileReader.readLine()) != null)\n {\n String[] info = e.split(\"/\");\n //Creates a new empty Room, itemArray, and exitArray every loop, and suspectArray that is specific to each room.\n Room r = new Room();\n ArrayList<Item> itemsArray = new ArrayList<>();\n ArrayList<String> exitsArray = new ArrayList<>();\n ArrayList<Suspect> suspectsArray = new ArrayList<>();\n\n // Loop to add items to rooms if item.location == room.getname\n for(Item item : itemStringHashMap.values())\n {\n // If the RoomName(Info[0]) is also the location of the Item Object\n // If they are equal, add the Item to the items in the room array.\n if(info[0].equalsIgnoreCase(item.getRoomLocation()))\n {\n itemsArray.add(item);\n }\n\n }\n\n //Takes the suspectArrayList of ALL suspects, add them to another suspect array specific to the room.\n for(Suspect s : suspectsArrayList)\n {\n // Checks suspect location, with room name to make sure suspects go in the right rooms.\n if(info[0].equalsIgnoreCase(s.getLocation()))\n {\n suspectsArray.add(s);\n }\n }\n\n // 2 Is the index where the room exits start on the file\n for(int i = 2; i < info.length; i++)\n {\n exitsArray.add(info[i]);\n }\n\n // Then construct the Room\n r.setName(info[0]);\n r.setDesc(info[1]);\n r.setContents(itemsArray);\n r.setSuspects(suspectsArray);\n\n //Convert array list to array as that's what is used in Room class\n String[] newArray = new String[exitsArray.size()];\n for(int i = 0; i < exitsArray.size(); i++)\n {\n newArray[i] = exitsArray.get(i);\n }\n r.setExits(newArray);\n\n //If the room is the bedroom, make inaccessible\n if(r.getName().equalsIgnoreCase(\"Bedroom\"))\n r.setType(RoomType.INACCESSIBLE);\n\n //Finally add the Room to an ArrayList of Rooms\n roomsArray.add(r);\n\n // Once the for loop ends, Room and itemsArray get renewed as empty.\n }\n }\n catch(IOException ex)\n {\n System.out.println(\"File not found\");\n }\n\n return roomsArray;\n }", "@Override\n public void loadFoodItems(String filePath) {\n file = new File(filePath);\n \n // Check the file existence\n try {\n scnr = new Scanner(file);\n } catch (FileNotFoundException e1) {\n e1.printStackTrace();\n System.out.println(\"no such file\");\n }\n \n // Read the file and save the food info to food class\n try {\n while (scnr.hasNextLine()) {\n \t\n // read line by line\n String text = scnr.nextLine().trim();\n \n // if line is not empty\n \n // load the file to memory\n if (!text.isEmpty()) {\n \t\n String[] objects = text.split(\",\");\n \n //skip the data with wrong format\n if(objects.length != 12) continue;\n String id = objects[0];\n String name = objects[1];\n FoodItem food = new FoodItem(id, name);\n for(int i = 0; i < 5; i++) {\n \tfood.addNutrient(nutrition[i], Double.parseDouble(objects[2*(i+1)+1]));\n }\n foodItemList.add(food);\n \n }\n }\n \n // add the food item to nutrition BPTree\n \n Iterator<FoodItem> foodItr = foodItemList.iterator();\n while(foodItr.hasNext()) {\n \tIterator<BPTree<Double, FoodItem>> treeItr = nutriTree.iterator();\n \tFoodItem tempFood = foodItr.next();\n \tint i = 0;\n while(treeItr.hasNext()) {\n \ttreeItr.next().insert(tempFood.getNutrientValue(nutrition[i]), tempFood);\n \ti ++;\n }\n }\n \n \n scnr.close();\n } catch (Exception e) {\n System.out.println(e.getMessage());\n System.out.println(\"Error in food data processing\");\n }\n }", "@SuppressWarnings(\"resource\")\n\tpublic void setPieces(String filename) throws IOException\n {\n\tString[] colors = new String[11]; //array containing the colors of the pieces\n\tcolors[0] = \"Red\";\n\tcolors[1] = \"Orange\";\n\tcolors[2] = \"Yellow\";\n\tcolors[3] = \"Green\";\n\tcolors[4] = \"Teal\";\n\tcolors[5] = \"Sky\";\n\tcolors[6] = \"Azure\";\n\tcolors[7] = \"Blue\";\n\tcolors[8] = \"Pink1\";\n\tcolors[9] = \"Pink2\";\n\tcolors[10] = \"Violet\";\n\n\tFileReader file = new FileReader(filename);\n\tScanner stringIn = new Scanner(file);\n\tString[] temp_pieces = new String[11]; \n\tint index = 0;\n\twhile(stringIn.hasNext())\n\t {\n\t\ttemp_pieces[index] = stringIn.nextLine(); \n\t\tindex++;\n\t }\n\n\tpieces = new Piece[11];\n\tunused = new Piece[11];\n\tfor(int i=0;i<temp_pieces.length;i++)\n\t {\n\t\tPiece temp = new Piece(temp_pieces[i],colors[i]); //creates new pieces from the temp array\n\t\tpieces[i] = temp;\n\t\tunused[i] = temp;\n\t\t}\n }", "private static City[] fileInterpreter(Scanner file,int numberOfLines){\n City[] cities = new City [numberOfLines];\n for(int i = 0 ; file.hasNextLine(); i++){\n String line = file.nextLine();\n Scanner string = new Scanner(line); //String Scanner to consume the line into city and country and rainfall...\n String cityName = string.next();\n String countryName = string.next();\n double[] data = extractRainfallInformation(line.split(\"[ \\t]+[ \\t]*\")); //to create the array of monthly rainfall\n cities[i] = new City(cityName , countryName , data);\n string.close();\n }\n file.close();\n return cities;\n }", "void readProducts(String filename) throws FileNotFoundException {\n\t\t//reads the file, computes the number of rows in the file\n\t\tScanner input=new Scanner(new File(filename));\n\t\tint numOfRow=0;\n\t\twhile(input.hasNextLine()) {\n\t\t\tnumOfRow++;\n\t\t\tinput.nextLine();\n\t\t}\n\t\t//load the products array one by one, using constructor\n\t\tproducts=new Product[numOfRow-1];\n\t\tScanner input2=new Scanner(new File(filename));\n\t\tinput2.nextLine();\n\t\tint i=0;\n\t\twhile(input2.hasNextLine()) {\n\t\t\tString row=input2.nextLine();\n\t\t\tString[] split1=row.split(((char)34+\",\"+(char)34));\n\t\t\tproducts[i++]=new Product(split1[0].substring(1, split1[0].length())\n\t\t\t\t\t, split1[1], split1[4], split1[7].substring(0, split1[7].length()-1));\n\t\t}\n\t\t//close the input\n\t\tinput.close();\n\t\tinput2.close();\n\t}", "void readNutrients(String filename) throws FileNotFoundException {\n\t\t//reads the file, computes the number of unique nutrient objects\n\t\t//uses StringBuilder to append the unique Nutrient_Code\n\t\tScanner input=new Scanner(new File(filename));\n\t\tint numOfRow=0;\n\t\tStringBuilder uniqueNutrient=new StringBuilder();\n\t\twhile(input.hasNextLine()) {\n\t\t\tString row0=input.nextLine();\n\t\t\tString[] split0=row0.split(((char)34+\",\"+(char)34));\n\t\t\tif(!uniqueNutrient.toString().contains(split0[1]+\",\")) {\n\t\t\t\tuniqueNutrient=uniqueNutrient.append(split0[1]+\",\");\n\t\t\t\tnumOfRow++;\n\t\t\t}\n\t\t}\n\t\t//load the products array one by one, using constructor\n\t\t//keep only the unique nutrient objects\n\t\tnutrients=new Nutrient[numOfRow-1];\n\t\tScanner input2=new Scanner(new File(filename));\n\t\tinput2.nextLine();\n\t\tint i=0;\n\t\tStringBuilder uniqueNutrien2=new StringBuilder();\n\t\twhile(input2.hasNextLine()) {\n\t\t\tString row=input2.nextLine();\n\t\t\tString[] split1=row.split(((char)34+\",\"+(char)34));\n\t\t\tif(!uniqueNutrien2.toString().contains(split1[1]+\",\")) {\n\t\t\t\tuniqueNutrien2.append(split1[1]+\",\");\n\t\t\t\tnutrients[i++]=new Nutrient(split1[1], split1[2], split1[5]);\n\t\t\t}\n\t\t}\n\n\t\t//reads the file, computes the number of unique productNutrient objects\n\t\tScanner input3 =new Scanner(new File(filename));\n\t\tinput3.nextLine();\n\t\tint numOfRowProductNutrient=0;\n\t\twhile(input3.hasNextLine()) {\n\t\t\tnumOfRowProductNutrient++;\n\t\t\tinput3.nextLine();\n\t\t}\n\t\t//load the products array one by one, using constructor\n\t\tproductNutrients=new ProductNutrient[numOfRowProductNutrient];\n\t\tScanner input4=new Scanner(new File(filename));\n\t\tinput4.nextLine();\n\t\tint i2=0;\n\t\twhile(input4.hasNextLine()) {\n\t\t\tString row=input4.nextLine();\n\t\t\tString[] split1=row.split(((char)34+\",\"+(char)34));\n\t\t\tproductNutrients [i2++]=new ProductNutrient(split1[0].substring\n\t\t\t\t\t(1, split1[0].length()), split1[1], split1[2], \n\t\t\t\t\tFloat.parseFloat(split1[4]),split1[5].substring(0, split1[5].length()-1));\n\t\t}\n\t\t//close the input\n\t\tinput.close();\n\t\tinput2.close();\n\t\tinput3.close();\n\t\tinput4.close();\n\t}", "private void loadParkingLots() {\n ParkingLot metrotown = new ParkingLot(\"Metrotown\", 4);\n ParkingLot pacificcenter = new ParkingLot(\"PacificCenter\", 5);\n\n for (int i = 0; i < 3; i++) {\n metrotown.addParkingSpot(new ParkingSpot(\"M\" + i, \"medium\", 5));\n pacificcenter.addParkingSpot(new ParkingSpot(\"PC\" + i, \"large\", 4));\n }\n\n parkinglots.add(metrotown);\n parkinglots.add(pacificcenter);\n }", "public void loadData() {\n Path path= Paths.get(filename);\n Stream<String> lines;\n try {\n lines= Files.lines(path);\n lines.forEach(ln->{\n String[] s=ln.split(\";\");\n if(s.length==3){\n try {\n super.save(new Teme(Integer.parseInt(s[0]),Integer.parseInt(s[1]),s[2]));\n } catch (ValidationException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }else\n System.out.println(\"linie corupta in fisierul teme.txt\");});\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Test\n public void main() throws IOException {\n currentArticle = null;\n\n for(String line: FileUtils.readLines(new File(\"D:\\\\projects\\\\вёрстка томов ИИ\\\\9 том\\\\термины.txt\"))) {\n\n Matcher matcher = compile(\"\\\\|([^\\\\|]+)\\\\|\\\\s[–\\\\-—]\\\\s(.+)\").matcher(line);\n if (matcher.find()) {\n if (currentArticle != null) {\n saveItem();\n currentArticle = null;\n }\n String term = matcher.group(1);\n String body = matcher.group(2);\n if(body.indexOf(\"см. \") != 0) {\n currentArticle = new Article(term, body);\n } /*else {\n String alias = body.replace(\"см. \", \"\").replace(\"«\", \"\").replace(\"»\", \"\").replace(\".\", \"\");\n saveAliases(alias, term);\n }*/\n } else if (currentArticle != null) {\n currentArticle.setContent(currentArticle.getContent() + \"<br/>\"+line);\n }\n }\n if (currentArticle != null) {\n saveItem();\n }\n }", "private static void ReadText(String path) {\n\t\t//reads the file, throws an error if there is no file to open\n\t\ttry {\n\t\t\tinput = new Scanner(new File(path));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error opening file...\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tString line; //stores the string of text from the .txt file\n\t\tString parsedWord; //Stores the word of the parsed word\n\t\tint wordLength; //Stores the length of the word\n\t\tint lineNum = 1; //Stores the number of line\n\t\ttry {\n\t\t\t//loops while there is still a new line in the .txt file\n\t\t\twhile ((line = input.nextLine()) != null) {\n\t\t\t\t//separates the lines by words\n\t\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\t\t//loops while there are still more words in the line\n\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\tparsedWord = st.nextToken();\n\t\t\t\t\twordLength = parsedWord.length();\n\t\t\t\t\t//Regex gets rid of all punctuation\n\t\t\t\t\tif (parsedWord.matches(\".*\\\\p{Punct}\")) {\n\t\t\t\t\t\tparsedWord = parsedWord.substring(0, wordLength - 1);\n\t\t\t\t\t}\n\t\t\t\t\t//add the word to the list\n\t\t\t\t\twordList.add(parsedWord);\n\t\t\t\t\tlineList.add(lineNum);\n\t\t\t\t}\n\t\t\t\tlineNum++;\n\t\t\t}\n\t\t} catch (NoSuchElementException e) {\n\t\t\t//Do nothing\n\t\t}\n\t\tinput.close();\n\t}", "public static ArrayList<Point> read_from_file(String file){\n Locale.setDefault(new Locale(\"en\", \"US\"));\n\n ArrayList<Point> points = new ArrayList<>();\n\n try {\n //java.io.File myObj = new java.io.File(\"test_points_2.txt\");\n //java.io.File myObj = new java.io.File(\"points.txt\");\n java.io.File myObj = new java.io.File(file);\n Scanner myReader = new Scanner(myObj);\n int N = myReader.nextInt();\n\n //System.out.println(N);\n for (int i = 0; i < N; i++) {\n double x = myReader.nextDouble();\n double y = myReader.nextDouble();\n points.add(new Point(x, y));\n //System.out.println(\"x: \" + x + \" y: \" + y);\n }\n\n myReader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n return null;\n }\n return points;\n }", "public void buildListGems(String filename) throws ServiceException {\n\t\ttry {\n\t\t\treader.parse(filename);\n\t\t} catch (IOException e) {\n\t\t\tLOG.debug(\"can't find file on path \" + filename);\n\t\t\tthrow new ServiceException(\"wrong_file\");\n\t\t} catch (SAXException e) {\n\t\t\tLOG.debug(\"error in XML file\");\n\t\t\tthrow new ServiceException(\"wrong_xml\");\n\t\t}\n\t\tgems = handler.getGems();\n\t}", "public void populateDictionary() throws IOException {\n\t\tScanner scan = new Scanner(new File(\"dictionary.txt\"));\n\t\twhile(scan.hasNextLine()) {\n\t\t\tString curr = scan.nextLine().toLowerCase();\n\t\t\tthis.dictionary.add(curr);\n\t\t}\n\t}", "public static void createPlanets() {\n\t\tplanets = new PlanetV4[planetNames.length];\n\t\tfor (int i = 0; i < planetNames.length; i ++) {\n\t\t\tplanets[i] = new PlanetV4(planetNames[i], planetMasses[i], planetDiameters[i], planetPositions[i], planetVelocities[i], planetCircles[i]);\n\t\t\t//mainFrame.add(planets[i]);\n\t\t}\n\t}", "public List<String> getFileLines() {\n\t\tspeciesByExperiment = new TIntObjectHashMap<List<String>>();\n\t\ttissuesByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tcellTypesByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tdiseaseByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tquantificationByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tinstrumentByExperiment = new TIntObjectHashMap<List<String>>();\n\t\tmodificationByExperiment = new TIntObjectHashMap<List<String>>();\n\t\texperimental_factorByExperiment = new TIntObjectHashMap<List<String>>();\n\n\t\tfinal List<String> ret = new ArrayList<String>();\n\t\tfinal Map<String, PexFileMapping> fileLocationsMapping = new THashMap<String, PexFileMapping>();\n\t\tfinal List<PexFileMapping> totalFileList = new ArrayList<PexFileMapping>();\n\t\tint fileCounter = 1;\n\t\t// organize the files by experiments\n\t\tfor (final Experiment experiment : experimentList.getExperiments()) {\n\n\t\t\tfinal File prideXmlFile = experiment.getPrideXMLFile();\n\t\t\tif (prideXmlFile != null) {\n\t\t\t\t// FILEMAPPINGS\n\t\t\t\t// PRIDE XML\n\t\t\t\tfinal int resultNum = fileCounter;\n\t\t\t\tfinal PexFileMapping prideXMLFileMapping = new PexFileMapping(\"result\", fileCounter++,\n\t\t\t\t\t\tprideXmlFile.getAbsolutePath(), null);\n\n\t\t\t\ttotalFileList.add(prideXMLFileMapping);\n\t\t\t\tfileLocationsMapping.put(prideXMLFileMapping.getPath(), prideXMLFileMapping);\n\n\t\t\t\t// Iterate over replicates\n\t\t\t\tfinal List<Replicate> replicates = experiment.getReplicates();\n\t\t\t\tfor (final Replicate replicate : replicates) {\n\t\t\t\t\t// sample metadatas\n\t\t\t\t\taddSampleMetadatas(resultNum, replicate);\n\n\t\t\t\t\t// PEak lists\n\t\t\t\t\tfinal List<PexFileMapping> peakListFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\t// raw files\n\t\t\t\t\tfinal List<PexFileMapping> rawFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\t// search engine output lists\n\t\t\t\t\tfinal List<PexFileMapping> outputSearchEngineFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\t// MIAPE MS and MSI reports\n\t\t\t\t\tfinal List<PexFileMapping> miapeReportFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\t// RAW FILES\n\t\t\t\t\tfinal List<PexFile> rawFiles = getReplicateRawFiles(replicate);\n\n\t\t\t\t\tif (rawFiles != null) {\n\t\t\t\t\t\tfor (final PexFile rawFile : rawFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(rawFile.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping rawFileMapping = new PexFileMapping(\"raw\", fileCounter++,\n\t\t\t\t\t\t\t\t\t\trawFile.getFileLocation(), null);\n\t\t\t\t\t\t\t\trawFileMappings.add(rawFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(rawFile.getFileLocation(), rawFileMapping);\n\n\t\t\t\t\t\t\t\t// PRIDE XML -> RAW file\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(rawFileMapping.getId());\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\t// PEAK LISTS\n\t\t\t\t\tfinal List<PexFile> peakListFiles = getPeakListFiles(replicate);\n\t\t\t\t\tfinal List<PexFileMapping> replicatePeakListFileMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\tif (peakListFiles != null) {\n\t\t\t\t\t\tfor (final PexFile peakList : peakListFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(peakList.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping peakListFileMapping = new PexFileMapping(\"peak\", fileCounter++,\n\t\t\t\t\t\t\t\t\t\tpeakList.getFileLocation(), null);\n\t\t\t\t\t\t\t\tpeakListFileMappings.add(peakListFileMapping);\n\t\t\t\t\t\t\t\treplicatePeakListFileMappings.add(peakListFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(peakList.getFileLocation(), peakListFileMapping);\n\n\t\t\t\t\t\t\t\t// PRIDE XML -> PEAK LIST file\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(peakListFileMapping.getId());\n\t\t\t\t\t\t\t\t// RAW file -> PEAK LIST file\n\t\t\t\t\t\t\t\tfor (final PexFileMapping rawFileMapping : rawFileMappings) {\n\t\t\t\t\t\t\t\t\trawFileMapping.addRelationship(peakListFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// prideXMLFileMapping\n\t\t\t\t\t\t\t\t// .addRelationship(peakListFileMapping\n\t\t\t\t\t\t\t\t// .getId());\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\t// MIAPE MS REPORTS\n\t\t\t\t\tfinal List<PexFile> miapeMSReportFiles = getMiapeMSReportFiles(replicate);\n\t\t\t\t\tif (miapeMSReportFiles != null)\n\t\t\t\t\t\tfor (final PexFile miapeMSReportFile : miapeMSReportFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(miapeMSReportFile.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping miapeReportFileMapping = new PexFileMapping(\"other\", fileCounter++,\n\t\t\t\t\t\t\t\t\t\tmiapeMSReportFile.getFileLocation(), null);\n\t\t\t\t\t\t\t\tmiapeReportFileMappings.add(miapeReportFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(miapeMSReportFile.getFileLocation(), miapeReportFileMapping);\n\n\t\t\t\t\t\t\t\t// PRIDE XML -> MIAPE MS report\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t// RAW file -> MIAPE MS report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping rawFileMapping : rawFileMappings) {\n\t\t\t\t\t\t\t\t\trawFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// PEAK LIST file -> MIAPE MS report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping peakListFileMapping : replicatePeakListFileMappings) {\n\t\t\t\t\t\t\t\t\tpeakListFileMapping.addRelationship(miapeReportFileMapping.getId());\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\n\t\t\t\t\t// SEARCH ENGINE OUTPUT FILES\n\t\t\t\t\tfinal List<PexFile> searchEngineOutputFiles = getSearchEngineOutputFiles(replicate);\n\t\t\t\t\tfinal List<PexFileMapping> replicatesearchEngineOutputFilesMappings = new ArrayList<PexFileMapping>();\n\t\t\t\t\tif (searchEngineOutputFiles != null) {\n\t\t\t\t\t\tfor (final PexFile peakList : searchEngineOutputFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(peakList.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping searchEngineOutputFileMapping = new PexFileMapping(\"search\",\n\t\t\t\t\t\t\t\t\t\tfileCounter++, peakList.getFileLocation(), null);\n\t\t\t\t\t\t\t\toutputSearchEngineFileMappings.add(searchEngineOutputFileMapping);\n\t\t\t\t\t\t\t\treplicatesearchEngineOutputFilesMappings.add(searchEngineOutputFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(peakList.getFileLocation(), searchEngineOutputFileMapping);\n\t\t\t\t\t\t\t\t// PRIDE XML -> SEARCH ENGINE OUTPUT file\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(searchEngineOutputFileMapping.getId());\n\t\t\t\t\t\t\t\t// RAW file -> SEARCH ENGINE OUTPUT file\n\t\t\t\t\t\t\t\tfor (final PexFileMapping rawFileMapping : rawFileMappings) {\n\t\t\t\t\t\t\t\t\trawFileMapping.addRelationship(searchEngineOutputFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// PEAK LIST FILE -> SEARCH ENGINE OUTPUT file\n\t\t\t\t\t\t\t\tfor (final PexFileMapping peakListFileMapping : replicatePeakListFileMappings) {\n\t\t\t\t\t\t\t\t\tpeakListFileMapping.addRelationship(searchEngineOutputFileMapping.getId());\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\n\t\t\t\t\t// MIAPE MSI REPORTS\n\t\t\t\t\tfinal List<PexFile> miapeMSIReportFiles = getMiapeMSIReportFiles(replicate);\n\t\t\t\t\tif (miapeMSIReportFiles != null)\n\t\t\t\t\t\tfor (final PexFile miapeMSIReportFile : miapeMSIReportFiles) {\n\t\t\t\t\t\t\tif (!fileLocationsMapping.containsKey(miapeMSIReportFile.getFileLocation())) {\n\t\t\t\t\t\t\t\tfinal PexFileMapping miapeReportFileMapping = new PexFileMapping(\"other\", fileCounter++,\n\t\t\t\t\t\t\t\t\t\tmiapeMSIReportFile.getFileLocation(), null);\n\t\t\t\t\t\t\t\tmiapeReportFileMappings.add(miapeReportFileMapping);\n\t\t\t\t\t\t\t\tfileLocationsMapping.put(miapeMSIReportFile.getFileLocation(), miapeReportFileMapping);\n\n\t\t\t\t\t\t\t\t// PRIDE XML -> MIAPE MSI report\n\t\t\t\t\t\t\t\tprideXMLFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t// RAW file -> MIAPE MSI report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping rawFileMapping : rawFileMappings) {\n\t\t\t\t\t\t\t\t\trawFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// PEAK LIST FILE -> MIAPE MSI report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping peakListFileMapping : replicatePeakListFileMappings) {\n\t\t\t\t\t\t\t\t\tpeakListFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// SEARCH ENGINE OUTPUT file -> MIAPE MSI report\n\t\t\t\t\t\t\t\tfor (final PexFileMapping searchEngineOutputFileMapping : replicatesearchEngineOutputFilesMappings) {\n\t\t\t\t\t\t\t\t\tsearchEngineOutputFileMapping.addRelationship(miapeReportFileMapping.getId());\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t// Add all to the same list and then sort by id\n\t\t\t\t\ttotalFileList.addAll(outputSearchEngineFileMappings);\n\t\t\t\t\ttotalFileList.addAll(miapeReportFileMappings);\n\t\t\t\t\ttotalFileList.addAll(peakListFileMappings);\n\t\t\t\t\ttotalFileList.addAll(rawFileMappings);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Sort the list of files\n\t\tCollections.sort(totalFileList, new Comparator<PexFileMapping>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(PexFileMapping o1, PexFileMapping o2) {\n\n\t\t\t\treturn Integer.valueOf(o1.getId()).compareTo(Integer.valueOf(o2.getId()));\n\n\t\t\t}\n\n\t\t});\n\t\tfor (final PexFileMapping pexFileMapping : totalFileList) {\n\t\t\tret.add(pexFileMapping.toString());\n\t\t}\n\t\treturn ret;\n\t}", "private void populatepets(){\r\n\t\tpets.add(new Cat(\"UnNamed\"));\r\n\t\tpets.add(new Cow(\"UnNamed\"));\r\n\t\tpets.add(new Dog(\"UnNamed\"));\r\n\t\tpets.add(new Rabbit(\"UnNamed\"));\r\n\t\tpets.add(new Rat(\"UnNamed\"));\r\n\t\tpets.add(new Velociraptor(\"UnNamed\"));\r\n\t}", "public static List<Server> readFile() {\n String fileName = \"servers.txt\";\n\n List<Server> result = new LinkedList<>();\n try (Scanner sc = new Scanner(createFile(fileName))) {\n\n while (sc.hasNextLine()) {\n String line = sc.nextLine();\n result.add(lineProcessing(line));\n\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File is not found\");\n } catch (MyException e) {\n System.out.println(\"File is corrupted\");\n }\n return result;\n }", "public void loadPlayers(String filename) throws IOException {\r\n //TODO:4\r\n // 1. use try-with-resources syntax to ensure the file is closed\r\n // 2. read the number of players, then read an empty line\r\n // 3. for each player:\r\n // 3.1 read playerName, gold, sciencePoint, productionPoint, numCities and numMinisters separated by blank characters.\r\n // 3.2 create a player of corresponding values\r\n // 3.3 for (int i=1; i<numCities; i++):\r\n // read population, troops, cropYields\r\n // create a corresponding city object and add to the player's city list\r\n // 3.4 for (int i=1; i<numMinisters; i++):\r\n // read type, intelligence, experience, leadership\r\n // use switch-case to create a corresponding minister object and add to the player's minister list\r\n // check for invalid formats and throw custom exceptions.\r\n // (When there is any invalid minister type, throw InvalidMinisterTypeException.\r\n // Only \"WarGeneral\", \"Scientist\" and \"Economist\" are allowed.)\r\n // 3.5 add the player to the ArrayList<Player> players\r\n // Hint: use add() method of ArrayList.\r\n players = new ArrayList<>();\r\n File inputFile = new File(filename);\r\n try(\r\n Scanner reader = new Scanner(inputFile);\r\n ) {\r\n int numOfPlayers = reader.nextInt();\r\n String line = \"\";\r\n for (int i = 0; i < numOfPlayers; i++) {\r\n String name = reader.next();\r\n int gold = reader.nextInt();\r\n int sciencePoint = reader.nextInt();\r\n int productionPoint = reader.nextInt();\r\n Player newPlayer = new Player(name, gold, sciencePoint, productionPoint);\r\n this.players.add(newPlayer);\r\n\r\n int numOfCity = reader.nextInt();\r\n int numOfMin = reader.nextInt();\r\n\r\n for (int j = 0; j < numOfCity; j++) {\r\n int cityID = reader.nextInt();\r\n String cName = reader.next();\r\n int pop = reader.nextInt();\r\n int troops = reader.nextInt();\r\n int cropYields= reader.nextInt();\r\n\r\n City temp = new City(cityID, cName, pop, troops, cropYields);\r\n this.players.get(i).getCities().add(temp);\r\n }\r\n\r\n for (int j = 0; j < numOfMin; j++) {\r\n String mName = reader.next();\r\n int intel = reader.nextInt();\r\n int exp = reader.nextInt();\r\n int lead = reader.nextInt();\r\n\r\n if (mName.equals(\"Scientist\")) {\r\n Scientist temp = new Scientist(intel, exp, lead);\r\n this.players.get(i).getMinisters().add(temp);\r\n }\r\n else if (mName.equals(\"Economist\")) {\r\n Economist temp = new Economist(intel, exp, lead);\r\n this.players.get(i).getMinisters().add(temp);\r\n }\r\n else if (mName.equals(\"WarGeneral\")) {\r\n WarGeneral temp = new WarGeneral(intel, exp, lead);\r\n this.players.get(i).getMinisters().add(temp);\r\n }\r\n else {\r\n throw new InvalidMinisterTypeException(\"Only \\\"WarGeneral\\\", \\\"Scientist\\\" and \\\"Economist\\\" are allowed\");\r\n }\r\n }\r\n }\r\n }\r\n }", "private void fillPlayersList(List<String> lines, int numberOfFields) throws Exception {\n if (fields.size() == 0) throw new Exception(\"No fields found\");\n int numberOfPlayersIndex = Integer.parseInt(lines.get(numberOfFields + 1));\n for (int index = numberOfFields + 2;\n index <= numberOfFields + numberOfPlayersIndex + 1;\n index++) {\n String[] player = lines.get(index).split(\" \");\n switch (player[1]) {\n case \"greedy\":\n players.add(new Player(player[0], StrategyType.GREEDY));\n break;\n case \"careful\":\n players.add(new Player(player[0], StrategyType.CAREFUL));\n break;\n case \"tactical\":\n players.add(new Player(player[0], StrategyType.TACTICAL));\n break;\n }\n }\n }", "public ArrayList<quizImpl> readFile() {\n\n // The name of the file to open.\n String fileName = \"Quizzes.txt\";\n\n // This will reference one line at a time\n String line;\n\n try {\n //reads file twice the first time adding contacts the second adding meetings\n // FileReader reads text files in the default encoding.\n FileReader fileReader = new FileReader(fileName);\n\n // Wrap FileReader in BufferedReader.\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n while ((line = bufferedReader.readLine()) != null) {\n quizzes.add(line);\n }\n bufferedReader.close();\n for (String s : quizzes) {\n if (s.startsWith(\"quizName\")) {\n //splits the line into an array of strings\n String[] stringArray = s.split(\",\");\n //If game already has a highScore\n if (stringArray.length > 3) {\n if (stringArray[stringArray.length - 3].equals(\"highScore\")) {\n quizImpl q = new quizImpl(stringArray[1], stringArray[stringArray.length - 2], Integer.parseInt(stringArray[stringArray.length - 1]));\n for (int i = 2; i < stringArray.length - 3; i = i + 6) {\n q.addQuestion(stringArray[i], stringArray[i + 1], stringArray[i + 2], stringArray[i + 3], stringArray[i + 4], Integer.parseInt(stringArray[i + 5]));\n }\n quizArray.add(q);\n } else {\n quizImpl q = new quizImpl(stringArray[1]);\n for (int i = 2; i < stringArray.length; i = i + 6) {\n q.addQuestion(stringArray[i], stringArray[i + 1], stringArray[i + 2], stringArray[i + 3], stringArray[i + 4], Integer.parseInt(stringArray[i + 5]));\n }\n quizArray.add(q);\n }\n } else {\n quizImpl q = new quizImpl(stringArray[1]);\n for (int i = 2; i < stringArray.length; i = i + 6) {\n q.addQuestion(stringArray[i], stringArray[i + 1], stringArray[i + 2], stringArray[i + 3], stringArray[i + 4], Integer.parseInt(stringArray[i + 5]));\n }\n quizArray.add(q);\n }\n }\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"Unable to open file '\" + fileName + \"'\");\n } catch (IOException ex) {\n System.out.println(\"Error reading file '\" + fileName + \"'\");\n }\n return quizArray;\n }", "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 }", "public void askPoets(){\n System.out.println(\"Walt Whitman William Shakespeare John Keats Emily Dickinson\");\n System.out.println(\"Pick a poet and press enter: \");\n\n String poet1_input = scanner.nextLine();\n if (poet1_input.toLowerCase().contains(\"whitman\") || poet1_input.toLowerCase().contains(\"withman\")){\n poet1 = \"Whitman\";\n }else if (poet1_input.toLowerCase().contains(\"shakespeare\") || poet1_input.toLowerCase().contains(\"shakespear\")){\n poet1 = \"Shakespeare\";\n }else if (poet1_input.toLowerCase().contains(\"keats\")){\n poet1 = \"Keats\";\n }else if (poet1_input.toLowerCase().contains(\"dickinson\") || poet1_input.toLowerCase().contains(\"dikcinson\")){\n poet1 = \"Dickinson\";\n }\n\n System.out.println(\"Pick another poet: \");\n String poet2_input = scanner.nextLine();\n if (poet2_input.toLowerCase().contains(\"whitman\") || poet2_input.toLowerCase().contains(\"withman\")){\n poet2 = \"Whitman\";\n }else if (poet2_input.toLowerCase().contains(\"shakespeare\") || poet2_input.toLowerCase().contains(\"shakespear\")){\n poet2 = \"Shakespeare\";\n }else if (poet2_input.toLowerCase().contains(\"keats\")){\n poet2 = \"Keats\";\n }else if (poet2_input.toLowerCase().contains(\"dickinson\") || poet2_input.toLowerCase().contains(\"dikcinson\")){\n poet2 = \"Dickinson\";\n }\n System.out.println();\n\n System.out.println(\"Choose a theme [Love / Death]: \");\n String theme_input = scanner.nextLine();\n if(theme_input.toLowerCase().contains(\"love\")){\n theme = \"Love\";\n }else if(theme_input.toLowerCase().contains(\"death\")){\n theme = \"Death\";\n }\n System.out.println(\"\\n(\" + poet1 + \" + \" + poet2 + \") * \" + theme + \". Coming right up! [Press Enter]\" );\n String ignore = scanner.nextLine();\n }", "public ArrayList<Task> load() throws DukeException {\n ArrayList<Task> tasks = new ArrayList<>();\n try {\n File f = new File(filePath);\n if (f.exists()) {\n Scanner sc = new Scanner(f);\n while (sc.hasNext()) {\n String next = sc.nextLine();\n Task t = parseLine(next);\n tasks.add(t);\n }\n sc.close();\n } else {\n if (!f.getParentFile().exists()) {\n f.getParentFile().mkdir();\n }\n }\n f.createNewFile();\n } catch (IOException e) {\n throw new DukeException(\"Error retrieving/reading from data file, creating new file instead.\");\n }\n return tasks;\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 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 void loadFromFile(String cinderellaFilePath) throws IOException {\n\t\tString dataLine;\n\t\tBufferedReader bufferedReader = null;\n\t\t\n\t\tunzip(cinderellaFilePath);\n\t\t\n\t\ttry {\n\t\t\tbufferedReader = new BufferedReader(\n\t\t\t\t\tnew FileReader(TEMP_FOLDER + File.separator + \"construction.cdy\"));\n\t\t\twhile ((dataLine = bufferedReader.readLine()) != null) {\n\t\t\t\tif (dataLine.matches(\".*:=FreePoint.*\")) {\n\t\t\t\t\taddElement(parseFreePoint(dataLine));\t\t\t\t\t\n\t\t\t\t}else if (dataLine.matches(\".*:=Meet.*\")) {\n\t\t\t\t\taddElement(parseMeet(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=Mid.*\")) {\n\t\t\t\t\taddElement(parseMid(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=Join.*\")) {\n\t\t\t\t\taddElement(parseJoin(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=Segment.*\")) {\n\t\t\t\t\taddElement(parseSegment(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=Through.*\")) {\n\t\t\t\t\taddElement(parseThrough(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=Parallel.*\")) {\n\t\t\t\t\taddElement(parseParallel(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=Orthogonal.*\")) {\n\t\t\t\t\taddElement(parseOrthogonal(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=AngularBisector.*\")) {\n\t\t\t\t\taddElement(parseAngularBisector(dataLine));\n\t\t\t\t}\n\t\t\t\telse if (dataLine.matches(\".*:=CircleMP.*\")) {\n\t\t\t\t\taddElement(parseCircleMP(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=CircleByRadius.*\")) {\n\t\t\t\t\taddElement(parseCircleByRadius(dataLine));\n\t\t\t\t}else if (dataLine.matches(\".*:=CircleBy3.*\")) {\n\t\t\t\t\taddElement(parseCinderellaCircleBy3(dataLine));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private ArrayList<AlturaMxpPuertos> puertos(String parse) {\n\n ArrayList<AlturaMxpPuertos> lista_puertos = new ArrayList<AlturaMxpPuertos>();\n\n\n while (parse.contains(\"ports\")) {\n AlturaMxpPuertos p = new AlturaMxpPuertos();\n\n String info = StringUtils.substringBetween(parse, \"<ports>\", \"</ports>\"); // a esto tengo que sacar la info sobre puerto, vecino y puerto vecino\n\n String info_nombre_puerto = StringUtils.substringBetween(info, \"<port>\", \"</port>\");\n p.setPuerto(Integer.valueOf(info_nombre_puerto));\n\n String info_nombre_vecino = StringUtils.substringBetween(info, \"<neighbor>\", \"</neighbor>\");\n p.setVecino(Integer.valueOf(info_nombre_vecino));\n\n String info_nombre_puerto_vecino = StringUtils.substringBetween(info, \"<port_neighbor>\", \"</port_neighbor>\");\n p.setPuertoVecino(Integer.valueOf(info_nombre_puerto_vecino));\n\n parse = parse.replaceFirst(\"(?s)<ports>.*?</ports>\", \"\"); // (?s) significa que se aplica a todas las lineas del string.\n\n lista_puertos.add(p);\n }\n\n return lista_puertos;\n }", "public static void UserAccounts() throws FileNotFoundException{\n\t\tScanner input = new Scanner(new File(AccountFile));\t\t\t\t//Creats objects and adds to array list.\r\n\t\t\r\n\t\twhile (input.hasNextLine()) {\t\t\t\t\t\t\t\t\t//Loops as long as there is another line\r\n\t\t\t\r\n\t\t\tString line = input.nextLine();\r\n\t\t\tif(line.equals(\"ADMIN\")) {\t\t\t\t\t\t\t\t\t//Checks if the data is for Admin, creats admin object\r\n\t\t\t\tString AdminUsername = input.nextLine();\r\n\t\t\t\tString AdminPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tAdmin admin = new Admin(AdminUsername, AdminPassword);\r\n\t\t\t\taccounts.add(admin);\r\n\t\t\t\t\r\n\t\t\t} if(line.equals(\"COORDINATOR\")){\r\n\t\t\t\tString coordinatorUsername = input.nextLine();\r\n\t\t\t\tString coordinatorPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tCoordinator coordinator = new Coordinator(coordinatorUsername, coordinatorPassword);\r\n\t\t\t\taccounts.add(coordinator);\r\n\r\n\t\t\t} if(line.equals(\"APPROVER\")){\r\n\t\t\t\tString approverUsername = input.nextLine();\r\n\t\t\t\tString approverPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tApprover approver = new Approver(approverUsername, approverPassword);\r\n\t\t\t\taccounts.add(approver);\r\n\r\n\t\t\t} if(line.equals(\"CASUAL\")){\r\n\t\t\t\tString casualUsername = input.nextLine();\r\n\t\t\t\tString casualPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tCasualStaff casual = new CasualStaff(casualUsername, casualPassword);\r\n\t\t\t\taccounts.add(casual);\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} loginSystem();\r\n\t}", "public static void RT() {////cada clase que tiene informacion en un archivo txt tiene este metodo para leer el respectivo archivoy guardarlo en su hashmap\n\t\treadTxt(\"peliculas.txt\", pelisList);\n\t}", "static TreeSet<Preposition> parsePrepositions(Scanner data){\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Preposition> output = new TreeSet<Preposition>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.PREPOSITION_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString Preposition;\n\t\t\tint caseTaken = 0;\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\tPreposition = current[1].split(\" \\\\+ \")[0];\n\t\t\t\tcaseTaken = Values.getCaseFromString(current[1].split(\" \\\\+ \")[1]);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(NumberFormatException e){ //can happen if a chapter isn't specified. Read the noun from a null chapter.\n\t\t\t\tchapter = Values.CHAPTER_VOID;\n\t\t\t\tPreposition = current[1].split(\" \\\\+ \")[0];\n\t\t\t\tcaseTaken = Values.getCaseFromString(current[1].split(\" \\\\+ \")[1]);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\ttrimAll(definitions);\n\t\t\tPreposition currentPreposition = new Preposition(Preposition, caseTaken, chapter, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentPreposition);\n\t\t\toutput.add(currentPreposition);\n\t\t}\n\n\t\treturn output;\n\t}", "public static ArrayList<Stue> getStueData() {\n ArrayList<Stue> fillArray = new ArrayList<>();\n\n try {\n File fileIn = new File(\"Stuedata.txt\");\n\n Scanner in = new Scanner(fileIn);\n\n while (in.hasNext()) {\n Stue stueData = new Stue();\n stueData.idRum = in.next();\n stueData.navn = in.next();\n stueData.motto = in.next();\n stueData.etage = in.next();\n fillArray.add(stueData);\n }\n in.close(); //WHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY?\n } catch (IOException i) {\n i.printStackTrace();\n System.exit(0);\n }\n return fillArray;\n }" ]
[ "0.5651232", "0.5560198", "0.54061973", "0.53513664", "0.5232113", "0.51958084", "0.5186931", "0.51778287", "0.5134997", "0.5106615", "0.5092412", "0.506221", "0.5060974", "0.50496525", "0.50411993", "0.5039559", "0.49974167", "0.49839842", "0.49665987", "0.49353597", "0.49176982", "0.4840325", "0.48213357", "0.48210466", "0.48128918", "0.48127165", "0.4808092", "0.47992837", "0.4789636", "0.4787724", "0.47838", "0.47668338", "0.4746664", "0.4734401", "0.46882817", "0.46779218", "0.46767405", "0.4654644", "0.4652308", "0.46276483", "0.46248144", "0.4622887", "0.46167123", "0.46124566", "0.459681", "0.45825577", "0.45806816", "0.45781517", "0.45763925", "0.45729288", "0.45725465", "0.45685184", "0.4566229", "0.45608574", "0.45570666", "0.4550727", "0.45417643", "0.45382896", "0.45371982", "0.45293674", "0.45208022", "0.45184383", "0.45127374", "0.4511362", "0.4506087", "0.45034072", "0.44918686", "0.44841957", "0.44832212", "0.4482129", "0.44811115", "0.4477459", "0.4469173", "0.4468645", "0.4467652", "0.44673583", "0.44621357", "0.44571784", "0.44504577", "0.4446016", "0.44456667", "0.44450414", "0.4444644", "0.44419268", "0.4435104", "0.4432106", "0.44279248", "0.4426748", "0.44244358", "0.44229364", "0.44165272", "0.4414663", "0.4413317", "0.44093952", "0.440731", "0.44067603", "0.44027868", "0.44019097", "0.4401566", "0.4398907" ]
0.8379908
0
Generates the actual printable poem. Decides the length of generated poem and fetches every other verse line from desired poet and every other from another desired poet.
public void fetchVerseLines() throws IncorrectInput{ String strObject1 = ""; PoetAndTheme object1 = poetsAndThemesList.get(0); String strObject2 = ""; PoetAndTheme object2 = poetsAndThemesList.get(0); strObject1 = userInputToPoet(poet1, theme); strObject2 = userInputToPoet(poet2, theme); for(PoetAndTheme object: poetsAndThemesList){ if (object.getNameAndTheme().equals(strObject1)){ object1 = object; } if (object.getNameAndTheme().equals(strObject2)){ object2 = object; } } //Poems length is a random number between 5 and 10 int poemLength = getRandomPoemLength(); if(poemLength % 2 == 0){ for (int i=0; i < (poemLength/2); i++){ if(i != (poemLength/2 - 1)){ System.out.println(object1.getRandomVerseLine()); System.out.println(object2.getRandomVerseLine()); }else{ System.out.println(object1.getRandomVerseLine()); //Checking if the last verse line ends with period or question mark. //If not, get a new verse line. System.out.println(getLastPoemLine(object2)); } } }else{ for (int i=0; i < (poemLength/2 - 1); i++){ System.out.println(object1.getRandomVerseLine()); System.out.println(object2.getRandomVerseLine()); } //Checking if the last verse line ends with period or question mark. //If not, get a new verse line. System.out.println(getLastPoemLine(object1)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printTest(){\n\r\n p.resetAll();\r\n p.initialize();\r\n p.feedBack((byte)2);\r\n// p.color(1);\r\n p.alignCenter();\r\n p.setText(\"The Dum Dum Name\");\r\n p.newLine();\r\n p.setText(\"Restaurant Dining\");\r\n p.newLine();\r\n p.addLineSeperator();\r\n p.newLine();\r\n p.setText(\"Bling Bling\");\r\n p.newLine();\r\n p.addLineSeperator();\r\n p.newLine();\r\n\r\n p.alignLeft();\r\n p.setText(\"POD No \\t\\t: 2001 \\t\\t Table \\t: E511\");\r\n p.newLine(); \r\n\r\n p.setText(\"Res Date \\t: \" + \"01/01/1801 22:59\");\r\n\r\n p.newLine();\r\n p.setText(\"Session \\t: Evening Session\");\r\n p.newLine();\r\n p.setText(\"Staff \\t\\t: Bum Dale\");\r\n p.newLine();\r\n p.addLineSeperator();\r\n p.newLine();\r\n p.alignCenter();\r\n p.setText(\" - Some Items - \");\r\n p.newLine();\r\n p.alignLeft();\r\n p.addLineSeperator();\r\n\r\n p.newLine();\r\n\r\n p.setText(\"No \\tItem\\t\\tUnit\\tQty\");\r\n p.newLine();\r\n p.addLineSeperator();\r\n \r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n \r\n p.addLineSeperator();\r\n p.feed((byte)3);\r\n p.finit();\r\n\r\n p.feedPrinter(p.finalCommandSet().getBytes());\r\n \r\n }", "@Override\n public void printable()\n {\n\tfor (int i = 0; i < width; i++)\n\t{\n\t for (int k = 0; k < length; k++)\n\t {\n\t\tif (k == 0 || k == length - 1)\n\t\t System.out.print(\"O \");\n\t\telse if (i == 0 || i == width - 1)\n\t\t System.out.print(\"O \");\n\t\telse\n\t\t System.out.print(\" \");\n\t }\n\n\t System.out.println();\n\t}\n }", "@Test \n\tpublic void generateParagraphsTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\n\t\t// select 'paragraphs' radio button \n\t\thomePage.selectContentType(\"paragraphs\");\n\n\t\t// enter '10' in the count field \n\t\thomePage.inputCount(\"10\");\n\n\t\t// click \"Generate Lorum Ipsum\" button\n\t\thomePage.generateLorumIpsum();\n\t\tGeneratedPage generatedPage = new GeneratedPage(driver);\n\n\t\t// validate the number of text paragraphs generated \n\t\tint paragraphCount = generatedPage.getActualGeneratedCount(\"paragraphs\");\n\t\tAssert.assertTrue(paragraphCount == 10);\n\n\t\t// validate the report text // ex: \"Generated 10 paragraphs, 1106 words, 7426 bytes of Lorem Ipsum\"\n\t\tAssert.assertEquals(\"Generated \" + generatedPage.getReport(\"paragraphs\") + \n\t\t\t\t\" paragraphs, \" + generatedPage.getReport(\"words\") + \n\t\t\t\t\" words, \" + generatedPage.getReport(\"bytes\") + \n\t\t\t\t\" bytes of Lorem Ipsum\", generatedPage.getCompleteReport());\n\t}", "private synchronized void print4() {\n try {\n int jNum = 0;\n\n byte[] printText22 = new byte[10240];\n\n byte[] oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setInternationalCharcters('3');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setWH('4');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = getGbk(\"FoodCiti\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setWH('4');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = getGbk(\"\\nOrder No : \" + order.getOrderNo());\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"\\n........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(SessionManager.get(getActivity()).getRestaurantName() + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n String location = SessionManager.get(getActivity()).getRestaurantLocation();\n int spacecount = commacount(location);\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n if (spacecount >= 1) {\n oldText = getGbk(location.substring(0, location.indexOf(',')) + \"\\n\" + location.substring(location.indexOf(',') + 1) + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n } else {\n oldText = getGbk(location + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n }\n\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = getGbk(SessionManager.get(getActivity()).getRestaurantPostalCode() + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"Tel:\" + SessionManager.get(getActivity()).getRestaurantPhonenumber());\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"\\n........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n if (order.getOrderSpecialInstruction() != null) {\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(order.getOrderSpecialInstruction());\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"\\n........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n }\n\n oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setWH('5');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setCusorPosition(390);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\" \" + \"GBP\" + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n // Toast.makeText(getContext(),\"Size \"+order.getOrderedItemList().size(),Toast.LENGTH_LONG).show();\n\n for (int i = 0; i < order.getOrderedItemList().size(); i++) {\n\n OrderedItem orderedItem = order.getOrderedItemList().get(i);\n\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('5');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// int qntity = Integer.parseInt(orderedItem.getQuantity());\n oldText = getGbk(\" \" + orderedItem.getQuantity() + \" x \" + orderedItem.getItemData().getItemName());\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setCusorPosition(390);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n Double total_price = Double.valueOf(orderedItem.getTotalPrice()) * Double.valueOf(orderedItem.getQuantity());\n\n oldText = getGbk(\" \" + String.format(Locale.getDefault(), \"%.2f\", total_price) + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n for (int j = 0; j < orderedItem.getSubItemList().size(); j++) {\n\n oldText = setWH('5');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setCusorPosition(35);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n SubItem subItem = orderedItem.getSubItemList().get(j);\n\n String subitemname = subItem.getItemName();\n int subItemOrderQty = Integer.parseInt(subItem.getOrderedQuantity());\n\n if (subItemOrderQty > 1) {\n oldText = getGbk(\" \" + subItem.getOrderedQuantity() + \" x \" + subitemname + \"\\n\");\n } else {\n oldText = getGbk(\" \" + subitemname + \"\\n\");\n }\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n // By Ravi\n// oldText = getGbk(\"........................\\n\");\n// System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n// jNum += oldText.length;\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n /** TODO\n * change here for print suboptions text\n * **/\n //print text for suboptions items\n if (subItem.getSubOptions() != null && subItem.getSubOptions().size() > 0) {\n List<SubOptions> subOptions = subItem.getSubOptions();\n for (int k = 0; k < subOptions.size(); k++) {\n SubOptions options = subOptions.get(k);\n oldText = getGbk(\" - \" + options.getName() + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n }\n }\n\n }\n\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n /*oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;*/\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"-----------------------\\n\");\n oldText = getGbk(\"........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n }\n\n oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('5');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"Subtotal : \");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setCusorPosition(390);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = getGbk(\" \" + String.format(\" %.2f\", Double.valueOf(order.getOrderSubtotal())) + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n if (Double.valueOf(order.getDiscount()) > 0) {\n oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('5');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"Discount : \");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setCusorPosition(390);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = getGbk(\" \" + String.format(\" %.2f\", Double.valueOf(order.getDiscount())) + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n }\n\n\n if (Double.valueOf(order.getTax()) > 0) {\n oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('5');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"Service Charge : \");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setCusorPosition(390);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n if (order.getTax() != null) {\n oldText = getGbk(\" \" + String.format(\" %.2f\", Double.valueOf(order.getTax())) + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n } else {\n oldText = getGbk(\" \" + \"0.00\" + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n }\n }\n\n if (!order.getOrderDelivery().equals(Consts.PICK_UP) && Double.valueOf(order.getDeliveryCharges()) > 0) {\n oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('5');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"Delivery Charges : \");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setCusorPosition(390);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = getGbk(\" \" + String.format(\" %.2f\", Double.valueOf(order.getDeliveryCharges())) + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n }\n\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"TOTAL Price: \");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setCusorPosition(370);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n //Toast.makeText(getActivity(),String.valueOf(order.getOrderTotal()),Toast.LENGTH_LONG).show();\n\n oldText = getGbk(\" \" + String.format(\" %.2f\", Double.valueOf(order.getOrderTotal())));\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"\\n........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n if (order.getFreenDrinkText() != null && !TextUtils.isEmpty(order.getFreenDrinkText())) {\n oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n String freeTxt = \"Free \" + order.getFreenDrinkText();\n oldText = getGbk(freeTxt);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n }\n\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"\\n........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('4');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n /** TODO\n * change here to print payment method text\n * **/\n //print text for payment method\n if (order.getOrderPaid().equalsIgnoreCase(\"paypal\") || order.getOrderPaid().equalsIgnoreCase(\"worldpay\")) {\n oldText = getGbk(order.getOrderPaid() + \" PAID \" + \"\\n\");\n } else {\n oldText = getGbk(order.getOrderPaid() + \" NOT PAID \" + \"\\n\");\n }\n// oldText = getGbk(\"ORDER BY \" + order.getOrderPaid() + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setWH('4');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n if (order.getOrderDelivery().equals(Consts.PICK_UP)) {\n oldText = getGbk(\"COLLECTION\" + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n } else {\n oldText = getGbk(\"DELIVERY\" + \"\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n }\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n // String strTmp2 = new SimpleDateFormat(\"dd-MM-yyyy hh:mm a\", Locale.UK).format(new Date());\n oldText = getGbk(getDate(order.getOrderTime()));\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"\\n........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('0');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('4');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"Customer Details: \" + \"\\n\" +\n order.getUser().getUserName().toUpperCase() + \"\\n\" +\n order.getUser().getAddress().toUpperCase() + \"\\n\" +\n order.getUser().getCity().toUpperCase() + \"\\n\" +\n order.getUser().getPostalCode().toUpperCase() + \"\\n\" +\n order.getUser().getPhNo().toUpperCase()\n );\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"\\n........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('5');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"Ref:\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = getGbk(order.getOrderId());\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(false);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n// oldText = getGbk(\"\\n-----------------------\\n\");\n oldText = getGbk(\"\\n........................\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setAlignCenter('1');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = setBold(true);\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = setWH('2');\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n\n oldText = getGbk(\"www.foodciti.co.uk\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n oldText = getGbk(\"\\n\\n\");\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n /*String s = new String(printText22);\n Toast.makeText(getActivity(),s,Toast.LENGTH_LONG).show();*/\n\n oldText = CutPaper();\n System.arraycopy(oldText, 0, printText22, jNum, oldText.length);\n jNum += oldText.length;\n\n Intent intent = new Intent(PrintUtils.ACTION_PRINT_REQUEST);\n intent.putExtra(PrintUtils.PRINT_DATA, printText22);\n localBroadcastManager.sendBroadcast(intent);\n\n// mOutputStream.write(printText22);\n\n } catch (Exception ex) {\n Exlogger exlogger = new Exlogger();\n exlogger.setErrorType(\"Print Error\");\n exlogger.setErrorMessage(ex.getMessage());\n exlogger.setScreenName(\"OrderInfo->>print4() function\");\n logger.addException(exlogger);\n Toast.makeText(getActivity(), ex.getMessage(), Toast.LENGTH_LONG).show();\n\n\n }\n }", "public void TesteCompleto() {\n\n\n TectoySunmiPrint.getInstance().initPrinter();\n TectoySunmiPrint.getInstance().setSize(24);\n\n // Alinhamento do texto\n\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Alinhamento\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n\n // Formas de impressão\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Formas de Impressão\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setSize(28);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printStyleBold(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleAntiWhite(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleDoubleHeight(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleDoubleWidth(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleInvert(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleItalic(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleStrikethRough(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleUnderLine(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\", 35);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\", 28);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\",50);\n // TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setSize(24);\n\n\n // Impressão de BarCode\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime BarCode\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_INFORME_UM_TEXTO);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ABAIXO_DO_CODIGO_DE_BARRAS);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ACIMA_DO_CODIGO_DE_BARRAS_BARCODE);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ACIMA_E_ABAIXO_DO_CODIGO_DE_BARRAS);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n // Impressão de BarCode\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime QrCode\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printDoubleQRCode(\"www.tectoysunmi.com.br\",\"tectoysunmi\", 7, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n\n\n // Impresão Imagem\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime Imagem\\n\");\n TectoySunmiPrint.getInstance().printText(\"-------------------------------\\n\");\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inTargetDensity = 160;\n options.inDensity = 160;\n Bitmap bitmap1 = null;\n Bitmap bitmap = null;\n if (bitmap == null) {\n bitmap = BitmapFactory.decodeResource(getResources(), test, options);\n }\n if (bitmap1 == null) {\n bitmap1 = BitmapFactory.decodeResource(getResources(), test1, options);\n bitmap1 = scaleImage(bitmap1);\n }\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime Tabela\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n\n String[] prod = new String[3];\n int[] width = new int[3];\n int[] align = new int[3];\n\n width[0] = 100;\n width[1] = 50;\n width[2] = 50;\n\n align[0] = TectoySunmiPrint.Alignment_LEFT;\n align[1] = TectoySunmiPrint.Alignment_CENTER;\n align[2] = TectoySunmiPrint.Alignment_RIGTH;\n\n prod[0] = \"Produto 001\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 002\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 003\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 004\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 005\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 006\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().openCashBox();\n TectoySunmiPrint.getInstance().cutpaper();\n\n }", "public void startPoemGenerator(){\n PoemWindow win = new PoemWindow();\n System.out.println(\"\\nYou found a Secret Poem Generator.\");\n System.out.println(\"Welcome, Friend!\");\n System.out.println(\"\\n **************************************\");\n System.out.println();\n readPoemFiles();\n askPoets();\n try{\n fetchVerseLines();\n }catch(Exception e){\n System.out.println(\"Invalid input. Please, try again!\");\n }\n }", "public void computeParagraph(){\r\n\r\n\t\tstrBuff = new StringBuffer();\r\n\r\n\t\t//For else for ER2 rule of inserting the first letter of my last name twice before each consonant\r\n\t\tfor(int i = 0; i < paragraph.length(); i++){\r\n\r\n\t\t\tif(paragraph.charAt(i) == 'a' || paragraph.charAt(i) == 'e' || paragraph.charAt(i) == 'i'\r\n\t\t\t\t|| paragraph.charAt(i) == 'o' || paragraph.charAt(i) == 'u' || paragraph.charAt(i) == 'A'\r\n\t\t\t\t|| paragraph.charAt(i) == 'E' || paragraph.charAt(i) == 'I' || paragraph.charAt(i) == 'O'\r\n\t\t\t\t|| paragraph.charAt(i) == 'U' || paragraph.charAt(i) == ' ' || paragraph.charAt(i) == '.'\r\n\t\t\t\t|| paragraph.charAt(i) == '!' || paragraph.charAt(i) == '?'){\r\n\t\t\t\tstrBuff.append(paragraph.charAt(i));\r\n\t\t\t}\r\n\r\n\t\t\telse{\r\n\t\t\t\tstrBuff.append(\"OO\");\r\n\t\t\t\tstrBuff.append(paragraph.charAt(i));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tnewParagraph = strBuff.toString();\r\n\r\n\t\tcount = 0;\r\n\r\n\t\t//For for ER2 rule of counting the number of characters in the initial text excluding the number of vowels\r\n\t\tfor(int i = 0; i < paragraph.length(); i++){\r\n\t\t\tif(paragraph.charAt(i) != 'a' && paragraph.charAt(i) != 'e' && paragraph.charAt(i) != 'i'\r\n\t\t\t\t&& paragraph.charAt(i) != 'o' && paragraph.charAt(i) != 'u' && paragraph.charAt(i) != 'A'\r\n\t\t\t\t&& paragraph.charAt(i) != 'E' && paragraph.charAt(i) != 'I' && paragraph.charAt(i) != 'O'\r\n\t\t\t\t&& paragraph.charAt(i) != 'U'){\r\n\t\t\t\t\tcount++;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t}", "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 }", "private void makeOutro()\r\n\t{\r\n\t TextProperties outroProperties = new TextProperties();\r\n\t outroProperties.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(Font.SANS_SERIF, Font.PLAIN, width >= 80 ? 18 : 13));\r\n\t outroProperties.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.blue);\r\n\t \r\n\t String outro1Text = \"In the result all \"+amountOfStars+\" points are assigned to groups.\";\r\n\t String outro2Text = width > 80 ? \"This is used in astrophysics to find clusters of stars or dark matter out of millions of 2D or 3D points.\" : \"This is used in astrophysics to find clusters\";\r\n\t String outro3Text = \" of stars or dark matter out of millions of 2D or 3D points.\";\r\n\t \r\n\t\toutro1 = lang.newText(getStarPosition(0, height+3), outro1Text, \"outro1\", null, outroProperties);\r\n\t\toutro2 = lang.newText(new Offset(0, 0, \"outro1\", AnimalScript.DIRECTION_SW), outro2Text, \"outro2\", null, outroProperties);\r\n\t\tif(width <= 80) outro3 = lang.newText(new Offset(0, 0, \"outro2\", AnimalScript.DIRECTION_SW), outro3Text, \"outro3\", null, outroProperties);\r\n\t}", "public void KTesteCompleto() throws RemoteException {\n\n // Alinhamento\n kPrinterPresenter.printStyleBold(false);\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.text(\"Alinhamento\\n\");\n kPrinterPresenter.text(\"--------------------------------\\n\");\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_LEFT);\n kPrinterPresenter.text(\"TecToy Automação\\n\");\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.text(\"TecToy Automação\\n\");\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_RIGTH);\n kPrinterPresenter.text(\"TecToy Automação\\n\");\n kPrinterPresenter.print3Line();\n\n // Formas de impressão\n\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.text(\"Formas de Impressão\\n\");\n kPrinterPresenter.text(\"--------------------------------\\n\");\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_LEFT);\n kPrinterPresenter.printStyleBold(true);\n kPrinterPresenter.text(\"TecToy Automação\\n\");\n\n\n // Barcode\n\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.text(\"BarCode\\n\");\n kPrinterPresenter.text(\"--------------------------------\\n\");\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_LEFT);\n kPrinterPresenter.printBarcode(\"7891098010575\", 2, 162, 2, 0);\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.printBarcode(\"7891098010575\", 2, 162, 2, 2);\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_RIGTH);\n kPrinterPresenter.printBarcode(\"7891098010575\", 2, 162, 2, 1);\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.printBarcode(\"7891098010575\", 2, 162, 2, 3);\n kPrinterPresenter.print3Line();\n // QrCode\n\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.text(\"QrCode\\n\");\n kPrinterPresenter.text(\"--------------------------------\\n\");\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.printQr(\"www.tectoyautomacao.com.br\", 8, 0);\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_LEFT);\n kPrinterPresenter.printQr(\"www.tectoyautomacao.com.br\", 8, 0);\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_RIGTH);\n kPrinterPresenter.printQr(\"www.tectoyautomacao.com.br\", 8, 0);\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_LEFT);\n kPrinterPresenter.printDoubleQRCode(\"www.tectoyautomacao.com.br\",\"tectoy\", 7, 1);\n // Imagem\n\n\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.text(\"Imagem\\n\");\n kPrinterPresenter.text(\"--------------------------------\\n\");\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inTargetDensity = 160;\n options.inDensity = 160;\n Bitmap bitmap1 = null;\n if (bitmap1 == null) {\n bitmap1 = BitmapFactory.decodeResource(getResources(), test1, options);\n bitmap1 = scaleImage(bitmap1);\n }\n kPrinterPresenter.printBitmap(bitmap1, 0);\n kPrinterPresenter.setAlign(0);\n kPrinterPresenter.printBitmap(bitmap1, 0);\n kPrinterPresenter.setAlign(2);\n kPrinterPresenter.printBitmap(bitmap1, 0);\n // Tabelas\n\n\n kPrinterPresenter.setAlign(kPrinterPresenter.Alignment_CENTER);\n kPrinterPresenter.text(\"Tabelas\\n\");\n kPrinterPresenter.text(\"--------------------------------\\n\");\n String[] prod = new String[3];\n int[] width = new int[3];\n int[] align = new int[3];\n\n width[0] = 100;\n width[1] = 50;\n width[2] = 50;\n\n align[0] = kPrinterPresenter.Alignment_LEFT;\n align[1] = kPrinterPresenter.Alignment_CENTER;\n align[2] = kPrinterPresenter.Alignment_RIGTH;\n\n prod[0] = \"Produto 001\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n kPrinterPresenter.printTable(prod, width, align);\n\n prod[0] = \"Produto 002\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n kPrinterPresenter.printTable(prod, width, align);\n\n\n prod[0] = \"Produto 003\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n kPrinterPresenter.printTable(prod, width, align);\n\n\n prod[0] = \"Produto 004\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n kPrinterPresenter.printTable(prod, width, align);\n\n\n prod[0] = \"Produto 005\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n kPrinterPresenter.printTable(prod, width, align);\n\n prod[0] = \"Produto 006\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n kPrinterPresenter.printTable(prod, width, align);\n\n\n kPrinterPresenter.print3Line();\n kPrinterPresenter.cutpaper(KTectoySunmiPrinter.HALF_CUTTING, 10);\n\n }", "public void savingsWithdrawReceipPrint(List receiptDetails,Component c) {\n \np.resetAll();\n\np.initialize();\n\np.feedBack((byte)2);\n\np.color(0);\np.chooseFont(1);\np.alignCenter();\n//p.emphasized(true);\n//p.underLine(2);\np.setText(receiptDetails.get(1).toString());\np.newLine();\np.setText(receiptDetails.get(2).toString());\np.newLine();\np.setText(receiptDetails.get(3).toString());\np.newLine();\np.newLine();\n//p.addLineSeperatorX();\np.underLine(0);\np.emphasized(false);\np.underLine(0);\np.alignCenter();\np.setText(\" *** Savings Withdrawal ***\");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Account Number: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(9).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Savings Id: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(0).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\np.setText(\"Customer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\np.newLine(); \n//p.emphasized(false);\n//p.setText(\"Loan+Interest: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\n//p.newLine();\n//p.setText(\"Date Taken: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(7).toString()+p.underLine(0));\n//p.newLine();\n//p.setText(\"Loan Status: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(14).toString()+p.underLine(0));\n//p.newLine();\np.setText(\"Withdrawal Date: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(10).toString()+p.underLine(0));\np.newLine();\np.setText(\"Withdrawal Time: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(11).toString()+p.underLine(0));\np.newLine();\n\np.underLine(0);\np.emphasized(false);\n//p.underLine(0);\np.addLineSeperator();\np.newLine();\np.alignCenter();\np.setText(\"***** Withdrawal Details ***** \");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Withdrawal Made: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(7).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Savings Balance: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(8).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\n//p.setText(\"Customer Name: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\n//p.newLine(); \n//p.emphasized(false);\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(5).toString()+p.underLine(0));\np.newLine();\np.addLineSeperatorX();\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer Signiture:\");\np.addLineSeperatorX();\np.newLine();\np.addLineSeperator();\np.doubleStrik(true);\n//p.newLine();\np.underLine(2) ;\np.setText(\"Customer Signiture:\");\np.addLineSeperatorX();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\np.newLine();\np.setText(\"OFFICE NUMBER: \"+receiptDetails.get(12).toString());\n\np.newLine();\np.addLineSeperatorX();\n//p.newLine();\np.feed((byte)3);\np.finit();\n\nprint.feedPrinter(dbq.printDrivers(c),p.finalCommandSet().getBytes());\n \n\n }", "private void print4(String word, int height) {\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = height - i; j > 0; j--) {\n\t\t\t\tta.append(spece);\n\t\t\t}\n\t\t\tfor (int j = 0; j < (i + 1) * 2 - 1; j++) {\n\t\t\t\tta.append(word);\n\t\t\t}\n\t\t\tta.append(\"\\r\\n\");\n\t\t}\n\t}", "public static void main(String args[]) throws IOException {\n\t File file = new File(\"fdpModification.pdf\");\n\t PDDocument document = PDDocument.load(file);\n\n\t //Retrieving the pages of the document\n\t PDPage page = document.getPage(1);\n\t PDPageContentStream contentStream = new PDPageContentStream(document, page);\n\n\t //Begin the Content stream\n\t contentStream.beginText();\n\t contentStream.moveTextPositionByAmount(7, 105);\n\t contentStream.setFont(PDType1Font.HELVETICA, 12);\n\t contentStream.drawString(\"Normal text and \");\n\t contentStream.setFont(PDType1Font.HELVETICA_BOLD, 12);\n\t contentStream.drawString(\"bold text\");\n\t contentStream.moveTextPositionByAmount(0, -25);\n\t contentStream.setFont(PDType1Font.HELVETICA_OBLIQUE, 12);\n\t contentStream.drawString(\"Italic text and \");\n\t contentStream.setFont(PDType1Font.HELVETICA_BOLD_OBLIQUE, 12);\n\t contentStream.drawString(\"bold italic text\");\n\t contentStream.endText();\n\n\t contentStream.setLineWidth(.5f);\n\n\t contentStream.beginText();\n\t contentStream.moveTextPositionByAmount(7, 55);\n\t contentStream.setFont(PDType1Font.HELVETICA, 12);\n\t contentStream.drawString(\"Normal text and \");\n\t contentStream.appendRawCommands(\"2 Tr\\n\");\n\t contentStream.drawString(\"artificially bold text\");\n\t contentStream.appendRawCommands(\"0 Tr\\n\");\n\t contentStream.moveTextPositionByAmount(0, -25);\n\t contentStream.appendRawCommands(\"1 Tr\\n\");\n\t contentStream.drawString(\"Artificially outlined text\");\n\t contentStream.appendRawCommands(\"0 Tr\\n\");\n\t contentStream.setTextMatrix(1, 0, .2f, 1, 7, 5);\n\t contentStream.drawString(\"Artificially italic text and \");\n\t contentStream.appendRawCommands(\"2 Tr\\n\");\n\t contentStream.drawString(\"bold italic text\");\n\t contentStream.appendRawCommands(\"0 Tr\\n\");\n\t //Setting the font to the Content streamt\n\t contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);\n\n\t //Setting the position for the line\n\t contentStream.newLineAtOffset(0, 0);\n\n //Setting the leading\n contentStream.setLeading(14.5f);\n\n //Setting the position for the line\n contentStream.newLineAtOffset(25, 725);\n\n String text1 = \"This is an example of adding text to a page in the pdf document. we can add as many lines\";\n String text2 = \"as we want like this using the ShowText() method of the ContentStream class\";\n\n //Adding text in the form of string\n contentStream. showText(text1);\n contentStream.newLine();\n contentStream. showText(text2);\n //Ending the content stream\n contentStream.endText();\n\n System.out.println(\"Content added\");\n\n //Closing the content stream\n contentStream.close();\n\n //Saving the document\n document.save(new File(\"newtou.pdf\"));\n\n //Closing the document\n document.close();\n }", "private void gen_rdp_pc() {\r\n // create prolog: coordinates, name, display options, default properties\r\n // first, set the visual properties for the source code\r\n SourceCodeProperties scProps = new SourceCodeProperties();\r\n scProps.set(AnimationPropertiesKeys.CONTEXTCOLOR_PROPERTY, Color.BLUE);\r\n scProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\"Monospaced\",\r\n Font.PLAIN, 12));\r\n scProps.set(AnimationPropertiesKeys.HIGHLIGHTCOLOR_PROPERTY, Color.RED);\r\n scProps.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\r\n\r\n // now, create the prolog entity\r\n SourceCode prolog = lang.newSourceCode(new Coordinates(15, 40), \"prolog\",\r\n null, scProps);\r\n\r\n // add the lines to the prolog object.\r\n // line, name, indentation, display delay\r\n prolog\r\n .addCodeLine(\r\n \"The Ramer-Douglas-Peucker algorithm is an algorithm for reducing the number\",\r\n null, 0, null); // 0\r\n prolog.addCodeLine(\r\n \"of points in a curve that is approximated by a series of points.\",\r\n null, 0, null); // 1\r\n prolog\r\n .addCodeLine(\r\n \"The initial form of the algorithm was independently suggested in 1972\",\r\n null, 0, null); // 2\r\n prolog.addCodeLine(\r\n \"by Urs Ramer and 1973 by David Douglas and Thomas Peucker.\", null, 0,\r\n null); // 3\r\n prolog.addCodeLine(\" \", null, 0, null); // 4\r\n prolog\r\n .addCodeLine(\r\n \"The purpose of the algorithm is, given a curve composed of line segments,\",\r\n null, 0, null); // 5\r\n prolog\r\n .addCodeLine(\r\n \"to find a similar curve with fewer points. The algorithm defines 'dissimilarity'\",\r\n null, 0, null); // 6\r\n prolog\r\n .addCodeLine(\r\n \"based on the maximum distance between the original curve and the simplified curve.\",\r\n null, 0, null); // 6\r\n prolog\r\n .addCodeLine(\r\n \"The simplified curve consists of a subset of the points that defined the original curve.\",\r\n null, 0, null); // 6\r\n prolog.addCodeLine(\" \", null, 0, null); // 6\r\n prolog\r\n .addCodeLine(\r\n \"The Ramer-Douglas-Peucker algorithm finds its application within processing of \",\r\n null, 0, null); // 6\r\n prolog\r\n .addCodeLine(\r\n \"vector graphics and in cartographic generalization. One can find it also in robotics.\",\r\n null, 0, null); // 6\r\n\r\n // create code entity\r\n code = lang\r\n .newSourceCode(new Coordinates(15, 40), \"code\", null, SourceCode);\r\n code.addCodeLine(\"Input: points=\" + p + \"; \" + \"epsilon=\" + e + \"; \", null,\r\n 0, null);\r\n code.addCodeLine(\" \", null, 1, null);\r\n code.addCodeLine(\"ResultList.add(PointList[1], PointList[end]);\", null, 0,\r\n null);\r\n code.addCodeLine(\"pdp(PointList[],1,(PointList[].size()),epsilon);\", null,\r\n 0, null);\r\n code.addCodeLine(\"function rdp(lPointList[], start, end, l_epsilon) {\",\r\n null, 0, null);\r\n code.addCodeLine(\r\n \"dmax = OrthogonalMaxDistance(PointList[start+1...end-1]);\", null, 1,\r\n null);\r\n code.addCodeLine(\"index = OrthogonalMaxDistancePointIndex();\", null, 1,\r\n null);\r\n code.addCodeLine(\"if (dmax >= epsilon){\", null, 1, null);\r\n code.addCodeLine(\r\n \"ResultList.add(lPointList.get(index)); //add a split point\", null, 2,\r\n null);\r\n code.addCodeLine(\r\n \"pdp(lPointList[],start,index,l_epsilon); //go recursively left\", null,\r\n 2, null);\r\n code.addCodeLine(\r\n \"pdp(lPointList[],index,end,l_epsilon); //go recursively right\", null,\r\n 2, null);\r\n code.addCodeLine(\"}else{\", null, 1, null);\r\n code.addCodeLine(\"//dmax < l_epsilon: no new 'dissimilar' points to add\",\r\n null, 2, null);\r\n code.addCodeLine(\"}endif\", null, 1, null);\r\n code.addCodeLine(\"return ResultList[];\", null, 1, null);\r\n code.addCodeLine(\"}\", null, 0, null);\r\n\r\n SourceCodeProperties scPROPERTIES = new SourceCodeProperties();\r\n scPROPERTIES.set(AnimationPropertiesKeys.CONTEXTCOLOR_PROPERTY, Color.BLUE);\r\n scPROPERTIES.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\r\n \"Monospaced\", Font.PLAIN, 12));\r\n scPROPERTIES\r\n .set(AnimationPropertiesKeys.HIGHLIGHTCOLOR_PROPERTY, Color.RED);\r\n scPROPERTIES.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\r\n\r\n SourceCode func_desc = lang.newSourceCode(new Coordinates(15, 245),\r\n \"func_desc\", null, scPROPERTIES);\r\n func_desc.addCodeLine(\"Remarks:\", null, 0, null);\r\n func_desc.addCodeLine(\r\n \"The algorithm makes use of the following functions:\", null, 0, null);\r\n func_desc\r\n .addCodeLine(\r\n \"OrthogonalMaxDistance() - computes orthogonal distance from a point to a line segment;\",\r\n null, 0, null);\r\n func_desc\r\n .addCodeLine(\r\n \"OrthogonalMaxDistancePointIndex() - retrieves the index and coordinates of the furtherst point.\",\r\n null, 0, null);\r\n func_desc.addCodeLine(\"\", null, 0, null);\r\n func_desc\r\n .addCodeLine(\r\n \"There are different approaches how to compute orthogonal distances: e.g. least squares or least circles for 2D.\",\r\n null, 0, null);\r\n func_desc.addCodeLine(\"\", null, 0, null);\r\n func_desc\r\n .addCodeLine(\r\n \"Practically it might be effective to combine both functions or even to embedd OrthogonalMaxDistancePointIndex()\",\r\n null, 0, null);\r\n func_desc\r\n .addCodeLine(\r\n \"directly within OrthogonalMaxDistance(), where OrthogonalMaxDistance() is executed against the current set\",\r\n null, 0, null);\r\n func_desc\r\n .addCodeLine(\r\n \"of points, and goes through every point in the set located within the given line segment computing their\",\r\n null, 0, null);\r\n func_desc\r\n .addCodeLine(\r\n \"orthogonal distances; here OrthogonalMaxDistancePointIndex() keeps track of the most distant point\",\r\n null, 0, null);\r\n func_desc.addCodeLine(\"and retrieves its index and coordinates.\", null, 0,\r\n null);\r\n\r\n func_desc.highlight(0);\r\n code.hide();\r\n lang.nextStep();\r\n\r\n code.show();\r\n func_desc.hide();\r\n prolog.hide();\r\n\r\n lang.nextStep();\r\n }", "public void savingsReceipPrint(List receiptDetails,Component c) {\n \np.resetAll();\n\np.initialize();\n\np.feedBack((byte)2);\n\n//p.color(0);\n//p.chooseFont(1);\np.alignCenter();\n//p.emphasized(true);\n//p.underLine(2);\np.setText(receiptDetails.get(1).toString());\np.newLine();\np.setText(receiptDetails.get(2).toString());\np.newLine();\np.setText(receiptDetails.get(3).toString());\np.newLine();\np.newLine();\n//p.addLineSeperatorX();\np.underLine(0);\np.emphasized(false);\np.underLine(0);\np.alignCenter();\np.setText(\" *** Savings Made Receipt ***\");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Account Number: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(9).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Savings Id: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(0).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\np.setText(\"Customer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\np.newLine(); \n//p.emphasized(false);\n//p.setText(\"Loan+Interest: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\n//p.newLine();\n//p.setText(\"Date Taken: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(7).toString()+p.underLine(0));\n//p.newLine();\n//p.setText(\"Loan Status: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(14).toString()+p.underLine(0));\n//p.newLine();\np.setText(\"Savings Date: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(10).toString()+p.underLine(0));\np.newLine();\np.setText(\"Savings Time: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(11).toString()+p.underLine(0));\np.newLine();\n\np.underLine(0);\np.emphasized(false);\n//p.underLine(0);\np.addLineSeperator();\np.newLine();\np.alignCenter();\np.setText(\"***** Savings Details ***** \");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Savings Made: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Savings Balance: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(8).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\n//p.setText(\"Customer Name: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\n//p.newLine(); \n//p.emphasized(false);\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(5).toString()+p.underLine(0));\np.newLine();\np.addLineSeperatorX();\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer Signiture:\");\np.addLineSeperatorX();\np.newLine();\np.addLineSeperator();\np.doubleStrik(true);\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\np.underLine(2) ;\np.setText(\"Customer Signiture:\");\np.addLineSeperatorX();\np.newLine();\np.setText(\"OFFICE NUMBER: \"+receiptDetails.get(12).toString());\n////p.newLine();\n//p.addLineSeperatorX();\np.feed((byte)3);\np.finit();\n\nprint.feedPrinter(dbq.printDrivers(c),p.finalCommandSet().getBytes());\n \n\n }", "private void print2(String word, int height) {\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = height - i; j > 0; j--) {\n\t\t\t\tta.append(spece);\n\t\t\t}\n\t\t\tfor (int j = 0; j < (i + 1); j++) {\n\t\t\t\tta.append(word);\n\t\t\t}\n\t\t\tta.append(\"\\r\\n\");\n\t\t}\n\t}", "public String getHaikuPoem(){\n\t\treturn getStringOfList(getRow(1)) + \"\\n\" + getStringOfList(getRow(2)) + \"\\n\" + getStringOfList(getRow(3));\r\n\t}", "private void generate()\n {\n for (int i = 0; i < this.syllables; i++) {\n Word word = getNextWord();\n this.text += word.getWord();\n if (i < this.syllables - 1) {\n this.text += \" \";\n }\n }\n }", "public static void tip() {\n \t\n for(int tip = 1; tip <= SIZE; tip++) { \t\n for(int spaces = 1; spaces <= SIZE*3; spaces++) { \t\n System.out.print(\" \");\n } \n System.out.println(\"||\"); \n }\n }", "public static int Main()\n\t\t{\n\t\t\tint n;\n\t\t\tint i;\n\t\t\tint wl;\n\t\t\tint len = 0;\n\t\t\tint line = 0;\n\t\t\tString w = new String(new char[64]);\n\t\t\tString tempVar = ConsoleInput.scanfRead();\n\t\t\tif (tempVar != null)\n\t\t\t{\n\t\t\t\tn = Integer.parseInt(tempVar);\n\t\t\t}\n\t\t\tfor (int i = 1; i <= n; i++)\n\t\t\t{\n\t\t\t\tString tempVar2 = ConsoleInput.scanfRead();\n\t\t\t\tif (tempVar2 != null)\n\t\t\t\t{\n\t\t\t\t\tw = tempVar2.charAt(0);\n\t\t\t\t}\n\t\t\t\twl = w.length();\n\t\t\t\tif (line == 0)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"%s\",w);\n\t\t\t\t\tlen = wl;\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t\telse if (len + wl + 1 <= 80)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\" %s\",w);\n\t\t\t\t\tlen += wl + 1;\n\t\t\t\t}\n\t\t\t\telse if (len + wl + 1 > 80)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.printf(\"\\n%s\",w);\n\t\t\t\t\tlen = wl;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}", "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}", "static void generate(Proc proc, PrintWriter outData)\r\n {\r\n for (int i=0; i < proc.lines.size(); i++)\r\n {\r\n //String l = (String) proc.lines.elementAt(i);\r\n Line line = \tproc.lines.elementAt(i);\r\n outData.println(line.line);\r\n }\r\n outData.println();\r\n }", "@Override\n\tpublic String printToScreen(){\n\t\n\t\tif(this.getyMaxLines() == 0){return \"\";}\n\t\tTextProfile textProfile= new TextProfile(this.getScreenScores(), this.getyMaxLines(), this.getYLimitMin(), this.getYLimitMax());\n\t\t\n\t\tArrayList<String> lineStrings= new ArrayList<String>();\n\t\tfor(int i= (textProfile.getProfile().size() - 1); i >= 0; i--){\n\t\t\tList<String> xl= textProfile.getProfile().get(i);\n\t\t\tlineStrings.add(StringUtils.join(xl, \"\"));\n\t\t}\t\t\n\t\treturn Joiner.on(\"\\n\").join(lineStrings);\n\t}", "public static void body() {\n \tfor(int i = 1; i <= SIZE*SIZE; i++) {\n for(int j = 1; j <= 3*SIZE-(SIZE-1); j++) {\n System.out.print(\" \");\n }\n \n System.out.print(\"|\");\n for(int j = 1; j <= SIZE-2; j++) {\n \tSystem.out.print(\"%\");\n }\n System.out.print(\"||\");\n for(int j = 1; j <= SIZE-2; j++) {\n \tSystem.out.print(\"%\");\n }\n System.out.print(\"|\");\n \n System.out.println();\n }\n }", "public void 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 static String getRandomLongDescription() {\n int paragraphs = RandomNumberGenerator.getRandomInt(2, 5);\n StringBuilder sb = new StringBuilder();\n\n for (int i = 0; i < paragraphs; i++) {\n\n sb.append(\"##\").append(getRandomText(2, 1).replace('.', ' ')).append(\"##\\n\");\n int length = RandomNumberGenerator.getRandomInt(30, 200);\n sb.append(getRandomText(length, 1)).append(\"\\n\");\n }\n return sb.toString();\n }", "private void printLines() {\n for (String L: testLines) {\n print.write(L);\n }\n }", "private void skrivOversikt() {\n System.out.println(\"\\n- Leger -\\n\");\n for (Lege lege : leger){\n System.out.println(lege);\n }\n\n System.out.println(\"\\n- Pasienter -\");\n for (Pasient pasient : pasienter){\n System.out.println(\"\\n\" + pasient);\n }\n\n System.out.println(\"\\n- Legemidler -\");\n for (Legemiddel legemiddel : legemidler){\n System.out.println(\"\\n\" + legemiddel);\n }\n\n System.out.println(\"\\n- Resepter -\");\n for (Resept resept : resepter){\n System.out.println(\"\\n\" + resept);\n }\n }", "public String toString() {\n\t\tString ret = \"----------------------------\";\n\t\t\n\t\tret += \"\\n\";\n\t\t\n\t\tfor(int i=0; i<table.length; i++) {\n\t\t\tret+=\"|\";\n\t\t\tfor(int j=0; j<table[i].length; j++) {\n\t\t\t\tif(table[i][j] == Constants.EMPTY) {\n\t\t\t\t\tret += \"_\";\n\t\t\t\t} else if(table[i][j] == Constants.P1_COLOUR) {\n\t\t\t\t\tret += \"G\";\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tret += \"T\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tret += \"|\\n\";\n\t\t}\n\t\tret += \"\\n\";\n\t\t\n\t\tret += \" DEBUG: P1 movable table:\\n\";\n\t\tret += \"\\n\";\n\t\t\n\t\tfor(int i=0; i<table.length; i++) {\n\t\t\tret+=\"|\";\n\t\t\tfor(int j=0; j<table[i].length; j++) {\n\t\t\t\tif(table[i][j] == Constants.EMPTY && P1Movable[i][j]) {\n\t\t\t\t\tret += \"1\";\n\t\t\t\t} else if(table[i][j] == Constants.P1_COLOUR) {\n\t\t\t\t\tret += \"G\";\n\t\t\t\t\t\n\t\t\t\t} else if(table[i][j] == Constants.P2_COLOUR) {\n\t\t\t\t\tret += \"T\";\n\t\t\t\t} else {\n\t\t\t\t\tret += \"_\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tret += \"|\\n\";\n\t\t}\n\t\tret += \"\\n\";\n\t\t\n\t\tret += \" DEBUG: P2 movable table:\\n\";\n\t\tret += \"\\n\";\n\t\t\n\t\tfor(int i=0; i<table.length; i++) {\n\t\t\tret+=\"|\";\n\t\t\tfor(int j=0; j<table[i].length; j++) {\n\t\t\t\tif(table[i][j] == Constants.EMPTY && P2Movable[i][j]) {\n\t\t\t\t\tret += \"2\";\n\t\t\t\t} else if(table[i][j] == Constants.P1_COLOUR) {\n\t\t\t\t\tret += \"G\";\n\t\t\t\t\t\n\t\t\t\t} else if(table[i][j] == Constants.P2_COLOUR) {\n\t\t\t\t\tret += \"T\";\n\t\t\t\t} else {\n\t\t\t\t\tret += \"_\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tret += \"|\\n\";\n\t\t}\n\t\tret += \"\\n\";\n\t\t\n\t\tif(this.P1turn) {\n\t\t\tret += \"Player 1's turn\\n\\n\";\n\t\t} else {\n\t\t\tret += \"Player 2's turn\\n\\n\";\n\t\t\t\n\t\t}\n\t\t\n\t\tret += \"----------------------------\";\n\n\t\treturn ret;\n\t}", "@Override\n public String toString() {\n return String.format(\"%-4s %-35s %-20s %-20s\\n\", this.pokeNumber, this.pokeName,\n this.pokeType_1, this.hitPoints);\n }", "public static void main (String args[]){\n\t\tString paragraph;//paragraph entered\r\n\t\tString newParagraph;//paragraph modified after string\r\n\t\tint count;//Count the characters excluding vowels\r\n\t\tString repeat;//Insert more paragraphs\r\n\t\tint menu;//Insert menu option\r\n\r\n\r\n\t\t//Declare objects for Q1\r\n\t\tScanner sc = new Scanner (System.in);\r\n\t\tTextProcessor myT = new TextProcessor();\r\n\r\n\r\n\t\t//Do While to set the menu options\r\n\t\tdo{\r\n\r\n\t\t//Input for menu\r\n\t\tSystem.out.println(\"\\n ____________________________________________________\" +\r\n\t\t\t\t\t\t\"\\n|Welcome to the Programming Society Application Menu!|\" +\r\n\t\t\t\t\t\t\"\\n| |\" +\r\n\t\t\t\t\t\t\"\\n|1 - Encode paragraphs |\" +\r\n\t\t\t\t\t\t\"\\n|2 - Enter words and find the longest one |\" +\r\n\t\t\t\t\t\t\"\\n|3 - Exit Application |\" +\r\n\t\t\t\t\t\t\"\\n|Enter your choice (1, 2 or 3): |\" +\r\n\t\t\t\t\t\t\"\\n|____________________________________________________|\" +\r\n\t\t\t\t\t\t\"\\n \");\r\n\t\tmenu = Integer.parseInt(sc.nextLine());\r\n\r\n\t\t\tif(menu == 1){\r\n\t\t\t\t//Do While for input and output for Q1 MPA2\r\n\t\t\t\tdo{\r\n\t\t\t\t\t//Input for Q1\r\n\t\t\t\t\tSystem.out.println(\"\\n \" + \"Please enter paragraph\");\r\n\t\t\t\t\tparagraph = sc.nextLine();\r\n\r\n\t\t\t\t\t//Set for Q1 (user input)\r\n\t\t\t\t\tmyT.setParagraph(paragraph);\r\n\r\n\t\t\t\t\t//Process for Q1\r\n\t\t\t\t\tmyT.computeParagraph();\r\n\r\n\t\t\t\t\t//Fetch results and Output for Q1\r\n\t\t\t\t\tnewParagraph = myT.getNewParagraph();\r\n\t\t\t\t\tcount = myT.getCount();\r\n\r\n\t\t\t\t\t//Output for Q1\r\n\t\t\t\t\tSystem.out.println(\"\\n \" + \"Your encoded paragraph is \" + newParagraph + count);\r\n\r\n\t\t\t\t\t//Repeat for inserting more paragraphs for Q1 MPA2\r\n\t\t\t\t\tSystem.out.println(\"\\n \" + \"Would you like to encode another paragraph?(yes or no)\");\r\n\t\t\t\t\trepeat = sc.nextLine();\r\n\t\t\t\t}\r\n\r\n\t\t\t\twhile (!repeat.equalsIgnoreCase(\"no\"));\r\n\t\t\t}\r\n\r\n\t\t\telse if(menu == 2){\r\n\t\t\t\tSystem.out.println(\"\\n \" + \"How many words would you like to enter?\");\r\n\t\t\t\tint wordNumber = Integer.parseInt(sc.nextLine());\r\n\t\t\t\tString word[] = new String [wordNumber];\r\n\t\t\t\tmyT.setWordNumber(wordNumber);\r\n\r\n\r\n\t\t\t\tfor(int i = 0; i < word.length; i++){\r\n\t\t\t\t\tSystem.out.println(\"\\n \" + \"Please enter word \" + \"(\" + (i+1) + \"):\");\r\n\t\t\t\t\tword[i] = sc.nextLine();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmyT.setWord(word);\r\n\r\n\t\t\t\tString longestWord[] = new String[wordNumber];\r\n\r\n\t\tSystem.out.println(\"the longest is: \" + Arrays.deepToString(longestWord));\r\n\r\n\r\n\t\t\t}\r\n\r\n\t\t\telse if(menu == 3){\r\n\t\t\t\tSystem.out.println(\"Thank you\");\r\n\t\t\t}\r\n\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Not a valid function.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile(menu != 3);\r\n\r\n\t}", "public static String getSleepingSnake(int size)\r\n\t{\r\n if (size == 0) {\r\n\t\t return \"Size needs to be a positive integer\\n\";\r\n }\r\n if (size == 4) {\r\n return \">____ \\n ___ |\\n| > ||\\n||__||\\n|____|\\n\";\r\n }\r\n if (size == 7) {\r\n return \">_______\\n ______ |\\n| ____ ||\\n|| __ |||\\n||| < |||\\n|||___|||\\n||_____||\\n|_______|\\n\";\r\n }\r\n /*\r\n else if (size % 2 != 0) {\r\n StringBuffer sb = new StringBuffer(); \r\n\r\n // first line\r\n sb.append(\">\");\r\n for (int j = 0; j < size; j++) {\r\n sb.append(\"_\");\r\n }\r\n //sb.append(\" \\n\");\r\n sb.append(\"\\n\");\r\n \r\n // second through half\r\n for (int i = 1; i < size / 2 + 1; i++) {\r\n for (int j = 0; j < i - 1; j++) {\r\n sb.append(\"|\");\r\n }\r\n sb.append(\" \");\r\n for (int j = 0; j < size - 2 * i + 1; j++) {\r\n sb.append(\"_\");\r\n }\r\n\r\n sb.append(\" \");\r\n for (int j = 0; j < i; j++) {\r\n sb.append(\"|\");\r\n }\r\n sb.append(\"\\n\");\r\n }\r\n\r\n // middle\r\n for (int j = 0; j < size - 4; j++) {\r\n sb.append(\"|\");\r\n }\r\n sb.append(\" < \");\r\n for (int j = 0; j < size - 4; j++) {\r\n sb.append(\"|\");\r\n }\r\n sb.append(\"\\n\");\r\n\r\n \r\n int k = 0;\r\n // half through end\r\n for (int i = size / 2 + 1; i < size; i++, k++) {\r\n for (int j = i; j < size; j++) {\r\n sb.append(\"|\");\r\n }\r\n for (int j = 0; j < i - 1 + k; j++) {\r\n sb.append(\"_\");\r\n\r\n }\r\n\r\n for (int j = i; j < size; j++) {\r\n sb.append(\"|\");\r\n }\r\n sb.append(\"\\n\");\r\n }\r\n //sb.setLength(sb.length() - 1);\r\n return sb.toString();\r\n }\r\n */\r\n else {\r\n StringBuffer sb = new StringBuffer(); \r\n return sb.toString();\r\n }\r\n \r\n\t}", "private void print1(String word, int height) {\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = height - i; j > 0; j--) {\n\t\t\t\tta.append(word);\n\t\t\t}\n\t\t\tta.append(\"\\r\\n\");\n\t\t}\n\t}", "private static void task43() {\n System.out.println(\"Twinkle, twinkle, little star,\");\n System.out.println(\"\\tHow I wonder what you are!\");\n System.out.println(\"\\t\\tUp above the world so high,\");\n System.out.println(\"\\t\\tLike a diamond in the sky!\");\n System.out.println(\"Twinkle, twinkle, little star,\");\n System.out.println(\"How I wonder what you are.\");\n }", "private static void chaotic(int lines) {\n Random rand = new Random();\r\n //prints out a random amout of * from 1 to 5 for every line\r\n for (int i = 0; i < lines; i++) {\r\n int length = rand.nextInt(5) + 1;\r\n for(int o = 0; o < length; o++)\r\n System.out.print(\"* \");\r\n //new line to separate lines of *\r\n System.out.println(\"\");\r\n }\r\n }", "public String toString() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tDecimalFormat dFormat = new DecimalFormat(\".00\"); //Format the price ...\n\n\t\tsb.append(\"MENU PIZZA PRONTO\\n\\n\");\n\t\t// Pizzas\n\t\tsb.append(\"Prima special pizzas: \\n 1 normal (Diameter approx. 26 cm) and \\n 2 grande (Diameter approx. 32 cm)\\n\");\n\t\tint i = 0;\n\t\tdo {\n\t\t\tsb.append(dishes.get(i).getNumber() + \"\\t\");\n\t\t\tsb.append(dishes.get(i).getName() + \"\\t\");\n\t\t\tsb.append(dishes.get(i).ingredientsToString());\n\t\t\tsb.append(\"\\n\\tPrice:\\t\\t\\t\"\n\t\t\t\t\t+ dFormat.format(dishes.get(i).getPrice()) + \" Euro\");\n\t\t\tif(dishes.get(i).getNumber() == dishes.get(i+1).getNumber()){\n\t\t\t\tsb.append(\"\\n\\tPrice:\\t\\t\\t\"\n\t\t\t\t\t\t+ dFormat.format(dishes.get(i+1).getPrice()) + \" Euro\");\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t\ti+=2;\n\t\t\t}\n\t\t\telse i++;\n\t\t} while (i < dishes.size() && dishes.get(i) instanceof PizzaVO );\n\t\t\n\t\t//Pasta \n\t\t\n\t\tsb.append(\"\\nPrima special pastas: \\n4 Spaghetti\\n5 Tortellini\\n6 Gnocchi\\n\");\n\t\tdo {\n\t\t\tsb.append(\" \" + dishes.get(i).getNumber() + \"\\t\");\n\t\t\tsb.append(dishes.get(i).getName() + \"\\t\");\n\n\t\t\tsb.append(dishes.get(i).ingredientsToString());\n\n\t\t\tsb.append(\"\\n\\tPrice:\\t\\t\\t\"\n\t\t\t\t\t+ dFormat.format(dishes.get(i).getPrice()) + \" Euro\");\n\t\t\tif(dishes.get(i).getNumber() == dishes.get(i+1).getNumber() && dishes.get(i).getNumber() == dishes.get(i+2).getNumber()){\n\t\t\t\ti+=3;\n\t\t\t} else {\n\t\t\tif(dishes.get(i).getNumber() == dishes.get(i+1).getNumber()){\n\t\t\t\ti+=2;\n\t\t\t}\n\t\t\telse\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tsb.append(\"\\n\");\n\t\t} while (i < dishes.size() && dishes.get(i) instanceof PastaVO);\n\t\t\n\t\tsb.append(\"\\nPrima desserts\\n\");\n\t\tdo {\n\t\t\tsb.append(dishes.get(i).getNumber() + \"\\t\");\n\t\t\tsb.append(dishes.get(i).getName() + \"\\t\");\n\n\t\t\tsb.append(dishes.get(i).ingredientsToString());\n\n\t\t\tsb.append(\"\\n\\tPrice:\\t\\t\\t\"\n\t\t\t\t\t+ dFormat.format(dishes.get(i).getPrice()) + \" Euro\");\n\t\t\tsb.append(\"\\n\");\n\t\t\ti++;\n\t\t} while (i < dishes.size() && dishes.get(i) instanceof DessertVO);\n\n\t\treturn sb.toString();\n\t}", "@Override\n\tpublic void makeEyesWithMan() {\n\t\tSystem.out.println(\"Å×ÃÄÑÛÄØ¡£¡£¡£\");\n\t}", "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}", "public static String printIntro() {\n return\n \" /$$ /$$ /$$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$ /$$ /$$\\n\"\n + \"| $$$ /$$$| $$_____/| $$$ /$$$ /$$__ $$| $$__ $$| $$ /$$/\\n\"\n + \"| $$$$ /$$$$| $$ | $$$$ /$$$$| $$ \\\\ $$| $$ \\\\ $$ \\\\ $$ /$$/ \\n\"\n + \"| $$ $$/$$ $$| $$$$$ | $$ $$/$$ $$| $$ | $$| $$$$$$$/ \\\\ $$$$/ \\n\"\n + \"| $$ $$$| $$| $$__/ | $$ $$$| $$| $$ | $$| $$__ $$ \\\\ $$/ \\n\"\n + \"| $$\\\\ $ | $$| $$ | $$\\\\ $ | $$| $$ | $$| $$ \\\\ $$ | $$ \\n\"\n + \"| $$ \\\\/ | $$| $$$$$$$$| $$ \\\\/ | $$| $$$$$$/| $$ | $$ | $$ \\n\"\n + \"|__/ |__/|________/|__/ |__/ \\\\______/ |__/ |__/ |__/ \\n\"\n + \" \\n\";\n }", "public static void part2(){\n\t\n System.out.println(\"\\\\\"); //Outer wall\n System.out.println(\"\\\\\");\n System.out.println(\"\\\\\");\n for(int i = 0; i <= 16; i++){ //loop created to display top of the door\n\n \tSystem.out.print(\"-\");\n\n\t}\n System.out.println(\"\");\n System.out.println(\"\\\\\\t\\t| \\t(\\\")\"); //The door and the stick figure\n System.out.println(\"\\\\\\t\\t|\\t-|-\");\n System.out.println(\"\\\\\\t o | \\t |\");\n System.out.println(\"\\\\\\t\\t|\\t /\\\\\");\n System.out.println(\"\\\\\\t\\t|\\t/ \\\\\");\n\t\t\n }", "static String printInstructions() {\n return \"Hello, Test Subject 525. I am Charlie, your personal helper bot.\\n\\n\" +\n \"I suggest you pick up the cryonic files in the starting area, and inspect them before proceeding.\" +\n \" You may drop them afterwards if you wish.\\n\\n\" +\n \"You awaken in the Cryostasis Containment Chamber, which only contains 'cryonics files'.\\n\" +\n \"You can traverse the ship by using the north, south, east, or west buttons.\\n\" +\n \"You can see what is in the room you are in by typing 'look', or you can use the current room button.\\n\" +\n \"You can pick things up by typing 'pickup thing' where thing is what you see in the room.\\n\"+\n \"You can drop things you are carrying by typing 'drop thing' where thing names something you have.\\n\"+\n \"You can see your status by typing status, and quit by using the quit button.\\n\" +\n \"If you wish to view the instructions again, press the instructions button.\\n\\n\" +\n \"You can also inspect things you are carrying by typing 'inspect thing' where thing names\" +\n \" something you have.\\n\" +\n \"Inspected things may possess different functions, so inspect them thoroughly.\\n\" +\n \"If you use things in your bag when you're not supposed to, I'll inform you.\" +\n \" If you continually try to use things when you're not supposed to...\\n\" +\n \"you can see for yourself what'll happen.\\n\\n\" +\n \"OBJECTIVE: My sensors have detected a dangerous invader among us...quietly lurking around the ship.\\n\" +\n \"Search the ship for weapons to arm yourself with, and find a transmitter to contact home base.\\n\" +\n \"I suggest you act quickly before this creature finds you first, 525.\\n\\n\";\n }", "public String generateString() {\n List<Trip<String, String, String>> sequence = super.generateSequence(startTrip, endTrip);\n sequence = sequence.subList(1, sequence.size()-1);\n String generated = \"\";\n for (int i = 0; i<sequence.size()-2; i++) generated += sequence.get(i).getThird() + \" \";\n return generated.substring(0, generated.length()-1);\n }", "public void savingsWithdrawReceipPrintStamp(List receiptDetails,Component c) {\n \np.resetAll();\n\np.initialize();\n\np.feedBack((byte)2);\n\np.color(0);\np.chooseFont(1);\np.alignCenter();\n//p.emphasized(true);\n//p.underLine(2);\np.setText(receiptDetails.get(1).toString());\np.newLine();\np.setText(receiptDetails.get(2).toString());\np.newLine();\np.setText(receiptDetails.get(3).toString());\np.newLine();\np.newLine();\n//p.addLineSeperatorX();\np.underLine(0);\np.emphasized(false);\np.underLine(0);\np.alignCenter();\np.setText(\" *** Savings Withdrawal ***\");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Account Number: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(9).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Savings Id: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(0).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\np.setText(\"Customer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\np.newLine(); \n//p.emphasized(false);\n//p.setText(\"Loan+Interest: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\n//p.newLine();\n//p.setText(\"Date Taken: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(7).toString()+p.underLine(0));\n//p.newLine();\n//p.setText(\"Loan Status: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(14).toString()+p.underLine(0));\n//p.newLine();\np.setText(\"Withdrawal Date: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(10).toString()+p.underLine(0));\np.newLine();\np.setText(\"Withdrawal Time: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(11).toString()+p.underLine(0));\np.newLine();\n\np.underLine(0);\np.emphasized(false);\n//p.underLine(0);\np.addLineSeperator();\np.newLine();\np.alignCenter();\np.setText(\"***** Withdrawal Details ***** \");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Withdrawal Made: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(7).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Savings Balance: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(8).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\n//p.setText(\"Customer Name: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\n//p.newLine(); \n//p.emphasized(false);\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(5).toString()+p.underLine(0));\np.newLine();\np.addLineSeperatorX();\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer Signiture:\");\np.addLineSeperatorX();\np.newLine();\np.addLineSeperator();\np.doubleStrik(true);\n//p.newLine();\np.underLine(2) ;\np.setText(\"Customer Signiture:\");\np.addLineSeperatorX();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.setText(\"OFFICE NUMBER: \"+receiptDetails.get(12).toString());\n\np.newLine();\np.addLineSeperatorX();\n//p.newLine();\np.feed((byte)3);\np.finit();\n\nprint.feedPrinter(dbq.printDrivers(c),p.finalCommandSet().getBytes());\n \n\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 savingsReceipPrintStamp(List receiptDetails,Component c) {\n \np.resetAll();\n\np.initialize();\n\np.feedBack((byte)2);\n\n//p.color(0);\n//p.chooseFont(1);\np.alignCenter();\n//p.emphasized(true);\n//p.underLine(2);\np.setText(receiptDetails.get(1).toString());\np.newLine();\np.setText(receiptDetails.get(2).toString());\np.newLine();\np.setText(receiptDetails.get(3).toString());\np.newLine();\np.newLine();\n//p.addLineSeperatorX();\np.underLine(0);\np.emphasized(false);\np.underLine(0);\np.alignCenter();\np.setText(\" *** Savings Made Receipt ***\");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Account Number: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(9).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Savings Id: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(0).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\np.setText(\"Customer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\np.newLine(); \n//p.emphasized(false);\n//p.setText(\"Loan+Interest: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\n//p.newLine();\n//p.setText(\"Date Taken: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(7).toString()+p.underLine(0));\n//p.newLine();\n//p.setText(\"Loan Status: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(14).toString()+p.underLine(0));\n//p.newLine();\np.setText(\"Savings Date: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(10).toString()+p.underLine(0));\np.newLine();\np.setText(\"Savings Time: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(11).toString()+p.underLine(0));\np.newLine();\n\np.underLine(0);\np.emphasized(false);\n//p.underLine(0);\np.addLineSeperator();\np.newLine();\np.alignCenter();\np.setText(\"***** Savings Details ***** \");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Savings Made: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Savings Balance: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(8).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\n//p.setText(\"Customer Name: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\n//p.newLine(); \n//p.emphasized(false);\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(5).toString()+p.underLine(0));\np.newLine();\np.addLineSeperatorX();\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer Signiture:\");\np.addLineSeperatorX();\np.newLine();\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.underLine(2) ;\np.setText(\"Customer Signiture:\");\np.addLineSeperatorX();\np.newLine();\n//p.setText(\"OFFICE NUMBER: \"+receiptDetails.get(12).toString());\n////p.newLine();\n//p.addLineSeperatorX();\np.feed((byte)3);\np.finit();\n\nprint.feedPrinter(dbq.printDrivers(c),p.finalCommandSet().getBytes());\n \n\n }", "private void _generateComments() {\n int classInstNum = 0; //total class instance num in this department\n long totalClassInstNum = 0l; //total class instance num so far\n int propInstNum = 0; //total property instance num in this department\n long totalPropInstNum = 0l; //total property instance num so far\n String comment;\n\n comment = \"External Seed=\" + baseSeed_ + \" Interal Seed=\" + seed_;\n log_.println(comment);\n log_.println();\n\n comment = \"CLASS INSTANCE# TOTAL-SO-FAR\";\n log_.println(comment);\n comment = \"----------------------------\";\n log_.println(comment);\n for (int i = 0; i < CLASS_NUM; i++) {\n comment = CLASS_TOKEN[i] + \" \" + instances_[i].logNum + \" \" +\n instances_[i].logTotal;\n log_.println(comment);\n classInstNum += instances_[i].logNum;\n totalClassInstNum += instances_[i].logTotal;\n }\n log_.println();\n comment = \"TOTAL: \" + classInstNum;\n log_.println(comment);\n comment = \"TOTAL SO FAR: \" + totalClassInstNum;\n log_.println(comment);\n\n comment = \"PROPERTY---INSTANCE NUM\";\n log_.println();\n comment = \"PROPERTY INSTANCE# TOTAL-SO-FAR\";\n log_.println(comment);\n comment = \"-------------------------------\";\n log_.println(comment);\n for (int i = 0; i < PROP_NUM; i++) {\n comment = PROP_TOKEN[i] + \" \" + properties_[i].logNum;\n comment = comment + \" \" + properties_[i].logTotal;\n log_.println(comment);\n propInstNum += properties_[i].logNum;\n totalPropInstNum += properties_[i].logTotal;\n }\n log_.println();\n comment = \"TOTAL: \" + propInstNum;\n log_.println(comment);\n comment = \"TOTAL SO FAR: \" + totalPropInstNum;\n log_.println(comment);\n\n System.out.println(\"CLASS INSTANCE #: \" + classInstNum + \", TOTAL SO FAR: \" +\n totalClassInstNum);\n System.out.println(\"PROPERTY INSTANCE #: \" + propInstNum +\n \", TOTAL SO FAR: \" + totalPropInstNum);\n System.out.println();\n\n log_.println();\n }", "public void print()\r\n\t{\r\n\r\n\t\t for(int i = 0; i < 20; i++)\r\n\t\t {\r\n\t\t\t for(int j = 0; j < 20; j++)\r\n\t\t\t {\r\n\t\t\t\t if(sTalker.getY() == randomer.getY() && sTalker.getX() == randomer.getX() && sTalker.getY() == i && sTalker.getX() == j)\r\n\t\t\t\t \tSystem.out.print(\"x\");\r\n\r\n\t\t\t\t else if (i == randomer.getY() && j == randomer.getX())\r\n\t\t\t\t \tSystem.out.print(\"o\");\r\n\r\n\t\t\t\t else if (i == sTalker.getY() && j == sTalker.getX())\r\n\t\t\t\t \tSystem.out.print(\"*\");\r\n\r\n\t\t\t\t else\r\n\t\t\t\t \tSystem.out.print(\"-\");\r\n\t\t\t }\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t\tif(sTalker.getY() == randomer.getY() && sTalker.getX() == randomer.getX())\r\n\t\t{\r\n\t\t \tSystem.out.println(\"The stalker has caught the walker!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\trandomer.move();\r\n\t\tsTalker.move(randomer);\r\n\t}", "public static void GeneratorMethod(boolean vP, boolean nP, boolean sP, boolean sS, boolean nS, boolean vS) throws IOException {\n List<String> lines = new ArrayList<>();\n\n if(vP){\n VerbPluralGen vpg;\n for (int i = 0; i<50; i++){\n vpg = new VerbPluralGen();\n lines.add(vpg.verbPluralExercise());\n }\n }\n if(nP){\n NounPluralGen npg;\n for (int i = 0; i<50; i++){\n npg = new NounPluralGen();\n lines.add(npg.nounPluralExercises());\n }\n }\n if(sP){\n SentencePluraliserGen spg;\n for (int i = 0; i<50; i++){\n spg = new SentencePluraliserGen();\n lines.add(spg.sentencePluraliseExercise());\n }\n }\n if(sS){\n SentenceScrabbleGen ssg;\n for (int i = 0; i<50; i++){\n ssg = new SentenceScrabbleGen();\n lines.add(ssg.sentenceScrabbleExercise());\n }\n }\n if(nS){\n NounSingularGen nsg;\n for (int i = 0; i<50; i++){\n nsg = new NounSingularGen();\n lines.add(nsg.nounSingularExercises());\n }\n }\n if(vS){\n VerbSCModifier vscm;\n for (int i = 0; i<50; i++){\n vscm = new VerbSCModifier();\n lines.add(vscm.verbSCModifier());\n }\n }\n Path file = Paths.get(\"questions.txt\");\n Files.write(file, lines, Charset.forName(\"UTF-8\"));\n }", "public static void main(String[] args) {\n char ch1 = '1';\n char ch2 = 'Z';\n int numberPerLine = 10;\n //Peredajem dani metody\n printChars(ch1, ch2, numberPerLine);\n }", "private void print() {\n printInputMessage();\n printFrequencyTable();\n printCodeTable();\n printEncodedMessage();\n }", "private void prnFOOTR()\n\t{\n\t\ttry\n\t\t{\n\t\t\tif(cl_dat.M_intLINNO_pbst >= 64)\n\t\t\t{\n\t\t\t\tdosREPORT.writeBytes(\"-------------------------------------------------------------------------------------------------------------------------------------\");\t\t\n\t\t\t\tif(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))\n\t\t\t\t\tprnFMTCHR(dosREPORT,M_strEJT);\n\t\t\t\tif(M_rdbHTML.isSelected())\n\t\t\t\t\tdosREPORT.writeBytes(\"<P CLASS = \\\"breakhere\\\">\");\t\t\t\t\t\t\t\t\n\t\t\t\tprnHEADER();\n\t\t\t}\n\t\t\tdosREPORT.writeBytes(\"-------------------------------------------------------------------------------------------------------------------------------------\\n\");\n\t\t\tdosREPORT.writeBytes (\"\\n\\n\\n\\n\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",10));//margin\n\t\t\tif(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))\n\t\t\t\tprnFMTCHR(dosREPORT,M_strBOLD);\n\t\t\tif(M_rdbHTML.isSelected())\n\t\t\t\tdosREPORT.writeBytes(\"<B>\");\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\"PREPARED BY\",40));\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\"CHECKED BY \",40));\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\"H.O.D (MHD) \",40));\n\t\t\tif(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))\n\t\t\t\tprnFMTCHR(dosREPORT,M_strNOBOLD);\n\t\t\tif(M_rdbHTML.isSelected())\n\t\t\t\tdosREPORT.writeBytes(\"</B>\");\n\t\t\tdosREPORT.writeBytes(\"\\n\");\n\t\t\tdosREPORT.writeBytes(\"-------------------------------------------------------------------------------------------------------------------------------------\\n\");\n\t\t\t\n\t\t\tdosREPORT.writeBytes(\" System generated report, hence signature not required \\n\");\n\t\t\tcl_dat.M_intLINNO_pbst += 8;\n\t\t\tif(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst))\n\t\t { \n\t\t\t\tprnFMTCHR(dosREPORT,M_strEJT);\n\t\t\t\tprnFMTCHR(dosREPORT,M_strNOCPI17);\n\t\t\t\tprnFMTCHR(dosREPORT,M_strCPI10);\n\t\t\t}\t\n\t\t}\n\t catch(Exception L_EX)\n\t {\n\t\t\tsetMSG(L_EX + \" prnFOOTR\",'E');\n\t\t}\t\n\t}", "public void print() {\n DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;\n \n //Aca obtenemos el servicio de impresion por default\n //Si no quieres ver el dialogo de seleccionar impresora usa esto\n //PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();\n \n \n //Con esto mostramos el dialogo para seleccionar impresora\n //Si quieres ver el dialogo de seleccionar impresora usalo\n //Solo mostrara las impresoras que soporte arreglo de bits\n PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();\n PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);\n PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();\n PrintService service = ServiceUI.printDialog(null, 700, 200, printService, defaultService, flavor, pras);\n \n //Creamos un arreglo de tipo byte\n byte[] bytes;\n\n //Aca convertimos el string(cuerpo del ticket) a bytes tal como\n //lo maneja la impresora(mas bien ticketera :p)\n bytes = this.contenidoFactura.getBytes();\n //Creamos un documento a imprimir, a el se le appendeara\n //el arreglo de bytes\n Doc doc = new SimpleDoc(bytes,flavor,null);\n \n //Creamos un trabajo de impresión\n DocPrintJob job = service.createPrintJob();\n\n //Imprimimos dentro de un try de a huevo\n try {\n //El metodo print imprime\n job.print(doc, null);\n \n } catch (Exception er) {\n JOptionPane.showMessageDialog(null,\"Error al imprimir: \" + er.getMessage());\n }\n DocPrintJob cutjob = service.createPrintJob();\n DocPrintJob spacejob = service.createPrintJob();\n //dejando espacios al final\n byte[] espacio = (\"\\n \\n \\n \\n\").getBytes();\n try{\n spacejob.print(new SimpleDoc(espacio,flavor,null),null);\n }\n catch (Exception er) {\n JOptionPane.showMessageDialog(null,\"Error al imprimir: \" + er.getMessage());\n }\n //cortando el papel\n try{\n byte[] cutP = new byte[] { 0x1d, 'V', 1 };\n cutjob.print(new SimpleDoc(cutP,flavor,null),null); \n }catch (Exception er) {\n JOptionPane.showMessageDialog(null,\"Error al imprimir: \" + er.getMessage());\n }\n \n }", "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 }", "void genReport() {\n\n current_part.save_state(); \n\n JTextArea ta = text;\n\n ta.setText(\"\");\n\n if (!t_foil_name.equals(\"Test\"))\n ta.append(\"Hydrofoil: \" + t_foil_name);\n\n java.util.Date date = new java.util.Date();\n ta.append(\"\\n Date: \" + date);\n \n wing.print( \"Main Wing\", ta);\n stab.print( \"Stabilizer Wing\", ta);\n strut.print(\"Mast (a.k.a. Strut)\", ta);\n fuse.print( \"Fuselage\", ta);\n\n ta.append( \"\\n\\n\");\n // tail volume is LAElev * AreaElev / (MACWing * AreaWing)\n // LAElev : The elevator's Lever Arm measured at the wing's and elevator's quarter chord point\n double LAElev = stab.xpos + stab.chord_xoffs + 0.25*stab.chord - (wing.xpos + wing.chord_xoffs + 0.25*wing.chord);\n // MAC : The main wing's Mean Aerodynamic Chord\n // AreaWing : The main wing's area\n // AreaElev : The elevator's area\n \n ta.append( \"\\nTail Voulume: \" + LAElev*stab.span*stab.chord/(wing.chord*wing.chord*wing.span));\n \n\n ta.append( \"\\n\\n\");\n switch (planet) {\n case 0: { \n ta.append( \"\\n Standard Earth Atmosphere\" );\n break;\n }\n case 1: { \n ta.append( \"\\n Martian Atmosphere\" );\n break;\n }\n case 2: { \n ta.append( \"\\n Water\" );\n break;\n }\n case 3: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n case 4: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n }\n\n // ta.append( \"\\n Altitude = \" + filter0(alt_val) );\n // if (lunits == IMPERIAL) ta.append( \" ft ,\" );\n // else /*METRIC*/ ta.append( \" m ,\" );\n \n switch (lunits) {\n case 0: { /* English */\n ta.append( \"\\n Density = \" + filter5(rho_EN) );\n ta.append( \"slug/cu ft\" );\n ta.append( \"\\n Pressure = \" + filter3(ps0/144.) );\n ta.append( \"lb/sq in,\" );\n ta.append( \" Temperature = \" + filter0(ts0 - 460.) );\n ta.append( \"F,\" );\n break;\n }\n case 1: { /* Metric */\n ta.append( \" Density = \" + filter3(rho_EN*515.4) );\n ta.append( \"kg/cu m\" );\n ta.append( \"\\n Pressure = \" + filter3(101.3/14.7*ps0/144.) );\n ta.append( \"kPa,\" );\n ta.append( \" Temperature = \" + filter0(ts0*5.0/9.0 - 273.1) );\n ta.append( \"C,\" );\n break;\n }\n }\n\n ta.append( \"\\n Speed = \" + filter1(velocity * (lunits==IMPERIAL? 0.868976 : 0.539957 )) + \"Kts, or\" );\n ta.append( \" \" + filter1(velocity) );\n if (lunits == IMPERIAL) ta.append( \" mph ,\" );\n else /*METRIC*/ ta.append( \" km/hr ,\" );\n\n // if (out_aux_idx == 1)\n // ta.append( \"\\n Lift Coefficient = \" + filter3(current_part.cl) );\n // if (out_aux_idx == 0) {\n // if (Math.abs(lift) <= 10.0) ta.append( \"\\n Lift = \" + filter3(lift) );\n // if (Math.abs(lift) > 10.0) ta.append( \"\\n Lift = \" + filter0(lift) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n // if ( polarOut == 1)\n // ta.append( \"\\n Drag Coefficient = \" + filter3(current_part.cd) );\n // if (out_aux_idx == 0) {\n // ta.append( \"\\n Drag = \" + filter0(drag) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n\n ta.append( \"\\n Lift = \" + dash.outTotalLift.getText());\n ta.append( \"\\n Drag = \" + dash.outTotalDrag.getText());\n\n if (min_takeoff_speed_info != null) \n ta.append( \"\\n\\n\" + min_takeoff_speed_info);\n\n if (cruising_info != null) \n ta.append( \"\\n\\n\" + cruising_info);\n\n if (max_speed_info != null) \n ta.append( \"\\n\\n\" + max_speed_info);\n\n // ensure end ta.setCaretPosition(ta.getText().length());\n // ensure start\n ta.setCaretPosition(0);\n }", "public static void printGivenAndGeneratedCombinations() {\n\t\tSystem.out.println(GENERATE_START);\n\t\t\n\t\tfor(int row = 0; row < SAFE_COMBINATIONS.length; row++) {\n\t\t\tfor(int col = 0; col < SAFE_COMBINATIONS[0].length; col++) {\n\t\t\t\tSystem.out.print(SAFE_COMBINATIONS[row][col] + COMMA);\n\t\t\t}\n\t\t\tSystem.out.print(true + NEWLINE);\n\t\t}\n\t\t\n\t\tSystem.out.println(LINE_BREAK);\n\t\t\n\t\tfor(int i = 0; i < 10; i++) {\n\t\t\tprintGeneratedCombination();\n\t\t}\n\t\t\n\t}", "public String printHangman(int bodyParts) {\r\n\t\tStringBuffer stringBuff = new StringBuffer();\r\n\t\tString[][] hangman = {\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \"#\", \"#\", \" \", \" \", \" \", \" \", \" \"},\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \"#\", \"#\", \" \", \" \", \" \", \" \", \" \"},\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \" \", \" \", \" \", \" \", \" \", \" \"},\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \"#\", \"#\", \"#\", \"#\", \" \", \" \", \" \", \" \"},\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \" \", \"#\", \"#\", \"#\", \" \", \"#\", \" \", \" \", \" \"},\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \"#\", \"#\", \" \", \" \", \" \", \" \", \" \"},\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \"#\", \"#\", \" \", \" \", \" \", \" \", \" \"},\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \" \", \"#\", \" \", \" \", \" \", \" \", \" \"},\r\n\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \"#\", \" \", \" \", \" \", \"#\", \"#\", \" \", \" \", \" \"},\r\n\t\t\t\t{\"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\", \"#\"},\r\n\t\t\t\t{\"#\", \"#\", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \"#\"}, \r\n\t\t\t\t{\"#\", \"#\", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"#\", \"#\"}\r\n\t\t};\r\n\t\tswitch (bodyParts) {\r\n\t\tcase 8:\r\n\t\t\tfor (int i = 0; i < hangman.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < hangman[0].length; j++) {\r\n\t\t\t\t\t// out.print( hangman[i][j] );\r\n\t\t\t\t\tstringBuff.append(hangman[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\t// out.println();\r\n\t\t\t\tstringBuff.append(System.lineSeparator());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 7:\r\n\t\t\tfor (int i = 2; i < hangman.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < hangman[0].length; j++) {\r\n\t\t\t\t\tstringBuff.append(hangman[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\tstringBuff.append(System.lineSeparator());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 6:\r\n\t\t\tfor (int i = 3; i < hangman.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < hangman[0].length; j++) {\r\n\t\t\t\t\tstringBuff.append(hangman[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\tstringBuff.append(System.lineSeparator());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 5:\r\n\t\t\tfor (int i = 3; i < hangman.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < hangman[0].length; j++) {\r\n\t\t\t\t\tif ((i == 4 && j == 14) || (i == 4 && j == 20)) {\r\n\t\t\t\t\t\tstringBuff.append(\" \");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstringBuff.append(hangman[i][j]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tstringBuff.append(System.lineSeparator());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 4:\r\n\t\t\tfor (int i = 7; i < hangman.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < hangman[0].length; j++) {\r\n\t\t\t\t\tstringBuff.append(hangman[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\tstringBuff.append(System.lineSeparator());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 3:\r\n\t\t\tfor (int i = 9; i < hangman.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < hangman[0].length; j++) {\r\n\t\t\t\t\tstringBuff.append(hangman[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\tstringBuff.append(System.lineSeparator());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 2:\r\n\t\t\tfor (int i = 10; i < hangman.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < hangman[0].length; j++) {\r\n\t\t\t\t\tstringBuff.append(hangman[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\tstringBuff.append(System.lineSeparator());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 1:\r\n\t\t\tfor (int i = 11; i < hangman.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < hangman[0].length; j++) {\r\n\t\t\t\t\tstringBuff.append(hangman[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\tstringBuff.append(System.lineSeparator());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 0:\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\t\treturn stringBuff.toString();\r\n\r\n\t}", "public static void printGeneratedCombination() {\n\t\t\n\t\tfinal int randomDistance = randomizer(LARGE_DISTANCE * 3);\n\t\tfinal int randomDuration = randomizer(LARGE_DURATION * 3);\n\t\tfinal int randomExhalation = randomizer(LARGE_EXHALATION_LEVEL * 3);\n\t\t\n\t\tfinal boolean isSafe = isInterpolatedSafe(randomDistance, randomDuration, randomExhalation);\n\t\t\n\t\tSystem.out.println(\"(\" + randomDistance + COMMA + randomDuration + COMMA + randomExhalation + COMMA + isSafe + \")\");\n\t\t\n\t}", "public void loanPaymentReceit(List receiptDetails,Component c) {\n \np.resetAll();\n\np.initialize();\n\np.feedBack((byte)2);\n\n//p.color(0);\n//p.chooseFont(1);\np.alignCenter();\np.emphasized(true);\np.underLine(2);\np.newLine();\np.setText(receiptDetails.get(1).toString());\np.newLine();\np.setText(receiptDetails.get(2).toString());\np.newLine();\np.setText(receiptDetails.get(3).toString());\np.newLine();\np.newLine();\n//p.addLineSeperatorX();\np.underLine(0);\np.emphasized(false);\np.underLine(0);\np.alignCenter();\np.setText(\" *** Loan Repayment Receipt ***\");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Batch Number: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(10).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Loan ID: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(11).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\np.setText(\"Customer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\np.newLine(); \np.emphasized(false);\np.setText(\"Loan+Interest: \" +p.underLine(0)+p.underLine(2)+\"UGX\"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\np.newLine();\np.setText(\"Date Taken: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(7).toString()+p.underLine(0));\np.newLine();\np.setText(\"Loan Status: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(14).toString()+p.underLine(0));\np.newLine();\np.setText(\"Payment Date: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(12).toString()+p.underLine(0));\np.newLine();\np.setText(\"Payment Time: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(13).toString()+p.underLine(0));\np.newLine();\n\np.underLine(0);\np.emphasized(false);\n//p.underLine(0);\np.addLineSeperator();\np.newLine();\np.alignCenter();\np.setText(\"***** Payment Details ***** \");\np.newLine();\np.addLineSeperator();\np.newLine();\np.newLine();\np.alignLeft();\np.setText(\"Loan Paid: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(8).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Loan Balance: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(9).toString()+\"/=\"+p.underLine(0));\np.newLine(); \n//p.alignLeft();\n//p.emphasized(true);\n//p.setText(\"Customer Name: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\n//p.newLine(); \n//p.emphasized(false);\np.newLine();\n\np.addLineSeperator();\np.doubleStrik(true);\n\np.underLine(2) ;\np.newLine();\np.setText(\"Officer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(5).toString()+p.underLine(0));\n\np.addLineSeperatorX();\np.newLine();\np.addLineSeperator();\np.newLine();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer Signiture:\");\np.addLineSeperatorX();\n//p.newLine();\n\np.addLineSeperator();\n//p.newLine();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\n//p.newLine();\np.setText(\"Customer Signiture:\");\np.addLineSeperatorX();\n//p.newLine();\n\n//p.addLineSeperator();\np.newLine();\np.setText(\"OFFICE NUMBER: \"+receiptDetails.get(17).toString());\n//p.newLine();\np.feed((byte)3);\np.finit();\n\nprint.feedPrinter(dbq.printDrivers(c),p.finalCommandSet().getBytes());\n \n\n }", "public String outputTemplatePetMail() throws IOException {\n\t\tVelocityEngine ve = new VelocityEngine();\n\t\tve.setProperty(RuntimeConstants.RESOURCE_LOADER, \"classpath\");\n\t\tve.setProperty(\"classpath.resource.loader.class\",\n\t\t\t\tClasspathResourceLoader.class.getName());\n\n\t\tve.init();\n\t\t/* next, get the Template */\n\t\tTemplate t = ve.getTemplate(\"de/velocityTest/petEmail.vm\");\n\t\t/* create a context and add data */\n\t\tArrayList list = new ArrayList();\n\t\tMap map = new HashMap();\n\t\tmap.put(\"name\", \"horse\");\n\t\tmap.put(\"price\", \"00.00\");\n\t\tlist.add(map);\n\n\t\tmap = new HashMap();\n\t\tmap.put(\"name\", \"dog\");\n\t\tmap.put(\"price\", \"9.99\");\n\t\tlist.add(map);\n\t\tmap = new HashMap();\n\t\tmap.put(\"name\", \"bear\");\n\t\tmap.put(\"price\", \".99\");\n\t\tlist.add(map);\n\t\t/* add that list to a VelocityContext */\n\t\tVelocityContext context = new VelocityContext();\n\t\tcontext.put(\"petList\", list);\n\t\t\n\t\tFile file = new File(\"./petMail.txt\");\n\t\tFileWriter out = new FileWriter(file);\n\t\tBufferedWriter w = new BufferedWriter(out);\n\t\tStringWriter writer = new StringWriter();\n\t\tt.merge(context, w);\n\t\tw.flush();\n\t\t/* show the World */\n\t\treturn w.toString();\n\t}", "private void print() {\r\n // Print number of survivors and zombies\r\n System.out.println(\"We have \" + survivors.length + \" survivors trying to make it to safety (\" + childNum\r\n + \" children, \" + teacherNum + \" teachers, \" + soldierNum + \" soldiers)\");\r\n System.out.println(\"But there are \" + zombies.length + \" zombies waiting for them (\" + cInfectedNum\r\n + \" common infected, \" + tankNum + \" tanks)\");\r\n }", "private void showIntro() { \n \n System.out.println(\" \".repeat(32) + \"DIAMOND\");\n System.out.println(\" \".repeat(14) + \"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\");\n System.out.println(\"\\n\\n\");\n \n }", "private void draw (String printable, StringBuffer canvas) {\r\n \t\t\tcanvas.append(\"| \");\r\n \t\t\t\r\n \t\t\tcanvas.append(printable);\r\n \t\t\tfor (int i=printable.length(); i<width-4; i++) //Fill in the spaces.\r\n \t\t\t{\r\n \t\t\t\tcanvas.append(' ');\r\n \t\t\t}\r\n \t\t\tcanvas.append(\" |\\n\");\r\n \t\t}", "public String toString()\n\t{\n\t\tString s = \"\";\n\t\tfor(int i = 0; i < numberOfPoles; i++)\n\t\t\ts += \"[\"+i+\"] \"+poles[i]+\"\\n\";\n\t\treturn s;\n\t}", "public void loanPaymentReceitStamp(List receiptDetails,Component c) {\n \np.resetAll();\n\np.initialize();\n\np.feedBack((byte)2);\n\n//p.color(0);\n//p.chooseFont(1);\np.alignCenter();\np.emphasized(true);\np.underLine(2);\np.newLine();\np.setText(receiptDetails.get(1).toString());\np.newLine();\np.setText(receiptDetails.get(2).toString());\np.newLine();\np.setText(receiptDetails.get(3).toString());\np.newLine();\np.newLine();\n//p.addLineSeperatorX();\np.underLine(0);\np.emphasized(false);\np.underLine(0);\np.alignCenter();\np.setText(\" *** Loan Repayment Receipt ***\");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Batch Number: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(10).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Loan ID: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(11).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\np.setText(\"Customer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\np.newLine(); \np.emphasized(false);\np.setText(\"Loan+Interest: \" +p.underLine(0)+p.underLine(2)+\"UGX\"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\np.newLine();\np.setText(\"Date Taken: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(7).toString()+p.underLine(0));\np.newLine();\np.setText(\"Loan Status: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(14).toString()+p.underLine(0));\np.newLine();\np.setText(\"Payment Date: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(12).toString()+p.underLine(0));\np.newLine();\np.setText(\"Payment Time: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(13).toString()+p.underLine(0));\np.newLine();\n\np.underLine(0);\np.emphasized(false);\n//p.underLine(0);\np.addLineSeperator();\np.newLine();\np.alignCenter();\np.setText(\"***** Payment Details ***** \");\np.newLine();\np.addLineSeperator();\np.newLine();\np.newLine();\np.alignLeft();\np.setText(\"Loan Paid: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(8).toString()+\"/=\"+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Loan Balance: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(9).toString()+\"/=\"+p.underLine(0));\np.newLine(); \n//p.alignLeft();\n//p.emphasized(true);\n//p.setText(\"Customer Name: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\n//p.newLine(); \n//p.emphasized(false);\np.newLine();\n\np.addLineSeperator();\np.doubleStrik(true);\n\np.underLine(2) ;\np.newLine();\np.setText(\"Officer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(5).toString()+p.underLine(0));\n\np.addLineSeperatorX();\np.newLine();\np.addLineSeperator();\np.newLine();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer Signiture:\");\np.addLineSeperatorX();\n//p.newLine();\n\np.addLineSeperator();\n//p.newLine();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.setText(\"Customer Signiture:\");\np.addLineSeperatorX();\n//p.newLine();\n\n//p.addLineSeperator();\n//p.newLine();\n//p.setText(\"OFFICE NUMBER: \"+receiptDetails.get(17).toString());\n//p.newLine();\np.feed((byte)3);\np.finit();\n\nprint.feedPrinter(dbq.printDrivers(c),p.finalCommandSet().getBytes());\n \n\n }", "public String printableString()\r\n {\r\n String answer=\"\";\r\n answer=\"\\n Title:\\t\"+title+\"\\n Author:\\t\"+author+\"\\n Asking Price:\\t\"+askingPrice+\r\n \"\\n Purchased for:\\t\"+purchasePrice+\"\\n Date Acquired:\\t\"+dateAcquired+\"\\n Genre:\\t\"+genre+\"\\n Number on hand:\\t\"+bookCount+\"\\n\";\r\n return answer;\r\n }", "void printout() {\n\t\tprintstatus = idle;\n\t\tanyprinted = false;\n\t\tfor (printoldline = printnewline = 1;;) {\n\t\t\tif (printoldline > oldinfo.maxLine) {\n\t\t\t\tnewconsume();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (printnewline > newinfo.maxLine) {\n\t\t\t\toldconsume();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (newinfo.other[printnewline] < 0) {\n\t\t\t\tif (oldinfo.other[printoldline] < 0)\n\t\t\t\t\tshowchange();\n\t\t\t\telse\n\t\t\t\t\tshowinsert();\n\t\t\t} else if (oldinfo.other[printoldline] < 0)\n\t\t\t\tshowdelete();\n\t\t\telse if (blocklen[printoldline] < 0)\n\t\t\t\tskipold();\n\t\t\telse if (oldinfo.other[printoldline] == printnewline)\n\t\t\t\tshowsame();\n\t\t\telse\n\t\t\t\tshowmove();\n\t\t}\n\t\tif (anyprinted == true)\n\t\t\tprintln(\">>>> End of differences.\");\n\t\telse\n\t\t\tprintln(\">>>> Files are identical.\");\n\t}", "private void print() {\n\t\t// reorganize a wraparound queue and print\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(bq[(head + i) % bq.length] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t}", "public void printPerFloorLine() {\r\n\t\tgetPerFloor();\r\n\t\tgetPerLine();\r\n\t\tprintPerFloor();\r\n\t\tSystem.out.println(\"\");\r\n\t\tprintPerLine();\r\n\t}", "public static void main(String[] args) throws IOException {\n\n int[] h = new int[26];\n\n// String[] hItems = scanner.nextLine().split(\" \");\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n// for (int i = 0; i < 26; i++) {\n// int hItem = Integer.parseInt(hItems[i]);\n// h[i] = hItem;\n// }\n h[0] = 1;\n h[1] = 3;\n h[2] = 1;\n h[3] = 3;\n h[4] = 1;\n h[5] = 4;\n h[6] = 1;\n h[7] = 3;\n h[8] = 2;\n h[9] = 5;\n h[10] = 5;\n h[11] = 5;\n h[12] = 5;\n h[13] = 5;\n h[14] = 5;\n h[15] = 5;\n h[16] = 5;\n h[17] = 5;\n h[18] = 5;\n h[19] = 5;\n h[20] = 5;\n h[21] = 5;\n h[22] = 5;\n h[23] = 5;\n h[24] = 5;\n h[25] = 7;\n\n\n String word = \"zaba\";\n\n int result = designerPdfViewer(h, word);\n\n// bufferedWriter.write(String.valueOf(result));\n// bufferedWriter.newLine();\n//\n// bufferedWriter.close();\n\n// scanner.close();\n }", "public static void main(String[] args) {\n\t\tRandom rndm = new Random();\r\n\t\tchar c1 = (char)(rndm.nextInt(26) + 'a');\r\n\t\tchar c2 = (char)(rndm.nextInt(26) + 'a');\r\n\t\tchar c3 = (char)(rndm.nextInt(26) + 'a');\r\n\t\tchar[] chars = {c1,c2,c3};\r\n\t\tString s = new String(chars);\r\n\t\tint num1 = rndm.nextInt(10);\r\n\t\tint num2 = rndm.nextInt(10);\r\n\t\tint num3 = rndm.nextInt(10);\r\n\t\tint num4 = rndm.nextInt(10);\r\n\t\tString lp = \"Your License Plate Number is \" + s.toUpperCase() + num1 + num2 + num3 + num4;\r\n\t\tSystem.out.println(lp);\r\n\r\n\t}", "public void dump(){\n int address = 0;\n String lastline = new String(\"junk\");\n String nextline;\n boolean star = false, needNewline = false;\n for (int i = 0; i < memory.length; i+=8){\n nextline = buildLine(i);\n if (! lastline.equals(nextline)){\n star = false;\n if (needNewline) System.out.println(); \n System.out.print(Tools.pad(Integer.toHexString(address), 4, \"0\",\n Direction.RIGHT) + \":\\t\");\n System.out.print(nextline); \n needNewline = true;\n } \n\t\t\telse if (lastline.equals(nextline) && (star == false)){\n System.out.println(\" *\");\n needNewline = false;\n star = true;\n } \n address = address + 32;\n lastline = nextline;\n }\n System.out.println();\n }", "public String build() {\n List<String> fishes = new ArrayList<String>();\n int fishTypeCount = random.nextInt(Chars.FISH_TYPES.size()) + 1;\n if (fishTypeCount == Chars.FISH_TYPES.size()) {\n fishes.addAll(Chars.FISH_TYPES);\n } else {\n while (fishes.size() < fishTypeCount) {\n String fishType = random.oneOf(Chars.FISH_TYPES);\n if (!fishes.contains(fishType)) {\n fishes.add(fishType);\n }\n }\n }\n\n // A rare swimmer should show up about once every 8 tweets.\n if (random.nextInt(8) == 5) {\n fishes.add(random.oneOf(Chars.RARE_SWIMMER_TYPES));\n }\n\n // There will be about 8 tweets a day. Something should be special about\n // many of them but not all of them. Only once a week should something\n // exceedingly rare show up. 8 tweets * 7 days = 56 tweets per week\n boolean exceedinglyRareBottomTime = (random.nextInt(56) == 37);\n\n // A rare bottom dweller should show up about once every 8 tweets.\n boolean rareBottomDwellerTime = (random.nextInt(8) == 2);\n\n int maxLineLength = 10;\n List<String> bottom = new ArrayList<String>();\n if (rareBottomDwellerTime) {\n bottom.add(random.oneOf(Chars.RARE_BOTTOM_DWELLERS));\n }\n if (exceedinglyRareBottomTime) {\n bottom.add(random.oneOf(Chars.EXCEEDINGLY_RARE_JUNK));\n }\n int plantCount = midFavoringRandom(maxLineLength - bottom.size() - 1);\n if (plantCount < 1) {\n plantCount = 1;\n }\n for (int i = 0; i < plantCount; i++) {\n bottom.add(random.oneOf(Chars.PLANT_TYPES));\n }\n while (bottom.size() < maxLineLength) {\n bottom.add(Chars.IDEOGRAPHIC_SPACE);\n }\n random.shuffle(bottom);\n String bottomLine = String.join(\"\", bottom);\n\n // For each swimmer line, choose a random number of fish, then random small whitespace\n // in front of some.\n int swimLineCount = 5;\n List<List<String>> swimLines = new ArrayList<List<String>>();\n int previousSwimmerCount = 0;\n for (int s = 0; s < swimLineCount; s++) {\n List<String> swimLine = new ArrayList<String>();\n\n // Lines should tend to have similar swimmer densities. How crowded in general is\n // this aquarium?\n int maxPerLine = random.nextInt((int) Math.round((maxLineLength * 0.6))) + 1;\n int swimmerCount = midFavoringRandom(maxPerLine);\n\n // At least one swimmer on first line so first lines aren't trimmed.\n if (previousSwimmerCount == 0 && swimmerCount == 0) {\n swimmerCount++;\n }\n\n for (int i = 0; i < swimmerCount; i++) {\n swimLine.add(getSmallPersonalSpace() + random.oneOf(fishes));\n }\n while (swimLine.size() < maxLineLength) {\n swimLine.add(Chars.IDEOGRAPHIC_SPACE);\n }\n random.shuffle(swimLine);\n swimLines.add(swimLine);\n previousSwimmerCount = swimmerCount;\n }\n\n StringBuilder stringBuilder = new StringBuilder();\n for (int i = 0; i < swimLines.size(); i++) {\n List<String> swimLine = swimLines.get(i);\n stringBuilder.append(String.join(\"\", swimLine)).append(\"\\n\");\n }\n stringBuilder.append(bottomLine);\n\n return stringBuilder.toString();\n }", "public void printAll() {\n\t\tSystem.out.println(mainPot);\n\t\tcurrentPlayer.printHandAndPocket();\n\t\tcurrentPlayer.printCombos();\n\t\topponentPlayer.printCombos();\n\t\tSystem.out.println();\n\t}", "private void print3(String word, int height) {\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < i; j++) {\n\t\t\t\tta.append(spece);\n\t\t\t}\n\t\t\tfor (int j = height - i; j > 0; j--) {\n\t\t\t\tta.append(word);\n\t\t\t}\n\t\t\tta.append(\"\\r\\n\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tarticle.add(\"the\");\n\t\tarticle.add(\"a\");\n\t\tarticle.add(\"some\");\n\t\tarticle.add(\"one\");\n\t\tnoun.add(\"boy\");\n\t\tnoun.add(\"girl\");\n\t\tnoun.add(\"dog\");\n\t\tnoun.add(\"town\");\n\t\tnoun.add(\"car\");\n\t\tverb.add(\"drove\");\n\t\tverb.add(\"ran\");\n\t\tverb.add(\"jumped\");\n\t\tverb.add(\"walked\");\n\t\tverb.add(\"skipped\");\n\t\tpreposition.add(\"to\");\n\t\tpreposition.add(\"from\");\n\t\tpreposition.add(\"over\");\n\t\tpreposition.add(\"on\");\n\t\tpreposition.add(\"under\");\n\t\tRandom r= new Random();\n\t\tfor(int i=0;i<15;i++)\n\t\t{\n\t\tint n= r.nextInt(4);\n\t\tint n2= r.nextInt(5);\n\t\tint n3= r.nextInt(5);\n\n\t\tint n4= r.nextInt(5);\n\t\tint n5= r.nextInt(4);\n\t\tint n6= r.nextInt(5);\n\n\t\tSystem.out.println(article.get(n)+ \" \"+ noun.get(n2)+\" \"+ verb.get(n3)+\" \"+ preposition.get(n4)+\" \" + article.get(n5)+\" \"+ noun.get(n6)+\".\");\n\t\t}\n\n\t}", "public void realizacjap34() {\n System.out.println(\"REALIZACJA PUNKTU 3\\n\");\n\n System.out.println(\"\\nWyszukiwanie osob po imieniu (Piotr) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzOsobyPoImieniu(Listy.osoby, \"Piotr\").forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po nazwisku (Oleszczuk) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzOsobyPoNazwisku(Listy.osoby, \"Oleszczuk\").forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po stazu pracy mniejszym niz 10============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoStazuPracyMniejszymNiz(Listy.osoby, 10).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po stazu pracy większym niz 10============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoStazuPracyWiekszymNiz(Listy.osoby, 10).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po stazu pracy równym 5============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoStazuPracyRownym(Listy.osoby, 5).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po liczbie nadgodzin mniejszej niz 6 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoNadgodzinachMniejszychNiz(Listy.osoby, 6).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po liczbie nadgodzin wiekszej niz 6 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoNadgodzinachWiekszychNiz(Listy.osoby, 6).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po liczbie nadgodzin równej 6 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoNadgodzinachRownych(Listy.osoby, 6).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po pensji wiekszej niz 15000 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoPensjiWiekszejNiz(Listy.osoby, 15000).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po pensji mniejszej niz 15000 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoPensjiMniejszejNiz(Listy.osoby, 15000).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po pensji rownej 15000 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoPensjiRownej(Listy.osoby, 15000).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po stanowisku (Adiunkt) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoStanowisku(Listy.osoby, \"Adiunkt\").forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie studenta po numerze indeksu (123456) ============================================================================\\n\");\n System.out.println(NarzedziaWyszukiwania.znajdzStudentaPoIndeksie(Listy.osoby, \"123456\"));\n\n System.out.println(\"\\nWyszukiwanie studentów po roku studiów (1) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzStudentowPoRokuStudiow(Listy.osoby, 1).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie studentów po kierunku (Informatyka Stosowana) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzStudentowPoKierunku(Listy.osoby, \"Informatyka Stosowana\").forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie kursu po nazwie (Analiza Matematyczna 1) ============================================================================\\n\");\n System.out.println(NarzedziaWyszukiwania.znajdzKursPoNazwie(Listy.kursy, \"Analiza Matematyczna 1\"));\n\n System.out.println(\"\\nWyszukiwanie kursów po liczbie ects (5) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzKursyPoECTS(Listy.kursy, 5).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie kursów po prowadzacym+\"+Listy.osoby.get(0).getImie()+\" \"+Listy.osoby.get(0).getNazwisko()+\" ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzKursyPoProwadzacym(Listy.kursy, Listy.osoby.get(0)).forEach(System.out::println);\n\n\n //REALIZACJA PUNKTU 4\n System.out.println(\"=====================================================================================================================\");\n System.out.println(\"REALIZACJA PUNKTU 4\");\n System.out.println(\"=====================================================================================================================\\n\");\n System.out.println(\"Kursy:\\n\");\n for (Kurs kurs : Listy.kursy) {\n System.out.println(kurs.toString());\n }\n\n System.out.println(\"\\nOsoby:\\n\");\n for (Osoba osoba : Listy.osoby) {\n System.out.println(\"OSOBA====================================================================================================\");\n System.out.println(osoba.toString());\n System.out.println();\n }\n }", "public void doPrint() {\n printBehavior.printReceipt();\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 tenthProgram() {\n\t\tfor(int i=1;i<=4;i++) {\n\t\t\tfor(int j=1;j<=i-1;j++) {\n\t\t\t\tSystem.out.print(\" \");\t\t\t\n\t\t\t}for(int k=1;k<=4;k++) {\n\t\t\t\tSystem.out.print(\"*\");\t\t\n\t\t\t}System.out.println();\n\t\t}\n\t}", "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 int printLength() { return printLength; }", "public static void giant() {\n System.out.println(\" --------- \");\n System.out.println(\" | / \\\\| \");\n System.out.println(\" ZZZZZH | O | HZZZZZ \");\n System.out.println(\" H ----------- H \");\n System.out.println(\" ZZZZZHHHHHHHHHHHHHHHHHHHHHZZZZZ \");\n System.out.println(\" H HHHHHHHHHHH H \");\n System.out.println(\" ZZZZZH HHHHHHHHHHH HZZZZZ \");\n System.out.println(\" HHHHHHHHHHH \");\n System.out.println(\" HHH HHH \");\n System.out.println(\" HHH HHH \");\n }", "public void loanDisbursementReceitStamp(List receiptDetails,Component c) {\n \np.resetAll();\n\np.initialize();\n\np.feedBack((byte)2);\n\n//p.color(0);\n//p.chooseFont(1);\np.alignCenter();\n//p.emphasized(true);\n//p.underLine(2);\np.setText(receiptDetails.get(1).toString());\np.newLine();\np.setText(receiptDetails.get(2).toString());\np.newLine();\np.setText(receiptDetails.get(3).toString());\np.newLine();\np.newLine();\n//p.addLineSeperatorX();\np.underLine(0);\np.emphasized(false);\np.underLine(0);\np.alignCenter();\np.setText(\" *** Loan Disbursment Receipt ***\");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Batch Number: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(10).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.setText(\"Loan ID: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(11).toString()+p.underLine(0));\np.newLine(); \np.alignLeft();\np.emphasized(true);\np.setText(\"Customer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\np.newLine(); \n//p.emphasized(false);\np.setText(\"Loan+Interest: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(6).toString()+\"/=\"+p.underLine(0));\np.newLine();\np.setText(\"Date Taken: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(7).toString()+p.underLine(0));\np.newLine();\np.setText(\"Loan Status: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(14).toString()+p.underLine(0));\np.newLine();\np.setText(\"Disbursemnt Date: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(12).toString()+p.underLine(0));\np.newLine();\np.setText(\"Disbursement Time: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(13).toString()+p.underLine(0));\np.newLine();\n\np.underLine(0);\np.emphasized(false);\n//p.underLine(0);\np.addLineSeperator();\np.newLine();\np.alignCenter();\np.setText(\"***** Disbursement Details ***** \");\np.newLine();\np.addLineSeperator();\np.newLine();\n\np.alignLeft();\np.setText(\"Loan Disbursed: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(15).toString()+\"/=\"+p.underLine(0));\np.newLine(); \n//p.alignLeft();\n//p.setText(\"Loan Remaining: \" +p.underLine(0)+p.underLine(2)+\"UGX \"+receiptDetails.get(9).toString()+\"/=\"+p.underLine(0));\n//p.newLine(); \n//p.alignLeft();\n//p.emphasized(true);\n//p.setText(\"Customer Name: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(4).toString()+p.underLine(0));\n//p.newLine(); \n//p.emphasized(false);\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer: \" +p.underLine(0)+p.underLine(2)+receiptDetails.get(5).toString()+p.underLine(0));\np.newLine();\np.addLineSeperatorX();\n\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.underLine(2) ;\np.setText(\"Officer Signiture:\");\np.addLineSeperatorX();\n//p.newLine();\np.addLineSeperator();\np.doubleStrik(true);\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.newLine();\np.underLine(2) ;\np.setText(\"Customer Signiture:\");\np.addLineSeperatorX();\n//p.newLine();\n//p.setText(\"OFFICE NUMBER: \"+receiptDetails.get(17).toString());\n//p.addLineSeperatorX();\n//p.newLine();\np.feed((byte)3);\np.finit();\n\nprint.feedPrinter(dbq.printDrivers(c),p.finalCommandSet().getBytes());\n \n }", "static void printTheSpecifiedMap(MapLM mapToPrint){\n List<List<List<Ansi>>> mapAnsi = mapLMToAnsi(mapToPrint.getMap());\n for(int mapRow = 0; mapRow < GeneralInfo.ROWS_MAP; mapRow++){\n /*mapAnsi.get(mapRow).get(0) is the first square of the current mapRow,\n assuming the other squares on the same mapRow have the same\n number of rows (in other words, the same .size())\n */\n for(int squareRow=0; squareRow < mapAnsi.get(mapRow).get(0).size() ; squareRow++){\n //for each square on the specified mapRow(mapRow is a list of squares)\n for(List<Ansi> square: mapAnsi.get(mapRow)){\n AnsiConsole.out.print(square.get(squareRow));\n /*after the last character of the second line of the last square of\n each row of the map, print the corresponding vertical coordinate\n */\n if((/*last square of the foreach*/ square.equals(mapAnsi.get(mapRow).get(mapAnsi.get(mapRow).size()-1)))\n && squareRow == 1){\n //print vertical coordinate coordinate\n System.out.print(\" \" + verticalCoordinateForUser(mapRow));\n }\n }\n /*after printing the whole specified line of the map (the specified line of all\n the squares on the specified row of squares of the map), start a new line\n */\n System.out.print(\"\\n\");\n }\n }\n //print horizontal coordinates\n System.out.print(\"\\n\");\n for(int i=0; i < GeneralInfo.COLUMNS_MAP; i++){\n System.out.print(\" \" + horizontalCoordinateForUser(i) + \" \");\n }\n }", "public static void main(String argv[]) {\n\n\tRandomIntGenerator rand = new RandomIntGenerator(5,10);\n\tRandomIntGenerator rand2 = new RandomIntGenerator(10,15);\n\tRandomIntGenerator rand3 = new RandomIntGenerator(1,2);\n\n\tint vertices = rand.nextInt();\n\tSystem.out.println(\"vertices=\"+vertices);\n\t\n\tRandomIntGenerator rand4 = new RandomIntGenerator(0,vertices-1);\n\n\tTrAnchor[] vertex = new TrAnchor[vertices];\n\tfor (int i=0;i<vertices;i++) {\n\t int t=rand3.nextInt();\n\t if (t==1) {\n\t\tvertex[i] = new Statename(\"S\"+i);\n\t } else if (t==2) {\n\t\tvertex[i] = new Conname(\"C\"+i);\n\t } else {\n\t\tvertex[i] = new UNDEFINED();\n\t }\n\t}\n\n\tint edges = rand2.nextInt();\n\tSystem.out.println(\"edges=\"+edges);\n\t\n\tTr[] transition = new Tr[edges];\n\tfor (int i=0;i<edges;i++) {\n\t int si = rand4.nextInt();\n\t int ti = rand4.nextInt();\n\t \n\t TrAnchor source = vertex[si];\n\t TrAnchor target = vertex[ti];\n\t transition[i] = new Tr(source,target,null);\n\t}\n\t \n\tSystem.out.println();\n\tSystem.out.println(\"Ausgabe:\");\n\n\tfor (int i=0;i<edges;i++) \n\t new PrettyPrint().start(transition[i]);\n\t\n\ttesc2.ProperMap properMap = new tesc2.ProperMap(vertex,transition);\n\n\tfor (int i=0;i<properMap.getHeight();i++) {\n\t System.out.print(properMap.getWidthOfRow(i));\n\t \n\t for (int j=0;j<properMap.getWidthOfRow(i);j++) {\n\t\tSystem.out.print(properMap.getElement(i,j)+\" \");\n\t }\n\t System.out.println();\n\t}\n\n\ttesc2.MapTransition[] mt = properMap.getMapTransitions();\n\tfor (int i=0;i<mt.length;i++)\n\t System.out.println(mt[i]);\n\n }", "public void description() throws Exception {\n PrintWriter pw = new PrintWriter(System.getProperty(\"user.dir\")+ \"/resources/merged_file.txt\"); \n \n // BufferedReader for obtaining the description files of the ontology & ODP\n BufferedReader br1 = new BufferedReader(new FileReader(System.getProperty(\"user.dir\")+ \"/resources/ontology_description\")); \n BufferedReader br2 = new BufferedReader(new FileReader(System.getProperty(\"user.dir\")+ \"/resources/odps_description.txt\")); \n String line1 = br1.readLine(); \n String line2 = br2.readLine(); \n \n // loop is used to copy the lines of file 1 to the other \n if(line1==null){\n\t \tpw.print(\"\\n\");\n\t }\n while (line1 != null || line2 !=null) \n { \n if(line1 != null) \n { \n pw.println(line1); \n line1 = br1.readLine(); \n } \n \n if(line2 != null) \n { \n pw.println(line2); \n line2 = br2.readLine(); \n } \n } \n pw.flush(); \n // closing the resources \n br1.close(); \n br2.close(); \n pw.close(); \n \n // System.out.println(\"Merged\"); -> for checking the code execution\n /* On obtaining the merged file, Doc2Vec model is implemented so that vectors are\n * obtained. And the, similarity ratio of the ontology description with the ODPs \n * can be found using cosine similarity \n */\n \tFile file = new File(System.getProperty(\"user.dir\")+ \"/resources/merged_file.txt\"); \t\n SentenceIterator iter = new BasicLineIterator(file);\n AbstractCache<VocabWord> cache = new AbstractCache<VocabWord>();\n TokenizerFactory t = new DefaultTokenizerFactory();\n t.setTokenPreProcessor(new CommonPreprocessor()); \n LabelsSource source = new LabelsSource(\"Line_\");\n ParagraphVectors vec = new ParagraphVectors.Builder()\n \t\t.minWordFrequency(1)\n \t .labelsSource(source)\n \t .layerSize(100)\n \t .windowSize(5)\n \t .iterate(iter)\n \t .allowParallelTokenization(false)\n .workers(1)\n .seed(1)\n .tokenizerFactory(t) \n .build();\n vec.fit();\n \n //System.out.println(\"Check the file\");->for execution of code\n PrintStream p=new PrintStream(new File(System.getProperty(\"user.dir\")+ \"/resources/description_values\")); //storing the numeric values\n \n \n Similarity s=new Similarity(); //method that checks the cosine similarity\n s.similarityCheck(p,vec);\n \n \n }", "public String getLastPoemLine(PoetAndTheme object){\n boolean lastCharDot = false;\n String lastVerseLine = \"\";\n while(!lastCharDot){\n lastVerseLine = object.getRandomVerseLine();\n if(lastVerseLine.substring(lastVerseLine.length() - 1).equals(\".\") ||\n lastVerseLine.substring(lastVerseLine.length() - 1).equals(\"!\")||\n lastVerseLine.substring(lastVerseLine.length() - 1).equals(\"?\")){\n lastCharDot = true;\n }\n }\n return lastVerseLine;\n }", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println( Prob04.leftPad(\"SDS\", 6, '#') );\n\t\tSystem.out.println( Prob04.leftPad(\"SDS\", 5, '$') );\n\t\tSystem.out.println( Prob04.leftPad(\"SDS\", 2, '&') ); \n\t\t//\n\t\tSystem.out.println( Prob04.leftPad2(\"SDS\", 6, '#') );\n\t\tSystem.out.println( Prob04.leftPad2(\"SDS\", 5, '$') );\n\t\tSystem.out.println( Prob04.leftPad2(\"SDS\", 2, '&') );\n\t\t//\n\t\tProb04 prob = new Prob04();\n\t\tSystem.out.println( prob.rightPad2(\"SDS\", 6, '#') );\n\t\tSystem.out.println( prob.rightPad2(\"SDS\", 5, '$') );\n\t\tSystem.out.println( prob.rightPad2(\"SDS\", 2, '&') );\n\t\t//\n\t}", "private void generateTreasureDesc() {\n description += \" Treasure: \" + treasure.getDescription() + \" Container: \" + treasure.getContainer();\n try {\n description += \" Protection: \" + treasure.getProtection();\n } catch (NotProtectedException ex) {\n\n }\n }", "public static void main(String[] args) {\n System.out.println(\"\\n\\n\"+EXPL+\"\\n\\n\");\n String[] voci = {AGAIN};\n MyMenuCorretto menuConsole = new MyMenuCorretto(voci);\n boolean exit = false;\n \n do\n {\n \n System.out.println(\"\\n\"+Point.STP+\"\\n\");\n Point StP = new Point(Point.consoleInputAbscissa(),Point.consoleInputOrdinate());\n System.out.println(\"\\n\\n\"+StP.toString()+\"\\n\\n\");\n \n System.out.println(\"\\n\"+Point.NDP+\"\\n\");\n Point NdP = new Point(Point.consoleInputAbscissa(),Point.consoleInputOrdinate());\n System.out.println(\"\\n\\n\"+NdP.toString()+\"\\n\\n\");\n \n System.out.println(\"\\n\"+StP.stringDistance(NdP)+\"\\n\\n\");\n \n if( !(StP.getAbscissa()==NdP.getAbscissa()&&StP.getOrdinate()==NdP.getOrdinate()) )\n {\n \n System.out.println(Line.LINE);\n Line StL = new Line(StP,NdP);\n System.out.println(\"\\n\\n\"+StL.toString()+\"\\n\\n\");\n System.out.println(\"\\n\\n\");\n \n System.out.println(\"\\n\"+Point.RDP+\"\\n\");\n Point RdP = new Point(Point.consoleInputAbscissa(),Point.consoleInputOrdinate());\n System.out.println(\"\\n\\n\"+RdP.toString()+\"\\n\\n\");\n \n System.out.println(\"\\n\\n\"+StL.stringHasPoint(RdP)+\"\\n\\n\");\n \n }\n else\n {\n System.out.println(\"\\n\\n\"+Line.COINCIDENT_POINTS+\"\\n\\n\");\n }\n \n System.out.println(\"\\n\\n\");\n int scelta = menuConsole.scegliSenzaTitolo();\n if (scelta==0)\n {\n exit=true;\n }\n else exit=false;\n \n }\n while(exit==false);\n System.out.println(\"\\n\\n\"+END+\"\\n\\n\");\n }", "public String toString() {\n\t\treturn \"MAVLINK_MSG_ID_PROPELLER -\" + \" propeller1:\" + propeller1\n\t\t\t\t+ \" propeller2:\" + propeller2 + \" propeller3:\" + propeller3\n\t\t\t\t+ \" propeller4:\" + propeller4 + \"\";\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}", "@Override\n public void print(int n) {\n for (int i = 0; i < n; i++) {\n System.out.print(' ');\n }\n System.out.print(\" #{Built-in Procedure \");\n symbol.print(0);\n for (int i = 0; i < n; i++) {\n System.out.print(' ');\n }\n System.out.print('}');\n System.out.println();\n }", "private void printOut(String[] printerMakerResult)\n {\n //shows user the printerMaker result\n\n for(int i=0;i<printerMakerResult.length;i++)\n {\n outVideo.println(printerMakerResult[i]);\n outVideo.flush();\n }\n }", "private static void printTerrainInfo(ParkerPaulTerrain taxable, int count) {\r\n System.out.printf(\"%1$-25s%2$17.2f%3$10.2f%4$13.3f%5$8d%6$10.2f%n\", count + \" \" + taxable.getDescription(), taxable.getArea(), taxable.getUnitPrice(), taxable.getAgroFraction(), taxable.getNumberOfTrees(), taxable.getTax());\r\n }", "public static void main(String[] args) {\n StringBuilder sb = new StringBuilder();\n sb.append(1);\n sb.append(\"00\");\n sb.append(\"%\");\n sb.append(' ');\n sb.append('P');\n \n String createdString = sb.toString();\n System.out.println(\"createdString = \" + createdString);\n\n }", "public static void main(String[] args) {\r\n // feed the generator a fixed random value for repeatable behavior\r\n MarkovTextGeneratorLoL gen = new MarkovTextGeneratorLoL(new Random(42));\r\n //String textString = \"hi there hi Leo\";\r\n //String textString = \"\";\r\n \r\n String textString = \"Hello. Hello there. This is a test. Hello there. Hello Bob. Test again.\";\r\n System.out.println(textString);\r\n gen.train(textString);\r\n System.out.println(gen);\r\n System.out.println(\"Generator: \" + gen.generateText(0));\r\n String textString2 = \"You say yes, I say no, \" +\r\n \"You say stop, and I say go, go, go, \" +\r\n \"Oh no. You say goodbye and I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello. \" +\r\n \"I say high, you say low, \" +\r\n \"You say why, and I say I don't know. \" +\r\n \"Oh no. \" +\r\n \"You say goodbye and I say hello, hello, hello. \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello. \" +\r\n \"Why, why, why, why, why, why, \" +\r\n \"Do you say goodbye. \" +\r\n \"Oh no. \" +\r\n \"You say goodbye and I say hello, hello, hello. \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello. \" +\r\n \"You say yes, I say no, \" +\r\n \"You say stop and I say go, go, go. \" +\r\n \"Oh, oh no. \" +\r\n \"You say goodbye and I say hello, hello, hello. \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello,\";\r\n System.out.println(textString2);\r\n gen.retrain(textString2);\r\n System.out.println(gen);\r\n System.out.println(gen.generateText(20));\r\n }", "public static void WriteInputGallerySpecification(GalleryProblem galleryProblem) {\n \n try {\n String fileName = \"tempGallery.txt\";\n FileWriter fileWriter = new FileWriter(fileName);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n \n Gallery gallery = galleryProblem.getGallery();\n Polygon outerPolygon = gallery.getOuterPolygon();\n List<Vertex> verticesOuterPolygon = outerPolygon.getVertices();\n List<Polygon> innerPolygons = gallery.getInnerPolygons();\n //bufferedWriter.write(numOfGuards);\n //bufferedWriter.newLine();\n \n // line 1\n numOfVertices = verticesOuterPolygon.size();\n numOfHoles = innerPolygons.size();\n numOfExits = gallery.getExits();\n numOfArts = gallery.getArtPieces();\n \n bufferedWriter.write(numOfVertices + \", \" + numOfHoles + \", \" + numOfExits + \", \" + numOfArts + \", \");\n //bufferedWriter.write(numOfVertices + \", \" + numOfHoles + \", \" + numOfExits + \", \" + numOfArts);\n bufferedWriter.newLine();\n \n for (Polygon innerPolygon : innerPolygons ) {\n List<Vertex> verticesHole = innerPolygon.getVertices();\n bufferedWriter.write(verticesHole.size() + \", \");\n }\n \n bufferedWriter.newLine();\n \n //g, vmax, T, deltaT\n numOfGuards = galleryProblem.getGuards();\n vmaxGuards = galleryProblem.getSpeed();\n globalTime = galleryProblem.getGlobalTime();\n deltaT = galleryProblem.getObservationTime();\n \n bufferedWriter.write(numOfGuards + \", \" + vmaxGuards + \", \" + globalTime + \", \" + deltaT + \", \");\n //bufferedWriter.write(numOfGuards + \", \" + vmaxGuards + \", \" + globalTime + \", \" + deltaT);\n bufferedWriter.newLine();\n \n for (Vertex vertexOuterPolygon : verticesOuterPolygon) {\n x = vertexOuterPolygon.getX();\n y = vertexOuterPolygon.getY();\n artFlag = vertexOuterPolygon.getArtFlag();\n exitFlag = vertexOuterPolygon.getExitFlag();\n bufferedWriter.write(x + \", \" + y + \", \" + artFlag + \", \" + exitFlag + \", \");\n //bufferedWriter.write(x + \", \" + y + \", \" + artFlag + \", \" + exitFlag);\n bufferedWriter.newLine();\n }\n \n for (Polygon innerPolygon : innerPolygons) {\n List<Vertex> verticesHole = innerPolygon.getVertices();\n for (Vertex verticeHole : verticesHole) {\n x = verticeHole.getX();\n y = verticeHole.getY();\n artFlag = verticeHole.getArtFlag();\n bufferedWriter.write(x + \", \" + y + \", \" + artFlag + \", \");\n //bufferedWriter.write(x + \", \" + y + \", \" + artFlag);\n bufferedWriter.newLine();\n }\n }\n \n bufferedWriter.close();\n }\n catch(IOException ex) {\n ex.printStackTrace();\n }\n }", "@Override\n\tpublic void printLotteryNo() {\n\t\tint[] prefixNums = generateNumber(35, 5);\n\t\tint[] suffixNums = generateNumber(12, 2);\n\t\tSystem.out.println(\"本期大乐透前区号码是:\" + printNums(prefixNums));\n\t\tSystem.out.println(\"本期大乐透后区号码是:\" + printNums(suffixNums));\n\t}", "private String showText() {\n\t\tString text = \"\";\n\t\ttry {\n\t\t\tString line1 = \"\";\n\t\t\tString line2 = \"\";\n\t\t\tString line3 = \"\";\n\t\t\tfor (LakeTile lake_tile : removed_laketile) {\n\t\t\t\tint i = removed_laketile.indexOf(lake_tile);\n\t\t\t\tPosition pos = removed_position.get(i);\n\t\t\t\tQueue<Color> color_queue = lake_tile.getColorOfFourSides();\n\t\t\t\tArrayList<Color> color_list = new ArrayList<Color>(color_queue);\n\n\t\t\t\tline1 += String.format(\"%12s\", \"\");\n\t\t\t\tline1 += Color.getColorText(color_list.get(0), \" \");\n\n\t\t\t\tline1 += String.format(\"%4s\", \"\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tline2 += String.format(\"%2s\", lake_tile.getIndex());\n\t\t\t\tline2 += \":\";\n\t\t\t\tline2 += String.format(\"%-7s\",\"(\" + pos.getX() + \",\" + pos.getY() + \")\");\n\t\t\t\tline2 += Color.getColorText(color_list.get(3), \" \");\n\t\t\t\tline2 += \" \";\n\t\t\t\tif (lake_tile.isPlatform()) {\n\t\t\t\t\tline2 += \"O\";\n\t\t\t\t} else {\n\t\t\t\t\tline2 += \"X\";\n\t\t\t\t}\n\t\t\t\tline2 += \" \" + Color.getColorText(color_list.get(1), \" \") + \" \";\n\n\t\t\t\tline3 += String.format(\"%12s\", \"\");\n\t\t\t\tline3 += Color.getColorText(color_list.get(2), \" \");\n\t\t\t\tline3 += String.format(\"%4s\", \"\");\n\n\t\t\t}\n\t\t\ttext += line1 + \"\\n\";\n\t\t\ttext += line2 + \"\\n\";\n\t\t\ttext += line3 + \"\\n\";\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\ttext = \"No Data\";\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn text;\n\n\t}" ]
[ "0.5891402", "0.56924474", "0.565544", "0.56343853", "0.56315976", "0.55876356", "0.5423861", "0.5414381", "0.52296215", "0.5147898", "0.511276", "0.510926", "0.51079994", "0.5107107", "0.5043014", "0.5034918", "0.5017594", "0.5005708", "0.5004873", "0.4988595", "0.49661735", "0.49613515", "0.49497083", "0.49104497", "0.49085096", "0.49075207", "0.49061623", "0.4886784", "0.4882846", "0.48798743", "0.48665884", "0.48460197", "0.4845058", "0.48393473", "0.48341572", "0.48304176", "0.4820214", "0.48179978", "0.48129722", "0.4806719", "0.4805423", "0.48012742", "0.48003584", "0.4799896", "0.4796072", "0.4794834", "0.4793916", "0.47929412", "0.47900158", "0.47879693", "0.4781661", "0.4777417", "0.4775089", "0.47720695", "0.4771822", "0.47706792", "0.47658512", "0.47572857", "0.47522473", "0.4751446", "0.47466782", "0.47423807", "0.47352463", "0.4729998", "0.47243908", "0.4718949", "0.4716379", "0.47109002", "0.4708996", "0.47086692", "0.47078905", "0.47055256", "0.47014406", "0.470086", "0.46941364", "0.46935424", "0.4693066", "0.4690977", "0.46857643", "0.4681947", "0.46786314", "0.4674093", "0.46739435", "0.4668519", "0.4667619", "0.46667773", "0.46635497", "0.46594766", "0.46581343", "0.46571472", "0.4653977", "0.4653599", "0.46528196", "0.46497762", "0.46494755", "0.46490592", "0.46478882", "0.46438956", "0.4642835", "0.46424785" ]
0.60302997
0
Reformats user input to match the name of desired PoetAndTheme object (for purpose of fetching the correct PoetAndTheme object.)
public String userInputToPoet(String poet, String theme) throws IncorrectInput{ String returnable = ""; if(poet.equals("Whitman")){ if(theme.equals("Love")){ returnable = "love Whitman"; }else{ returnable = "death Whitman"; } }else if(poet.equals("Shakespeare")){ if(theme.equals("Love")){ returnable = "love Shakespeare"; }else{ returnable = "death Shakespeare"; } }else if(poet.equals("Keats")){ if(theme.equals("Love")){ returnable = "love Keats"; }else{ returnable = "death Keats"; } }else if(poet.equals("Dickinson")){ if(theme.equals("Love")){ returnable = "love Dickinson"; }else{ returnable = "death Dickinson"; } }else{ IncorrectInput e = new IncorrectInput(); throw e; } return returnable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void askPoets(){\n System.out.println(\"Walt Whitman William Shakespeare John Keats Emily Dickinson\");\n System.out.println(\"Pick a poet and press enter: \");\n\n String poet1_input = scanner.nextLine();\n if (poet1_input.toLowerCase().contains(\"whitman\") || poet1_input.toLowerCase().contains(\"withman\")){\n poet1 = \"Whitman\";\n }else if (poet1_input.toLowerCase().contains(\"shakespeare\") || poet1_input.toLowerCase().contains(\"shakespear\")){\n poet1 = \"Shakespeare\";\n }else if (poet1_input.toLowerCase().contains(\"keats\")){\n poet1 = \"Keats\";\n }else if (poet1_input.toLowerCase().contains(\"dickinson\") || poet1_input.toLowerCase().contains(\"dikcinson\")){\n poet1 = \"Dickinson\";\n }\n\n System.out.println(\"Pick another poet: \");\n String poet2_input = scanner.nextLine();\n if (poet2_input.toLowerCase().contains(\"whitman\") || poet2_input.toLowerCase().contains(\"withman\")){\n poet2 = \"Whitman\";\n }else if (poet2_input.toLowerCase().contains(\"shakespeare\") || poet2_input.toLowerCase().contains(\"shakespear\")){\n poet2 = \"Shakespeare\";\n }else if (poet2_input.toLowerCase().contains(\"keats\")){\n poet2 = \"Keats\";\n }else if (poet2_input.toLowerCase().contains(\"dickinson\") || poet2_input.toLowerCase().contains(\"dikcinson\")){\n poet2 = \"Dickinson\";\n }\n System.out.println();\n\n System.out.println(\"Choose a theme [Love / Death]: \");\n String theme_input = scanner.nextLine();\n if(theme_input.toLowerCase().contains(\"love\")){\n theme = \"Love\";\n }else if(theme_input.toLowerCase().contains(\"death\")){\n theme = \"Death\";\n }\n System.out.println(\"\\n(\" + poet1 + \" + \" + poet2 + \") * \" + theme + \". Coming right up! [Press Enter]\" );\n String ignore = scanner.nextLine();\n }", "public void parseInput(Map gameMap, Player player) {\n String[] splitInput = playerInput.split(\" \", 0); // Splits the input into an action and an object.\n String action; // Stores the action that the user input\n String predic; // Stores the predicate of the input\n String object; // Stores the object to do action on of the input\n String object2; // Stores extra words from the input\n String ANSI_RED = \"\\u001B[31m\"; // Red text color\n String ANSI_BLUE = \"\\u001B[34m\"; // Blue text color\n prevInputs.add(splitInput);\n\n // Parses single word inputs\n // Stores the action of the input\n if (splitInput.length == 1) {\n action = splitInput[0];\n switch (action.toLowerCase()) {\n case \"cheat\":\n System.out.println(player.getHint());\n break;\n case \"superbrief\":\n System.out.println(\"Dialogue length set to superbrief.\");\n player.changeDialogueState(\"superbrief\");\n break;\n case \"brief\":\n System.out.println(\"Dialogue length set to brief.\");\n player.changeDialogueState(\"brief\");\n break;\n case \"verbose\":\n System.out.println(\"Dialogue length set to verbose.\");\n player.changeDialogueState(\"verbose\");\n break;\n case \"autoplay\":\n case \"auto\":\n System.out.println(\"Turning on autoplay.\");\n player.changeDialogueState(\"autoplay\");\n break;\n case \"again\":\n case \"g\":\n prevInputs.remove(splitInput);\n playerInput = \"\";\n for (int i = 0; i < prevInputs.get(prevInputs.size() - 1).length; i++) {\n playerInput = playerInput.concat(prevInputs.get(prevInputs.size() - 1)[i]);\n playerInput = playerInput.concat(\" \");\n }\n parseInput(gameMap, player);\n return;\n case \"i\":\n case \"inventory\":\n case \"inv\":\n player.getInventory();\n break;\n case \"look\":\n case \"l\":\n player.checkArea();\n player.incrementTurn();\n break;\n case \"equipment\":\n player.getEquipment();\n break;\n case \"diagnose\":\n player.diagnose();\n player.incrementTurn();\n break;\n case \"hi\":\n case \"hello\":\n System.out.println(\"You said 'Hello'\");\n player.incrementTurn();\n break;\n case \"jump\":\n System.out.println(\"For whatever reason, you jumped in place.\");\n player.incrementTurn();\n break;\n case \"walk\":\n System.out.println(\"You walked around the area but you've already seen everything.\");\n player.incrementTurn();\n break;\n case \"save\":\n System.out.println(\"Saving Game...\");\n try {\n TimeUnit.SECONDS.sleep(1);\n }\n catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n player.save();\n break;\n case \"restore\":\n System.out.println(\"Loading Game...\");\n try {\n TimeUnit.SECONDS.sleep(1);\n }\n catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n player.load(gameMap);\n player.checkArea();\n break;\n case \"restart\":\n player.setHealth(0);\n break;\n case \"status\":\n player.getStatus();\n break;\n case \"score\":\n System.out.println(\"SCORE: \" + player.getScore());\n break;\n case \"quit\":\n case \"q\":\n System.out.print(\"Thank you for playing!\");\n System.exit(0);\n case \"wait\":\n case \"z\":\n case \"stay\":\n System.out.println(\"You stood in place.\");\n player.incrementTurn();\n break;\n case \"north\":\n case \"south\":\n case \"east\":\n case \"west\":\n case \"northeast\":\n case \"northwest\":\n case \"southeast\":\n case \"southwest\":\n case \"n\":\n case \"s\":\n case \"e\":\n case \"w\":\n case \"ne\":\n case \"nw\":\n case \"se\":\n case \"sw\":\n if (player.getLocation().getConnectedRoom(action.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(action.toLowerCase()));\n player.incrementTurn();\n break;\n case \"version\":\n System.out.println(\"Version: \" + VERSION);\n return;\n default:\n System.out.println(\"Invalid Command\");\n return;\n }\n }\n\n // Parses two word inputs\n if (splitInput.length == 2) {\n action = splitInput[0]; // Stores the action that the user inputs\n object = splitInput[1]; // Stores the object that the user inputs\n switch (action.toLowerCase()) {\n case \"attack\":\n if (player.getLocation().isCharaInRoom(object.toUpperCase())) {\n player.attack(player.getLocation().getChara(object.toUpperCase()));\n }\n else {\n System.out.println(\"There is no \" + ANSI_RED + object.toLowerCase() + ANSI_RESET + \" here.\");\n }\n player.incrementTurn();\n break;\n case \"go\":\n if (player.getLocation().getConnectedRoom(object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(object.toLowerCase()));\n else\n System.out.println(\"There is nothing in that direction.\");\n player.incrementTurn();\n break;\n case \"enter\":\n case \"exit\":\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()));\n player.incrementTurn();\n break;\n case \"break\":\n if (player.getLocation().getConnectedRoom(object.toLowerCase()) != null) {\n if (player.getLocation().getConnectedRoom(object.toLowerCase()).getLocked()) {\n player.getLocation().getConnectedRoom(object.toLowerCase()).unlock();\n System.out.println(\"You broke down the door.\");\n } else\n System.out.println(\"There is nothing to break down.\");\n }\n else\n System.out.println(\"There is nothing to break down.\");\n player.incrementTurn();\n break;\n case \"equip\":\n player.equipFromInv(object.toUpperCase());\n player.incrementTurn();\n break;\n case \"unequip\":\n player.equipToInv(object.toUpperCase());\n player.incrementTurn();\n break;\n case \"examine\":\n if (player.inInventory(object.toUpperCase()))\n player.examineInv(player.getItem(object.toUpperCase()));\n else if (player.inEquip(object.toUpperCase()))\n player.examineInv(player.getEquip(object.toUpperCase()));\n else\n System.out.println(\"You do not have: \" + ANSI_BLUE + object.toUpperCase() + ANSI_RESET);\n break;\n case \"read\":\n if (player.inInventory(object.toUpperCase()))\n player.examineInv(player.getItem(object.toUpperCase()));\n else\n System.out.println(\"You do not have: \" + ANSI_BLUE + object.toUpperCase() + ANSI_RESET);\n break;\n case \"get\":\n case \"take\":\n if (player.getLocation().isObjInRoom(object.toUpperCase())) {\n ZorkObj zorkObj = player.getLocation().getObj(object.toUpperCase());\n if (player.checkWeight(zorkObj))\n player.addItemToInventory(zorkObj);\n else {\n System.out.println(ANSI_BLUE + zorkObj.getName() + ANSI_RESET + \" is too heavy to pick up.\");\n player.getLocation().addObject(zorkObj);\n }\n }\n else if (object.toLowerCase().equals(\"all\")) {\n int objectsInRoom = player.getLocation().getObjLength();\n\n if (objectsInRoom == 0)\n System.out.println(\"There are no items in this room.\");\n\n for (int i = 0; i < objectsInRoom; i++) {\n ZorkObj zorkObj = player.getLocation().getObj();\n if (player.checkWeight(zorkObj) && player.checkInvSize()){\n player.addItemToInventory(zorkObj);\n }\n else if (!player.checkInvSize()) {\n System.out.println(\"Your inventory is too full.\");\n player.getLocation().addObject(zorkObj);\n }\n else {\n System.out.println(ANSI_BLUE + zorkObj.getName() + ANSI_RESET + \" is too heavy to pick up.\");\n player.getLocation().addObject(zorkObj);\n }\n }\n }\n else\n System.out.println(\"There is no item named \" + ANSI_BLUE + object + ANSI_RESET + \" in this area.\");\n player.incrementTurn();\n break;\n case \"drop\":\n player.removeItemFromChara(object.toUpperCase());\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command\");\n return;\n }\n }\n\n else if (splitInput.length == 3) {\n action = splitInput[0]; // Stores the action that the user inputs\n predic = splitInput[1]; // Stores the predicate of the input\n object = splitInput[2]; // Stores the object that the user inputs\n switch (action.toLowerCase()) {\n case \"attack\":\n if (player.getLocation().isCharaInRoom((predic + \" \" + object).toUpperCase())) {\n player.attack(player.getLocation().getChara((predic + \" \" + object).toUpperCase()));\n }\n else {\n System.out.println(\"There is no \" + ANSI_RED + (predic + \" \" + object).toLowerCase() + ANSI_RESET + \" here.\");\n }\n player.incrementTurn();\n break;\n case \"go\":\n switch (predic.toLowerCase()) {\n case \"down\":\n case \"up\":\n case \"in\":\n case \"out\":\n if (player.getLocation().getConnectedRoom(predic.toLowerCase(), object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(predic.toLowerCase(), object.toLowerCase()));\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command.\");\n break;\n }\n break;\n case \"look\":\n switch (predic.toLowerCase()) {\n case \"inside\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getInsideDesc());\n else if(player.getLocation().isCharaInRoom((object).toUpperCase()))\n System.out.println(player.getLocation().getChara((object).toUpperCase()).getInsideDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"under\":\n case \"below\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getUnderDesc());\n else if(player.getLocation().isCharaInRoom((object).toUpperCase()))\n System.out.println(player.getLocation().getChara((object).toUpperCase()).getUnderDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"behind\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getBehindDesc());\n else if(player.getLocation().isCharaInRoom((object).toUpperCase()))\n System.out.println(player.getLocation().getChara((object).toUpperCase()).getBehindDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"through\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getThroughDesc());\n else if(player.getLocation().isCharaInRoom((object).toUpperCase()))\n System.out.println(player.getLocation().getChara((object).toUpperCase()).getThroughDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"at\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getDescription());\n else if (player.getLocation().isCharaInRoom(object.toUpperCase()))\n player.examineChara(player.getLocation().getChara(object.toUpperCase()));\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command.\");\n return;\n }\n break;\n case \"talk\":\n case \"speak\":\n if (\"to\".equals(predic)) {\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getDialogue());\n else if (player.getLocation().isCharaInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getChara(object.toUpperCase()).getDialogue());\n else\n System.out.println(\"There is nothing to talk to.\");\n player.incrementTurn();\n } else {\n System.out.println(\"Invalid Command.\");\n }\n break;\n case \"in\":\n case \"enter\":\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()));\n else\n System.out.println(\"There is nothing to enter.\");\n player.incrementTurn();\n break;\n case \"out\":\n case \"exit\":\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()));\n else\n System.out.println(\"There is nothing to exit.\");\n player.incrementTurn();\n break;\n case \"get\":\n case \"take\":\n if (predic.toLowerCase().equals(\"off\")) {\n player.equipToInv(object.toUpperCase());\n player.incrementTurn();\n break;\n }\n else if (player.getLocation().getObj((predic + object).toUpperCase()) != null) {\n player.addItemToInventory(player.getLocation().getObj((predic + object).toUpperCase()));\n System.out.println(\"You have picked up: \" + predic + \" \" + object);\n }\n else\n System.out.println(\"There is no item named \" + predic + \" \" + object + \" in this area.\");\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command\");\n return;\n }\n }\n\n else if (splitInput.length == 4) {\n action = splitInput[0]; // Stores the action that the user inputs\n predic = splitInput[1]; // Stores the predicate of the input\n object = splitInput[2]; // Stores the object that the user inputs\n object2 = splitInput[3]; // Stores extra words that the user inputs\n switch (action.toLowerCase()) {\n case \"attack\":\n if (player.getLocation().isCharaInRoom((predic + \" \" + object + \" \" + object2).toUpperCase())) {\n player.attack(player.getLocation().getChara((predic + \" \" + object + \" \" + object2).toUpperCase()));\n }\n else {\n System.out.println(\"There is no \" + ANSI_RED + (predic + \" \" + object + \" \" + object2).toLowerCase() + ANSI_RESET + \" here.\");\n }\n player.incrementTurn();\n break;\n case \"look\":\n switch (predic.toLowerCase()) {\n case \"inside\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getInsideDesc());\n else if(player.getLocation().isCharaInRoom(((object + \" \" + object2)).toUpperCase()))\n System.out.println(player.getLocation().getChara(((object + \" \" + object2)).toUpperCase()).getInsideDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"under\":\n case \"below\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getUnderDesc());\n else if(player.getLocation().isCharaInRoom(((object + \" \" + object2)).toUpperCase()))\n System.out.println(player.getLocation().getChara(((object + \" \" + object2)).toUpperCase()).getUnderDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"behind\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getBehindDesc());\n else if(player.getLocation().isCharaInRoom(((object + \" \" + object2)).toUpperCase()))\n System.out.println(player.getLocation().getChara(((object + \" \" + object2)).toUpperCase()).getBehindDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"through\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getThroughDesc());\n else if(player.getLocation().isCharaInRoom(((object + \" \" + object2)).toUpperCase()))\n System.out.println(player.getLocation().getChara(((object + \" \" + object2)).toUpperCase()).getThroughDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"at\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getDescription());\n else if (player.getLocation().isCharaInRoom((object + \" \" + object2).toUpperCase()))\n player.examineChara(player.getLocation().getChara((object + \" \" + object2).toUpperCase()));\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command.\");\n break;\n }\n break;\n case \"talk\":\n case \"speak\":\n if (\"to\".equals(predic)) {\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getDialogue());\n else if (player.getLocation().isCharaInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getChara((object + \" \" + object2).toUpperCase()).getDialogue());\n else\n System.out.println(\"There is nothing to talk to.\");\n player.incrementTurn();\n } else {\n System.out.println(\"Invalid Command.\");\n }\n break;\n case \"use\":\n if (predic.toUpperCase().equals(\"KEY\")) {\n if (object.toUpperCase().equals(\"ON\")) {\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object2.toLowerCase()) != null) {\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object2.toLowerCase()).getLocked()) {\n player.getLocation().getConnectedRoom(action.toLowerCase(), object2.toLowerCase()).unlock();\n System.out.println(\"You unlocked the door.\");\n } else\n System.out.println(\"You do not have a key.\");\n } else {\n if (player.inInventory(\"KEY\"))\n System.out.println(\"There is nothing to use a key on.\");\n else\n System.out.println(\"You do not have a key.\");\n }\n }\n }\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command\");\n return;\n }\n }\n else if (splitInput.length > 4) {\n System.out.println(\"Invalid Command\");\n return;\n }\n\n // Makes the enemies that are in the 'aggressive' state in the same room as the player attack the player.\n ArrayList<Character> NPCsInRoom = player.getLocation().getCharacters();\n if (NPCsInRoom.size() > 0) {\n for (Character character : NPCsInRoom) {\n if (character.getHealth() > 0 && character.getState().getStateName().equals(\"agg\")) {\n try {\n TimeUnit.SECONDS.sleep(1);\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n System.out.println(ANSI_RED + character.getName() + ANSI_RESET + \" is attacking!\");\n try {\n TimeUnit.SECONDS.sleep(1);\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n character.attack(player);\n }\n }\n }\n }", "private static String parse( String hostName, String input ) {\n final String prop_name = hostName + \" -> \";\n// System.out.println(\"XXXXX \" + input.indexOf( prop_name ) );\n if( input.indexOf( prop_name ) >= 0 ) { // has the required property (= html input tag with specified name)\n return input.split( prop_name )[ 1 ].split( \"<br>\" )[0];\n }\n return \"\";\n }", "public String FormatState(String state)\n {\n String formatState = state;\n \n if(formatState.length() == 2)\n {\n formatState = formatState.toUpperCase();\n } else\n {\n formatState = formatState.toLowerCase().replaceAll(\" \", \"\"); //replace all spaces with a blank\n\n if(formatState.contains(\"new\"))\n {\n //grab the string \"new\" and put a space after it\n formatState = formatState.substring(0, 2) + \" \" + formatState.substring(3);\n } else if(formatState.contains(\"rhode\") || formatState.contains(\"north\") || formatState.contains(\"south\"))\n {\n //grab the string \"rhode\" and put a space after it\n formatState = formatState.substring(0, 4) + \" \" + formatState.substring(5);\n } else if(formatState.contains(\"district\"))\n {\n //grab the string \"district\" and put a space after it\n formatState = formatState.substring(0, 7) + \" \" + formatState.substring(8, 9) + \" \" + formatState.substring(10);\n } else if(formatState.contains(\"west\"))\n {\n //grab the string \"west\" and put a space after it\n formatState = formatState.substring(0, 3) + \" \" + formatState.substring(4);\n }\n\n char[] stateChar = formatState.toCharArray(); //convert the formatted string to a character array\n boolean previousCharIsLetter = false;\n formatState = \"\";\n \n /**\n * This for loop loops through the character array. It attempts to find the start of a word and capitalize it.\n * If a word is after a space, it is a new word. If not, it will keep looping until the character array has been\n * completely gone through to reformat the string (ex: new york -> New York .. if it were somehow nEw yOrK -> New York).\n */\n for(int i = 0; i < stateChar.length; i++)\n {\n if(!previousCharIsLetter && Character.isLetter(stateChar[i]))\n {\n stateChar[i] = Character.toUpperCase(stateChar[i]);\n previousCharIsLetter = true;\n } else if(Character.isWhitespace(stateChar[i])) //if the character is a space\n {\n previousCharIsLetter = false;\n }\n \n formatState += stateChar[i];\n }\n }\n \n return formatState;\n }", "private void parseAndFormatInput() {\n try {\n String input = getText();\n if (input == null || input.length() == 0) {\n return;\n }\n Number parsedNumber = nf.parse(input);\n BigDecimal newValue = new BigDecimal(parsedNumber.toString());\n setNumber(newValue);\n selectAll();\n } catch (ParseException ex) {\n // If parsing fails keep old number\n setText(nf.format(number.get()));\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 }", "public void fetchVerseLines() throws IncorrectInput{\n String strObject1 = \"\";\n PoetAndTheme object1 = poetsAndThemesList.get(0);\n String strObject2 = \"\";\n PoetAndTheme object2 = poetsAndThemesList.get(0);\n strObject1 = userInputToPoet(poet1, theme);\n strObject2 = userInputToPoet(poet2, theme);\n\n for(PoetAndTheme object: poetsAndThemesList){\n if (object.getNameAndTheme().equals(strObject1)){\n object1 = object;\n }\n if (object.getNameAndTheme().equals(strObject2)){\n object2 = object;\n }\n }\n //Poems length is a random number between 5 and 10\n int poemLength = getRandomPoemLength();\n\n if(poemLength % 2 == 0){\n for (int i=0; i < (poemLength/2); i++){\n if(i != (poemLength/2 - 1)){\n System.out.println(object1.getRandomVerseLine());\n System.out.println(object2.getRandomVerseLine());\n }else{\n System.out.println(object1.getRandomVerseLine());\n\n //Checking if the last verse line ends with period or question mark.\n //If not, get a new verse line.\n System.out.println(getLastPoemLine(object2));\n }\n }\n }else{\n for (int i=0; i < (poemLength/2 - 1); i++){\n System.out.println(object1.getRandomVerseLine());\n System.out.println(object2.getRandomVerseLine());\n }\n //Checking if the last verse line ends with period or question mark.\n //If not, get a new verse line.\n System.out.println(getLastPoemLine(object1));\n }\n }", "public void decideName()\n {\n System.out.println(\"What do want your newly tamed WIND dragon to be named?\");\n String name = new String(input.nextLine());\n \n setName(name);\n }", "public static Theme loadFromFile( final String name,\n final Theme defaultTheme,\n final InputStream inStr,\n final ResourceLoader loader )\n throws IOException\n {\n if( inStr == null ) {\n throw new NullPointerException( \"null argument\" );\n }\n Theme newTheme = new Theme( name, defaultTheme );\n Properties properties = new Properties();\n properties.load( inStr );\n Iterator iterator = properties.keySet().iterator();\n while( iterator.hasNext() ) {\n String key = ( ( String )iterator.next() ).trim();\n String keyName;\n String keyVariant;\n int index = key.indexOf( '/' );\n if( index != -1 ) {\n keyVariant = key.substring( 0, index );\n keyName = key.substring( index + 1 );\n } else {\n keyName = key;\n keyVariant = null;\n }\n if( !defaultTheme.definesKey( keyName ) ) {\n String pattern = \"Invalid key for themeing: ''{0}'' in ''{1}''\";\n Object[] arguments = new Object[] { keyName, key };\n String message = MessageFormat.format( pattern, arguments );\n throw new IllegalArgumentException( message );\n }\n QxType defValue = defaultTheme.getValue( keyName, null );\n String value = ( ( String )properties.get( key ) ) .trim();\n if( value != null && value.trim().length() > 0 ) {\n QxType newValue;\n if( defValue instanceof QxBorder ) {\n newValue = QxBorder.valueOf( value );\n } else if( defValue instanceof QxBoolean ) {\n newValue = QxBoolean.valueOf( value );\n } else if( defValue instanceof QxBoxDimensions ) {\n newValue = QxBoxDimensions.valueOf( value );\n } else if( defValue instanceof QxFont ) {\n newValue = QxFont.valueOf( value );\n } else if( defValue instanceof QxColor ) {\n newValue = QxColor.valueOf( value );\n } else if( defValue instanceof QxDimension ) {\n newValue = QxDimension.valueOf( value );\n } else if( defValue instanceof QxImage ) {\n newValue = QxImage.valueOf( value, loader );\n } else {\n throw new RuntimeException( \"unknown type\" );\n }\n newTheme.setValue( keyName, keyVariant, newValue );\n }\n }\n return newTheme;\n }", "private void processInput(String str) {\r\n String[] strs = str.split(\":\")[1].split(\",\");\r\n for (String s : strs) {\r\n color.add(s.trim().toUpperCase());\r\n }\r\n }", "private String getThemeString(PageParameters parameters){\n String themeString = \"default\";\n if (parameters.getAllNamed().size() < 2) {\n return themeString;\n } else {\n themeString= parameters.getAllNamed().get(0).getValue();\n }\n return themeString;\n }", "@Override\n\tprotected Pizza createPizza(String type) {\n\t\tPizza pizza = null;\n\t\tPizzaIngredientFactory pizzaIngredientFactory = new NYPizzaIngredientFactory();\n\t\tif(type.equals(\"cheese\")){\n\t\t\tpizza = new CheesePizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Cheese Pizza\");\n\t\t} else if(type.equals(\"veggie\")){\n\t\t\tpizza = new VeggiePizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Veggie Pizza\");\n\t\t} else if(type.equals(\"clam\")) {\n\t\t\tpizza = new ClamPizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Clam Pizza\");\n\t\t} return pizza;\n\t}", "private void createThemeDialog() {\n\n\t\tAlertDialog.Builder alb = new AlertDialog.Builder(this);\n\t\talb.setTitle(getString(R.string.choose_theme));\n\t\talb.setCancelable(true);\n\n\t\tString[] items;\n\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {\n\t\t\titems = new String[]{getString(R.string.light), getString(R.string.dark),\n\t\t\t\t\tgetString(R.string.time), getString(R.string.system)};\n\t\t} else {\n\t\t\titems = new String[]{getString(R.string.light), getString(R.string.dark),\n\t\t\t\t\tgetString(R.string.time)};\n\t\t}\n\n\t\tAtomicInteger newTheme = new AtomicInteger(currentTheme);\n\n\t\talb.setSingleChoiceItems(items, currentTheme, (dialog, which) -> newTheme.set(which));\n\n\t\talb.setPositiveButton(getString(R.string.set_theme), (dialog, which) -> {\n\t\t\tcurrentTheme = newTheme.get();\n\t\t\tchangeTheme();\n\t\t});\n\n\t\talb.show();\n\t}", "public void benefitLayout() {\n Scanner stdin = new Scanner(System.in);\n System.out.println(\"Please state which benefit to check (Bonus or Pension): \");\n String benefitToCheck = stdin.next();\n\n while ((!benefitToCheck.equals(\"Pension\")) && (!benefitToCheck.equals(\"Bonus\"))) {\n System.out.println(\"Please state which benefit to check (Bonus or Pension): \");\n benefitToCheck = stdin.next();\n }\n\n if (benefitToCheck.equals(\"Pension\")) {\n System.out.println(\"Please state Name of Employee (format: \\\"FirstName_LastName\\\"): \");\n calculateEmployeePension(employeeSalaryForBenefits(stdin.next()));\n }\n if (benefitToCheck.equals(\"Bonus\")) {\n System.out.println(\"Please state Name of Employee (format: \\\"FirstName_LastName\\\"): \");\n calculateEmployeeBonus(employeeSalaryForBenefits(stdin.next()), 0, null);\n }\n stdin.close();\n }", "public static MetalTheme valueOf(String aText) {\n if (aText == null) return null;\n for(MetalTheme theme: VALUES){\n if (aText.endsWith(theme.getName())){\n return theme;\n }\n }\n throw new IllegalArgumentException(\"Cannot parse into Theme object:\" + aText);\n }", "public String chooseColorName(){\n Scanner scanner = new Scanner(System.in);\n int nextColorIndex;\n System.out.println(\"what color ? :\");\n System.out.println(\"1-black\");\n System.out.println(\"2-red\");\n System.out.println(\"3-green\");\n System.out.println(\"4-blue\");\n nextColorIndex = scanner.nextInt();\n// scanner.nextLine();\n if (nextColorIndex > 4 || nextColorIndex < 1) {\n System.out.println(\"not valid input\");\n return chooseColorName();\n } else {\n if (nextColorIndex == 1) {\n return (ColorNames.BLACK_NAME);\n }\n else if (nextColorIndex == 2) {\n return (ColorNames.RED_NAME);\n }\n else if (nextColorIndex == 3) {\n return (ColorNames.GREEN_NAME);\n }\n else {\n return (ColorNames.BLUE_NAME);\n }\n\n }\n\n }", "public static String preprocessForFormating(String inputText){\n\t\tif (inputText != null) {\n\t\t\treturn inputText.replace(\"''\", \"'\").replace(\"'\", \"''\");\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}", "public String convertWordOrPhoneme(String wordToConvert, String wordType,\n String legacyPhoneme) {\n String wordCurrentPhonemes = \"\";\n WordType type = WordType.getWordType(wordType);\n\n if (type == WordType.URL) {\n wordCurrentPhonemes = processAsUrl(wordToConvert);\n } else if (type == WordType.PRONUNCIATION) {\n wordCurrentPhonemes = processAsPronunciation(legacyPhoneme);\n } else if (type == WordType.DYNAMIC) {\n wordCurrentPhonemes = processAsDynamic(legacyPhoneme);\n } else {\n // A SUBSTITUTION/DYNAMIC/UNKNOWN\n wordCurrentPhonemes = wordToConvert;\n }\n\n return wordCurrentPhonemes;\n }", "public void fix4() {\n\t\tBufferedReader br;\n\t\tString name;\n\t\t\n\t\ttry {\n\t\t\tSystem.out.println(\"Enter the correct optionset name:\\n\");\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tname = br.readLine();\n\t\t\treturnStr = name;\n\t\t} catch (Exception e) {\n\t //return null;\n\t }\n\t}", "public void Prompt(){\n System.out.println(\"Enter information about the topping: \\n\\n\");\n super.Prompt();\n System.out.println(\"Enter any topping: \");\n this.Topping = new String(this.read.next());\n this.read.nextLine();\n System.out.println(\"Density:\\n 1. Heavy\\n 2. Standard\\n 3. Light\\n(Enter corresponding number): \");\n this.Density = this.read.nextInt();\n System.out.println(\"Is it vegetarian? (true or false): \");\n this.Vegetarian = this.read.nextBoolean();\n System.out.println(\"\\n\");\n }", "public static String parse(Object obj) {\n Class screenClass = obj.getClass();\n\n AliasName screenClassAnnotation = (AliasName) screenClass.getAnnotation(AliasName.class);\n if (screenClassAnnotation != null) {\n return screenClassAnnotation.value();\n }\n\n String className = screenClass.getSimpleName();\n\n for (Couple<Pattern, String> rule : rules.values()) {\n Matcher matcher = rule.first.matcher(className);\n if (matcher.find()){\n return matcher.replaceAll(rule.second);\n }\n }\n\n return className;\n }", "public static void main(String[] args) {\n\t\tString input = JOptionPane.showInputDialog(\"input stuff here\");\n\t\t\n\t\tinput = input.toLowerCase();\n\t\tswitch(input) {\n\t\t\tcase \"aries\": {\n\t\t\t\tgiveHoroscope(Zodiac.ARIES);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"taurus\": {\n\t\t\t\tgiveHoroscope(Zodiac.TAURUS);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"gemini\": {\n\t\t\t\tgiveHoroscope(Zodiac.GEMINI);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"cancer\": {\n\t\t\t\tgiveHoroscope(Zodiac.CANCER);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"virgo\": {\n\t\t\t\tgiveHoroscope(Zodiac.VIRGO);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"leo\": {\n\t\t\t\tgiveHoroscope(Zodiac.LEO);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"libra\": {\n\t\t\t\tgiveHoroscope(Zodiac.LIBRA);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"scorpio\": {\n\t\t\t\tgiveHoroscope(Zodiac.SCORPIO);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"sagittarius\": {\n\t\t\t\tgiveHoroscope(Zodiac.SAGITTARIUS);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"capricorn\": {\n\t\t\t\tgiveHoroscope(Zodiac.CAPRICORN);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"aquarius\": {\n\t\t\t\tgiveHoroscope(Zodiac.AQUARIUS);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"pisces\": {\n\t\t\t\tgiveHoroscope(Zodiac.PISCES);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public String process(Item item) throws ProcessException {\n\t\t\tString name = item.getFeatures().getString(\"name\");\n\t\t\tString dc = name.toLowerCase();\n\t\t\tif (DIGITS_PATTERN.matcher(dc).matches()) {\n\t\t\t\treturn \"numeric\";\n\t\t\t} else if (DOUBLE_PATTERN.matcher(dc).matches()) {\n\t\t\t\treturn \"number\";\n\t\t\t} else if (months.contains(dc)) {\n\t\t\t\treturn \"month\";\n\t\t\t} else if (days.contains(dc)) {\n\t\t\t\treturn \"day\";\n\t\t\t} else if (dc.equals(\"a\")) {\n\t\t\t\treturn \"a\";\n\t\t\t} else if (dc.equals(\"flight\")) {\n\t\t\t\treturn \"flight\";\n\t\t\t} else if (dc.equals(\"to\")) {\n\t\t\t\treturn \"to\";\n\t\t\t} else {\n\t\t\t\treturn \"_other_\";\n\t\t\t}\n\t\t}", "public static Shape parse() {\n Shape shape = null;\n System.out.print(\"Enter command:\");\n try {\n Scanner scanner = new Scanner(System.in);\n String commandString = scanner.nextLine();\n String[] request = commandString.split(\"\\\\s+\"); //the array of strings computed by space\n\n switch (Command.findCommandByAcronyms(request[0])){\n case CANVAS:\n int[] canvasCoordinates = convertStringArrayToIntArray(Arrays.copyOfRange(request,1,request.length));\n canvas = new Canvas(canvasCoordinates);\n shape = canvas;\n break;\n case LINE:\n int[] lineCoordinates = convertStringArrayToIntArray(Arrays.copyOfRange(request,1,request.length));\n shape = new Line(canvas, lineCoordinates);\n break;\n case RECTANGLE:\n int[] rectCoordinates = convertStringArrayToIntArray(Arrays.copyOfRange(request,1,request.length));\n shape = new Rectangle(canvas, rectCoordinates);\n break;\n case FILL:\n shape = new Fill(canvas, Arrays.copyOfRange(request,1,request.length));\n break;\n case EXIT:\n System.out.print(\"Thank you for using the Drawing App! See you again.\");\n System.exit(0);\n default:\n System.out.println(\"Command not supported: \" + request[0]);\n help();\n }\n return shape;\n } catch (NumberFormatException nfe){\n System.out.println(\"Only non negative numbers are allowed in args: \" + nfe.getMessage());\n help();\n } catch (Exception e) {\n System.out.println(\"Sorry! can't parse the entered value. Try again: \" + e.getMessage());\n help();\n }\n return shape;\n }", "private static String fixParams(String _placeInfo) {\r\n String toLowerCase = _placeInfo.toLowerCase();\r\n if (\"city\".equals(toLowerCase) || \"timezone\".equals(toLowerCase)) {\r\n return toLowerCase;\r\n } else {\r\n switch (toLowerCase) {\r\n case \"latitude\":\r\n return \"lat\";\r\n case \"longitude\":\r\n return \"lon\";\r\n case \"countryname\":\r\n return \"country\";\r\n case \"stateorprov\":\r\n return \"region\";\r\n case \"ip\":\r\n return \"query\";\r\n }\r\n return _placeInfo;\r\n }\r\n }", "public static void processCreateEdit(String str){\n\n\t\tString fullMatch;\n\t\tString relation1;\n\t\tString relation2;\n\t\tString name1;\n\t\tString name2;\n\n\t\tPattern pattern = Pattern.compile(INPUT_REGEX_ADD_EDIT);\n\t\tMatcher matcher = pattern.matcher(str);\n\t\twhile (matcher.find()) {\n\n\t\t\tfullMatch = matcher.group(0);\n\t\t\trelation1 = matcher.group(1);\n \t\tname1 = matcher.group(2);\n \t\trelation2 = matcher.group(3);\n \t\tname2 = matcher.group(4);\n\n \t\tSystem.out.println(\"fullMatch\" + fullMatch);\n\t\t\tSystem.out.println(\"relation1: \" + relation1);\n \t\tSystem.out.println(\"name1: \" + name1);\n \t\tSystem.out.println(\"relation2: \" + relation2);\n \t\tSystem.out.println(\"name2: \" + name2);\n\n \tif(relation1.equalsIgnoreCase(Relationships.HUSBAND.name()) && relation2.equalsIgnoreCase(Relationships.WIFE.name())){\n\n \t\t\tPerson person1 = new Person(name1, Gender.MALE);\n \t\t\tPerson person2 = new Person(name2, Gender.FEMALE);\n \t\t\tCouple couple = new Couple(person1, person2);\n\n\t\t\t\tfamilyTree.setData(couple);\n\n\t\t\t\tSystem.out.println(familyTree.getData());\n \t}\n\n \telse if(relation1.equalsIgnoreCase(Relationships.MOTHER.name()) && relation2.equalsIgnoreCase(Relationships.SON.name())){\n \t\tPerson person1 = new Person(name1, Gender.FEMALE);\n\t\t\tPerson person2 = new Person(name2, Gender.MALE);\n\t\t\t\n\t\t\t\n\t\t\tCouple couple = new Couple(person2);\n\n\t\t\tfamilyTree.addChild(couple);\n\n\t\t\tSystem.out.println(familyTree.getData());\n\t\t\t\n\t\t\tSystem.out.println(\"name found: \" + familyTree.getDescendants(familyTree, \"name\"));\n \t}\n \telse{\n \t\tFamilyTreeNode huh = familyTree.getChildren().get(0);\n \t\t\n \t\tPerson person2 = new Person(\"name\", Gender.MALE);\n\t\t\t\n\t\t\tCouple couple = new Couple(person2);\n\t\t\t\n \t\thuh.addChild(couple);\n \t}\n\n}\n\n\n\t}", "public static void main(String[] args) {\n \n String MaritalStatus=\"D\";\n \n Scanner in = new Scanner(System.in);\n \n System.out.print(\"Please enter your Marital status:\");\n String userInput = in.nextLine();\n \n switch (MaritalStatus) \n { \n case \"D\":\n System.out.print(\"status: divorced\");\n break;\n case \"S\":\n System.out.print(\"status: single\");\n break;\n case \"M\":\n System.out.print(\"status: married\");\n break;\n case \"W\":\n System.out.print(\"status: widowed\");\n break; \n default:\n System.out.print(\"Invalid Date\");\n }\n \n \n }", "public static String[] getPoiType(String input, String language){\n\t\t//DE\n\t\tif (language.equals(LANGUAGES.DE)){\n\t\t\tif (NluTools.stringContains(input, \"bar|bars|pub|pubs|drinks|was trinken\")){\n\t\t\t\treturn new String[]{\"bar\"};\n\t\t\t}else if (NluTools.stringContains(input, \"kiosk|bude\")){\n\t\t\t\treturn new String[]{\"store\", \"liquor_store\"};\n\t\t\t}else if (NluTools.stringContains(input, \"cafe|cafes|kaffee|coffeeshop|coffee-shop\")){\n\t\t\t\treturn new String[]{\"cafe\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(pizza|doener|pommes|schnitzel)(-| |)(laden|laeden|bude|buden|imbiss|)|imbiss|(\\\\b\\\\w{3,}(sches |sche )|)(restaurant|restaurants|imbiss)|\\\\b\\\\w{3,}(sches |sche )(essen)|(et|)was (zu |)(essen|futtern)|futter\")){\n\t\t\t\treturn new String[]{\"food\", \"restaurant\", \"meal_takeaway\"};\n\t\t\t}else if (NluTools.stringContains(input, \"baeckerei(en|)|baecker\")){\n\t\t\t\treturn new String[]{\"bakery\"};\n\t\t\t}else if (NluTools.stringContains(input, \"tankstelle|tankstellen|tanken\")){\n\t\t\t\treturn new String[]{\"gas_station\"};\n\t\t\t}else if (NluTools.stringContains(input, \"auto waschen\")){\n\t\t\t\treturn new String[]{\"car_wash\"};\n\t\t\t}else if (NluTools.stringContains(input, \"hotel|hotels|motel|hostel(s|)\")){\n\t\t\t\treturn new String[]{\"lodging\"};\n\t\t\t}else if (NluTools.stringContains(input, \"disco|discos|diskothek|club|clubs|nachtclub|tanzen|feiern|party\")){\n\t\t\t\treturn new String[]{\"night_club\"};\n\t\t\t}else if (NluTools.stringContains(input, \"\\\\w*(-bahnhof|bahnhof)|hbf\")){\n\t\t\t\treturn new String[]{\"train_station\"};\n\t\t\t}else if (NluTools.stringContains(input, \"\\\\w*(-|)haltestelle|bus|u(-| |)bahn.*\")){\n\t\t\t\tif (NluTools.stringContains(input, \"u(-| |)bahn.*\")){\n\t\t\t\t\treturn new String[]{\"subway_station\", \"transit_station\"};\n\t\t\t\t}else if (NluTools.stringContains(input, \".*bus.*\")){\n\t\t\t\t\treturn new String[]{\"bus_station\"};\n\t\t\t\t}else{\n\t\t\t\t\treturn new String[]{\"transit_station\", \"bus_station\", \"subway_station\", \"train_station\"};\n\t\t\t\t}\n\t\t\t}else if (NluTools.stringContains(input, \"flughafen\")){\n\t\t\t\treturn new String[]{\"airport\"};\n\t\t\t}else if (NluTools.stringContains(input, \"sixt|europcar|starcar|autovermietung\")){\n\t\t\t\treturn new String[]{\"car_rental\"};\n\t\t\t}else if (NluTools.stringContains(input, \"taxi stand|taxi\")){\n\t\t\t\treturn new String[]{\"taxi_stand\"};\n\t\t\t}else if (NluTools.stringContains(input, \"museum\")){\n\t\t\t\treturn new String[]{\"museum\"};\n\t\t\t}else if (NluTools.stringContains(input, \"geldautomat(en|)|atm(s|)|geld (besorgen|abholen|holen|abheben)|geld\")){\n\t\t\t\treturn new String[]{\"atm\", \"bank\", \"finance\"};\n\t\t\t}else if (NluTools.stringContains(input, \"bank(en|)\")){\n\t\t\t\treturn new String[]{\"bank\", \"finance\"};\n\t\t\t}else if (NluTools.stringContains(input, \"aldi|lidl|penny|edeka|netto|rewe|supermarkt|supermaerkte|markt|einkaufen\")){\n\t\t\t\treturn new String[]{\"grocery_or_supermarket\"};\n\t\t\t}else if (NluTools.stringContains(input, \"krankenhaus|krankenhaeuser|notaufnahme\")){\n\t\t\t\treturn new String[]{\"hospital\"};\n\t\t\t}else if (NluTools.stringContains(input, \"doktor|arzt\")){\n\t\t\t\treturn new String[]{\"doctor\"};\n\t\t\t}else if (NluTools.stringContains(input, \"apotheke|medikamente\")){\n\t\t\t\treturn new String[]{\"pharmacy\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(polizei)(-station|station| station|-wache| wache|wache|)(en|)\")){\n\t\t\t\treturn new String[]{\"police\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(feuerwehr)(-station|station| station|-wache| wache|wache|)(en|)\")){\n\t\t\t\treturn new String[]{\"fire_station\"};\n\t\t\t}else if (NluTools.stringContains(input, \"kirche(n|)|moschee(n|)|tempel|synagoge(n|)\")){\n\t\t\t\treturn new String[]{\"place_of_worship\", \"church\", \"hindu_temple\", \"mosque\", \"synagogue\"};\n\t\t\t}else if (NluTools.stringContains(input, \"werkstatt|werkstaetten|auto schuppen|schrauber bude\")){\n\t\t\t\treturn new String[]{\"car_repair\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(fussball|basketball|football|baseball|hockey|)(| )(stadion|stadium)\")){\n\t\t\t\treturn new String[]{\"stadium\"};\n\t\t\t}else if (NluTools.stringContains(input, \"uni|universitaet(en|)\")){\n\t\t\t\treturn new String[]{\"university\"};\n\t\t\t}else if (NluTools.stringContains(input, \"kino|cinemaxx|uci|imax\")){\n\t\t\t\treturn new String[]{\"movie_theater\"};\n\t\t\t}else if (NluTools.stringContains(input, \"einkaufszentrum|shoppingcenter|shoppingzentrum\")){\n\t\t\t\treturn new String[]{\"shopping_mall\", \"store\"};\n\t\t\t}else if (NluTools.stringContains(input, \"kaufen|shop|\\\\w*laden|geschaeft\")){\n\t\t\t\treturn new String[]{\"store\"};\n\t\t\t}else if (NluTools.stringContains(input, \"casino\")){\n\t\t\t\treturn new String[]{\"casino\"};\n\t\t\t}else if (NluTools.stringContains(input, \"bordell|puff\")){\n\t\t\t\treturn new String[]{\"establishment\"};\n\t\t\t}else if (NluTools.stringContains(input, \"zoo\")){\n\t\t\t\treturn new String[]{\"zoo\"};\n\t\t\t}\n\t\t//EN\t\n\t\t}else if (language.equals(LANGUAGES.EN)){\n\t\t\tif (NluTools.stringContains(input, \"bar|bars|pub|pubs|drinks|get drunk\")){\n\t\t\t\treturn new String[]{\"bar\", \"liquor_store\"};\n\t\t\t}else if (NluTools.stringContains(input, \"cafe|cafes|coffee(-| |)(shop|)\")){\n\t\t\t\treturn new String[]{\"cafe\"};\n\t\t\t}else if (NluTools.stringContains(input, \"liquor(-| |)store|get (alkohol|spirit|booze)\")){\n\t\t\t\treturn new String[]{\"liquor_store\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(pizza|doener|fries|schnitzel|kebab)(-| |)(shop|imbiss|place|)|imbiss|(\\\\b\\\\w{3,}(an |nese )|)(restaurant|restaurants|diner|takeaway|food)|something to eat|food\")){\n\t\t\t\treturn new String[]{\"food\", \"restaurant\", \"meal_takeaway\"};\n\t\t\t}else if (NluTools.stringContains(input, \"bakery|bakers|bakehouse\")){\n\t\t\t\treturn new String[]{\"bakery\"};\n\t\t\t}else if (NluTools.stringContains(input, \"disco|discos|diskothek|club|clubs|nightclub|party|dance\")){\n\t\t\t\treturn new String[]{\"night_club\"};\n\t\t\t}else if (NluTools.stringContains(input, \"hospital(s|)|emergency room\")){\n\t\t\t\treturn new String[]{\"hospital\"};\n\t\t\t}else if (NluTools.stringContains(input, \"pharmacy|drugstore\")){\n\t\t\t\treturn new String[]{\"pharmacy\"};\n\t\t\t}else if (NluTools.stringContains(input, \"doctor\")){\n\t\t\t\treturn new String[]{\"doctor\", \"pharmacy\"};\n\t\t\t}else if (NluTools.stringContains(input, \"\\\\w*(-station| station|train)|(bus|train) stop\")){\n\t\t\t\tif (NluTools.stringContains(input, \".*bus.*\")){\n\t\t\t\t\treturn new String[]{\"bus_station\"};\n\t\t\t\t}else if (NluTools.stringContains(input, \".*train.*\")){\n\t\t\t\t\treturn new String[]{\"train_station\"};\n\t\t\t\t}else if (NluTools.stringContains(input, \".*subway.*\")){\n\t\t\t\t\treturn new String[]{\"subway_station\", \"train_station\"};\n\t\t\t\t}else{\n\t\t\t\t\treturn new String[]{\"transit_station\", \"train_station\"};\n\t\t\t\t}\n\t\t\t}else if (NluTools.stringContains(input, \"airport\")){\n\t\t\t\treturn new String[]{\"airport\"};\n\t\t\t}else if (NluTools.stringContains(input, \"sixt|europcar|starcar|car rental\")){\n\t\t\t\treturn new String[]{\"car_rental\"};\n\t\t\t}else if (NluTools.stringContains(input, \"need a cab|taxi stand|taxi\")){\n\t\t\t\treturn new String[]{\"taxi_stand\"};\n\t\t\t}else if (NluTools.stringContains(input, \"museum\")){\n\t\t\t\treturn new String[]{\"museum\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(gas|petrol)(-| |)station|get (gas|petrol)\")){\n\t\t\t\treturn new String[]{\"gas_station\"};\n\t\t\t}else if (NluTools.stringContains(input, \"car(-| |)wash|wash\\\\b.* car\")){\n\t\t\t\treturn new String[]{\"car_wash\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(police)(-station|station| station|department|)(s|)\")){\n\t\t\t\treturn new String[]{\"police\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(fire)(-station|station| station|department|)(s|)\")){\n\t\t\t\treturn new String[]{\"fire_station\"};\n\t\t\t}else if (NluTools.stringContains(input, \"hotel|hotels|motel|hostel(s|)\")){\n\t\t\t\treturn new String[]{\"lodging\"};\n\t\t\t}else if (NluTools.stringContains(input, \"church(es|)|mosque(s|)|temple(s|)|synagogue(s|)|synagog\")){\n\t\t\t\treturn new String[]{\"place_of_worship\", \"church\", \"hindu_temple\", \"mosque\", \"synagogue\"};\n\t\t\t}else if (NluTools.stringContains(input, \"aldi|lidl|penny|edeka|netto|rewe|supermarket(s|)|market|buy stuff\")){\n\t\t\t\treturn new String[]{\"grocery_or_supermarket\"};\n\t\t\t}else if (NluTools.stringContains(input, \"cash machine|atm(s|)|get (money|cash)\")){\n\t\t\t\treturn new String[]{\"atm\", \"bank\", \"finance\"};\n\t\t\t}else if (NluTools.stringContains(input, \"bank(s|)\")){\n\t\t\t\treturn new String[]{\"bank\", \"finance\"};\n\t\t\t}else if (NluTools.stringContains(input, \"workshop(s|)\")){\n\t\t\t\treturn new String[]{\"car_repair\"};\n\t\t\t}else if (NluTools.stringContains(input, \"(soccer|football|basketball|baseball|hockey|)( stadium|stadium)\")){\n\t\t\t\treturn new String[]{\"stadium\"};\n\t\t\t}else if (NluTools.stringContains(input, \"uni|university\")){\n\t\t\t\treturn new String[]{\"university\"};\n\t\t\t}else if (NluTools.stringContains(input, \"cinema|cinemaxx|uci|imax\")){\n\t\t\t\treturn new String[]{\"movie_theater\"};\n\t\t\t}else if (NluTools.stringContains(input, \"shopping (center|mall)\")){\n\t\t\t\treturn new String[]{\"shopping_mall\", \"store\"};\n\t\t\t}else if (NluTools.stringContains(input, \"\\\\w*shop|\\\\w*store|kiosk\")){\n\t\t\t\treturn new String[]{\"store\"};\n\t\t\t}else if (NluTools.stringContains(input, \"brothel|cathouse\")){\n\t\t\t\treturn new String[]{\"establishment\"};\n\t\t\t}else if (NluTools.stringContains(input, \"zoo\")){\n\t\t\t\treturn new String[]{\"zoo\"};\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tDebugger.println(\"Place.java - getPoiType() has no support for language '\" + language + \"'\", 1);\n\t\t\treturn new String[]{};\n\t\t}\n\t\treturn new String[]{};\n\t}", "public static void handleInput(String input, String player) {\n\t\tint choice = 0;\n\t\tswitch(input.toLowerCase())\n\t\t{\n\t\t\tcase \"1\":\n\t\t\tcase \"rock\":\n\t\t\t\tchoice = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\tcase \"paper\":\n\t\t\t\tchoice = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\tcase \"scissors\":\n\t\t\t\tchoice = 3;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// random number from 1 to 3, if the input is none of the above.\n\t\tif (choice == 0) {\n\t\t\tchoice = random.nextInt(3) + 1;\n\t\t}\n\t\t\n\t\t// check which player sent the input.\n\t\tif(player.equals(\"playerOne\")) {\n\t\t\tPlayerBean.PLAYERONE = choice;\n\t\t} else {\n\t\t\tPlayerBean.PLAYERTWO = choice;\n\t\t}\n\t}", "protected String getThemeForWindow(PortletRequest request, Window window) {\n // Finds theme name\n String themeName;\n \n // theme defined for the window?\n themeName = window.getTheme();\n \n if (themeName == null) {\n // no, is the default theme defined by the portal?\n themeName = getPortalProperty(\n Constants.PORTAL_PARAMETER_VAADIN_THEME,\n request.getPortalContext());\n }\n \n if (themeName == null) {\n // no, using the default theme defined by Vaadin\n themeName = DEFAULT_THEME_NAME;\n }\n \n return themeName;\n }", "public String parseItemChoice() {\n\t\tSystem.out.println(\"What would you like to do?\");\n\t\tSystem.out.println(\"Equip/Unequip Weapon\\t(W)\");\n\t\tSystem.out.println(\"Equip/Unequip Armor\\t(A)\");\n\t\tSystem.out.println(\"Use Potion\\t(P)\");\n\t\tSystem.out.println(\"Back\\t(B)\");\n\t\tString res = parseString().toUpperCase();\n\t\tboolean isValid = false;\n\t\twhile(!isValid) {\n\t\t\tswitch(res) {\n\t\t\tcase \"W\":\n\t\t\tcase \"A\":\n\t\t\tcase \"P\":\n\t\t\tcase \"B\":\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprintErrorParse();\n\t\t\t\tres = parseString().toUpperCase();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t\t\n\t}", "public static void countryName (){\n System.out.println(\"Enter a country domain\");\n Scanner input = new Scanner(System.in);\n String userInput = input.nextLine();\n userInput = userInput.toLowerCase();\n\n switch (userInput) {\n case \"us\":\n System.out.println(\"United States\");\n break;\n case \"de\":\n System.out.println(\"Germany\");\n break;\n case \"hu\":\n System.out.println(\"Hungary:\");\n break;\n default:\n System.out.println(\"Unknown\");\n }\n\n }", "public static String transformGFM(IStoredSettings settings, String input, String repositoryName) {\r\n\t\tString text = input;\r\n\r\n\t\t// strikethrough\r\n\t\ttext = text.replaceAll(\"~~(.*)~~\", \"<s>$1</s>\");\r\n\t\ttext = text.replaceAll(\"\\\\{(?:-){2}(.*)(?:-){2}}\", \"<s>$1</s>\");\r\n\r\n\t\t// underline\r\n\t\ttext = text.replaceAll(\"\\\\{(?:\\\\+){2}(.*)(?:\\\\+){2}}\", \"<u>$1</u>\");\r\n\r\n\t\t// strikethrough, replacement\r\n\t\ttext = text.replaceAll(\"\\\\{~~(.*)~>(.*)~~}\", \"<s>$1</s><u>$2</u>\");\r\n\r\n\t\t// highlight\r\n\t\ttext = text.replaceAll(\"\\\\{==(.*)==}\", \"<span class='highlight'>$1</span>\");\r\n\r\n\t\tString canonicalUrl = settings.getString(Keys.web.canonicalUrl, \"https://localhost:8443\");\r\n\r\n\t\t// emphasize and link mentions\r\n\t\tString mentionReplacement = String.format(\" **[@$1](%1s/user/$1)**\", canonicalUrl);\r\n\t\ttext = text.replaceAll(\"\\\\s@([A-Za-z0-9-_]+)\", mentionReplacement);\r\n\r\n\t\t// link ticket refs\n\t\tString ticketReplacement = MessageFormat.format(\"$1[#$2]({0}/tickets?r={1}&h=$2)$3\", canonicalUrl, repositoryName);\n\t\ttext = text.replaceAll(\"([\\\\s,]+)#(\\\\d+)([\\\\s,:\\\\.\\\\n])\", ticketReplacement);\n\n\t\t// link commit shas\r\n\t\tint shaLen = settings.getInteger(Keys.web.shortCommitIdLength, 6);\r\n\t\tString commitPattern = MessageFormat.format(\"\\\\s([A-Fa-f0-9]'{'{0}'}')([A-Fa-f0-9]'{'{1}'}')\", shaLen, 40 - shaLen);\r\n\t\tString commitReplacement = String.format(\" [`$1`](%1$s/commit?r=%2$s&h=$1$2)\", canonicalUrl, repositoryName);\r\n\t\ttext = text.replaceAll(commitPattern, commitReplacement);\r\n\r\n\t\tString html = transformMarkdown(text);\r\n\t\treturn html;\r\n\t}", "public String fixNumTeam(String input, String team) {\n if (input.length() < 4) {\n //System.out.println(\"Shorter than 4 digits\");\n return fixNumTeam(\"0\".concat(input), team);\n } else if (input.length() > 4) {\n System.out.println(\"Err - Longer than 4\");\n //JOptionPane.showMessageDialog(tester,\n // team + \" team number greater than 4 digits\",\n // \"Team number error\",\n // JOptionPane.ERROR_MESSAGE);\n input = input.substring(0, 4);\n }\n return input;\n }", "public static String checkNameFormat(String str, String name, String error, String format) {\r\n String rep = \"\"; // contain one word to using for Uppercase\r\n StringTokenizer temp = new StringTokenizer(name, \" \");//Help split off words for rep to Uppercase words\r\n name = \"\";\r\n while (temp.hasMoreTokens()) {\r\n rep = temp.nextToken().trim();// Spliting off\r\n boolean match = rep.matches(format);// check if right format\r\n if (match == false) {\r\n name = name + \" \" + rep.substring(0, 1).toUpperCase() + rep.substring(1);//Upper case first character\r\n rep = \"\"; //reset to null for next word\r\n } else {\r\n System.out.println(\"Error Name! please input again!\");//if not right format then input again\r\n name = getName(str, error, format);//Re-input\r\n }\r\n }\r\n //if all valid then return name\r\n return name.trim();\r\n }", "public void update() {\n System.out.print(\"What do you want to update? A person, address, house, reunion, \" +\n \"or relationship? \");\n Scanner scan = new Scanner(System.in);\n String toUpdate = scan.nextLine();\n if (toUpdate.equalsIgnoreCase(\"person\")) {\n updatePerson();\n }\n else if (toUpdate.equalsIgnoreCase(\"address\")) {\n updateAddress();\n }\n else if (toUpdate.equalsIgnoreCase(\"house\")) {\n updateHouse();\n }\n else if (toUpdate.equalsIgnoreCase(\"reunion\")) {\n // show all reunions\n this.updateReunion();\n }\n else if (toUpdate.equalsIgnoreCase(\"relationship\")) {\n // show all reunions\n this.updateRelationship();\n }\n }", "private FontBoxFont findFont(FontFormat format, String postScriptName) {\n/* 403 */ if (postScriptName == null)\n/* */ {\n/* 405 */ return null;\n/* */ }\n/* */ \n/* */ \n/* 409 */ if (this.fontProvider == null)\n/* */ {\n/* 411 */ getProvider();\n/* */ }\n/* */ \n/* */ \n/* 415 */ FontInfo info = getFont(format, postScriptName);\n/* 416 */ if (info != null)\n/* */ {\n/* 418 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 422 */ info = getFont(format, postScriptName.replaceAll(\"-\", \"\"));\n/* 423 */ if (info != null)\n/* */ {\n/* 425 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 429 */ for (String substituteName : getSubstitutes(postScriptName)) {\n/* */ \n/* 431 */ info = getFont(format, substituteName);\n/* 432 */ if (info != null)\n/* */ {\n/* 434 */ return info.getFont();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 439 */ info = getFont(format, postScriptName.replaceAll(\",\", \"-\"));\n/* 440 */ if (info != null)\n/* */ {\n/* 442 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 446 */ info = getFont(format, postScriptName + \"-Regular\");\n/* 447 */ if (info != null)\n/* */ {\n/* 449 */ return info.getFont();\n/* */ }\n/* */ \n/* 452 */ return null;\n/* */ }", "protected TextStyle getApplicableStyle( String word, int type ) \r\n\t{\r\n\t\tTextStyle toApply = null;\r\n\t\tswitch(type)\r\n\t\t{\r\n\t\tcase Token.KEYWORD:\r\n\t\t\tif (isFunction(word))\r\n\t\t\t{\r\n\t\t\t\ttoApply = m_scheme.getStyle(TokenTypes.SPEL);\r\n\t\t\t}\r\n\t\t\telse if (isLanguage(word))\r\n\t\t\t{\r\n\t\t\t\ttoApply = m_scheme.getStyle(TokenTypes.CODE);\r\n\t\t\t}\r\n\t\t\telse if (isModifier(word))\r\n\t\t\t{\r\n\t\t\t\ttoApply = m_scheme.getStyle(TokenTypes.MODIFIER);\r\n\t\t\t}\r\n\t\t\telse if (isConstant(word))\r\n\t\t\t{\r\n\t\t\t\ttoApply = m_scheme.getStyle(TokenTypes.CONSTANT);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttoApply = m_scheme.getStyle(TokenTypes.NORMAL);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase Token.LINE_COMMENT:\r\n\t\t\ttoApply = m_scheme.getStyle(TokenTypes.COMMENT);\r\n\t\t\tbreak;\r\n\t\tcase Token.NORMAL:\r\n\t\t\t// Easier than using a pattern for recognising numbers\r\n\t\t\tif (isNumber(word))\r\n\t\t\t{\r\n\t\t\t\ttoApply = m_scheme.getStyle(TokenTypes.NUMBER);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttoApply = m_scheme.getStyle(TokenTypes.NORMAL);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase Token.WHITESPACE:\r\n\t\tcase Token.EOF:\r\n\t\t\tbreak;\r\n\t\tcase Token.SEPARATOR:\r\n\t\tcase Token.SPECIAL_SEQUENCE:\r\n\t\t\ttoApply = m_scheme.getStyle(TokenTypes.SYMBOL);\r\n\t\t\tbreak;\r\n\t\tcase Token.STRING:\r\n\t\t\ttoApply = m_scheme.getStyle(TokenTypes.STRING);\r\n\t\t\tbreak;\r\n\t\tcase Token.UNKNOWN:\r\n\t\tdefault:\r\n\t\t\ttoApply = m_scheme.getDefaultStyle();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn toApply;\r\n\t}", "public Pizza makePizza(String newPizzaType){\n if(newPizzaType.equals(\"a\")){\r\n return new CheesePizza();\r\n }\r\n else if(newPizzaType.equals(\"b\")){\r\n return new VeggiePizza();\r\n }\r\n else if(newPizzaType.equals(\"c\")){\r\n return new ChickenPizza(); \r\n }\r\n else{ \r\n return null; \r\n }\r\n \r\n }", "@RequestMapping(value = \"/themeChange\", method = RequestMethod.GET)\n\tpublic String getThemeChange(ModelMap model, HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows CustomException {\n\n\t\tlog.info(\"Received request for theme change\");\n\n\t\tEndUser endUser = endUserDAOImpl.findByUsername(getCurrentLoggedUserName()).getSingleResult();\n\t\tif (endUser.getTheme() == null)\n\t\t\tthemeResolver.setThemeName(request, response, \"themeBlue\");\n\t\tif (!endUser.getTheme().equalsIgnoreCase(request.getParameter(\"theme\"))) {\n\n\t\t\tif (request.getParameter(\"theme\").equalsIgnoreCase(\"themeBlue\")) {\n\t\t\t\tthemeResolver.setThemeName(request, response, \"themeBlue\");\n\t\t\t} else if (request.getParameter(\"theme\").equalsIgnoreCase(\"themeGreen\")) {\n\t\t\t\tthemeResolver.setThemeName(request, response, \"themeGreen\");\n\t\t\t} else if (request.getParameter(\"theme\").equalsIgnoreCase(\"themeOrange\")) {\n\t\t\t\tthemeResolver.setThemeName(request, response, \"themeOrange\");\n\t\t\t} else if (request.getParameter(\"theme\").equalsIgnoreCase(\"themeRed\")) {\n\t\t\t\tthemeResolver.setThemeName(request, response, \"themeRed\");\n\t\t\t}\n\n\t\t\tendUser.setTheme(request.getParameter(\"theme\"));\n\t\t\tendUserDAOImpl.update(endUser);\n\t\t} else\n\t\t\tthemeResolver.setThemeName(request, response, endUser.getTheme());\n\n\t\treturn \"redirect:adminPage\";\n\t}", "public static String changeModality(Scanner input){\n String modality;\n System.out.println(\"\\nAvailable options in the current version are:\\n\"+\n \"(1) Flashcards (Practice with your questions and answers!)\\n\"+\n \"(2) Number mania (Practice your mathemathical abilities!\\n\"+\n \"(3) Russian Roulette (Answer as much questions as you can before you die!)\\n\"+\n \"(4) Hangman (Guess which letters form the answer for a given questions!)\\n\"+\n \"(5) Roch, Paper or Scissor (Try to beat the I.A. to get as much lives you can to answer a question!)\\n\"+\n \"(6) Create a new set of questions\\n\"+\n \"Exit (exit)\\n\"\n +\"Enter the number of the mini game you wish to load, or write \\\"exit\\\" to leave Teacher.app\");\n modality=input.nextLine();\n while(true){\n switch(modality){\n case \"1\":case \"2\":case \"3\":case \"4\": case \"5\": case \"6\": case \"exit\":\n return modality;\n default:\n System.out.println(\"Write a valid option\");\n modality=input.nextLine();\n }\n }\n }", "public static Theme get(String literal) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tTheme result = VALUES_ARRAY[i];\n\t\t\tif (result.toString().equals(literal)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public void fix5() {\n\t\tBufferedReader br;\n\t\tString name;\n\t\t\n\t\ttry {\n\t\t\tSystem.out.println(\"Enter the correct option name:\\n\");\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tname = br.readLine();\n\t\t\treturnStr = name;\n\t\t} catch (Exception e) {\n\t //return null;\n\t }\n\t}", "public String TreatUserFan(String userFan)\n {\n String fan = \"number:3\";\n if (userFan.equals(\"0\"))\n fan = \"number:3\"; // auto segundo app android\n else if (userFan.equals(\"1\"))\n fan = \"number:2\"; // fraco ''\n else if (userFan.equals(\"2\"))\n fan = \"number:1\"; // medio ''\n else if (userFan.equals(\"3\"))\n fan = \"number:0\"; // forte ''\n return fan;\n }", "private void fixPeople(NameInfo nameInfo) {\n\t\tString type = nameInfo.getType();\n\t\tif (type.equals(NameInfo.GENERIC_TYPE)) {\n\t\t\tString name = nameInfo.getName();\n\t\t\tString tokens[] = name.split(\"\\\\s+\");\n\t\t\tboolean isPeople = false;\n\t\t\tfor (String token : tokens) {\n\t\t\t\tif (peopleMan.isValidPeopleName(token)) {\n\t\t\t\t\tisPeople = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isPeople == true)\n\t\t\t\tnameInfo.setType(\"PER\");\n\t\t}\n\t}", "static String fixInputLine(String input){\n\t\tString fixed = input;\n\n\t\tfor(int i = 0; i < 10; i++){ //run 10 passes, getting rid of redundant tabs.\n\t\t\tfixed = fixed.replaceAll(\"\\\\\\t\\\\\\t\", \"\\t\");\n\t\t}\n\n\t\t//turn any remaining tabs into % characters. \n\n\t\tfixed = fixed.replaceAll(\"\\\\\\t\", \"%\");\n\n\t\t//System.out.println(fixed);\n\t\treturn fixed;\n\t}", "static private String formats(String target)\n\t{\n\t\tString tmp = target.trim();\n\t\tif (tmp.length() < 1) return \"NaName\";\n\t\treturn (Character.toString(tmp.charAt(0)).toUpperCase()) + tmp.substring(1,tmp.length()).toLowerCase();\n\t}", "@Override\n\tpublic String editPriyom(String priyom) {\n\t\treturn null;\n\t}", "String getTheme();", "private String formatOutput(String raw) {\r\n // Remove quotes\r\n String formatted = raw.replace(\"\\\"\", \"\");\r\n //Capitalize first letter\r\n formatted = formatted.substring(0,1).toUpperCase() + formatted.substring(1);\r\n \r\n return formatted;\r\n }", "public static String getPriority(String userInput) throws InvalidPriorityException {\n String[] components = userInput.split(\"/priority \");\n String priority = components[1];\n if (isValidPriority(priority)) {\n return priority;\n } else {\n throw new InvalidPriorityException();\n }\n }", "public void updateGrepStyle()\n\t{\n\t\tgrepStyle.setName(textName.getText());\n\t\tgrepStyle.setBold(cbBold.getSelection());\n\t\tgrepStyle.setItalic(cbItalic.getSelection());\n\t\tgrepStyle.setForeground(cpForeground.getEffectiveColor());\n\t\tgrepStyle.setBackground(cpBackground.getEffectiveColor());\n\t\tgrepStyle.setUnderline(cpUnderline.isChecked());\n\t\tgrepStyle.setUnderlineColor(cpUnderline.getColor()); \n\t\tgrepStyle.setStrikeout(cpStrikethrough.isChecked());\n\t\tgrepStyle.setStrikeoutColor(cpStrikethrough.getColor());\n\t\tgrepStyle.setBorder(cpBorder.isChecked());\n\t\tgrepStyle.setBorderColor(cpBorder.getColor());\n\t}", "void applyTheme(T theme);", "public static String findDepartmentColorCode(String department) {\n String dept;\n if (department == null) {\n return \"#FFFFFF\";\n } else {\n dept = department.toLowerCase();\n }\n if (\"treasury\".equals(dept)) {\n return \"#0a8141\";\n } else if (\"department of the treasurer\".equals(dept)) {\n return \"#0a8141\";\n } else if (\"secretarial\".equals(dept)) {\n return \"#3a53a5\";\n } else if (\"department of the secretary\".equals(dept)) {\n return \"#3953a4\"; // Not sure which color code is correct, this is from 2016\n// return \"#3a53a5\";\n } else if (\"relations\".equals(dept)) {\n return \"#f282b4\";\n } else if (\"publicity\".equals(dept)) {\n return \"#e0e0e0\";\n } else if (\"programming\".equals(dept)) {\n return \"#6b52a2\";\n } else if (\"operations\".equals(dept)) {\n return \"#ec2426\";\n } else if (\"membership\".equals(dept)) {\n return \"#f57f20\";\n } else if (\"infrastructure\".equals(dept)) {\n return \"#414242\";\n } else if (\"chair\".equals(dept)) {\n return \"#f99f1d\";\n } else if (\"department of the chair\".equals(dept)) {\n return \"#f99f1d\";\n } else {\n System.out.println(\"Warning, couldn't find color code for \" + department);\n return \"#FFFFFF\";\n }\n }", "private String preprocessName(String original){\n\t\t// Remove non-alphabetical characters from the name\n\t\toriginal = original.replaceAll( \"[^A-Za-z]\", \"\" );\n\t\t\t\t\n\t\t// Convert to uppercase to help us ignore case-sensitivity\n\t\toriginal = original.toUpperCase();\n\t\t\n\t\t// Remove all occurences of the letters outlined in step 3\n\t\toriginal = original.substring(0,1) + original.substring(1).replaceAll(\"[AEIHOUWY]\",\"\");\n\t\t\n\t\t// Return the result\n\t\treturn original;\n\t}", "private void convertInput(double input) {\n\n if (input != 0) {\n // Set standard value in meters based on selected unit\n switch (selectedUnit) {\n case \"km\":\n standard = input / 0.001;\n break;\n case \"m\":\n standard = input;\n break;\n case \"cm\":\n standard = input / 100;\n break;\n case \"mm\":\n standard = input / 1000;\n break;\n case \"μm\":\n standard = input / 1000000;\n break;\n case \"nm\":\n standard = input / 1000000000;\n break;\n case \"mi\":\n standard = input / 0.000621371;\n break;\n case \"yd\":\n standard = input / 1.09361;\n break;\n case \"ft\":\n standard = input / 3.28084;\n break;\n case \"in\":\n standard = input / 39.3701;\n break;\n default:\n standard = input;\n break;\n }\n //km\n kmTextView.setText(numberFormatter(standard * 0.001));\n //m\n mTextView.setText(numberFormatter(standard * 1));\n //cm\n cmTextView.setText(numberFormatter(standard * 100));\n //mm\n mmTextView.setText(numberFormatter(standard * 1000));\n //um\n umTextView.setText(numberFormatter(standard * 1000000));\n //nm\n nmTextView.setText(numberFormatter(standard * 1000000000));\n //mi\n miTextView.setText(numberFormatter(standard * 0.000621371));\n //yd\n ydTextView.setText(numberFormatter(standard * 1.09361));\n //ft\n ftTextView.setText(numberFormatter(standard * 3.28084));\n //in\n inTextView.setText(numberFormatter(standard * 39.3701));\n } else {\n //km\n kmTextView.setText(\"\");\n //m\n mTextView.setText(\"\");\n //cm\n cmTextView.setText(\"\");\n //mm\n mmTextView.setText(\"\");\n //um\n umTextView.setText(\"\");\n //nm\n nmTextView.setText(\"\");\n //mi\n miTextView.setText(\"\");\n //yd\n ydTextView.setText(\"\");\n //ft\n ftTextView.setText(\"\");\n //in\n inTextView.setText(\"\");\n }\n }", "public static void main(String[] args) {\nString Arshia=\"Super Cool\";\r\nString Ashay=\"Hard-working\";\r\nString Devin=\"Positive\";\r\nString Andrew=\"Helpful\";\r\nString Darren=\"Kind and Nice\";\r\n\t\t// 2. Ask the user to enter a name. Store their answer in a variable.\r\nString input= JOptionPane.showInputDialog(null, \"Enter a name\");\r\nif(input.equalsIgnoreCase(\"Arshia\")) {\r\nJOptionPane.showMessageDialog(null, Arshia);\r\n\r\n}else if( input.equalsIgnoreCase(\"Ashay\")){\r\n\tJOptionPane.showMessageDialog(null, Ashay);\r\n\tif(input.equalsIgnoreCase(\"Devin\")) {\r\n\t\tJOptionPane.showMessageDialog(null, Devin);\r\n\t\tif(input.equalsIgnoreCase(\"Andrew\")) {\r\n\t\t\tJOptionPane.showMessageDialog(null, Andrew);\r\n\t\t\tif(input.equalsIgnoreCase(\"Darren\")) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, Darren);\r\n\t\t\r\n\r\n// 3. In a pop-up, tell the user what is remarkable about that person. \r\n}\r\n\t}\r\n}\r\n}\r\n}", "public void convert() {\r\n if (text != null && !text.isEmpty()) {\r\n // trim spaces at the edges, convert all to lowercase and\r\n // remove all non-alpha numeric characters\r\n String url = text.trim().toLowerCase().replaceAll(\"[^a-z0-9_\\\\s-]\", \"\"); \r\n // change all multiple white spaces to single white space\r\n url = url.replaceAll(\"[\\\\s-]+\", \" \");\r\n // replace all the single white spaces with a dash\r\n seoUrl = url.replaceAll(\"[\\\\s]\", \"-\");\r\n // at this point we will save the product in the database \r\n // with SEO friendly URL appended with the product ID at the end\r\n // Let's say the product ID is 12345\r\n Long productId = 12345L;\r\n seoUrl += \"-\" + productId; \r\n System.out.println(\"SEO Friendly URL --> \" + seoUrl);\r\n } else {\r\n seoUrl = \"Please enter text to convert\";\r\n }\r\n }", "public static void main(String[] args) {\n\t\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tPets pet1 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet2 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet3 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet4 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet5 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet6 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet7 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet8 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet9 = new Pets(null, null, 0, null, null, 0);\n\t\tPets pet10 = new Pets(null, null, 0, null, null, 0);\n\t\t\n\t\tPets[] allPets = {pet1,pet2,pet3,pet4,pet5,pet6,pet7,pet8,pet9,pet10};\n\t\tint i = 0;\n\t\tfor (Pets individualPets : allPets) {\n\t\t\ti++;\n\t\t\tSystem.out.println(\"Enter the data for the \" + i + \" pet\");\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"Enter the name\");\n\t\t\t\tindividualPets.name = bufferedReader.readLine();\n\t\t\t\tSystem.out.println(\"Enter the type\");\n\t\t\t\tindividualPets.type = bufferedReader.readLine();\n\t\t\t\tSystem.out.println(\"Enter the age\");\n\t\t\t\tString age = bufferedReader.readLine();\n\t\t\t\tindividualPets.age = Integer.parseInt(age);\n\t\t\t\tSystem.out.println(\"Enter the gender\");\n\t\t\t\tindividualPets.gender = bufferedReader.readLine();\n\t\t\t\tSystem.out.println(\"Enter the color\");\n\t\t\t\tindividualPets.color = bufferedReader.readLine();\n\t\t\t\tSystem.out.println(\"Enter the size\");\n\t\t\t\tString size = bufferedReader.readLine();\n\t\t\t\tindividualPets.size = Integer.parseInt(size);\n\t\t\t} \n\t\t\t\tcatch(IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (Pets individualPets : allPets) {\n\t\t\tSystem.out.println(\"-------------------\");\n\t\t\tSystem.out.println(\"name: \" + individualPets.name);\n\t\t\tSystem.out.println(\"type:\" + individualPets.type);\n\t\t\tSystem.out.println(\"age:\" + individualPets.age);\n\t\t\tSystem.out.println(\"gender:\" + individualPets.gender);\n\t\t\tSystem.out.println(\"color:\" + individualPets.color);\n\t\t\tSystem.out.println(\"size:\" + individualPets.size);\n\t\t}\n\t}", "private FontBoxFont findFontBoxFont(String postScriptName) {\n/* 374 */ Type1Font t1 = (Type1Font)findFont(FontFormat.PFB, postScriptName);\n/* 375 */ if (t1 != null)\n/* */ {\n/* 377 */ return (FontBoxFont)t1;\n/* */ }\n/* */ \n/* 380 */ TrueTypeFont ttf = (TrueTypeFont)findFont(FontFormat.TTF, postScriptName);\n/* 381 */ if (ttf != null)\n/* */ {\n/* 383 */ return (FontBoxFont)ttf;\n/* */ }\n/* */ \n/* 386 */ OpenTypeFont otf = (OpenTypeFont)findFont(FontFormat.OTF, postScriptName);\n/* 387 */ if (otf != null)\n/* */ {\n/* 389 */ return (FontBoxFont)otf;\n/* */ }\n/* */ \n/* 392 */ return null;\n/* */ }", "@Override\n\t\t\tprotected Type convert(String text) {\n\t\t\t\tType t = null;\n\t\t\t\ttry {\n\t\t\t\t\t// return null if the types do not match the\n\t\t\t\t\t// original\n\t\t\t\t\tt = Type.getType(text);\n\t\t\t\t\tif (t == null || !match(t, original)) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {}\n\t\t\t\treturn t;\n\t\t\t}", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "@Override\r\n\tprotected Pizza createPizza(String type) {\n\t\tif(type.equals(\"cheese\")) {\r\n\t\t\treturn new NYStyleCheesePizza();\r\n\t\t}\r\n\t\telse return null;\r\n\t}", "private String saisieString(String typeChoice) {\n\t\tSystem.out.println(typeChoice);\n\t\tString persoString= sc.nextLine();\n\t\treturn persoString;\n\t}", "public static void main(String[] args) {\n\t\tPokemon firstPokemon = new Pokemon(\" P1 Typhlosion \", 1600, \" Fire \" , \" Healthy \" , \"Scratch\" , \"Bite\" , \"Fire Blast\", 300 , 375 , 450);\r\n\t\t Pokemon secondPokemon = new Pokemon(\" P2 Snorlax \", 1300, \" Normal \" , \" Healthy \" , \"Body Slam\" , \"Sleep\" , \"Swallow\", 500 , 100 , 200);\r\n\t\t System.out.println (firstPokemon.name + firstPokemon.health + firstPokemon.type + firstPokemon.status );\r\n\t\t System.out.println (secondPokemon.name + secondPokemon.health + secondPokemon.type + secondPokemon.status );\r\n\t\t Scanner myObj = new Scanner(System.in);\r\n\t\t\r\n\t\t \r\n\t\t System.out.println( \"P1 Turn. Enter number for corresponding attack! \" );\r\n\t\t System.out.println( \" 1(\" + firstPokemon.pAttack1 +\")\"+ \" 2(\" + firstPokemon.pAttack2 +\")\"+ \" 3(\" + firstPokemon.pAttack3 +\")\" );\r\n\t\t String battleCommand = myObj.nextLine();\r\n\t\t System.out.println (battleCommand);\r\n\t\t if (battleCommand.charAt(0) == '1') {\r\n\t\t\t System.out.println (firstPokemon.pAttack1);\r\n\t\t }\r\n\t\t else if (battleCommand.charAt(0) == '2') {\r\n\t\t\t System.out.println (firstPokemon.pAttack2);\r\n\t\t }\r\n\t\t else if (battleCommand.charAt(0) == '3') {\r\n\t\t\t System.out.println (firstPokemon.pAttack3);\r\n\t\t }\r\n\t\t else {\r\n\t\t\t System.out.println(\"Please enter the correct number.\");\r\n\t\t\t \r\n\t\t }\r\n\t}", "private String format(String text) {\n if(text != null && !text.isEmpty())\n return text.substring(0, 1).toUpperCase(Locale.ENGLISH) + text.substring(1);\n else\n return \"\";\n }", "static String filterString(Object o, String str) {\r\n // if (o instanceof Named) {\r\n // Named n = (Named) o;\r\n // str = str.replace(\"$name\", n.getName());\r\n // // System.out.println(n.getName());\r\n // }\r\n // if (o instanceof Described) {\r\n // Described n = (Described) o;\r\n // str = str.replace(\"$description\", n.getDescription());\r\n // }\r\n return str;\r\n }", "private void getUserTypeChoice() {\n mTypeInput = \"(\";\n if (mBinding.chipApartment.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput = mTypeInput + \"'Apartment'\";\n }\n if (mBinding.chipLoft.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput += \"'Loft'\";\n }\n if (mBinding.chipHouse.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput += \"'House'\";\n }\n if (mBinding.chipVilla.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput += \"'Villa'\";\n }\n if (mBinding.chipManor.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput += \"'Manor'\";\n }\n mTypeInput += \")\";\n }", "private static Person createPerson(String type, Scanner input) {\n System.out.println(\"\\nPlease enter the details of the \" + type + \": \");\n System.out.println(\"\\nName: \");\n String name = input.nextLine();\n\n System.out.println(\"\\nContact number: \");\n String contactNo = input.nextLine();\n\n System.out.println(\"\\nEmail address : \");\n String email = input.nextLine();\n\n System.out.println(\"\\nAddress: \");\n String address = input.nextLine();\n\n return new Person(type, name, contactNo, email, address);\n\n }", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n // 1\n// System.out.print(\"Please enter your favorite number: \");\n// int userNumber = input.nextInt();\n// System.out.printf(\"Your favorite number is %d%n\", userNumber);\n// //Q.1: Error thrown = InputMismatchException - something to do with casting\n//\n// // 2\n System.out.println(\"Please enter 3 random words.\");\n String firstWord = input.next();\n String middleWord = input.next();\n String lastWord = input.next();\n System.out.printf(\"%s, %s, and %s are your 3 words.%n\", firstWord, middleWord, lastWord);\n// // Q.1: Cannot enter less than 3 words - have to enter something to move to next command\n// // Q.2: It doesn't pick up the 4th word - does it store it somewhere? Looks like it's wiped entirely\n\n//\n// // 3\n System.out.println(\"Please enter your favorite quote.\");\n input.nextLine();\n String userQuote = input.nextLine();\n System.out.printf(\"Your quote: %s\", userQuote);\n// // Q.1: Only picks up a single word. Discovery - whatever input is submitted, the .next method will pick up (ex: I entered dog 4 times in E.2, and my quote filled with 1 dog)\n\n\n\n // Calculate perimeter and area of Codeup's classroom\n\n // 1\n// System.out.println(\"Please enter the length of Codeup's classroom in feet\");\n// int length = Integer.parseInt(input.nextLine());\n//\n// System.out.println(\"Pleae enter the width of Codeup's classroom\");\n// int width = Integer.parseInt(input.nextLine());\n//\n// int area = length*width;\n// int perimeter = length*2 + width*2;\n//\n// System.out.printf(\"Length: %dft%nWidth: %dft%nArea: %dft%nPerimeter: %dft%n\", length, width, area, perimeter);\n\n }", "private static void format() {\n\t\tSystem.out.println(\"\\nThe following is a sample input file.\");\n\t\tSystem.out.println(\"-----------------------------------------\");\n\t\tSystem.out.println(\"low\\t\\t\\t // The first line should be the wind speed (low or high\");\n\t\tSystem.out.println(\"Babe:cscow:32.54\\r\\n\" + \n\t\t\t\t\"Renegade:420:38.01\\r\\n\" + \n\t\t\t\t\"Top:xboat:41.20\\r\\n\" + \n\t\t\t\t\"Jeanie-K:xboat:41.35\\r\\n\" + \n\t\t\t\t\"JuiceBox:capri:42.40\\r\\n\" + \n\t\t\t\t\"LadyBug:nj2k:55.40\\r\\n\" + \n\t\t\t\t\"XQ'sMe:xboat:56.58\\r\\n\" + \n\t\t\t\t\"Steve:mcscow:57.29\\r\\n\" + \n\t\t\t\t\"TunaFish:nj2k:60.32\\r\\n\" + \n\t\t\t\t\"NoName:nj2k:67.20\");\n\t\tSystem.out.println(\"-----------------------------------------\");\n\t\tSystem.out.println(\"Each boat entry follows the pattern of name:type:time\");\n\t\tSystem.out.println(\"Boat times should be formatted as mm.ss\");\n\t\tSystem.out.println(\"\\nThe total list of boat types can be seen with the types command.\\n\");\n\t}", "public synchronized void doStuff(String input) {\n\n\t\tif (input.equalsIgnoreCase(\"refresh\") || input.equalsIgnoreCase(\"\")) {\n\t\t\tgetSquare().refresh();\n\t\t} else if (input.equalsIgnoreCase(\"exit\")) {\n\t\t\tSystem.exit(0);\n\t\t} else if (input.equalsIgnoreCase(\"delete restaurants\")) {\n\t\t\tgetSquare().deleteAllPlaceblesOfType(Restaurant.class);\n\t\t\tSystem.out.println(\"All Restaurants deleted\");\n\t\t} else if (input.equalsIgnoreCase(\"delete hotels\")) {\n\t\t\tgetSquare().deleteAllPlaceblesOfType(Hotel.class);\n\t\t\tSystem.out.println(\"All Hotels deleted\");\n\t\t} else if (input.equalsIgnoreCase(\"delete fences\")) {\n\t\t\tgetSquare().deleteAllPlaceblesOfType(Fence.class);\n\t\t\tSystem.out.println(\"All Fences deleted\");\n\t\t} else if (input.equalsIgnoreCase(\"delete people\")) {\n\t\t\tgetSquare().deleteAllPlaceblesOfType(Person.class);\n\t\t\tSystem.out.println(\"All People deleted\");\n\t\t} else if (input.equalsIgnoreCase(\"clear\")) {\n\t\t\tgetSquare().clear();\n\t\t\tSystem.out.println(\"Square cleared\");\n\t\t} else if (input.startsWith(\"set sleep time to \")) {\n\t\t\ttry {\n\t\t\t\tchar[] sleepTimeStr = new char[input.length() - 18];\n\t\t\t\tinput.getChars(18, input.length(), sleepTimeStr, 0);\n\t\t\t\t\n\t\t\t\tint newSleepTime = Integer.parseInt(String.valueOf(sleepTimeStr));\n\t\t\t\tsetSleepTime(newSleepTime);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\t}\n\t\t}\n\n\t\tdrawer.setPlacebles(square.getPlacebles());\n\t\tdrawer.repaint();\n\n\t}", "private <T> T formatObject(String objectName, JSONObject object, Class objectClass){\n Gson gson = new Gson();\n String stringObject = object.getJSONObject(objectName).toString();\n T formattedObject = (T) gson.fromJson(stringObject,objectClass);\n return formattedObject;\n }", "private void bearbeitenAuswahlAuswaerten(Freund foundFriend) throws Exception {\n Scanner input = new Scanner(System.in);\n int auswahl = 0;\n if (input.hasNextInt()) {\n auswahl = input.nextInt(); // was wenn String\n } else {\n System.out.println(\"Please use a number between 1 and 6. You used: \" + input.next());\n bearbeitenAuswahlAuswaerten(foundFriend);\n }\n input.nextLine();\n\n switch (auswahl) {\n case 1: {\n\n System.out.println(\"Bitte den neuen VORNAMEN eingeben und mit RETURN bestaetigen\");\n\n Scanner newInput = new Scanner(System.in);\n String eingabe = foundFriend.getVorname();\n if (newInput.hasNextLine()) {\n eingabe = newInput.nextLine();\n }\n foundFriend.setVorname(eingabe);\n karteiAktualisieren(foundFriend);\n System.out.println(\"Vorname geaendert zu : \" + foundFriend.getVorname());\n break;\n }\n case 2: {\n\n System.out.println(\"Bitte den neuen NACHNAMEN eingeben und mit RETURN bestaetigen\");\n\n Scanner newInput = new Scanner(System.in);\n String eingabe = foundFriend.getNachname();\n if (newInput.hasNextLine()) {\n eingabe = newInput.nextLine();\n }\n foundFriend.setNachname(eingabe);\n karteiAktualisieren(foundFriend);\n System.out.println(\"Nachname geaendert zu : \" + foundFriend.getNachname());\n break;\n }\n case 3: {\n\n System.out.println(\"Bitte den neuen HANDY eingeben und mit RETURN bestaetigen\");\n\n Scanner newInput = new Scanner(System.in);\n String eingabe = foundFriend.getHandy();\n if (newInput.hasNext()) {\n eingabe = newInput.next();\n }\n foundFriend.setHandy(eingabe);\n karteiAktualisieren(foundFriend);\n System.out.println(\"Handy geaendert zu : \" + foundFriend.getHandy());\n break;\n }\n case 4: {\n System.out.println(\"Bitte den neuen TELEFON eingeben und mit RETURN bestaetigen\");\n Scanner newInput = new Scanner(System.in);\n String eingabe = foundFriend.getTelefon();\n if (newInput.hasNext()) {\n eingabe = newInput.next();\n }\n foundFriend.setTelefon(eingabe);\n karteiAktualisieren(foundFriend);\n System.out.println(\"Telefon geaendert zu : \" + foundFriend.getTelefon());\n break;\n }\n case 5: {\n\n System.out.println(\"Bitte den neuen ADRESSE eingeben und mit RETURN bestaetigen\");\n\n Scanner newInput = new Scanner(System.in);\n String eingabe = foundFriend.getAdresse();\n if (newInput.hasNextLine()) {\n eingabe = newInput.nextLine();\n }\n foundFriend.setAdresse(eingabe);\n karteiAktualisieren(foundFriend);\n System.out.println(\"Adresse geaendert zu : \" + foundFriend.getAdresse());\n break;\n }\n }\n\n }", "void rezervasyonYap(String name, String surname, String islem);", "private void getUserTextInput() {\n if (!TextUtils.isEmpty(mBinding.fragmentSearchZipcodeTxt.getText()))\n mZipcodeInput = Integer.parseInt(mBinding.fragmentSearchZipcodeTxt.getText().toString().trim());\n if (!TextUtils.isEmpty(mBinding.fragmentSearchCityTxt.getText()))\n mCityInput = mBinding.fragmentSearchCityTxt.getText().toString().trim();\n if (!TextUtils.isEmpty(mBinding.fragmentSearchMinSurfaceTxt.getText()))\n mMinSurfaceInput = Utils.convertAreaAccordingToPreferences(mActivity, mBinding.fragmentSearchMinSurfaceTxt.getText().toString().trim());\n if (!TextUtils.isEmpty(mBinding.fragmentSearchMaxSurfaceTxt.getText()))\n mMaxSurfaceInput = Utils.convertAreaAccordingToPreferences(mActivity, mBinding.fragmentSearchMaxSurfaceTxt.getText().toString().trim());\n if (!TextUtils.isEmpty(mBinding.fragmentSearchMinPriceTxt.getText()))\n mMinPriceInput = Utils.convertPriceAccordingToPreferences(mActivity, mBinding.fragmentSearchMinPriceTxt.getText().toString().trim());\n if (!TextUtils.isEmpty(mBinding.fragmentSearchMaxPriceTxt.getText()))\n mMaxPriceInput = Utils.convertPriceAccordingToPreferences(mActivity, mBinding.fragmentSearchMaxPriceTxt.getText().toString().trim());\n if (!TextUtils.isEmpty(mBinding.fragmentSearchMinFloorsTxt.getText()))\n mFloorsInput = Integer.parseInt(mBinding.fragmentSearchMinFloorsTxt.getText().toString().trim());\n if (!TextUtils.isEmpty(mBinding.fragmentSearchForSaleTxt.getText()))\n mForSaleDate = Converters.dateToTimestamp(Utils.convertStringToDate(mBinding.fragmentSearchForSaleTxt.getText().toString().trim()));\n if (!TextUtils.isEmpty(mBinding.fragmentSearchSoldTxt.getText()))\n mSoldDate = Converters.dateToTimestamp(Utils.convertStringToDate(mBinding.fragmentSearchSoldTxt.getText().toString().trim()));\n }", "public Entry buildEntry(String line) {\n\t\tlog.debug(\"line : \" + line);\n\t\t\n\t\tEntry entry = new Entry();\n\t\ttry {\n\t\t\tString[] strList = line.split(\",\");\n\t\t\tint length = strList.length;\n\t\t\t//Checking for phone number values\n\t\t\tif (length == 5)\n\t\t\t{\n\t\t\t\tif(FlatFileUtil.isPhone(strList[2]))\n\t\t\t\t{\n\t\t\t\t\tlog.debug(\"LastName, FirstName, (703)-711-0996, Blue, 11013 - format\");\n\t\t\t\t\tentry.setLastname(strList[0].trim());\n\t\t\t\t\tentry.setFirstname(strList[1].trim());\n\t\t\t\t\tentry.setPhonenumber(strList[2].replaceAll(\"\\\\D+\",\"\"));\n\t\t\t\t\tentry.setColor(strList[3].trim());\n\t\t\t\t\tentry.setZipcode(strList[4].trim());\n\t\t\t\t\t\n\t\t\t\t}else if(FlatFileUtil.isPhone(strList[3])) {\n\t\t\t\t\tlog.debug(\"FirstName, LastName, 12023, 636 121 1111, Yellow - format\");\n\t\t\t\t\tentry.setFirstname(strList[0].trim());\n\t\t\t\t\tentry.setLastname(strList[1].trim());\n\t\t\t\t\tentry.setZipcode(strList[2].trim());\n\t\t\t\t\tentry.setPhonenumber(strList[3].replaceAll(\"\\\\D+\",\"\"));\n\t\t\t\t\tentry.setColor(strList[4].trim());\n\t\t\t\t}\n\t\t\t} else if (length == 4) { \n\t\t\t\tlog.debug(\"FirstName LastName, Purple, 14537, 713 905 0383 - format\");\n\t\t\t\tString[] nameStrList = strList[0].split(\" \");\n\t\t\t\tentry.setFirstname(nameStrList[0].trim());\n\t\t\t\tentry.setLastname(nameStrList[1].trim());\n\t\t\t\tentry.setColor(strList[1].trim());\n\t\t\t\tentry.setZipcode(strList[2].trim());\n\t\t\t\tentry.setPhonenumber(strList[3].replaceAll(\"\\\\D+\",\"\"));\n\t\t\t}\n\t\t} catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn entry;\n\t}", "private void styleIngredientAddPane(){\n InterfaceStyling.setHighlightStyling(ingredNameInput, ingredientColor, defaultColor);\n InterfaceStyling.setHighlightStyling(ingredCalorieInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredSugarInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredProteinInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredFiberInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredCarbsInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredFatInput, ingredientColor , defaultColor);\n InterfaceStyling.setHighlightStyling(ingredQuantityAmountInput, ingredientColor, defaultColor);\n InterfaceStyling.setHighlightStyling(ingredQuantityNameInput, ingredientColor, defaultColor);\n InterfaceStyling.setHighlightStyling(ingredientsBrowseCombo, ingredientColor, defaultColor);\n InterfaceStyling.buttonStyle(btnSaveIngredients, ingredientColor, ingredientColorDark);\n\n //Style all the text in the Pane\n for (Node n: IngredientsAddSubPane.getChildren()){\n if (n.getClass().isInstance(new Text())){\n ((Text) n).setFont(InterfaceStyling.titleFontNonBold);\n ((Text) n).setFill(Paint.valueOf(defaultTextColor));\n\n }\n }\n }", "private String parseMaterialTemplateName(String line) {\n int space_index = line.indexOf(' ') + 1;\n String mtl_name = line.substring(space_index);\n mtl_name = mtl_name.trim();\n return mtl_name;\n }", "private void lookUp(String inputName) {\n \tif (! inputName.equals(\"\")) {\n\t\t\tif (database.containsProfile(inputName)) {\n\t\t\t\tcurrentProfile = database.getProfile(inputName);\n\t\t\t\tcanvas.displayProfile(currentProfile);\n\t\t\t\tcanvas.showMessage(\"Displaying \" + inputName);\n\t\t\t} else {\n\t\t\t\tcurrentProfile = null;\n\t\t\t\tcanvas.removeAll();\n\t\t\t\tcanvas.showMessage(\"A profile with the name \" + inputName + \" does not exist.\");\n\t\t\t}\n\t\t}\n\t}", "public String getOutput(String input)\n\t{\n\t\tString outPutString;\n\t\tboolean memeExists;\n\t\tboolean conversationExists;\n\t\tboolean musicExists;\n\t\tboolean fruitExists;\n\t\tString previousAnswer;\n\n\t\tif ((input == null) || (input.equals(\"\")))\n\t\t{\n\t\t\treturn \"Hello, my name is ChatBot-tle. Ask me a question.\";\n\t\t}\n\t\toutPutString = input.toLowerCase();\n\n\t\tif (outPutString.equals(\"let's talk about math.\"))\n\t\t{\n\t\t\ttalkAboutMath();\n\t\t}\n\t\t\n\t\tpreviousAnswer = answerChecker(outPutString);\n\t\tif (!previousAnswer.equals(\"\"))\n\t\t{\n\t\t\treturn previousAnswer;\n\t\t}\n\t\t\n\t\tfruitExists = fruitChecker(outPutString);\n\t\tif (fruitExists == true)\n\t\t{\n\t\t\treturn \"Mmmm, I love eating fruit. \" + outPutString + \" is very yummy.\";\n\t\t}\n\t\t\n\t\tmemeExists = memeChecker(outPutString);\n\t\tif (memeExists == true) // check if it is a meme that was inputted.\n\t\t{\n\t\t\treturn \"Ahh, I see you are aware of a popular meme! \"\n\t\t\t\t\t+ outPutString + \" is a good meme.\";\n\t\t}\n\t\tmusicExists = musicChecker(outPutString);\n\t\tif (musicExists == true)\n\t\t{\n\t\t\treturn \"Oh, I see you are a fan of music. \" + outPutString\n\t\t\t\t\t+ \" is an awesome instrument!\";\n\t\t}\n\t\tconversationExists = conversationChecker(outPutString);\n\t\tif (conversationExists == true) // check if it is a conversation starter\n\t\t\t\t\t\t\t\t\t\t// that was inputted.\n\t\t{\n\t\t\treturn \"I'm doing well. How are you?\";\n\t\t}\n\t\toutPutString = getRandomTopic();\n\t\treturn outPutString;\n\t}", "public static void main(String[] args) {\n String forename = Keyboard.getText(\"Please enter your forname\");\n //Step 2: ask user for surname\n String surname = Keyboard.getText(\"Please enter your surname\");\n //Step 3: ask user for mothers maiden name\n String maiden = Keyboard.getText(\"Please enter your mothers maiden name\");\n //Step 4: ask user for city in which they were born\n String town = Keyboard.getText(\"Please enter the town where you were born\");\n //Step 5: starwarsname = first 3 letter of surname + first 2 letters of first name + \" \" + first 3 letters of motehrs maiden name + first 2 letters of town you **were born in\n\nString starwarsname = (surname.substring(0,3)+(forename.substring(0,2)) + \" \"+ (maiden.substring(0,3)+ (town.substring(0,2))));\n\n //Step 6: display \"your star wars name is \" + starwarsname\n System.out.println(\"Your Star Wars name is \" + starwarsname);\n }", "private void setInputParams(InputCommand input) throws InvalidCommand {\n if (input.getParams().length < 2) throw new InvalidCommand(\"Please enter car registration no. followed by color\");\n try {\n carRegNo = input.getParams()[0].toUpperCase();\n carColor = input.getParams()[1].toUpperCase();\n } catch (NumberFormatException e) {\n throw new InvalidCommand(\"Something went wrong.\\nMake sure the command is of the format: 'park KA-01-HH-9999 White'\");\n }\n }", "public static void main(String[] args) {\n\n\t\tScanner input = new Scanner(System.in);\n\n\t\tString responseColor;\n\t\t do {\n\t\t\t System.out.println(\"What is your favorite ROYGBIV color?.\");\n\t\t\t System.out.println(\"Type \\\"help\\\" to list options.\");\n\t\t\t responseColor = input.nextLine();\n\t\t\t if(responseColor.toLowerCase().equals(\"help\")) {\n\t\t\t System.out.println(\"Options: red, orange, yellow, green, blue, indigo, violet\");\n\t\t\t }\n\t\t\t } while(responseColor.equals(\"help\"));\n\t\t\t input.close();\n\t\t \n\t\t String car = (\"\"); {\n\t\t } if (responseColor.toLowerCase().equals(\"red\")) {\n\t\t car = \"a Yugo\";\n\t\t } else if (responseColor.toLowerCase().equals(\"orange\")){\n\t\t car = \"public transportation\";\n\t\t } else if (responseColor.toLowerCase().equals(\"yellow\")) {\n\t\t car = \"a VW bus\";\n\t\t } else if (responseColor.toLowerCase().equals(\"green\")) {\n\t\t car = \"a Lamborghini\";\n\t\t } else if (responseColor.toLowerCase().equals(\"blue\")) {\n\t\t car = \"a Mitsubishi Eclipse\";\n\t\t } else if (responseColor.toLowerCase().equals(\"indigo\")){\n\t car = \"a rusty bicycle\";\n\t } else if (responseColor.toLowerCase().equals(\"violet\")){\n\t car = \"a 1977 Chrysler LeBaron\";\n\t\t }\n\t\t {\n\t\t System.out.println(car);\n\t} \n\t}", "private String[] formatEntry(String[] features) {\n if (this.format == DictionaryBuilder.DictionaryFormat.IPADIC) {\n return features;\n } else {\n String[] features2 = new String[13];\n features2[0] = features[0];\n features2[1] = features[1];\n features2[2] = features[2];\n features2[3] = features[3];\n features2[4] = features[4];\n features2[5] = features[5];\n features2[6] = features[6];\n features2[7] = features[7];\n features2[8] = features[8];\n features2[9] = features[9];\n features2[10] = features[11];\n\n // If the surface reading is non-existent, use surface form for reading and pronunciation.\n // This happens with punctuation in UniDic and there are possibly other cases as well\n if (features[13].length() == 0) {\n features2[11] = features[0];\n features2[12] = features[0];\n } else {\n features2[11] = features[13];\n features2[12] = features[13];\n }\n return features2;\n }\n }", "interface Themeable {\n\t\n\t/**\n\t * @param theme a Cool303Theme object that holds styling information.\n\t * A Cool303Theme object can be added to any Themeable class.\n\t */\n\tvoid addTheme(Cool303Theme theme);\n\t\n\t/**\n\t * @param theme a Cool303Theme object that holds styling information.\n\t * A Cool303Theme object can be removed from any Themeable class.\n\t */\n\tvoid removeTheme(Cool303Theme theme);\n\t\n\t/**\n\t * @return the Cool303Theme private attribute of this Themeable class.\n\t * Each Themeable class may hold 0 or 1 Cool303Theme private attribute.\n\t */\n\tCool303Theme getTheme();\n\t\n\t/**\n\t * Each Themeable class can have its component and child components pained.\n\t * Components will be painted in correspondence to a given Cool303Theme.\n\t */\n\tvoid paintComponent();\n}", "private String cleanLine(String line) {\n line = line.replace(\"class\", \"class\");\n line = line.replace(\"abstract class\", \"abstract class\");\n line = line.replace(\"enum\", \"enum\");\n return line;\n }", "public static String guessStyle(String fontName) {\n if (fontName != null) {\n for (String word : ITALIC_WORDS) {\n if (fontName.indexOf(word) != -1) {\n return Font.STYLE_ITALIC;\n }\n }\n }\n return Font.STYLE_NORMAL;\n }", "private void validateNewCraftEntry(String[] parsing, MessageReceivedEvent event) {\n\n //<editor-fold desc=\"Arguement Deconstruction\">\n /* Argument layout\n 0 - expertise bool\n 1 - prof int\n 2 - intel int\n 3 - tool/skill string\n 4 - crafterChar\n */\n boolean[] delete = new boolean[parsing.length];\n delete[0] = true;\n delete[1] = true;\n delete[2] = true;\n String[] arguementArray = new String[5];\n arguementArray[0] = \"false\";\n arguementArray[1] = \"0\";\n arguementArray[2] = \"0\";\n arguementArray[3] = \"None\";\n arguementArray[4] = parsing[2];\n for (int i = 2; i < parsing.length; i++) {\n if (parsing[i].equals(\"-expertise\") || parsing[i].equals(\"-expert\") || parsing[i].equals(\"-e\")) {\n arguementArray[0] = \"true\";\n delete[i] = true;\n } else if (parsing[i].contains(\"-proficiency\")||parsing[i].contains(\"-prof\")||parsing[i].contains(\"-p\")) {\n arguementArray[1] = parsing[i + 1];\n delete[i] = true;\n delete[i + 1] = true;\n } else if (parsing[i].contains(\"-intelligence\") || parsing[i].contains(\"-int\") || parsing[i].equals(\"-i\")) {\n arguementArray[2] = parsing[i + 1];\n delete[i] = true;\n delete[i + 1] = true;\n } else if (parsing[i].contains(\"-tool\") || parsing[i].contains(\"-skill\")) {\n arguementArray[3] = parsing[i + 1];\n delete[i] = true;\n delete[i + 1] = true;\n }\n }\n List<String> nameGen = new ArrayList<>();\n for (int i = 0; i < parsing.length; i++) {\n if (!delete[i]) {\n nameGen.add(parsing[i]);\n }\n }\n String itemString = \"\";\n for (String build : nameGen) {\n itemString = itemString.concat(build + \" \");\n }\n\n //</editor-fold>\n\n //Retrieve item name\n Item item = dataTable.getItem(itemString);\n if (item == null) {\n event.getChannel().sendMessage(\"Thats not an item, B-Baka\").queue();\n return;\n }else if(!item.isCraftable()){\n event.getChannel().sendMessage(\"Nice try, you can't craft that!!!\").queue();\n return;\n }\n\n //finalize the argstring, itemstring, and event\n final MessageReceivedEvent finalEvent = event;\n final String[] finalArgArray = arguementArray;\n final Item finalItem = item;\n\n //validate user does not have another job in progress\n boolean isCrafting = false;\n for(String[] entry: craftBacklog){\n LocalDateTime end = LocalDateTime.parse(entry[2]);\n if(entry[0].contains(event.getAuthor().getId()) && LocalDateTime.now().isBefore(end) && entry[4].contains(arguementArray[4])){\n isCrafting = true;\n }\n }\n\n if(isCrafting){\n event.getChannel().sendMessage(arguementArray[4] + \" is already crafting\").queue();\n return;\n }\n\n //<editor-fold desc=\"getCraftingTime\">\n int totalBonus = 10+((Integer.parseInt(arguementArray[2])-10)/2);\n System.out.println((Integer.parseInt(arguementArray[2])-10)/2 + \" and \" + totalBonus);\n if(arguementArray[1] != null) {\n if (arguementArray[0].equals(\"true\")) {\n totalBonus += (Integer.parseInt(arguementArray[1]) * 2);\n } else {\n totalBonus += Integer.parseInt(arguementArray[1]);\n }\n }\n int baseTime=20;\n String rarity = item.getRarity();\n switch(rarity){\n case \"common\":\n case \"Common\":\n baseTime = 20;\n if(item.isConsumable()){\n baseTime = baseTime/3;\n }\n break;\n case \"uncommon\":\n case \"Uncommon\":\n baseTime = 100;\n if(item.isConsumable()){\n baseTime = baseTime/3;\n }\n break;\n case \"rare\":\n case \"Rare\":\n baseTime = 240;\n if(item.isConsumable()){\n baseTime = baseTime/4;\n }\n break;\n case \"very rare\":\n case \"Very Rare\":\n baseTime = 400;\n if(item.isConsumable()){\n baseTime = baseTime/4;\n }\n break;\n case \"legendary\":\n case \"Legendary\":\n baseTime = 500;\n if(item.isConsumable()){\n baseTime = baseTime/4;\n }\n break;\n }\n int finalTime = baseTime/totalBonus;\n event.getChannel().sendMessage(\"Base Time for \" + arguementArray[4] + \" is = \"+baseTime+\"\\nBonus = \"+totalBonus+\"\\nCrafting time \"+finalTime+\" days\").queue();\n //</editor-fold>\n\n\n event.getChannel().sendMessage(\"<@\" + event.getAuthor().getId() + \">\\nAre you sure you want to craft:\\n***\" + item.getName() + \"***?\\nReact with :white_check_mark: or :negative_squared_cross_mark:\")\n .queue(new Consumer<Message>() {\n @Override\n public void accept(Message message) {\n message.addReaction(\"\\u2705\").queue();\n message.addReaction(\"\\u274E\").queue();\n String mID = message.getId();\n String author = finalEvent.getAuthor().getId();\n String validate = responseHandler.waitForReaction(mID, author);\n if(validate == null){\n message.delete().queue();\n message.getChannel().sendMessage(\"Timed Out\").queue();\n }else if(validate.contains(\"no\")){\n message.delete().queue();\n message.getChannel().sendMessage(\"Cancelled by user\").queue();\n }else{\n //message.getChannel().sendMessage(\"Working as intended\").queue();\n createNewCraftEntry(finalEvent, finalArgArray, finalItem);\n message.delete().queue();\n }\n }\n });\n }", "private void reformatInputFile() throws IOException, InvalidInputException{\r\n new InputFileConverter(this.inputFileName);\r\n }", "@Override\n public String generateLayoutName(String objectName){\n Scanner in = new Scanner(objectName);\n String out = \"\";\n String x = in.next();\n int z = x.length();\n for(int y = 0; y < z; y++){\n if(Character.isUpperCase(x.charAt(y))){\n out = out+\"_\"+(Character.toLowerCase(x.charAt(y)));\n\n }else{\n out = out+x.charAt(y);\n }\n }\n return \"activity\"+out;\n }", "public final java.lang.String getDisplayName(boolean daylight, int style) { throw new RuntimeException(\"Stub!\"); }", "@Override\r\n\tpublic Object getAsObject(FacesContext context, UIComponent component,\r\n\t\t\tString value) {\n\t\tloggerService.logPortalInfo(\" start getAsObject method of ServiceConverter \");\r\n\t\tif (value != null && value.trim().length() > 0\r\n\t\t\t\t&& (!value.equals(\"None\")&& value.trim().length() > 0)) {\r\n\t\t\ttry {\r\n\t\t\t\tProductTypeDTO selectedProduct = new ProductTypeDTO();\r\n\t\t\t\tselectedProduct.setId(new Integer(value));\r\n\t\t\t\tfor (Iterator iterator = productTypeDTOs.iterator(); iterator\r\n\t\t\t\t\t\t.hasNext();) {\r\n\t\t\t\t\tProductTypeDTO productTypeDTO = (ProductTypeDTO) iterator.next();\r\n\t\t\t\t\tif (productTypeDTO.equals(selectedProduct)){\r\n\t\t\t\t\t\tloggerService.logPortalInfo(\" end getAsObject method of ServiceConverter \");\r\n\t\t\t\t\t\treturn productTypeDTO;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\tloggerService.logPortalError(\"Not a valid Selected Accident\", e);\r\n\t\t\t\tthrow new ConverterException(new FacesMessage(\r\n\t\t\t\t\t\tFacesMessage.SEVERITY_ERROR, \"Conversion Error\",\r\n\t\t\t\t\t\t\"Not a valid theme.\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main ( String[] args ) throws IOException {\n Scanner scn = new Scanner(System.in);\n System.out.print(\"What name do you want for your output file? \");\n String outputN = scn.nextLine();\n\n // Function that will change the word 'utilize' to 'use'\n modifytext(outputN);\n }", "public static Color name2color(String name) {\n Color ans = name2color.get(name);\n if (ans!=null) return ans;\n else if (name.equals(\"magic\")) ans=Color.WHITE;\n else if (name.equals(\"palevioletred\")) ans=new Color(222,113,148);\n else if (name.equals(\"red\")) ans=new Color(255,0,0);\n else if (name.equals(\"salmon\")) ans=new Color(255,130,115);\n else if (name.equals(\"magenta\")) ans=new Color(255,0,255);\n else if (name.equals(\"limegreen\")) ans=new Color(49,207,49);\n else if (name.equals(\"green2\")) ans=new Color(0,239,0);\n else if (name.equals(\"darkolivegreen2\")) ans=new Color(189,239,107);\n else if (name.equals(\"chartreuse2\")) ans=new Color(115,239,0);\n else if (name.equals(\"gold\")) ans=new Color(255,215,0);\n else if (name.equals(\"yellow\")) ans=new Color(255,255,0);\n else if (name.equals(\"lightgoldenrod\")) ans=new Color(239,223,132);\n else if (name.equals(\"cornflowerblue\")) ans=new Color(99,150,239);\n else if (name.equals(\"blue\")) ans=new Color(0,0,255);\n else if (name.equals(\"cadetblue\")) ans=new Color(90,158,165);\n else if (name.equals(\"cyan\")) ans=new Color(0,255,255);\n else if (name.equals(\"lightgray\")) ans=new Color(214,214,214);\n else if (name.equals(\"white\")) ans=Color.WHITE;\n else ans=Color.BLACK;\n name2color.put(name,ans);\n return ans;\n }", "public void convertNumbers(Scanner input){\n\t\tint number;\n\t\tString format = \"\";\n\t\tSystem.out.println(\"Please Enter Number (1-3999)\");\n\t\t//Number input\n\t\tnumber = input.nextInt();\n\t\tif(number < 1){\n\t \t throw new NumberFormatException(\"Please Enter Positive Numbers Only.\"); \n\t\t}else if(number > 3999){\n\t\t\tSystem.out.println(\"Please Enter Less Than or Equal 3999\");\n\t\t\tnumber = input.nextInt();\n\t\t}\n\t\tSystem.out.println(\"Please Enter Format (WORDS or ROMAN)\");\n\t\t//Format input\n\t\tformat = input.next();\n\t\t//Checking Format to convert numbers\n\t\tif(format.equalsIgnoreCase(\"WORDS\")){\n\t\t\tNumberToWords convertWord = new NumberToWords();\n\t\t\tString word = convertWord.numbersToWordsConverter(number);\n\t\t\tSystem.out.println(number+\"'s English Word is \"+'\"'+ word+'\"');\n\t\t}else if(format.equalsIgnoreCase(\"ROMAN\")){\n\t\t\tNumberToRoman convertRoman = new NumberToRoman();\n\t\t\tString roman =convertRoman.convertNumberToRomanLetters(number);\n\t\t\tSystem.out.println(number+\"'s Roman Letter is \"+'\"'+ roman+'\"');\n\t\t}else{\n\t\t\tSystem.out.print(\"Please Enter Valid Format \\n\");\n\t\t}\n\t\n\t}", "public void applyTheme(){\n\t\tColor backgroundColour = new Color(255,255,255);\n\t\tColor buttonText = new Color(255,255,255);\n\t\tColor normalText = new Color(0,0,0);\n\t\tColor buttonColour = new Color(15,169,249);\n\n\t\tfirstAttemptResult.setForeground(new Color(255,0,110));\n\t\tsecondAttemptResult.setForeground(new Color(255,0,0));\n\t\t\n\t\t// background color\n\t\tthis.setBackground(backgroundColour);\n\t\t\n\t\t// normal text\n\t\tspellQuery.setForeground(normalText);\n\t\tdefinitionArea.setForeground(normalText);\n\t\tlblstAttempt.setForeground(normalText);\n\t\tlblndAttempt.setForeground(normalText);\n\t\tfirstAttempt.setForeground(normalText);\n\t\tsecondAttempt.setForeground(normalText);\n\t\tcurrentQuiz.setForeground(normalText);\n\t\tcurrentStreak.setForeground(normalText);\n\t\tlongestStreak.setForeground(normalText);\n\t\tnoOfCorrectSpellings.setForeground(normalText);\n\t\tquizAccuracy.setForeground(normalText);\n\t\tlblNewLabel.setForeground(normalText);\n\t\tlblYouOnlyHave.setForeground(normalText);\n\t\tlblCurrentQuiz.setForeground(normalText);\n\t\tlblCurrentStreak.setForeground(normalText);\n\t\tlblLongeststreak.setForeground(normalText);\n\t\tlblSpelledCorrectly.setForeground(normalText);\n\t\tlblQuizAccuracy.setForeground(normalText);\n\t\t\n\t\t// button text\n\t\tbtnConfirmOrNext.setForeground(buttonText);\n\t\tbtnStop.setForeground(buttonText);\n\t\tbtnListenAgain.setForeground(buttonText);\n\t\t// normal button color\n\t\tbtnConfirmOrNext.setBackground(buttonColour);\n\t\tbtnStop.setBackground(buttonColour);\n\t\tbtnListenAgain.setBackground(buttonColour);\n\t}", "private static void printOption(){\r\n System.out.println(\"Select option what you want to do\");\r\n System.out.println(\"Input plain(default) / stylish / slide\");\r\n option = scan.nextLine();\r\n try{\r\n if(option.toLowerCase().equals(\"plain\")){\r\n }\r\n else if(option.toLowerCase().equals(\"stylish\")){\r\n }\r\n else if(option.toLowerCase().equals(\"slide\")){\r\n }\r\n else if(option.toLowerCase().equals(\"\")){\r\n option = \"plain\";\r\n }\r\n else{\r\n throw new Exception(\"Check option\\n\");\r\n }\r\n } catch(Exception e){\r\n e.printStackTrace();\r\n } finally {\r\n System.out.println(\"Option : \" + option);\r\n }\r\n }", "private void getTextFromInput() {\n firstName = firstNameField.getText();\n lastName = lastNameField.getText();\n age = ageField.getText();\n email = emailField.getText().toLowerCase();\n }", "private String formatUsNumber(Editable text) {\n\t\tStringBuilder cashAmountBuilder = null;\n\t\tString USCurrencyFormat = text.toString();\n//\t\tif (!text.toString().matches(\"^\\\\$(\\\\d{1,3}(\\\\,\\\\d{3})*|(\\\\d+))(\\\\.\\\\d{2})?$\")) { \n\t\t\tString userInput = \"\" + text.toString().replaceAll(\"[^\\\\d]\", \"\");\n\t\t\tcashAmountBuilder = new StringBuilder(userInput);\n\n\t\t\twhile (cashAmountBuilder.length() > 3 && cashAmountBuilder.charAt(0) == '0') {\n\t\t\t\tcashAmountBuilder.deleteCharAt(0);\n\t\t\t}\n\t\t\twhile (cashAmountBuilder.length() < 3) {\n\t\t\t\tcashAmountBuilder.insert(0, '0');\n\t\t\t}\n\t\t\tcashAmountBuilder.insert(cashAmountBuilder.length() - 2, '.');\n\t\t\tUSCurrencyFormat = cashAmountBuilder.toString();\n\t\t\tUSCurrencyFormat = Util.getdoubleUSPriceFormat(Double.parseDouble(USCurrencyFormat));\n\n//\t\t}\n\t\tif(\"0.00\".equals(USCurrencyFormat)){\n\t\t\treturn \"\";\n\t\t}\n\t\tif(!USCurrencyFormat.contains(\"$\"))\n\t\t\treturn \"$\"+USCurrencyFormat;\n\t\treturn USCurrencyFormat;\n\t}" ]
[ "0.637292", "0.5062306", "0.49723536", "0.46916708", "0.46782863", "0.464013", "0.4621002", "0.45381778", "0.45165253", "0.4515437", "0.4513491", "0.44819102", "0.4481576", "0.44705418", "0.44529244", "0.4423998", "0.44213766", "0.4413711", "0.44028756", "0.4401036", "0.43967107", "0.4394235", "0.43798685", "0.43784463", "0.43724", "0.43709162", "0.43678665", "0.43654364", "0.4355312", "0.43549633", "0.4347357", "0.4345342", "0.43446642", "0.4343369", "0.43395016", "0.43371445", "0.43284455", "0.43281043", "0.43250898", "0.4322672", "0.43177313", "0.43117523", "0.43075535", "0.42973503", "0.42919806", "0.42821375", "0.42821243", "0.42794362", "0.42746904", "0.42719415", "0.426921", "0.4267196", "0.42639425", "0.42623743", "0.425645", "0.42522135", "0.4240948", "0.42238027", "0.42201903", "0.42182872", "0.42125684", "0.4212289", "0.4210996", "0.42065805", "0.41997236", "0.4196747", "0.41929603", "0.41928318", "0.4191827", "0.4190307", "0.4190297", "0.41872326", "0.41748968", "0.4170992", "0.41679573", "0.41642606", "0.41629362", "0.4159125", "0.41482654", "0.41455305", "0.41395158", "0.41376695", "0.4134513", "0.41338295", "0.41287333", "0.41282237", "0.41220003", "0.41218504", "0.41204062", "0.41181326", "0.41136244", "0.4107116", "0.41068706", "0.41058376", "0.41036937", "0.410329", "0.4098601", "0.4087366", "0.40868112", "0.40838978" ]
0.6898477
0
Decides the length of generated poem.
public int getRandomPoemLength(){ double poemLengthDouble = Math.random() * 4 + 6; int poemLength = (int) poemLengthDouble; return poemLength; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getLength(){\n return textQuestions.length;\n }", "public int getLength(){\n return sequence.length(); \n\t}", "public int getProtein_length() {\n return protein_length;\n }", "public static long getPrepositionLength(){\n\t\treturn prepositionLength;\n\t}", "public int get_length();", "Length createLength();", "int calculateBodyLength(TranscoderContext context);", "public int printLength() { return printLength; }", "public int length() {\n return 0; // REPLACE THIS LINE WITH THE RIGHT ANSWER.\n }", "public int getLength()\n {\n return encryptionDictionary.getInt( \"Length\", 40 );\n }", "public long getLength();", "public long getLength();", "public int getLength() {return length;}", "protected int getLength() {\n return length;\n }", "void calculateAndSetBodyLength(TranscoderContext context);", "public int getLength() {\r\n return this.seqLength;\r\n }", "public abstract long getLength();", "public abstract long getLength();", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:55:06.822 -0500\", hash_original_method = \"2D2F8FB9FD0DE4D4C70B238FD2D4C88B\", hash_generated_method = \"CFB81A0992BCD18B37272999971C8572\")\n \npublic ContentLength(int length) {\n super(NAME);\n this.contentLength = Integer.valueOf(length);\n }", "public long getLength() { \n return length; \n }", "public void setLength(long length) { \n this.length = length; \n }", "private int length() { return length; }", "public int getLength(){\n\t\treturn length;\n\t}", "public int getLength(){\n\t\treturn length;\n\t}", "public int getLength() {\r\n return length;\r\n }", "public int getLength() {\r\n return length;\r\n }", "public int getLength() {\r\n return length;\r\n }", "public int getLength() {\n return length;\n }", "public int getLength() {\n return length;\n }", "public int getLength()\n {\n return seq.length;\n }", "public abstract int getPuzzleLengthSize();", "public int getLength()\n {\n return length;\n }", "int getBodyLength();", "public int getFootprintLength() {\n return 1;\n }", "public int getLength() {\n return length;\n }", "public int getLength() { return length;\t}", "public int getLength() {\n return length_;\n }", "public int getLength()\n\t{\n\t\treturn length;\n\t}", "public int getLength()\n\t{\n\t\treturn length;\n\t}", "protected abstract int getLength();", "public int getLength() {\r\n\t\treturn length;\r\n\t}", "public int getLength(){\n return length;\n }", "public int getWordLength();", "public int getLength()\n {return length;}", "public int length() {\n // PUT YOUR CODE HERE\n }", "BigInteger getLength();", "public int getLength() { return this.words.size(); }", "public long length() {\n\tint nBits;\n\tlong x, y;\n\tlong length = 7 + Math.max(minBitsS(toFixed(getTranslateX())),\n\t\t\t\t minBitsS(toFixed(getTranslateY())));\n\tif (hasScale()) {\n\t length += 5 + Math.max(minBitsS(toFixed(getScaleX())),\n\t\t\t\t minBitsS(toFixed(getScaleY())));\n\t}\n\tif (hasRotate()) {\n\t length += 5 + Math.max(minBitsS(toFixed(getRotate1())),\n\t\t\t\t minBitsS(toFixed(getRotate2())));\n\t}\n\treturn length;\n }", "public int length(){\n\t\treturn this.tamanho;\n\t}", "@Override\n public Integer length() {\n return myLength;\n }", "public int getLength()\n {\n\treturn length;\n }", "public int getLength() {\n return length_;\n }", "public int getLength() {\n\t\treturn length;\n\t}", "public int getLength() {\n\t\treturn length;\n\t}", "public int getLength() {\n\t\treturn length;\n\t}", "public int getLength() {\n\t\treturn length;\n\t}", "public int getLength() {\n\t\treturn length;\n\t}", "public int getLength() {\n\t\treturn length;\n\t}", "public int getLength();", "public int getLength();", "public int getLength();", "public void setLength(long length);", "public void setLength(long length);", "LengthSmaller createLengthSmaller();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "public int length() {\n \treturn length;\n }", "public abstract int getLength();", "public abstract int getLength();", "int length() {\n if (extMap.isEmpty()) {\n return 0;\n } else {\n return encodedLength;\n }\n }", "public double getLength(){\r\n\t\treturn length;\r\n\t}", "public void setLength(int length)\n {\n this.length = length;\n }", "public Integer getLength() {\n return _length;\n }", "public Integer getLength() {\n return _length;\n }", "public long length() {\n return length;\n }", "public void setProtein_length(int protein_length) {\n this.protein_length = protein_length;\n }", "public void setLength(int length) {\r\n this.length = length;\r\n }", "public void setLength(int length) {\r\n this.length = length;\r\n }", "public static int getWordlenght() {\r\n\t\treturn lenght;\r\n\t}", "public int getLength() {\n\t\t\treturn this.text.length();\n\t}", "public int length() {\n return length;\n }", "public int length() {\n return length;\n }", "public int length() {\n return length;\n }", "public int getLength() {\n return this.length;\n }", "public int getLength() {\n return this.length;\n }", "public double getLength() {\n return length;\n }", "public double getLength() {\r\n return length;\r\n }", "public int my_length();", "public double getLength() {\n return count;\n }", "public int getLength() {\n/* 301 */ return this.stream.getInt(COSName.LENGTH, 0);\n/* */ }", "public int length() {\n return myFormals.size();\n }", "public int length() {\n \t\tif (-1 == n_points) setupForDisplay();\n \t\treturn n_points;\n \t}" ]
[ "0.62075937", "0.615097", "0.6133263", "0.6085752", "0.5950983", "0.59263873", "0.5890112", "0.5878226", "0.5874588", "0.58627206", "0.5858906", "0.5858906", "0.58580506", "0.584963", "0.58058596", "0.5804284", "0.5803863", "0.5803863", "0.5788746", "0.57863754", "0.57849133", "0.5782826", "0.5774669", "0.5774669", "0.57738703", "0.57738703", "0.57738703", "0.57640797", "0.57640797", "0.57600695", "0.57564473", "0.5754863", "0.5751715", "0.57387835", "0.5734416", "0.5714301", "0.5704461", "0.5689632", "0.5689632", "0.5683354", "0.5680773", "0.56754535", "0.5670923", "0.56701624", "0.5669642", "0.5669367", "0.5668448", "0.5664204", "0.56629944", "0.5662186", "0.5650177", "0.5636666", "0.5636619", "0.5636619", "0.5636619", "0.5636619", "0.5636619", "0.5636619", "0.55891603", "0.55891603", "0.55891603", "0.55747044", "0.55747044", "0.55603814", "0.5554877", "0.5554877", "0.5554877", "0.5554877", "0.5554877", "0.5554877", "0.5554877", "0.5554877", "0.5554877", "0.5554877", "0.55522835", "0.55400795", "0.55400795", "0.553649", "0.5533036", "0.552799", "0.5527294", "0.5527294", "0.55225694", "0.5518775", "0.55164665", "0.55164665", "0.5514927", "0.5503926", "0.55026394", "0.55026394", "0.55026394", "0.55025524", "0.55025524", "0.54827696", "0.5477348", "0.54708415", "0.54699475", "0.5467717", "0.54666346", "0.5459931" ]
0.7156521
0
Fetches the last poem line and checks that it ends with '.', '!' or '?'.
public String getLastPoemLine(PoetAndTheme object){ boolean lastCharDot = false; String lastVerseLine = ""; while(!lastCharDot){ lastVerseLine = object.getRandomVerseLine(); if(lastVerseLine.substring(lastVerseLine.length() - 1).equals(".") || lastVerseLine.substring(lastVerseLine.length() - 1).equals("!")|| lastVerseLine.substring(lastVerseLine.length() - 1).equals("?")){ lastCharDot = true; } } return lastVerseLine; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract boolean definitelyNotLastLine(String message);", "private Line getLastLine() {\n\t\treturn doily.lines.get(doily.lines.size()-1);\n\t}", "private static String getLastToken(String s)\r\n {\r\n int index = s.lastIndexOf('.');\r\n if (index == -1)\r\n {\r\n return null;\r\n }\r\n return s.substring(index+1);\r\n }", "private boolean validMessage(String message){\r\n //35 lines of text seems to be the max\r\n //TODO check if its a character limit and not a newline limit in iteration 4\r\n int newLines = 0;\r\n for(int i = 1; i < message.length(); i++)\r\n if(message.substring(i-1, i).equals(\".\")){\r\n newLines++;\r\n }\r\n return newLines <= this.lineBound;\r\n }", "private boolean isEndFound(String line) {\n\t\tif (end != null) {\n\t\t\tif (nothingAfterEnd) {\n\t\t\t\treturn line.endsWith(end);\n\t\t\t} else {\n\t\t\t\treturn line.contains(end);\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public String get_last_sentence() {\r\n\t\ttry {\r\n\t\t\tint numBytes = SerialSubsystem.serial.getBytesReceived();\r\n\t\t\tif (numBytes >= 5) { // minimum valid sentence\r\n\t\t\t\tbyte readBytes[] = SerialSubsystem.serial.read(numBytes);\r\n\t\t\t\tString sentence= new String(readBytes);\r\n\t\t\t\tint end= sentence.lastIndexOf('\\n');\r\n\t\t\t\tif (end >= 4) { // minimum valid sentence length\r\n\t\t\t\t\t// strip bytes received past end of sentence\r\n\t\t\t\t\tsentence = sentence.substring(0, end);\r\n\t\t\t\t\t// find end of preceding sentence\r\n\t\t\t\t\tint start = sentence.lastIndexOf('<');\r\n\t\t\t\t\tif ((start >= 0) && (end > start+1)) {\r\n\t\t\t\t\t\treturn sentence.substring(start+1, end);\r\n\t\t\t\t\t}\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\treturn null;\r\n\t}", "private static int lastnlposition(byte[] data, int len) {\n int at = -1;\n for(int i=len-1; i >= 0; i--) {\n if(data[i] == '\\n') {\n at = i;\n break;\n }\n }\n return at;\n }", "String getIfEnd();", "public boolean isAtEnd()\n\t{\n\t\treturn (lineNow >= lineTime);\n\t}", "private int getLastLine() {\n return lastSourcePosition.line;\n }", "private boolean endline() {\r\n return (CHAR('\\r') || true) && CHAR('\\n');\r\n }", "private static int findEndOfLine(final ChannelBuffer buffer) {\n final int n = buffer.writerIndex();\n for (int i = buffer.readerIndex(); i < n; i ++) {\n final byte b = buffer.getByte(i);\n if (b == '\\n') {\n return i;\n } else if (b == '\\r' && i < n - 1 && buffer.getByte(i + 1) == '\\n') {\n return i; // \\r\\n\n }\n }\n return -1; // Not found.\n }", "public String getLastP() {\n\t\treturn lastFieldP.getText();\n\t}", "public boolean roundEnd()\r\n {\r\n line = gameBoard.findLine();\r\n \r\n return line[0] != -1 || gameBoard.isFull();\r\n }", "public int getLastVisibleLine(){\n int l = Math.min((getOffsetY() + getHeight()) / getLineHeight(), getLineCount() - 1);\n if(l < 0){\n return 0;\n }else{\n return l;\n }\n }", "public String getEndingFor(File file) {\n if (workTree != null && !infoRules.isEmpty()) {\n String rootPath = workTree.getAbsolutePath();\n String path = file.getAbsolutePath();\n if (path.startsWith(rootPath)) {\n String subpath = path.substring(rootPath.length() + 1);\n String infoResult = findAttributeInRules(subpath, IS_FOLDER, KEY_EOL, infoRules);\n if (infoResult != null) {\n return convertEolToLineEnding(infoResult, file);\n }\n }\n }\n\n // handle the local .gitattributes (if any)\n String localResult = cache.valueFor(file, KEY_EOL);\n if (localResult != null) {\n return convertEolToLineEnding(localResult, file);\n }\n\n // handle the global .gitattributes\n String globalResult = findAttributeInRules(file.getAbsolutePath(), IS_FOLDER, KEY_EOL, globalRules);\n if (globalResult != null) {\n return convertEolToLineEnding(globalResult, file);\n }\n\n // if all else fails, use the default value\n return defaultEnding;\n }", "private static boolean checkFirstLastTag(String line) {\n return line.charAt(1) != line.charAt(line.length() - 2);\n }", "public String getEndLine() {\r\n return this.endLine;\r\n }", "public int getEndLine() {\r\n \r\n return endLine;\r\n }", "private boolean isEnd(String nextVal) throws java.io.IOException {\n\t\tif (Character.toString((char)PREPROCESSING).equals(nextVal)) {\n\t\t\tint pos = (int) reader.getFilePointer();\n\t\t\tthis.readUntilEndOfLine(nextVal.charAt(0));\n\t\t\tif (next.matches(\"^!end\"))\n\t\t\t\treturn true;\n\t\t\treader.seek(pos);\n\t\t}\n\t\treturn false;\n\n\t}", "public static String lastTerm(String input)\n {\n assert isNonBlank(input);\n int dotx = input.lastIndexOf('.');\n \n if (dotx < 0)\n return input;\n \n return input.substring(dotx + 1);\n }", "public boolean endsLy(String str) {\r\n return str.length() > 1 ? str.substring(str.length() - 2, str.length()).equals(\"ly\") : false;\r\n }", "public int getEndLIne() {\r\n return this.endLine;\r\n }", "String getEnd();", "private Point findTrailingPt() {\n\t\tPoint farthestPt = new Point(getDisplayXs()[0], getDisplayYs()[0]);\n\t\tfor (int i = 0; i < getDisplayXs().length; i++) {\n\t\t\tPoint nextPt = new Point(getDisplayXs()[i], getDisplayYs()[i]);\n\t\t\tPoint centerOfMass = Controller.flowArrow.findCenterOfMass();\n\t\t\tif (farthestPt.distance(centerOfMass) < nextPt.distance(centerOfMass)) {\n\t\t\t\tfarthestPt = nextPt; // update fartestPt\n\t\t\t}\n\t\t}\n\t\treturn farthestPt;\n\t}", "boolean hasEndLineNumber();", "@Pure\n public int getEndLine() {\n return this.endLine;\n }", "public boolean hasEndLineNumber() {\n return ((bitField0_ & 0x00000040) != 0);\n }", "public boolean hasEndLineNumber() {\n return ((bitField0_ & 0x00000040) != 0);\n }", "public static String everythingAfterDot(String str) {\n int index = str.indexOf('.');\n\n if (index > -1) {\n return str.substring(index + 1).trim();\n } else {\n return str;\n }\n }", "public int getLastLineLength()\n {\n return lastLineLength;\n }", "@Override\n\tprotected void testForTrailingText() {\n\t\tif (this.thisSentence.length() > 0) {\n\t\t\tthis.trailingSentence = true;\n\t\t\tsaveToken();\n\t\t\tsaveSentence();\n\t\t} else {\n\t\t\t//The tentative sentence must be saved (and cleared) - Notify the processor of this new sentence\n\t\t\tgetProcessor().processNlSentence(this.tentativeSentence);\n\t\t\tthis.tentativeSentence = null;\n\t\t}\n\t}", "int getEndLineNumber();", "private String getNextLine(Scanner input)\n\t{\n\t\tString line = input.nextLine().trim();\n\t\twhile ((line.length() == 0 || line.startsWith(\"#\") || line.startsWith(\"!\")) && input.hasNext())\n\t\t\tline = input.nextLine().trim();\n\t\tif (line.startsWith(\"#\") || line.startsWith(\"!\"))\n\t\t\tline = \"\";\n\t\treturn line;\n\t}", "public static String lastDotValue(String tokenString) {\n\t\tString[] strings = tokenString.split(\"\\\\.\");\n\t\treturn strings[strings.length -1];\n\t}", "private int findIndexOfLastWord (ArrayList<String> parameters) {\n int indexOfLastWord = -1;\n for (int i = 0; i < parameters.size(); i++) {\n if (parameters.get(i).contains(\".\")) {\n indexOfLastWord = i;\n } \n }\n return indexOfLastWord;\n }", "public String getExtension() {\n\t\t\n\t\tString result = null;\n\t\t\n\t\tif(this.get(this.lenght - 1).contains(\".\"))\n\t\t{\n\t\t\tString temp = this.get(this.lenght - 1);\n\t\t\t\n\t\t\tString[] parts = temp.split(\"\\\\.\");\n\t\t\t\n\t\t\tresult = parts[parts.length - 1];\n\t\t}\n\t\telse\n\t\t\tresult = \"\";\n\t\t\n\n\t\treturn result;\n\t}", "public String getLastMsg() {\n String s = msgs.peekTail();\n return s == null ? \"\" : s;\n }", "@Override\n\tpublic boolean isLast(Position P) throws InvalidPositionException {\n\t\treturn false;\n\t}", "org.mojolang.mojo.lang.Position getEndPosition();", "public VCFLine getNextValidLine () throws IOException {\n\t\tgoNextLine();\n\t\treturn getCurrentValidLine();\n\t}", "public String getStrAfterDot(String str) {\n\t\tif (str==null || str.length()==0)\n\t\t\treturn null;\n\t\tStringBuilder afterStr = new StringBuilder();\t\n\t\tint k=0;\t\n\t\tfor (int i=0; i<str.length(); i++) {\t\n\t\t\tif (str.charAt(i)=='.') {\t\n\t\t\t\tk=i;\t\n\t\t\t\tbreak;\t\n\t\t\t}\t\n\t\t} \n\t\tfor (int i=k+1; i<str.length(); i++) {\n\t\t\tafterStr.append(str.charAt(i));\n\t\t}\n\t\treturn afterStr.toString();\n\t}", "public GPoint last() {\n\t\tif (points.isEmpty()) {\n\t\t\tthrow new IllegalStateException(\"line group is empty\");\n\t\t}\n\t\treturn points.get(points.size() - 1);\n\t}", "private void checkAndThrowReceivedEndqryrm(int lastValidBytePositionBeforeFetch) {\n if (lastValidBytePosition_ > lastValidBytePositionBeforeFetch) {\n return;\n }\n checkAndThrowReceivedEndqryrm();\n }", "public static int getEndOfLineIndex() {\n return endOfLineIndex;\n }", "public void fetchVerseLines() throws IncorrectInput{\n String strObject1 = \"\";\n PoetAndTheme object1 = poetsAndThemesList.get(0);\n String strObject2 = \"\";\n PoetAndTheme object2 = poetsAndThemesList.get(0);\n strObject1 = userInputToPoet(poet1, theme);\n strObject2 = userInputToPoet(poet2, theme);\n\n for(PoetAndTheme object: poetsAndThemesList){\n if (object.getNameAndTheme().equals(strObject1)){\n object1 = object;\n }\n if (object.getNameAndTheme().equals(strObject2)){\n object2 = object;\n }\n }\n //Poems length is a random number between 5 and 10\n int poemLength = getRandomPoemLength();\n\n if(poemLength % 2 == 0){\n for (int i=0; i < (poemLength/2); i++){\n if(i != (poemLength/2 - 1)){\n System.out.println(object1.getRandomVerseLine());\n System.out.println(object2.getRandomVerseLine());\n }else{\n System.out.println(object1.getRandomVerseLine());\n\n //Checking if the last verse line ends with period or question mark.\n //If not, get a new verse line.\n System.out.println(getLastPoemLine(object2));\n }\n }\n }else{\n for (int i=0; i < (poemLength/2 - 1); i++){\n System.out.println(object1.getRandomVerseLine());\n System.out.println(object2.getRandomVerseLine());\n }\n //Checking if the last verse line ends with period or question mark.\n //If not, get a new verse line.\n System.out.println(getLastPoemLine(object1));\n }\n }", "String getEndSplited();", "public void checkClosePara(){\n try{\n if(numbers.length() > 2){\n String charactercheck = Character.toString(numbers.charAt(numbers.length()-2));\n if(charactercheck.equals(\")\")){\n numbers.append(multiplySTR);\n }else{\n return;\n }\n }else{\n return;\n }\n }catch (Exception e){\n\n }\n\n }", "public String getLosePitchLast(String team) {\n\n String losePitchLast = \"\";\n // if the game is in preview\n if (getGameStatus(team).equals(\"Pre-Game\") || getGameStatus(team).equals(\"Warmup\")) {\n losePitchLast = getPlayerInfo(team, \"home_probable_pitcher\",\"last\");\n }\n // if the game is in progress get the current pitcher\n if (getGameStatus(team).equals(\"In Progress\")) {\n losePitchLast = getPlayerInfo(team, \"pitcher\",\"last\");\n }\n // if the game is a final\n if (getGameStatus(team).equals(\"Game Over\") || getGameStatus(team).equals(\"Final\") || getGameStatus(team).equals(\"Completed Early\")) {\n losePitchLast = getPlayerInfo(team, \"losing_pitcher\",\"last\");\n }\n\n return losePitchLast;\n }", "public boolean isAfterLast() {\n/* 125 */ return (this.lastRowFetched && this.currentPositionInFetchedRows > this.fetchedRows.size());\n/* */ }", "private boolean isDotAllowed()\r\n\t{\r\n\t\t//if the previous character is a dot then the dot is not allowed.\r\n\t\tif(isPreCharDot())\r\n\t\t\treturn false;\r\n\t\t//if the previous character is a evaluation symbol then the dot is allowed.\r\n\t\tif(isPreEvalSymobl())\r\n\t\t\treturn true;\r\n\t\t//if the last number has a dot then another dot is not allowed.\r\n\t\tString lastNum = getLastNumber(expression);\r\n\t\tif(lastNum.contains(\".\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public abstract String getLastAnswer();", "public int maxL()\r\n {\r\n return metro.numberOfLines - 1;\r\n }", "void endLine() {\n\t\tif (loaded != null && loaded.length() > 0) {\n\t\t\tlineContainer.set(loaded.toString());\n\t\t}\n\t\tloaded = new StringBuilder();\n\t}", "private boolean handleGameEnd(String line){\n if (!line.startsWith(\"{Game \"))\n return false;\n \n Matcher matcher = GAME_END_REGEX.matcher(line);\n if (!matcher.matches())\n return false;\n\n int gameNumber = Integer.parseInt(matcher.group(1));\n String whiteName = matcher.group(2);\n String blackName = matcher.group(3);\n String reason = matcher.group(4);\n String result = matcher.group(5);\n\n if (!processGameEnd(gameNumber, whiteName, blackName, reason, result))\n processLine(line);\n\n return true;\n }", "private String readLine() throws IOException {\n/* 276 */ String line = null;\n/* */ \n/* */ \n/* 279 */ boolean isLastFilePart = (this.no == 1L);\n/* */ \n/* 281 */ int i = this.currentLastBytePos;\n/* 282 */ while (i > -1) {\n/* */ \n/* 284 */ if (!isLastFilePart && i < ReversedLinesFileReader.this.avoidNewlineSplitBufferSize) {\n/* */ \n/* */ \n/* 287 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ int newLineMatchByteCount;\n/* 292 */ if ((newLineMatchByteCount = getNewLineMatchByteCount(this.data, i)) > 0) {\n/* 293 */ int lineStart = i + 1;\n/* 294 */ int lineLengthBytes = this.currentLastBytePos - lineStart + 1;\n/* */ \n/* 296 */ if (lineLengthBytes < 0) {\n/* 297 */ throw new IllegalStateException(\"Unexpected negative line length=\" + lineLengthBytes);\n/* */ }\n/* 299 */ byte[] lineData = new byte[lineLengthBytes];\n/* 300 */ System.arraycopy(this.data, lineStart, lineData, 0, lineLengthBytes);\n/* */ \n/* 302 */ line = new String(lineData, ReversedLinesFileReader.this.encoding);\n/* */ \n/* 304 */ this.currentLastBytePos = i - newLineMatchByteCount;\n/* */ \n/* */ break;\n/* */ } \n/* */ \n/* 309 */ i -= ReversedLinesFileReader.this.byteDecrement;\n/* */ \n/* */ \n/* 312 */ if (i < 0) {\n/* 313 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ } \n/* */ \n/* 319 */ if (isLastFilePart && this.leftOver != null) {\n/* */ \n/* 321 */ line = new String(this.leftOver, ReversedLinesFileReader.this.encoding);\n/* 322 */ this.leftOver = null;\n/* */ } \n/* */ \n/* 325 */ return line;\n/* */ }", "private String getLastLine(ArrayList<Movie> movies)\n {\n int last = movies.size() - 1;\n \n String lastLine = movies.get(last).getTitle()+ \",\" + movies.get(last).getDirector()+ \",\" + movies.get(last).getActor1()+\",\"\n + movies.get(last).getActor2()+\",\"+movies.get(last).getActor3()+\",\"+movies.get(last).getRating();\n \n return lastLine;\n }", "static String getLastName() {\n\t\tScanner s = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter last name: \");\n\t\tString ln = s.nextLine();\n\t\treturn ln;\n\t}", "public GPoint getLastPoint() {\n\t\treturn (points.size() > 0) ? points.get(points.size() - 1) : null;\n\t}", "private int lastNotNull() {\n\t\treturn (!this.checkEmpty()) ? findLast() : 0;\n\t}", "public String getLastText() {\n\t\treturn lastText;\n\t}", "public StatusLine getLastStatus() {\r\n return lastStatusLine;\r\n }", "public String getLast()\n {\n return lastItem;\n }", "public static String lastName(String name) {\n int i = name.lastIndexOf('.');\n if (i == -1) return name;\n else return name.substring(i + 1);\n }", "boolean getIsEndOfSentence();", "@Override\n public void afterTextChanged(Editable s) {\n if (s.length() > 4) {\n if (s.charAt(s.length() - 4) == '.') {\n s.delete(s.length() - 1, s.length());\n }\n }\n }", "@DISPID(1610940416) //= 0x60050000. The runtime will prefer the VTID if present\n @VTID(22)\n boolean atEndOfLine();", "@Override\n //TODO lambda\n public int lastFieldLine() {\n int max = -1;\n for (int i : lineToField.keySet()) {\n if (i > max) {\n max = i;\n }\n }\n return max;\n }", "private boolean handlePTell(String line){\n if (line.indexOf(\"(your partner) tells you: \") == -1)\n return false;\n \n Matcher matcher = PTELL_REGEX.matcher(line);\n if (!matcher.matches())\n return false;\n\n String username = matcher.group(1);\n String titles = matcher.group(2);\n String message = matcher.group(3);\n\n if (!processPTell(username, titles, message))\n processLine(line);\n\n return true;\n }", "boolean isLast() {\n return !hasNext();\n }", "int getAfterLineNumber();", "private boolean isEndLineSpace(final String message) {\n\t\treturn message.contains(\"A line should not end with blank space\"); //$NON-NLS-1$\n\t}", "public String getLastCell() {\n\t\treturn lastCell;\n\t}", "public boolean isLast() throws SQLException {\n/* 219 */ return (this.lastRowFetched && this.currentPositionInFetchedRows == this.fetchedRows.size() - 1);\n/* */ }", "private boolean isAtEnd() {\n return peek().type == EOF;\n }", "E last() throws NoSuchElementException;", "String getDefiningEnd();", "public static String getEnd(String town){\n\t\treturn Character.toString(town.charAt(1));\n\t}", "public String getMessage() {\n String message = this.rawMessage;\n Boolean endsWithDot = false;\n Boolean endsWithQuestionMark = false;\n\n // Check if the last character is a dot\n if (message.charAt(message.length()-1) == '.') {\n message = message.substring(0, message.length()-1);\n endsWithDot = true;\n }\n\n // Check if the last character is a question mark\n if (message.charAt(message.length()-1) == '?') {\n message = message.substring(0, message.length()-1);\n endsWithQuestionMark = true;\n }\n\n if (templateName != null) {\n message += \" in \\\"\" + templateName + \"\\\"\";\n }\n\n if (lineNumber != null && lineNumber > -1) {\n message += \" at line \" + lineNumber;\n }\n\n if (endsWithDot) {\n message += \".\";\n }\n if (endsWithQuestionMark) {\n message += \"?\";\n }\n\n return message;\n }", "public int getEndLineNumber() {\n return this.endLine;\n }", "private boolean reachedEndOfReplay(String lastQuestionRefReplayed) {\n return lastQuestionRefReplayed.equals(formEntrySession.getStopRef());\n }", "public java.lang.String getLastNm() {\n return lastNm;\n }", "private String getExtension(String path){\n System.out.println(\"Начато получение расширения: \");\n if (path.contains(\".\")){\n int dot = path.lastIndexOf(\".\");\n System.out.println(\"return \"+path.substring(dot, path.length()));\n return path.substring(dot, path.length());\n } else {\n// System.out.println(\"return \\\"\\\"\");\n return \"\";\n }\n }", "public long getLastModified(){\n\t\tDate lastMod;\n\t\tIterator<ArrayList<String>> i = headerLines.iterator();\n\t\twhile(i.hasNext()){\n\t\t\tArrayList<String> headerLines = i.next();\n\t\t\tString headerName = headerLines.get(0);\n\t\t\tif (headerName.matches(\"Last-Modified:\")){\n\t\t\t\tString headerData = headerLines.get(1);\n\t\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss z\");\n\t\t\t\ttry {\n\t\t\t\t\tlastMod = dateFormat.parse(headerData.trim());\n\t\t\t\t\treturn lastMod.getTime();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (long) -1;\n\t}", "public int getEndLineNumber() {\n return endLineNumber_;\n }", "public String readLine() throws IOException {\n/* 176 */ String line = this.currentFilePart.readLine();\n/* 177 */ while (line == null) {\n/* 178 */ this.currentFilePart = this.currentFilePart.rollOver();\n/* 179 */ if (this.currentFilePart != null) {\n/* 180 */ line = this.currentFilePart.readLine();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 188 */ if (\"\".equals(line) && !this.trailingNewlineOfFileSkipped) {\n/* 189 */ this.trailingNewlineOfFileSkipped = true;\n/* 190 */ line = readLine();\n/* */ } \n/* */ \n/* 193 */ return line;\n/* */ }", "static int findEndOfString(String sb) {\n/* */ int result;\n/* 216 */ for (result = sb.length(); result > 0 && \n/* 217 */ Character.isWhitespace(sb.charAt(result - 1)); result--);\n/* */ \n/* */ \n/* */ \n/* 221 */ return result;\n/* */ }", "public String getLastNm()\n\t{\n\t\treturn mLastNm;\n\t}", "boolean hasIsEndOfSentence();", "public DrawingCommand getLastCommand() {\r\n\t\tint i = this.commands.size() - 1;\r\n\t\tif (i >= 0) {\r\n\t\t\treturn this.commands.get(this.commands.size() - 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public String getLastItem();", "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}", "public void checkIfLastQuestion(){\n if(questionNumber == 50){\n endGame();\n }\n }", "public boolean isAfterNL()\n \t{\n \t\tif (getContext() == null)\n \t\t{\n \t\t\treturn false;\n \t\t}\n \t\tMatcherContext ctx = (MatcherContext) getContext();\n \t\tInputLocation loc = ctx.getCurrentLocation();\n \t\tInputBuffer buf = ctx.getInputBuffer();\n \t\tint delta = -1;\n \t\tchar c;\n \t\t // MultiLine comment might have \\n to be ignored\n \t\tboolean inMlComment = false;\n \t\t// Lok back into the buffer for a '\\n'\n \t\twhile ((c = loc.lookAhead(buf, delta)) != Chars.EOI)\n \t\t{\n \t\t\tif (c == '\\n')\n \t\t\t{\n \t\t\t\tif (!inMlComment)\n \t\t\t\t{\n \t\t\t\t\treturn true;\n \t\t\t\t} else if (c == '/')\n \t\t\t\t{\n \t\t\t\t\tif (loc.lookAhead(buf, delta - 1) == '*')\n \t\t\t\t\t{\n \t\t\t\t\t\t// in ML comment\n \t\t\t\t\t\tinMlComment = true;\n \t\t\t\t\t\tdelta--;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\telse if (c == '*')\n \t\t\t\t{\n \t\t\t\t\tif (loc.lookAhead(buf, delta - 1) == '/')\n \t\t\t\t\t{\n \t\t\t\t\t\t// out of ML comment\n \t\t\t\t\t\tinMlComment = false;\n \t\t\t\t\t\tdelta--;\n \t\t\t\t\t}\n \t\t\t\t} else\n \t\t\t\t{\n \t\t\t\t\tif (! (inMlComment || c==' ' || c=='\\t' ||\n \t\t\t\t\t\tc=='\\r' || c=='\\u000c'))\n \t\t\t\t\t{\n \t\t\t\t\t\t// if not in a multiLineComment\n \t\t\t\t\t\t// or not a whitespace charcater, then we failed finding \\n\n \t\t\t\t\t\treturn false;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\t// keep going\n \t\t\tdelta--;\n \t\t}\n \t\treturn false;\n \t}", "public String getSavePitchLast(String team) {\n\n String savePitchLast = \"\";\n\n // if the game status is in preview, pre-game, or warmup\n if (getGameStatus(team).equals(\"Preview\") || getGameStatus(team).equals(\"Pre-Game\") || getGameStatus(team).equals(\"Warmup\")) {\n try {\n if (compareDates(getGameInfo(team, \"original_date\"), 3)) {\n savePitchLast = getPlayerInfo(team, \"home_probable_pitcher\",\"last\");\n }\n else {\n savePitchLast = \"\";\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }\n // if the game is in progress get the current pitcher\n if (getGameStatus(team).equals(\"In Progress\")) {\n savePitchLast = getPlayerInfo(team, \"pitcher\",\"last\");\n }\n if (getGameStatus(team).equals(\"Game Over\") || getGameStatus(team).equals(\"Final\") || getGameStatus(team).equals(\"Completed Early\")) {\n savePitchLast = getPlayerInfo(team, \"save_pitcher\",\"last\");\n }\n\n return savePitchLast;\n }", "public String getEnd() {\n\t\t\t\t\n\t\t\t\t\tString vS = \"NONE\";\n\t\t\t\t\tSystem.out.println(vS + \" l \" + length);\n\t\t\t\t\tif (length != 0) vS = tail.getPrev().getValue();\n\t\t\t\t\tSystem.out.println(vS + \" l2 \" + length);\n\t\t\t\treturn vS;\n\t\t\t\t}", "String getLastHtml();", "private int findHeaderEnd(final byte[] buf, int rlen) {\n\t\t\tint splitbyte = 0;\n\t\t\twhile (splitbyte + 1 < rlen) {\n\n\t\t\t\t// RFC2616\n\t\t\t\tif (buf[splitbyte] == '\\r' && buf[splitbyte + 1] == '\\n' && splitbyte + 3 < rlen\n\t\t\t\t\t\t&& buf[splitbyte + 2] == '\\r' && buf[splitbyte + 3] == '\\n') {\n\t\t\t\t\treturn splitbyte + 4;\n\t\t\t\t}\n\n\t\t\t\t// tolerance\n\t\t\t\tif (buf[splitbyte] == '\\n' && buf[splitbyte + 1] == '\\n') {\n\t\t\t\t\treturn splitbyte + 2;\n\t\t\t\t}\n\t\t\t\tsplitbyte++;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}", "public GJPoint2D lastPoint() {\n\t\tint n = this.segments.size();\n\t\tif (n == 0) \n\t\t\treturn null;\n\t\treturn this.segments.get(n-1).lastControl();\n\t}", "public boolean isLast() {\n\t\treturn last;\n\t}" ]
[ "0.65454537", "0.6528631", "0.5719587", "0.56174165", "0.561416", "0.5585858", "0.554086", "0.5429874", "0.54154664", "0.54089713", "0.5408789", "0.54058784", "0.54046875", "0.54024225", "0.5371129", "0.53550875", "0.5354374", "0.5284095", "0.5262537", "0.52605635", "0.5234338", "0.5168202", "0.5166614", "0.513803", "0.5133065", "0.51210105", "0.51003724", "0.5089298", "0.5080865", "0.50688136", "0.5065631", "0.5050238", "0.50496143", "0.50477", "0.5032954", "0.50274307", "0.50110155", "0.49794784", "0.49655876", "0.49567738", "0.4947712", "0.4933453", "0.49237308", "0.48864242", "0.48772484", "0.48758784", "0.48724046", "0.48594633", "0.48532143", "0.48523638", "0.4844895", "0.483016", "0.4828854", "0.4818452", "0.48158938", "0.48118544", "0.48089677", "0.48047087", "0.48015928", "0.47691482", "0.4759676", "0.4756621", "0.47513697", "0.4749414", "0.47491932", "0.4748918", "0.47486228", "0.47476345", "0.47450998", "0.47262275", "0.4725642", "0.4725129", "0.47226793", "0.4719778", "0.47186312", "0.47133973", "0.47080198", "0.47070742", "0.46823716", "0.46805498", "0.46768472", "0.46759394", "0.4675122", "0.46691173", "0.4667", "0.46651688", "0.46629632", "0.46620354", "0.46498433", "0.4646133", "0.46415707", "0.4637206", "0.4635878", "0.4635089", "0.46321177", "0.46312928", "0.46237624", "0.46171063", "0.46124575", "0.46023524" ]
0.73474383
0
sorting the array using bubble sort
void bubbleSort(int arr[]) { int n = arr.length; boolean swapped; for(int i = 0; i < n-1; i++) { //denotes pass # for(int j = 0; j < n-i-1; j++) { //denotes element in the pass if(arr[j] > arr[j+1]) { //swapping of the element arr[j] += arr[j+1]; arr[j+1] = arr[j] - arr[j+1]; arr[j] -= arr[j+1]; swapped = true; } //end of if block }//end of element checking loop //if no 2 elements were swapped by inner loop, then break if (swapped == false) break; }//end of pass loop }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void bubbleSort() {\n\t\tint n = data.size();\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = 1; j < n - i; j++) {\n\t\t\t\tif (data.get(j - 1) > data.get(j)) {\n\t\t\t\t\tswap(j, j - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public void bubbleSort() {\n boolean unordered = false;\n do {\n unordered = false;\n for (int i = 0; i < array.length - 1; i++) {\n if (((Comparable) array[i]).compareTo(array[i + 1]) > 0) {\n T temp = array[i + 1];\n array[i + 1] = array[i];\n array[i] = temp;\n unordered = true;\n }\n }\n } while (unordered);\n }", "public void bubbleSort(){\n for(int i = arraySize -1; i > 1; i--){\n for(int j = 0; j < i; j++){\n // Use < to change it to Descending order\n if(theArray[j] > theArray[j+1]){\n swapValues(j, j+1);\n printHorizontalArray(i, j);\n }\n printHorizontalArray(i, j);\n }\n }\n }", "public static void BubbleSort(int[] a) {\n\t int n = a.length;\n\t int temp = 0;\n\n\t for(int i = 0; i < n; i++) {\n\t for(int j=1; j < (n-i); j++) {\n\t if(a[j-1] > a[j]) {\n\t temp = a[j-1];\n\t a[j-1] = a[j];\n\t a[j] = temp;\n\t }\n\t }\n\t }\n\t}", "public static void bubbleSortAlgo(int[] arr) {\n for(int i = 1; i<arr.length-1; i++){\n // inner loop to compare each element with it's next one in every iteration in one complete outer loop\n for(int j = 0; j<arr.length -1; j++){\n if(isSmaller(arr, j+1, j)){ // compares the jth element from it's next element\n swap(arr, j+1, j); // if ismaller condition is true swaps both the elements\n }\n }\n }\n \n }", "public static void bubbleSort(int[] arr){\r\n \tfor(int i = 0; i< arr.length - 1;i++)\r\n \t{\r\n \t\tfor(int j = 0; j< arr.length - 1; j++)\r\n \t\t{\r\n \t\t\tif(arr[j] > arr[j + 1])\r\n \t\t\t{\r\n \t\t\t\tint temp = arr[j];\r\n \t\t\t\tarr[j] = arr[j + 1];\r\n \t\t\t\tarr[j + 1] = temp;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n }", "private void bubbleSort(T[] arr) {\n boolean swaps;\n for (int i = 0; i < n - 1; i++) { // since we always compare two elements, we will need to iterate up to (n - 1) times\n swaps = false;\n for (int j = 1; j < n - i; j++) // we reduce the inspected area by one element at each loop, because the largest element will already be pushed to the right\n if (arr[j].compareTo(arr[j - 1]) < 0) {\n swap(arr, j, j - 1); // the swap method is implemented further\n swaps = true;\n }\n if (!swaps) break; // we stop if there were no swaps during the last iteration\n }\n }", "public void bubbleSort(long [] a){\n\t\tint upperBound=a.length-1;\n\t\tint lowerBound =0;\n\t\tint swaps=0;\n\t\tint iterations=0;\n\t\twhile(upperBound>=lowerBound){\n\t\t\tfor(int i=0,j=1;i<=upperBound && j<=upperBound; j++,i++){\n\t\t\t\tlong lowerOrderElement = a[i];\n\t\t\t\tlong upperOrderElement = a[j];\n\t\t\t\titerations++;\n\t\t\t\tif(lowerOrderElement>upperOrderElement){ //swap positions\n\t\t\t\t\ta[i] = a[j];\n\t\t\t\t\ta[j]= lowerOrderElement;\n\t\t\t\t\tswaps=swaps+1;\n\t\t\t\t}\n\t\t\t\telse{ // sorted.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tupperBound--;\n//\t\tSystem.out.println(\"upperBound:- \" +upperBound);\n//\t\tSystem.out.println(\"lowerBound:- \" +lowerBound);\n\t\t}displayArr(a);\n\t\t\n\t\tSystem.out.println(\"Total Swaps:- \" + swaps);\n\t\tSystem.out.println(\"Total Iterations:- \" + iterations);\n\t}", "public void bubbleSort(int [] array) {\n\t\t\n\t\tfor(int i=0; i<array.length - 1; i++) {\n\t\t\t\n\t\t\tfor(int j=0; j<array.length-i-1; j++) {\n\t\t\t\t\n\t\t\t\tif(array[j]>array[j+1]) {\n\t\t\t\t\t\n\t\t\t\t\tint temp = array[j];\n\t\t\t\t\tarray[j] = array[j+1];\n\t\t\t\t\tarray[j+1] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(Arrays.toString(array));\n\t\t}\n\t}", "public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}", "public static int[] BubbleSort(int[] array){\n int j;\n int temp;\n boolean flag=false;\n while ( flag )\n {\n flag= false;\n for( j=0;j<array.length-1;j++ )\n {\n if ( array[j] < array[j+1] )\n {\n temp = array[j];\n array[j] = array[j+1];\n array[j+1] = temp;\n flag = true;\n }\n }\n }\n return array;\n }", "public static void bubbleSort(int[] arr)\n\t{\n\t\tint len=arr.length;\n\t\tboolean swapped=true;\n\t\twhile(swapped){\n\t\t\tswapped=false;\n\t\t\tfor(int j=1;j<len;j++){\n\t\t\t\tif(arr[j-1]>arr[j]){\n\t\t\t\t\tint temp=arr[j-1];\n\t\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\t\tarr[j]=temp;\n\t\t\t\t\tswapped=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static int[] bubbleSort(int array[]) {\n \t\t// TODO S1 implements bubble sort\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array.length - i - 1; j++) {\n\t\t\t\tif (array[j] > array[j + 1]) {\n\t\t\t\t\tint smaller = array[j + 1];\n\t\t\t\t\tint larger = array[j];\n\t\t\t\t\tarray[j] = smaller;\n\t\t\t\t\tarray[j + 1] = larger;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \t return array;\n \t}", "public void myBubbleSort(int array[]) {\n for (int i = 0; i < array.length - 1; i++) {\n //Iterate through the array to the index to the left of i\n for (int j = 0; j < array.length - i - 1; j++) {\n //Check if the value of the index on the left is less than the index on the right\n if (array[j] > array[j + 1]) {\n //If so, swap them.\n int temp = array[j];\n array[j] = array[j + 1];\n array[j + 1] = temp;\n\n }\n }\n }\n }", "static void BubbleSort(int[] arr){\n for(int i = 0; i< arr.length-1;i++){\n int numberOfSwaps = 0;\n for(int j = 0; j<arr.length-i-1;j++){\n if(arr[j]>arr[j+1]){\n Swap(arr, j, j+1);\n numberOfSwaps++;\n }\n }\n if(numberOfSwaps == 0){\n break;\n }\n }\n }", "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}", "public void sortArray(){\n\t\tfor (int i=0; i<population.length;i++){\n\n\t\t\tfor (int j=0; j<population.length-i-1;j++){\n\n\t\t\t\tif(population[j].computeFitness()>population[j+1].computeFitness()) {\n\t\t\t\t\t//swap their positions in the array\n\t\t\t\t\tChromosome temp1 = population[j];\n\t\t\t\t\tpopulation[j] = population[j+1];\n\t\t\t\t\tpopulation[j+1] = temp1;\n\t\t\t\t}//end if\n\n\t\t\t}//end j for\n\n\t\t}//end i for\n\t}", "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 }", "public static void bubbleSort(int[] arr){\n\n\t\tboolean swaps = true; //setting boolean swaps to true \n\t\tint l = arr.length; //varibale to hold the length of the array \n\n\t\twhile (swaps == true) { //goes through while swaps is true \n\n\t\t\tswaps = false; //setting swaps to false \n\n\t\t\tfor(int i = 0; i < l-1; i++) { //iterates through the length of the array \n\t\t\t\t\n\t\t\t\tif (arr[i + 1] < arr[i]) { //if the element on the right is less than the one on the left (54321)\n\n\n\t\t\t\t\tint temp = arr[i]; //holds the value of element at that index position \n\t\t\t\t\tarr[i] = arr[i+1]; //swaps the elments over \n\t\t\t\t\tarr[i+1] = temp; //moves onto the next element \n\n\t\t\t\t\tswaps = true; //as n-1, moves back and repeats to do the last element \n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}", "public static void sortBubble(int[] tab) {\n boolean alreadySorted=false;\n int temp;\n int n=tab.length;\n int i=0;\n if(tab.length!=0){\n while (i<n-1 && !alreadySorted){\n alreadySorted=true;\n for (int j=0; j<n-1-i;j++){\n if (tab[j]>tab[j+1]){\n alreadySorted=false;\n temp=tab[j];\n tab[j]=tab[j+1];\n tab[j+1]=temp;\n }\n }\n i=i+1;\n }\n }\n}", "static int[] bubbleSort(int[] a) {\n int n = a.length;\n while(n > 0) {\n int newLastN = 0; // if no swap occurred in last step we won't need to run next iteration\n for (int i = 1; i < n; i++) {\n comparisonCount++;\n if (a[i - 1] > a[i]) {\n swapCount++;\n swap(a, i - 1, i);\n newLastN = i;\n }\n }\n n = newLastN;\n }\n return a;\n }", "static void bubbleSort(int[] arr) {\n\t\tboolean swapped; //using swapped for optimization, inner loop will continue only if swapping is possible\n\t\tfor(int i=0;i<arr.length-1;i++) {\n\t\t\tswapped =false;\n\t\t\tfor(int j =0;j<arr.length-i-1;j++) {\n\t\t\t\tif(arr[j]>arr[j+1]) {\n\t\t\t\t\tint temp = arr[j+1]; \n\t\t arr[j+1] = arr[j]; \n\t\t arr[j] = temp;\n\t\t swapped = true;\n\t\t\t\t}\n\t\t\t\t// IF no two elements were \n\t // swapped by inner loop, then break \n\t\t\t\t if (swapped == false) \n\t\t break;\n\t\t\t}\n\t\t}\n\t\tfor(int a:arr) \n\t\t{ \n\t\t\tSystem.out.print(a+ \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t}", "public static void bubbleSort(Array a) {\n int temp;\n for (int i = 0; i < a.length - 1; i++) { // for passes\n int flag = 0;\n for (int j = 0; j < a.length - 1 - i; j++) { // for iteration\n if (a.get(j) > a.get(j + 1)) {\n temp = a.get(j);\n a.set(j, a.get(j + 1));\n a.set(j + 1, temp);\n flag = 1;\n }\n }\n if (flag == 0) break; // if the list is already sorted\n }\n }", "public void bubbleSort() {\n \tfor (int i = 0; i < contarElementos()-1; i++) {\n\t\t\tboolean intercambiado= false;\n\t\t\tfor (int j = 0; j < contarElementos()-1; j++) {\n\t\t\t\tif (encontrarNodoEnElndice(j).getElemento().compareTo(encontrarNodoEnElndice(j+1).getElemento())>0) {\n\t\t\t\t\tintercambiar(j, j+1);\n\t\t\t\t\tintercambiado=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!intercambiado) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }", "private void bubbleSort() {\r\n\r\n int n = leaderboardScores.size();\r\n int intChange;\r\n String stringChange;\r\n\r\n for (int i = 0 ; i < n - 1 ; i ++ ) {\r\n for (int j = 0 ; j < n - i - 1 ; j ++ ) {\r\n\r\n if (leaderboardScores.get(j) > leaderboardScores.get(j + 1)) {\r\n // swap arr[j+1] and arr[i]\r\n intChange = leaderboardScores.get(j);\r\n leaderboardScores.set(j, leaderboardScores.get(j + 1));\r\n leaderboardScores.set(j + 1, intChange);\r\n\r\n stringChange = leaderboardUsers.get(j);\r\n leaderboardUsers.set(j, leaderboardUsers.get(j + 1));\r\n leaderboardUsers.set(j + 1, stringChange);\r\n }\r\n\r\n }\r\n }\r\n }", "public int[] bubbleSort(int[] a) {\r\n\t\t boolean sorted = false;\r\n\t\t int temp;\r\n\t\t while(!sorted) {\r\n\t\t sorted = true;\r\n\t\t for (int i = 0; i < a.length - 1; i++) {\r\n\t\t if (a[i] > a[i+1]) {\r\n\t\t temp = a[i];\r\n\t\t a[i] = a[i+1];\r\n\t\t a[i+1] = temp;\r\n\t\t sorted = false;\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t\treturn a;\r\n\t\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}", "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 static void bubbleSort(int [] arr){\n int temp = 0; //temporary variable\n boolean flag = false; //mark if any reversion has happened\n for (int i = 0; i < arr.length - 1;i++){\n\n for (int j = 0; j < arr.length - 1-i; j++) {\n //if the previous number is bigger than the latter, reverse\n if (arr[j] > arr[j + 1]) {\n flag = true;\n temp = arr[j];\n arr[j] = arr[j + 1];\n arr[j + 1] = temp;\n }\n }\n\n //System.out.printf(\"After the %d round of sorting\",i+1);\n //System.out.println(Arrays.toString(arr));\n\n if(!flag){\n break;\n } else {\n flag = false;\n //reset flag to true to do the next check\n }\n }\n }", "public static void BubbleSort(int[] input) {\r\n for (int i = input.length - 1; i > 0; i--) {\r\n for (int j = 0; j < i; i++) {\r\n if (input[j] > input[j + 1]) {\r\n swap(input, j, j + 1);\r\n }\r\n }\r\n }\r\n }", "public static void bubbleSort(int[] array) {\n boolean swapped = true;\n for (int i = 0; i < array.length && swapped != false; i++) {\n swapped = false;\n for (int j = 1; j < (array.length - i); j++) {\n if (array[j - 1] > array[j]) {\n swap(array, j, j - 1);\n swapped = true;\n }\n }\n }\n }", "public static int[] bubble(int[] arr)\n {\n int l=arr.length;\n\n for (int i = 0; i <l-1; i++)\n {\n for (int j=0; j<l-1-i; j++)\n {\n if (arr[j] > arr[j + 1])\n {\n swap(j, j+ 1, arr);\n }\n }\n }\n return arr;\n }", "static int[] Bubble_sort(int[] input) {\n\t\t//int n=input.length;\t\t\t\t\t//length of the array\n\t\tfor(int i=0;i<input.length;i++)\n\t\t{\t\t\t\t\t\t\t\t\n\t\t\tint pos=0;\t\t\t//setting the first element as the Max element\n\t\t\tint max=input[pos];\n\t\t\tfor(int j=0;j<input.length-i;j++)\n\t\t\t{\t\t\t\t\t//traversing the array to find the max element\n\t\t\t\tif(input[j]>max)\n\t\t\t\t{\n\t\t\t\t\tpos=j;\n\t\t\t\t\tmax=input[pos];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t//swapping the Max element with input.length-i-1 position\n\t\t\tinput[pos]=input[input.length-i-1];\n\t\t\tinput[input.length-i-1]=max;\n\t\t}\n\t\treturn input;\n\t}", "public void bubbleSort(int[] array){\n int last = array.length;\r\n // boolean to flag a swap\r\n boolean swap = true;\r\n // continue if a swap has been made\r\n while(swap){\r\n // assume no swaps will be done\r\n swap = false;\r\n // look for swaps\r\n for(int i = 0; i < last - 1; i++){\r\n // find a bigger value?\r\n if(array[i] > array[i+1]){\r\n // swap\r\n swap(array, i, i+1);\r\n // set flag to true\r\n swap = true;\r\n }\r\n }\r\n // move the last position tracker\r\n last--;\r\n }\r\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t@Override\n\tpublic void sort() {\n\t\t\n\t\t// create maxHeap\n\t\tHeap<E> maxHeap = new MaxHeap<E>(arr);\n\t\t\n\t\telapsedTime = System.nanoTime(); // get time of start\n\t\t\n\t\tfor (int i = length - 1; i > 0; i--) {\n\n\t\t\tmaxHeap.swap(arr, 0, i);\n\t\t\tmaxHeap.heapSize--;\n\t\t\t((MaxHeap) maxHeap).maxHeapify(arr, 0);\n\n\t\t}\n\t\t\n\t\telapsedTime = System.nanoTime() - elapsedTime; // get elapsed time\n\t\t\n\t\tprint(); // print sorted array\n\t\tprintElapsedTime(); // print elapsed time\n\t\t\n\t\t\n\t}", "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}", "public static int[] sortBubble(int[] tab) {\n int n=tab.length;\n\t\tint i=0;\n\t\tboolean dejatrie=false;\n\t\twhile(i<n-1 && !dejatrie) {\n\t\t\tdejatrie=true;\n\t\t\tfor (int j=0; j<n-1;j++) {\n\t\t\t\tif (tab[j]>tab[j+1]) {\n\t\t\t\t\techanger(tab,j,j+1); //méthode d'échange de deux élément en 3 lignes\n\t\t\t\t\tdejatrie=false;\n\t\t\t\t}\n\t\t\t}\n\t\t\ti=i+1;\n\t\t}\n\t\treturn tab;\n }", "public void sort(int array[]){\n for(int i=1;i < array.length;i++){\n int j=i-1;\n int cur=i;\n while(array[cur] < array[j] && j >=0 ){\n swap(array,cur,j);\n cur--;\n j--;\n }\n\n }\n }", "public static void bubbleSort(int[] arr) {\r\n for (int i = 0; i < arr.length; i++) {\r\n boolean swapped = false;\r\n for (int j = 1; j < arr.length - i; j++) {\r\n if (arr[j] < arr[j - 1]) {\r\n swap(arr, j, j - 1);\r\n swapped = true;\r\n }\r\n }\r\n if (!swapped) {\r\n break;\r\n }\r\n }\r\n }", "public static void sort(int[] arr){\n\n for(int i=1;i<arr.length;i++){\n int current=arr[i];\n int j=i-1;\n\n while(j>=0 && arr[j]>current){\n arr[j+1]=arr[j];\n j--;\n }\n\n arr[j+1]=current;\n }\n\n\n\n }", "void bubblesort(int arr[],int n)\n {\n for(int i=0;i<n;i++)\n {\n for(int j=0;j<n-1;j++) //after its 1st iteration we have our maximum value sorted\n {\n if(arr[j]>arr[j+1]) // if value at present index is > the next index value then its swap the value \n {\n int temp=arr[j];\n arr[j]=arr[j+1];\n arr[j+1]=temp;\n }\n }\n }\n }", "@Test\n public void testBubbleSort() {\n BubbleSort<Integer> testing = new BubbleSort<>();\n\n testing.sort(array, new Comparator<Integer>() {\n @Override\n public int compare(Integer i1, Integer i2) {\n return i1.compareTo(i2);\n }\n });\n\n checkArray(\"Bubble sort doesn't work!\", array);\n }", "private void createArrays(){\n array1 = new BubbleSort(CreateIntArray.fillArray(15)).bubbleSort();\n array2 = new BubbleSort(CreateIntArray.fillArray(15)).bubbleSort();\n BubbleSort.listArrayElements(array1);\n BubbleSort.listArrayElements(array2);\n\n int[] array = new int[array1.length + array2.length];\n\n int i = 0, j = 0;\n for (int k = 0; k < array.length; k++){\n if(i > array1.length - 1){\n array[k] = array2[j];\n j++;\n } else if(j > array2.length - 1){\n array[k] = array1[i];\n i++;\n } else if (array1[i] < array2[j]){\n array[k] = array1[i];\n i++;\n } else {\n array[k] = array2[j];\n j++;\n }\n\n }\n BubbleSort.listArrayElements(array);\n\n\n }", "public static void bubbleSort(String[] words) {\n \n for(int i=0; i< words.length-1; i++) {\n for(int j=i+1; j<words.length; j++) {\n if(words[j].compareTo(words[i]) < 0) {\n String s = words[j];\n words[j] = words[i];\n words[i] = s;\n }\n } \n }\n }", "public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }", "@Override\n\tpublic T[] sort(T[] input) {\n\t\tfor(int i = 1; i < input.length; i++){\n\t\t\t//compare with the previous one, if smaller, switch with it.\n\t\t\tfor(int j = i; j > 0 && input[j-1].compareTo( input[j]) > 0; j--){\n\t\t\t\t//add the condition input[j-1] > input[j] in the for loop;\n\t\t\t\t//cause if j-1th < jth, j-2th < jth(left part is ordered)\n\t\t\t\tswap(input, j, j-1);\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}", "public static void bubbleSort(int[] a) {\r\n boolean swapped; // keeps track of when array values are swapped \r\n int i; // a loop counter\r\n int temp; // catalyst variable for String swapping\r\n\r\n // Each iteration of the outer do loop is is one pass through the loop. \r\n // If anything was swapped, it makes another pass\r\n do {\r\n // set swapped to false before each pass\r\n swapped = false;\r\n\r\n // the for loop is a pass through the array to the second to last element\r\n for (i = 0; (i < a.length - 1); i++) {\r\n // if the two items are out of order see page 16 for String compareTo() \r\n if (a[i + 1] < (a[i])) {\r\n // swap the two items and set swapped to true \r\n temp = a[i];//catalyst variable assignment to item\r\n a[i] = a[i + 1];//copy second item to first item slot\r\n a[i + 1] = temp;//copy catalyst variable to second slot\r\n\r\n swapped = true; //something was swapped!\r\n\r\n } // end if\r\n } // end for\r\n\r\n // the outer loop will repeat if a swap was made – another passs\r\n } while (swapped);\r\n\r\n }", "public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }", "public static <T extends Comparable<T>> void bubbleSort(T[] arrayToSort) {\n for(int i = 0; i < arrayToSort.length - 1; i++)\n for(int j = arrayToSort.length - 1; j > i + 1; j--)\n if(arrayToSort[j].compareTo(arrayToSort[j - 1]) < 0) {\n T value = arrayToSort[j];\n arrayToSort[j] = arrayToSort[j - 1];\n arrayToSort[j - 1] = value;\n }\n }", "@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}", "@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }", "public void printSortedByBubbleSort(int[] array){\r\n\t\tint temp;\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tfor (int j = 0; j < array.length - 1; j++) {\r\n\t\t\t\tif(array[j] > array[j + 1]){\r\n\t\t\t\t\ttemp = array[j];\r\n\t\t\t\t\tarray[j] = array[j + 1];\r\n\t\t\t\t\tarray[j + 1] = temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nSorted by BubleSort: \");\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tSystem.out.print(array[i] + \" \");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\r\n int[] numbers = {25, 43, 29, 50, -6, 32, -20, 43, 8, -6};\r\n\t\r\n\tSystem.out.print(\"before sorting: \");\r\n\toutputArray(numbers);\r\n \r\n\tbubbleSort(numbers);\r\n\t\r\n\tSystem.out.print(\"after sorting: \");\r\n\toutputArray(numbers);\r\n }", "private void sortBubble(ArrayList<String[]> jtData, int col)\n {\n String first, second;\n for(int i=0; i < jtData.size();i++)\n {\n for(int j=1; j < (jtData.size()-i); j++)\n {\n first = jtData.get(j-1)[col];\n second = jtData.get(j)[col];\n if(col == 2)\n {\n // Price is integer\n int x = Integer.valueOf(first);\n int y = Integer.valueOf(second);\n if(x < y)\n { \n Collections.swap(jtData, j, j-1);\n }\n }\n else if (first.compareToIgnoreCase(second) > 0) \n {\n // For Strings\n Collections.swap(jtData, j, j-1);\n }\n }\n }\n }", "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}", "public static void sort(int [] a) {\n for(int i=0; i<a.length;i++){\n for (int j = i+1; j < a.length; j++) {\n int temp=0;\n if(a[i]>a[j]){\n temp=a[j];\n a[j]=a[i];\n a[i]=temp;\n }\n }\n }\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}", "private static void sort(int[] arr) {\n\t\t\n\t\tint i=0;\n\t\tint j=0;\n\t\tint k=arr.length-1;\n\t\tSystem.out.println(\"length \"+arr.length);\n\t\twhile (i<=k)\n\t\t{\n\t\t\tSystem.out.println(\"at start i \"+i+\" j \"+j+\" k \"+k);\n\t\t\tif(arr[i]==0)\n\t\t\t\tswap(j++,i++,arr);\n\t\t\telse if(arr[i]==2)\n\t\t\t\tswap(k--,i,arr);\n\t\t\telse\n\t\t\t\ti++;\n\t\t\t\n\t\t\tprintArray(arr);\n\t\t\tSystem.out.println(\"at end i \"+i+\" j \"+j+\" k \"+k);\n\t\t\t\n\t\t}\n\t}", "public static int[] bubbleSortBasic(int [] arrayToSort , SorterObject results)\n {\n \t// Create a copy of array than was send\n int [] arr = Arrays.copyOf(arrayToSort,arrayToSort.length);\n // Start the timer\n long startTime = System.currentTimeMillis(); \n // Variable used for swaping elements\n int temp = 0; \n // Outer loop\n for(int i=0; i < arr.length-1; i++)\n { \n // inner loop\n for(int j=0; j < arr.length-1; j++)\n { \n \t// Increase number of comparisons\n \tresults.numberOfComparisons++;\n if(arr[j] > arr[j+1])\n { \n\t temp = arr[j]; \n\t arr[j] = arr[j+1]; \n\t arr[j+1] = temp; \n\t // Increase number of swaps\n\t results.numberOfSwaps++;\n }\n }\n } \n // Stop the timer\n long stopTime = System.currentTimeMillis();\n // Calculate time \n long elapsedTime = stopTime - startTime;\n // Save time elapsed in global results object\n results.time = elapsedTime;\n // Return sorted array\n return arr;\n \n }", "public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}", "public String[] bubbleSortString(String[] input){\r\n\t\tString temp=\"\";\r\n\t\tfor(int i=0;i<input.length;i++){\r\n\t\t\tfor(int j=i+1;j<input.length;j++){\r\n\t if(input[i].compareTo(input[j])>0){\r\n\t \t temp=input[i];\r\n\t \t input[i]=input[j];\r\n\t \t input[j]=temp;\r\n\t }\r\n\t\t\t}\r\n\t\t}return input;\r\n\t}", "public static <T extends Comparable<T>> void myBubbleSort(T[] arrayToSort) {\n boolean isNotSorted = true;\n while(isNotSorted) {\n isNotSorted = false;\n for(int i = 0; i < arrayToSort.length - 1; i++)\n if(arrayToSort[i].compareTo(arrayToSort[i + 1]) > 0) {\n T value = arrayToSort[i];\n arrayToSort[i] = arrayToSort[i + 1];\n arrayToSort[i + 1] = value;\n isNotSorted = true;\n }\n }\n }", "public static int[] bubbleSort(int[] arr, int n){\n for(int j=1; j<n; j++) {\n for (int i = 1; i < n; i++) {\n if (arr[i - 1] > arr[i]) {\n int temp = arr[i - 1];\n arr[i - 1] = arr[i];\n arr[i] = temp;\n }\n }\n }\n return arr;\n }", "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 static Integer[] optimisedBubbleSort(Integer[] n) {\n int len = n.length - 1;\n boolean swapped = false;\n for (int i = 0; i < len; i++) {\n for (int j = 0; j < len - i; j++) {\n if (n[j] > n[j + 1]) {\n int temp = n[j];\n n[j] = n[j + 1];\n n[j + 1] = temp;\n swapped = true;\n }\n }\n if(swapped == false) {\n break;\n }\n }\n return n;\n }", "@Override\r\n\tpublic void sort(int[] demo) {\n\t\tint temp;\r\n\t\tfor(int gap = 5;gap > 0;gap /= 2){\r\n\t\t\tfor(int i = gap;i < demo.length;i++){\r\n\t\t\t\tfor(int j = i - gap;j >= 0;j -= gap){\r\n\t\t\t\t\tif (demo[j] > demo[j + gap]) {\r\n\t\t\t\t\t\ttemp =demo[j];\r\n\t\t\t\t\t\tdemo[j] =demo[j + gap];\r\n\t\t\t\t\t\tdemo[j + gap] = temp;\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\tSystem.out.println(Arrays.toString(demo));\r\n\t}", "public static void bubbleSort(int[] a) {\n\t\tboolean loop;\n\t\tdo {\n\t\t\tloop = false;\n\t\t\tfor (int i = 0; i < a.length - 1; i ++) {\n\t\t\t\tif (a[i] > a[i + 1]) {\n\t\t\t\t\tint temp = a[i];\n\t\t\t\t\ta[i] = a[i + 1];\n\t\t\t\t\ta[i + 1] = temp;\n\t\t\t\t\tloop = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (loop);\n\t}", "public static void bubbleSort() {\r\n\t\tfor(int i = nodeArrList.size() -1; i > 0; i--) {\r\n\t\t\tfor(int j = 0; j < i; j++) {\r\n\t\t\t\tif(nodeArrList.get(j).frequency > nodeArrList.get(j +1).frequency) {\r\n\t\t\t\t\tHuffmanNode temp = nodeArrList.get(j);\r\n\t\t\t\t\tnodeArrList.set(j, nodeArrList.get(j + 1));\r\n\t\t\t\t\tnodeArrList.set(j + 1, temp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void sortDESC(int[] array) {\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}", "@Override\n public void sort(int[] array) {\n for (int i = 0; i < array.length - 1; ++i) {\n for (int j = i + 1; j < array.length; ++j) {\n if (array[i] > array[j]) {\n int tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n }\n }\n }", "private static void sort2(int[] a) {\n for(int i=0; i<a.length; i++){\n //find smallest from i to end \n int minIndex=i;\n for(int j=i ; j<a.length; j++)\n if(a[j]<a[minIndex])\n minIndex=j;\n //swap\n int t = a[i];\n a[i] = a[minIndex];\n a[minIndex] = t;\n }\n }", "public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}", "void sort();", "void sort();", "public static void LinearSorting(int[] arr) {\n\t\tfor(int i=0;i<arr.length-1;i++) {\r\n\t\t\tfor(int j=i+1;j<arr.length;j++) {\r\n\t\t\t if(arr[i]>arr[j]) {\r\n\t\t\t\t //Swap elements\r\n\t\t\t\t int temp=arr[i];\r\n\t\t\t\t arr[i]=arr[j];\r\n\t\t\t\t arr[j]=temp;\r\n\t\t\t }\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void sortAlternate(int[] nums){\n Arrays.sort(nums);\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}", "@Override\n\tvoid sort(int[] arr, SortingVisualizer display) {\n\t\tint current = 0;\n\t\tint x;\n\t\tint y;\n\t\tboolean complete = false;\n\t\twhile(complete == false) {\n\t\t\tcurrent = 0;\n\t\t\tcomplete = true;\n\t\t\tfor(int i = 0 ; i < arr.length; i ++) {\n\t\t\t\tdisplay.updateDisplay();\n\t\t\t\tif(arr[current] > arr[i]) {\n\t\t\t\t\tx = arr[i];\n\t\t\t\t\ty = arr[current];\n\t\t\t\t\tarr[i] = y;\n\t\t\t\t\tarr[current] = x;\n\t\t\t\t\tcomplete = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\tcurrent = i;\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "@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 }", "public static int[] bubbleSort(int[] inputArray) {\n boolean done = false;\n\n for (int i = 0; i < inputArray.length && !done; i++) {\n done = true;\n for (int j = 0; j < inputArray.length - i - 1; j++) {\n if (inputArray[j] > inputArray[j + 1]) {\n int temp = inputArray[j];\n inputArray[j] = inputArray[j + 1];\n inputArray[j + 1] = temp;\n done = false;\n }\n }\n }\n return inputArray;\n\n }", "private static void allSorts(int[] array) {\n\t\tSystem.out.printf(\"%12d\",array.length);\n\t\tint[] temp;\n\t\tStopWatch1 timer;\n\t\t\n\t\t//Performs bubble sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.bubbleSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n \n int swap = 0;\n \n Scanner scan = new Scanner(System.in);\n System.out.print(\"Kaç elemanlı = \");\n int max = scan.nextInt();\n\n int[] toSortArray = new int[max];\n\n toSortArray[0] = 0;\n\n for (int i = 1; i < max; i++) {\n\n toSortArray[i] = (int) (Math.random() * 100);\n toSortArray[0]++; //holds the number of values in the array;\n\n int index = i;\n\n while (toSortArray[index / 2] < toSortArray[index] && (index / 2) != 0) {\n\n int temp = toSortArray[index / 2];\n toSortArray[index / 2] = toSortArray[index];\n toSortArray[index] = temp;\n index = index / 2;\n\n }\n\n\t\t\t//Hence the heap is created!\n }\n\n System.out.println(\"The array to be sorted is:\");\n\n for (int i = 0; i < max; i++) {\n\n System.out.print(\" | \" + toSortArray[i]);\n\n }\n\n System.out.println(\" | \");\n\n\t\t//Start\n\t\t//Let's Sort it out now!\n while (toSortArray[0] > 0) {\n\n int temp = toSortArray[1];\n toSortArray[1] = toSortArray[toSortArray[0]];\n toSortArray[toSortArray[0]] = temp;\n\n for (int i = 1; i < toSortArray[0]; i++) {\n\n int index = i;\n\n while (toSortArray[index / 2] < toSortArray[index] && (index / 2) != 0) {\n\n int temp1 = toSortArray[index / 2];\n toSortArray[index / 2] = toSortArray[index];\n toSortArray[index] = temp1;\n index = index / 2;\n swap = swap+1;\n\n }\n\n }\n\n toSortArray[0]--;\n\n }\n\n\t\t//End\n System.out.println(\"The sorted array is: \");\n\n for (int i = 0; i < max; i++) {\n\n System.out.print(\" | \" + toSortArray[i]);\n }\n\n System.out.println(\" | \");\n System.out.println(max + \" eleman için \"+ swap + \" adet eleman yerdeğiştirildi. \" );\n\n }", "private static void BubbleIter(int[] arr) {\n\t\t\n\t\tint size = arr.length;\n\t for (int i=1; i<size; ++i) {\n\t for (int j=0; j<size-i; ++j) {\n\t \t// Sorts the array arr[first] through arr[last] iteratively.\n\t \t// Last index changes by i pass\n\t if (arr[j]>arr[j+1]) swap(arr, j);\n\t }\n\t }\n\t}", "@Override\n public int[] sort(int[] array) {\n\n int n = array.length;\n\n for (int i = 1; i <= n - 1; i++) {\n int j = i - 1;\n\n while (j >= 0 && array[j] > array[j + 1]) {\n swap(array, j, j + 1);\n j--;\n }\n }\n\n return array;\n }", "public static void main(String[] args) {\n\n\t\tint[] a= {10,9,7,13,2,6,14,20};\n\t\tSystem.out.println(\"before sort\"+Arrays.toString(a));\n\t\tfor(int k=1;k<a.length;k++) {\n\t\t\tint temp=a[k];\n\t\t\tint j=k-1;\n\t\t\t\n\t\t\twhile(j>=0 && temp<=a[j]) {\n\t\t\t\ta[j+1]=a[j];\n\t\t\t\tj=j-1;\n\t\t\t}\n\t\t\ta[j+1]=temp;\n\t\t}\n\n\t\t\n\t\tSystem.out.println(\"After sort\"+Arrays.toString(a));\n\t\t\n\t\tSystem.out.println(\"print uing for loop\");\n\t\tfor(int i=0;i<a.length;i++) {\n\t\t\tSystem.out.print(a[i]+\"\");\n\t\t}\n\t}", "public static void bubbleSort(int arr[], int n)\n {\n for (int i = 0; i < n - 1; i++) { \n\t\t\tfor (int j = 0; j < n - i - 1; j++) { \n\t\t\t\tif (arr[j] > arr[j + 1]) { \n\t\t\t\t\tint temp = arr[j]; \n\t\t\t\t\tarr[j] = arr[j + 1]; \n\t\t\t\t\tarr[j + 1] = temp; \n\t\t\t\t} \n\t\t\t} \n\t\t} \n }", "public int[] sort(int[] data) {\n int[] sorted = new int[data.length];\n int tempstrt, tempend;\n for (int i = 0; i < data.length; i = i + 2) {\n for (int j = i + 2; j < data.length; j = j + 2) {\n if (data[i] > data[j]) {\n //swap start pos\n tempstrt = data[i];\n data[i] = data[j];\n data[j] = tempstrt;\n //swwap end pos\n tempend = data[i + 1];\n data[i + 1] = data[j + 1];\n data[j + 1] = tempend;\n }\n\n }\n }\n\n return data;\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}", "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}", "@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 bubbleSort(int [] intArray)\n {\n int n = intArray.length;\n int temp = 0;\n try\n {\n for(int i=0; i < n; i++)\n {\n thread.sleep(100); //sleep the thread to particular to view the results in panel\n this.setThreadState();\n for(int j=1; j < (n-i); j++)\n { \n if(!orderPanel) //check for Descending order\n {\n if(intArray[j-1] > intArray[j])\n {\n //swap the elements!\n temp = intArray[j-1];\n intArray[j-1] = intArray[j];\n intArray[j] = temp;\n repaint();\n \n \n }\n }\n else if(intArray[j-1] < intArray[j]) //check for Ascending order\n {\n temp = intArray[j-1]; \n intArray[j-1] = intArray[j];\n intArray[j] = temp;\n repaint();\n \n }\n \n }\n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n }", "public static int[] bubbleSort(int[] values) {\n int temp;\n boolean nextPass = true;\n \n for (int i = 1; i < values.length && nextPass; i++) { // terminate loop if at end of array or a new pass is not needed\n nextPass = false;\n for (int j = 0; j < values.length - i; j++) {\n if (values[j] > values[j + 1]) { // current value greater than the next? swap values\n temp = values[j];\n values[j] = values[j + 1];\n values[j + 1] = temp;\n nextPass = true; \n }\n }\n }\n \n return values;\n }", "public void jsort() {\n\tArrays.sort(data);\n }", "public static void bubbleSort(String [] list1)\r\n\t{\r\n\t\t\r\n\t String temp;\r\n\t int swap=1000;\r\n\t while(swap>0) \r\n\t {\r\n\t \tswap=0;\r\n\t \tfor(int outside=0; outside<list1.length-1; outside++)\r\n\t \t{\r\n\t \t\tif(list1[outside+1].compareTo(list1[outside])<0)\r\n\t \t\t{\r\n\t \t\t\tswap++;\r\n\t \t\t\ttemp=list1[outside];\r\n\t \t\t\tlist1[outside]=list1[outside+1];\r\n\t \t\t\tlist1[outside+1]=temp;\r\n\t \t\t}\r\n\t \t}\r\n\t }\r\n\t \r\n\t}", "public static void sort(int[] ds){\n\t\tfor(int i = 0, maxi = ds.length - 1; i < maxi; i++){\n\t\t\tint min = i;\n\t\t\tfor(int j = i + 1, maxj = ds.length; j < maxj; j++){\n\t\t\t\tif(ds[min] > ds[j]){\n\t\t\t\t\tmin = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tint t = ds[min];\n\t\t\tds[min] = ds[i];\n\t\t\tds[i] = t;\n\t\t}\n\t}", "public static void sortArray(int[] array)\r\n {\r\n //create boolean variable to compare array values\r\n boolean swapped;\r\n //loop through the entire array\r\n for (int n=0; n < array.length; ++n)\r\n {\r\n do\r\n {\r\n //set boolean variable swapped to false\r\n swapped = false;\r\n \r\n //nested loop compares each pair of adjacent elements starting at array[n]\r\n for (int x = n + 1; x < array.length; x++) \r\n {\r\n //if the element in the array is greater than the following element\r\n if (array[n] > array[x]) \r\n {\r\n //initialize a temp variable to hold an array element value\r\n int temp;\r\n \r\n //swap the elements\r\n temp = array[n];\r\n array[n] = array[x];\r\n array[x] = temp;\r\n //set boolean variable swapped to true\r\n swapped = true;\r\n }\r\n }\r\n }while (swapped == true);\r\n }\r\n\r\n \r\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 }", "public static void sort(int[] array) {\n for (int i = 0; i < array.length - 1; i++) {\n for (int j = i + 1; j < array.length; j++) {\n if (array[j] < array[i]) {\n swap(array, i, j);\n }\n }\n\n }\n\n }", "@Override\n public <T extends Comparable<T>> T[] sort(T[] arr) {\n for (int i=1 ; i<arr.length ; i++) {\n\n T card = arr[i];\n int j = i - 1;\n \n //Kucuk degeri sola kaydirma\n while (j >= 0 && Sort.less(card, arr[j])) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = card;\n }\n return arr;\n }", "@Override\n\tpublic void sort(int[] array) {\n\n\t}" ]
[ "0.80037326", "0.7748423", "0.767007", "0.7627617", "0.7617527", "0.75071055", "0.74969584", "0.7456769", "0.7453551", "0.74195796", "0.7407863", "0.73909545", "0.735769", "0.7357232", "0.735272", "0.73512524", "0.7333602", "0.73138535", "0.72983706", "0.7296635", "0.72949433", "0.7294708", "0.7279077", "0.7274764", "0.7250497", "0.72412", "0.72133976", "0.7202817", "0.7188165", "0.71861535", "0.71669865", "0.71598697", "0.7149178", "0.71366155", "0.71278733", "0.71274245", "0.71241355", "0.7120727", "0.7106005", "0.7088726", "0.7083909", "0.70739925", "0.70678425", "0.70548403", "0.7051305", "0.701878", "0.7010638", "0.70054656", "0.7003161", "0.70019704", "0.6987058", "0.69859076", "0.6985406", "0.6978521", "0.6975667", "0.6967814", "0.69657964", "0.6941242", "0.6940006", "0.69126296", "0.69076914", "0.6899676", "0.6897814", "0.68882954", "0.6888243", "0.688194", "0.68753725", "0.6875094", "0.68704665", "0.6864469", "0.686174", "0.6846185", "0.6842669", "0.6842669", "0.6837555", "0.683747", "0.683743", "0.6830158", "0.68252534", "0.6822218", "0.6816928", "0.6812095", "0.6808427", "0.68080366", "0.67988074", "0.67778987", "0.67750317", "0.6773083", "0.67541486", "0.6753265", "0.67481756", "0.67470336", "0.6744291", "0.67377496", "0.67325205", "0.6728127", "0.6726094", "0.67204577", "0.671925", "0.6714685" ]
0.6990847
50
to print the array
void printArray(int arr[]) { //enhanced for loop for (int item:arr) { System.out.print(item + " "); } System.out.println(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showArray() {\n\t\tSystem.out.println(Arrays.toString(this.array));\n\n\t}", "public void print()\n\t{\n\t\tStringBuffer print = new StringBuffer();\n\t\tif (arraySize != 0)\n\t\t{\n\t\t\tfor (int index = 0; index < arraySize - 1; index++) \n\t\t\t{ \n\t\t\t\tprint.append(array[index] + \", \");\n\t\t\t}\n\t\t\tprint.append(array[arraySize - 1]);\n\t\t\tSystem.out.println(print.toString());\n\t\t}\n\t}", "private void displayArray() {\r\n System.out.println(\"CEK ARRAY : \");\r\n for (i = 0; i < array.length; i++) {\r\n System.out.print(array[i]+\",\");\r\n }\r\n }", "private static void printArray(Integer[] a) {\n\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\tSystem.out.print(a[k] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void printArray()\n {\n for (int i=0;i<array.length; i++)\n {\n System.out.print(array[i] + \" \"); \n }\n System.out.println();\n }", "private static void printArray(int[] a) {\n\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\tSystem.out.print(a[k] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "private static void printArray(int[] arr) {\n\t\tSystem.out.println(\"array is \");\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tSystem.out.print(arr[i]+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "static void printArray(Comparable[] arr) {\n\t\tint n = arr.length;\n\t\tfor (int i = 0; i < n; ++i)\n\t\t\tSystem.out.print(arr[i] + \" \");\n\t\tSystem.out.println();\n\t}", "public static void printArray(int[] array){\n for(int i=0;i<array.length;i++){\n System.out.print(array[i]+\" \");\n }}", "private static void printArray(Object[] array) {\n for (Object t : array) {\n System.out.println(\" \" + t + \", \");\n }\n }", "private static void print(int[] arr) {\n\t\tfor(int i=0;i<=arr.length;i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(arr[i]+\" \");\r\n\t\t}\r\n\t}", "private static void printArray(int[] array) {\n\t\tfor(int i: array) {\n\t\t\tSystem.out.print(i + \"\\t\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "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}", "public void printArray(int array[]) {\n\t\tfor(int i = 0;i<array.length;i++) {\n\t\t\tSystem.out.println(\"Array[\"+ (i+1) +\"] = \"+array[i]);\n\t\t}\n\t}", "private static void print(int[] a) {\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tSystem.out.println(\"i is \"+ i +\" value is \"+ a[i]);\n\t\t}\n\t}", "private static void show(Comparable[] a) {\n for (int i = 0; i < a.length; i++) {\n System.out.printf(\"a[%d] = %s\\n\", i + 1, a[i].toString());\n }\n System.out.println();\n }", "public static void displayValues(int [] array){\n System.out.println(Arrays.toString(array));\n }", "void printArray(CatalogueItem arr[])\r\n {\r\n int n = arr.length;\r\n for (int i=0; i<n; ++i)\r\n System.out.print(\r\n \"id: \" + arr[i].getItemId() + \" \"\r\n + \"name: \" + arr[i].getItemName() + \" \"\r\n + \"category: \" + arr[i].getCategory() + \"\\n\");\r\n System.out.println();\r\n System.out.println();\r\n }", "static void printArray(int[] array) {\n\n\n for (int i = 0; i < array.length; i++) {\n\n System.out.print(array[i] + \" \");\n\n\n }\n\n System.out.println();\n\n }", "private static void printArray(int[] array) {\n\t\tif(array==null){\n\t\t\tSystem.out.println(\"Nothing in the array.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint Len = array.length;\n\t\tfor(int i=0; i<Len; i++){\n\t\t\tSystem.out.print(\" \" + array[i]);\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}", "static void printArray(int arr[]) \n\t { \n\t\t int n = arr.length; \n\t\t for (int i=0; i<n; ++i) \n\t\t\t System.out.print(arr[i] + \" \"); \n\t\t System.out.println(); \n\t }", "public void printArrays() {\n for (ArraySymbol as: arrays) {\n System.out.println(as);\n }\n }", "private static void printArray(Node[][] puzzle) {\r\n\t\tfor (int i = 0; i < puzzle.length; i++) {\r\n\t\t\tfor (int j = 0; j < puzzle[0].length; j++) {\r\n\t\t\t\tSystem.out.print(puzzle[i][j].getValue());\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\r\n\t}", "public static void printArray(double[] a) {\n\t\tfor(int i=0;i<a.length;i++) {\n\t\t\tSystem.out.format(\"%.2f \",a[i]);\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void Display(int[] array) {\n for(int i=0;i<array.length;i++){\n System.out.print(array[i]+\"\\t\");\n }\n System.out.println();\n }", "public static void printArray(double[] array){\n for(int k = 0; k < array.length; k++){\n System.out.print(array[k] + \" \");\n }\n System.out.println();\n }", "private static void printIntArray(int[] arr){\n\t\tSystem.out.print(\"[ \");\n\t\tfor(Integer i : arr){\n\t\t\tSystem.out.print(i + \" \");\n\t\t}\n\t\tSystem.out.println(\" ]\");\n\t}", "public static void printArray(double[] array) {\r\n\r\n for (int i = 0; i < array.length; i++) {\r\n System.out.print(\"[\" + array[i] + \"] \");\r\n }\r\n System.out.println(\"\");\r\n }", "public static void printArray(int[] a) {\n System.out.print(\"{\" + a[0]);\n for (int i = 1; i < a.length; i++) {\n System.out.print(\", \" + a[i]);\n }\n System.out.println(\"}\");\n }", "static void printArray(int arr[]) {\n int n = arr.length;\n for (int i = 0; i < n; ++i)\n System.out.print(arr[i] + \" \");\n \tSystem.out.println();\n }", "public static void printArray(int[] array) {\r\n\t\tSystem.out.print(\"4. All values stored in the array is: \");\r\n\t\tfor (int i = 0; i < myList.length; i++) {\r\n\t\t\tSystem.out.print(myList[i] + \" \");\r\n\t\t}\r\n\t}", "public void printAll(){\nfor(int i=0;i<size ;i++){\n System.out.println(\"a[%d]\"+data[i]); \n}\n System.out.println(\"size\"+size); \n}", "public static void printArray(int[] arr) {\n String output = \"[ \";\n for (int i = 0; i < arr.length; i++) {\n if (i != 0) {\n output += \", \" + arr[i];\n }\n else {\n output += arr[i];\n }\n }\n output += \" ]\";\n System.out.println(output);\n }", "public void print() {\n\t\t\tfor (int i = 0; i < nowLength; i++) {\n\t\t\t\tSystem.out.print(ray[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}", "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}", "static void printArray(int arr[]) {\n\t\tint n = arr.length;\n\t\tfor (int i = 0; i < n; ++i)\n\t\t\tSystem.out.print(arr[i] + \" \");\n\t\tSystem.out.println();\n\t}", "public void print() {\r\n\t\tfor (int i = front; i <= rear; i++) {\r\n\t\t\tSystem.out.print(arr[i].getData() + \"\\t\");\r\n\t\t}\r\n\t}", "static void printArray(int arr[])\n {\n int n = arr.length;\n for (int i=0; i<n; ++i)\n System.out.print(arr[i]+\" \");\n System.out.println();\n }", "public void print(){\n\t\tif(isEmpty()) System.out.println(\"[vazio]\");\n\t\telse{\n\t\t\tSystem.out.print(\"A = [\" + A[0]);\n\t\t\tfor(int i=1; i<size; i++)\n\t\t\t\tSystem.out.print(\", \"+ A[i]);\n\t\t\tSystem.out.println(\"]\");\n\t\t}\n\t}", "protected static void show(Comparable[] a) {\n\t\t\r\n\t\tString retStr = \"\";\r\n\t\tfor(int i=0 ; i< a.length; i++)\r\n\t\t\tretStr+=\" \"+a[i];\r\n\t\t\r\n\t\tSystem.out.println(retStr);\r\n\t\t\r\n\t}", "static void print(int[] array)\n\t{\n\t\tfor(int i = 0; i < array.length; i++)\n\t\t{\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\t}", "public static void printArray( int[] a ) {\n\tSystem.out.print(\"[\");\n\tfor( int i : a )\n\t System.out.print( i + \",\");\n\tSystem.out.print(\"]\");\n }", "public static void printArray(int[] array)\r\n {\r\n //Loop through array and print each individual element\r\n for (int n=0; n < array.length; ++n)\r\n {\r\n System.out.println(array [n]); \r\n \r\n }\r\n \r\n }", "public static void printArray( int[] a ) {\n\tSystem.out.print(\"[\");\n\tfor( int i : a )\n\t System.out.print( i + \",\");\n\tSystem.out.println(\"]\");\n }", "public static void printArray(int[] arr) {\n System.out.println(\"===\");\n for (int i = 0; i < arr.length; i++) {\n System.out.println(arr[i]);\n }\n System.out.println(\"===\");\n }", "public static void printArray(int[] array) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.print(\"array = [\");\r\n\t\tfor (int i=0; i < SIZE_OF_ARRAY-1; i++)\r\n\t\t\tSystem.out.print(\"\"+ array[i]+\" | \");\r\n\t\tSystem.out.println(\"\"+ array[SIZE_OF_ARRAY-1]+\"]\");\r\n\t\tSystem.out.println(\"-------------------------------------------------\"\r\n\t\t\t\t+ \"-------------------\");\r\n\t}", "public static void printArray(Cell[] arr) {\r\n\t\tConstants.logger.info(\"\\nWhole Field as single Array[\");\r\n\t\tfor (int j = 0; j < arr.length; j++) {\r\n\t\t\tSystem.out.print(arr[j]);\r\n\t\t}\r\n\t\tConstants.logger.info(\"]\\n\");\r\n\t}", "public static void printIntArray(int[] array){\n for(int i = 0; i < array.length; i++)\n System.out.print(\"[\" + i + \"]\" + \" = \" + array[i] + \" \");\n }", "static void printArray(char [] a) {\n\t\tfor (int i=0; i< a.length; i++) System.out.print(a[i]); \n\t\tSystem.out.println();\n\t}", "public static void printArray( int[] a ) {\n System.out.print(\"[\");\n for( int i : a )\n System.out.print( i + \",\");\n System.out.println(\"]\");\n }", "public static void printArray( int[] a ) {\n System.out.print(\"[\");\n for( int i : a )\n System.out.print( i + \",\");\n System.out.println(\"]\");\n }", "public static void displayArr(int[] a)\r\n {\r\n for(int i : a)\r\n System.out.print(i + \" \");\r\n System.out.println();\r\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 static void printArray(int[] array){\n\n for(int i = 0 ; i < array.length; i++){\n System.out.println(\"Element \" + i + \", value is \" + array[i]);\n }\n\n }", "private static <T> void show(Comparable<T>[] a) {\n\t\tfor(int i=0; i<a.length; i++) \r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\tSystem.out.println();\r\n\t}", "public void printArray(long[] array) {\n System.out.println(Arrays.toString(array));\n }", "static void printArray(int[] arr) {\n for (int item : arr) {\n System.out.print(item+ \" \");\n }\n }", "public void printArray(int[] arr) {\n int n = arr.length;\n for (int i = 0; i < n; i++) {\n System.out.print(arr[i] + \" \");\n }\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}", "static void writearray(String[]array) {\n\t\t for (int i = 0; i < array.length; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\t}", "public static void MostrarArray(int array[]) {\n for (int i = 0; i < array.length; i++) {\n System.out.print(array[i] + \" | \");\n }\n System.out.println();\n }", "private static void printArrayTraversal() {\n for (int i = 0; i < traversalLength; i++)\n System.out.print(arrayTraversal[i] + \" \");\n }", "private void showArray(ArrayList<String[]> arr) {\n for(String[] row: arr){\n for(String x: row){\n System.out.print(x + \"\\t\\t\");\n }\n System.out.println();\n } \n System.out.println(\"------------------------------------\");\n }", "static void printArray(int arr[])\n {\n int n = arr.length;\n for (int i=0; i<n; ++i)\n System.out.print(arr[i] + \" \");\n System.out.println();\n }", "public static void printArray(int[] arr) {\n\t\t\t\t\tfor (int j = 0; j < arr.length - 1; j++) {\n\t\t\t\t\t\tSystem.out.print(arr[j] + \", \");\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(arr[arr.length - 1]);\n\t\t\t\t}", "public void printdia(int[][] array){\n\t\tint dim = array.length;\n\n\t for( int k = 0 ; k < dim * 2 ; k++ ) {\n\t for( int j = 0 ; j <= k ; j++ ) {\n\t int i = k - j;\n\t if( i < dim && j < dim ) {\n\t System.out.print( array[i][j] + \" \" );\n\t }\n\t }\n\t System.out.println();\n\t }\n\t}", "static void printArray(int arr[])\n {\n int n = arr.length;\n for (int i=0; i<n; ++i)\n System.out.print(arr[i] + \" \");\n\n System.out.println();\n }", "public static void show(int[][] arr) {\n\t\t\tfor(int i=0;i<arr.length;i++) {\n\t\t\t\tfor(int j=0;j<arr.length;j++) {\n\t\t\t\t\tSystem.out.print(arr[i][j]+\"\\t \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}", "static void printArray(int[] arr) {\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tif (i != arr.length - 1)\n\t\t\t\tSystem.out.print(arr[i] + \", \");\n\t\t\telse\n\t\t\t\tSystem.out.print(arr[i]);\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void printArray(int [] array) {\n\t\t\n\t\tfor(int i =0; i<array.length; i++) {\n\t\t\tSystem.out.print(array[i] + \" \");\n\t\t}\n\t}", "public static void printArray(int[] a) {\n for (int el : a) {\n System.out.print(el + \" \");\n }\n System.out.println();\n }", "public static void printArray(int[] array) {\n \n for (int i = 0; i < array.length; i++) {\n \n System.out.println(\"array[\" + i + \"] = \" + array[i]);\n }\n }", "private static void writeArray(int[] randomArray) {\n\t\tfor (int i = 0; i < randomArray.length; i++) {\r\n\t\t\tSystem.out.print(\" \" + i + \" . eleman :\" + randomArray[i]);\r\n\t\t}\r\n\t}", "public static void printArray(int[] grades){\n int arraylength=grades.length;//find length of input array\n for (int i=0; i<=arraylength-1;i++){\n //print out elements\n System.out.print(grades[i]+\" \");\n }\n System.out.println();//print new lnie\n }", "public static void printArray(int[] arr)\n {\n int i;\n // your code goes here\n for(i = 0;i< arr.length;i++)\n {\n\t\t System.out.println(arr[i]);\n }\n \n \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 String toString(){\n\treturn Arrays.toString(a);\n }", "public static void printArr(int[] arr){\n int i;\n System.out.print(\"Array { \");\n for(i = 0; i < n; i++){\n System.out.print(arr[i] + ((i < n - 1)? \",\":\"\") + \" \");\n }\n System.out.println(\"}\");\n }", "private static void show(Comparable[] a) {\n for (Comparable a1 : a)\n System.out.print(a1 + \" \");\n\n System.out.println();\n }", "private static void Display(Cars[] arr) {\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tSystem.out.println(arr[i]);\n\n\t\t}\n\t}", "public static void printArray(int[] array) {\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tSystem.out.print(array[i] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "static void printArray(int arr[]) \n { \n for (int i = 0; i < arr.length; i++) \n System.out.print(arr[i] + \" \"); \n }", "void printArray(Integer arr[])\n {\n int n = arr.length;\n for (int i=0; i<n; ++i)\n System.out.print(arr[i] + \" \");\n System.out.println();\n System.out.println();\n }", "void printArray(int[] arr) {\n\t\tfor (int ele : arr) {\n\t\t\tSystem.out.print(ele + \" \");\n\t\t}\n\t}", "private static void display(int[] arr) {\n\t\tif (null != arr && arr.length > 0) {\n\t\t\tfor (int n : arr) {\n\t\t\t\tSystem.out.print(n + \" \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\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 display()\n {\n System.out.println(�\\n The elements are�);\n for(int i=0; i<n; i++)\n System.out.println(� �+a[i]);\n }", "public static void printArray(double[] list) \n {\n for (int i = 0; i < list.length; i++) \n {\n System.out.print(list[i] + \" \");\n }\n int b[];\n b=new int[5];\n }", "public static void printArray(String[] array){\n int noOfElement=array.length; // Number of element is the length of this array\n for(int i=0;i<array.length;i++){ // print out the each element in array with \" \"(space) splitting\n System.out.print(array[i]+\" \");}}", "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 static void showArray(String[] a) {\n for (int row=0; row<a.length; row++) {\n Logger.print(a[row] + \" \");\n }\n Logger.print(\"\\n\");\n }", "public String toString()\n\t{\n\t\tSystem.out.print(\"Array list contains: [ \");\n\t\tfor(int i=0; i<size; i++)\n\t\t\tSystem.out.print(myArray[i]+ \", \");\n\t\treturn\" ]\";\n\t}", "public void print() \r\n\t{\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Starting print\");\r\n\t\t}\r\n\t\t\r\n\t\tfor (int index = 0; index < count; index++) \r\n\t\t{\r\n\t\t\tif (index % 5 == 0) \r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t\tif(debug)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\\nDebug - numArray[index] = \" + numArray[index]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.print(numArray[index] + \"\\t\");\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Ending print\");\r\n\t\t}\r\n\t}", "public String toString() {\n int iMax = array.length - 1;\n if (iMax == -1)\n return \"[]\";\n\n StringBuilder b = new StringBuilder();\n b.append('[');\n for (int i = 0; ; i++) {\n b.append(getRaw(byteOffset(i)));\n if (i == iMax)\n return b.append(']').toString();\n b.append(',').append(' ');\n }\n }", "void show(double[][][] arr,String name){\n \n System.out.println(name+\"Array\");\n Vector Size = new Vector(arr.length,arr[0].length,arr[0][0].length);\n \n for(int i=0;i<Size.x;i++){\n \n for(int j=0;j<Size.y;j++){\n \n for(int k=0;k<Size.z;k++){\n \n System.out.print(arr[i][j][k]+\" \");\n }\n System.out.println();\n }\n System.out.println();\n }\n\n}", "public static void printArray(String[] arr) {\n\t\tfor(int i = 0; i < arr.length; i++) {\n\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t}\n\t}", "private static void printArray(int[] integerArray) \n\t{\n\t\t\n\t\tfor (int i = 0; i < integerArray.length; i++)\n\t\t{\n\t\t\tSystem.out.println(integerArray[i]);\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"\\nContents of SimpleArray:\\n\" + Arrays.toString(array);\n\t}", "public static void display(int [] a)\n\t\t{\n\t\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\t\tSystem.out.print(a[i] + \" \");\n\t\t\t\t\n\t\t\t\t\n\t\t\t}System.out.println();\n\t}", "public static <T> void printArray(T[] array){\n for(int i=0;i<array.length;i++){\n System.out.println(array[i]);\n }\n }", "public String toString()\n\t{\n\t\t// For empty array\n\t\tif(length() < 1)\n\t\t\tSystem.out.print(\"\");\n\t\tString output = \"\";\n\n\t\tfor(int index = 0; index < length(); index++)\n\t\t{\n\t\t\toutput = output + data[index];\n\t\t\tif(index+1 < length())\n\t\t\t{\n\t\t\t\toutput = output + \" \";\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}" ]
[ "0.83761543", "0.7817703", "0.7816766", "0.7791281", "0.77802056", "0.77353376", "0.7691468", "0.7691232", "0.76466817", "0.7604845", "0.7602411", "0.7551739", "0.75349706", "0.7509735", "0.7491882", "0.74903286", "0.7466219", "0.7461517", "0.74162537", "0.74090475", "0.7402979", "0.74025565", "0.7397527", "0.7384289", "0.73701894", "0.73699975", "0.7362918", "0.73495626", "0.73206526", "0.7310108", "0.73046273", "0.730286", "0.7291643", "0.7289939", "0.72897434", "0.72822237", "0.72812706", "0.7279344", "0.72714865", "0.72605824", "0.7260421", "0.72408324", "0.72192395", "0.7216746", "0.72151285", "0.72116035", "0.7210793", "0.72078365", "0.72031164", "0.72029203", "0.72029203", "0.7202059", "0.71988994", "0.71988696", "0.7197405", "0.7188669", "0.71817243", "0.7179046", "0.7177492", "0.7176089", "0.7173783", "0.71641505", "0.7163124", "0.7160387", "0.7148822", "0.71360934", "0.71353114", "0.7132342", "0.7130172", "0.7126718", "0.71249264", "0.71236444", "0.71205074", "0.71175283", "0.7115874", "0.7102707", "0.70899075", "0.7086772", "0.7086067", "0.70859134", "0.70820254", "0.70631343", "0.70619476", "0.7060276", "0.7056325", "0.70493233", "0.7030036", "0.7010713", "0.70097244", "0.70059645", "0.7004244", "0.70034593", "0.69864213", "0.69822526", "0.69690126", "0.6959841", "0.69562733", "0.6948424", "0.69413733", "0.6940057", "0.6939071" ]
0.0
-1
Created by paride on 24/08/15. Commentable interface, needs to be implemented if a class supports a feedback
public interface Commentable { /** * set a comment for the item * @param comment string to comment */ public void setComment(String comment); /** * set comment and rating for the item * @param comment string comment * @param rating int rating */ public void setComment(String comment, int rating); /** * set a rating for the item * @param rating int rating */ public void setRating(int rating); /** * returns the comment of the item * @return string comment */ public String getComment(); /** * returns the rating of the item * @return int rating */ public int getRating(); /** * very dirty way, simplest mode to make few code and avoid problems with parcelable items * @param serializer */ public void setSerializer(Object serializer);//needed to resume without involve the whole tree of classes }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void comment() {\n\t\t\n\t}", "Feedback getFeedback();", "@Override\n\t/**\n\t * returns nothing because comments are disabled for classes\n\t * \n\t * @return nothing\n\t */\n\tpublic String getComment() {\n\t\treturn \"\";\n\t}", "@Override\n\t/**\n\t * returns false because comments are disabled for classes\n\t * \n\t * @return false \n\t */\n\tpublic boolean hasComment() {\n\t\treturn false;\n\t}", "@Override\n\t/**\n\t * returns false because comments are disabled for classes\n\t * \n\t * @return false \n\t */\n\tpublic boolean isComment() {\n\t\treturn false;\n\t}", "@Override\n public void comment(String comment)\n {\n }", "@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t * \n\t * @param c\n\t */\n\tpublic void setComment(String c) {\n\t}", "public String getComment();", "public String getComment();", "public String getComment();", "public String getComment();", "public String getComment();", "public String getComment();", "public String getSampleComment();", "@Override\n\t/**\n\t * returns nothing because comments are disabled for classes\n\t * \n\t * @return nothing \n\t */\n\tpublic String getOriginalCommentName() {\n\t\treturn \"\";\n\t}", "@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t */\n\tpublic void setItemHavingComment() {\n\t}", "public interface IAnswer extends IComment{\r\n\t\r\n\t\r\n}", "String getComment() {\n//\t\t\tm1();\n\t\t\treturn \"small\";\n\t\t}", "public interface IFeedbackView extends IView {\n void startSuccessFeedback();\n}", "@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t */\n\tpublic void removedComment() {\n\t}", "String getComment();", "String getComment();", "public interface ITestFeedback {\n\t\t/** A sets has been completed with the supplied text\n\t\t * \n\t\t * @param msg\n\t\t */\n\t\tpublic void testComplete(String msg);\n\t}", "Comment getBase_Comment();", "public interface NoteAlg extends Alg {\n\n\t\n\t/**\n\t * Noting some hinting usage.\n\t * @return some hinting usage.\n\t */\n\tString note();\n\t\n\t\n}", "public String getComment() {\n return description;\n }", "public String getComment() {\n \t\t\t\t\t\t\t\t\treturn null;\n \t\t\t\t\t\t\t\t}", "Comment createComment();", "public interface CommentGenerator {\n\n void addConfigurationProperties(Properties properties);\n\n void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn);\n\n void addFieldComment(Field field, IntrospectedTable introspectedTable);\n\n void addClassComment(JavaElement element, IntrospectedTable introspectedTable);\n\n void addDataServiceComment(JavaElement element, IntrospectedTable introspectedTable);\n\n void addClassAnnotation(JavaElement element);\n\n void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean markAsDoNotDelete);\n\n void addEnumComment(InnerEnum innerEnum, IntrospectedTable introspectedTable);\n\n void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable);\n\n void addDataServiceSaveMethodComment(Method method, IntrospectedTable introspectedTable);\n\n void addDataServiceQueryMethodComment(Method method, List<IntrospectedColumn> introspectedColumns, IntrospectedTable introspectedTable);\n\n void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn);\n\n void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn);\n\n void addJavaFileComment(CompilationUnit compilationUnit);\n\n void addComment(XmlElement xmlElement);\n\n void addRootComment(XmlElement rootElement);\n\n}", "public interface StoryCommentView extends BaseTiView{\n\n void displayComment(Comment comment);\n\n void removeDeletedComment(Comment comment);\n\n}", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getComment(){\n return this.comment;\n }", "@Override\n public void addModelClassComment(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {\n\n }", "public static interface Mutable extends DescribedObject\n { \n /** Set description\n * @param _desc description. */\n public void setDescription(String _desc);\n }", "public CompletionProvider createCommentCompletionProvider() {\n\t\tDefaultCompletionProvider cp = new DefaultCompletionProvider();\n\t\tcp.addCompletion(new BasicCompletion(cp, \"TODO:\", \"A to-do reminder\"));\n\t\tcp.addCompletion(new BasicCompletion(cp, \"FIXME:\", \"A bug that needs to be fixed\"));\n\t\treturn cp;\n\t}", "@Override\n public void addComment(XmlElement xmlElement) {\n\n }", "int getFeedback();", "@SuppressWarnings(\"unused\")\n public Comment() {\n edited = false;\n }", "public String getComment()\n {\n return comment;\n }", "public interface IMyComment {\n void getMyComment(String teacherId,int page,int pageSize,Response.Listener<MyEvaluate> listener,Response.ErrorListener errorListener);\n}", "private void addComment() {\r\n Editor classEditor = null;\r\n try {\r\n classEditor = curClass.getEditor();\r\n } catch (Exception e) {\r\n }\r\n if (classEditor == null) {\r\n System.out.println(\"Can't create Editor for \" + curClass);\r\n return;\r\n }\r\n\r\n int textLen = classEditor.getTextLength();\r\n TextLocation lastLine = classEditor.getTextLocationFromOffset(textLen);\r\n lastLine.setColumn(0);\r\n // The TextLocation now points before the first character of the last line of the current text\r\n // which we'll assume contains the closing } bracket for the class\r\n classEditor.setText(lastLine, lastLine, \"// Comment added by SimpleExtension\\n\");\r\n }", "boolean hasFeedback();", "public void comment(String data);", "public String getComment(){\n return comment;\n }", "@Override\n\tpublic String createComment_request() {\n\t\treturn null;\n\t}", "public String getComment() {\n return this.comment;\n }", "@Override\n public String getDescription() {\n return DESCRIPTION;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public interface IshowPersonalCommentActivityView extends IBaseActivityView{\n void showPersonalCommentSuccess(List<CommentEntity> commentList, boolean isHaveMore);\n void showPersonalCommentFail();\n}", "@Override\n public String toString() {\n return \"Comment{\" +\n \"game='\" + game + '\\'' +\n \"player='\" + player + '\\'' +\n \", rating=\" + rating +\n \", ratedOn=\" + ratedOn +\n '}';\n }", "public void handleComment(HtmlObjects.Comment t)\n {\n }", "public ClassCommentPlugin() {\n\n\t}", "lanyotech.cn.park.protoc.CommonProtoc.FEEDBACK4PARKING getFeedback();", "public Comment () {\n init();\n }", "public String getComment() {\n return comment ;\n }", "public interface DescribedObject \n{ \n /** Get a description for the object\n * @return a description */\n public String getDescription(); \n \n /** Subinterface for described objects which can change the description */\n public static interface Mutable extends DescribedObject\n { \n /** Set description\n * @param _desc description. */\n public void setDescription(String _desc);\n }\n}", "public String getDescription()\n/* */ {\n/* 74 */ return this.description;\n/* */ }", "public GoodsCommentExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "public ContactedUsComments() {\r\n }", "int getCommentsMode();", "@Override\n protected String getDescription() {\n return DESCRIPTION;\n }", "public Comment() {\n\n }", "@Override\n\tpublic String getDesignation() {\n\t\treturn \"NOTE \";\n\t}", "public String getComment() {\r\n\t\treturn comment;\r\n\t}", "public abstract void description();", "@Override\n\tpublic void drawFeedback(EditorInterface i, GraphicsContext gc) {\n\t\ti.getBoard().draw(gc);\n\t\ti.getSelection().drawFeedback(gc);\n\t}", "@Override\r\n public String description() {\r\n return \"<html>Create a new method in class A that delegates the call to object B. <br/>\" +\r\n \"Now the client doesn’t know about, or depend on, class B. </html>\";\r\n }", "public interface ICommentService {\n /**\n * 发布评论\n * @param comment\n * @return\n */\n public boolean addComment(Comment comment);\n\n /**\n * 根据Id查询评论\n * @param id\n * @return\n */\n public List getAllCounts(int id);\n\n /**\n * 后台查询所有评论\n * @return\n */\n public List getFindCounts();\n\n /**\n * 审核\n * @param comment\n * @return\n */\n public boolean updateComment(Comment comment);\n}", "public interface LedFeedback {\n\n\t/**\n\t * Turn the LED on/off\n\t * @param on true to turn the led on and false to turn off\n\t */\n\tvoid set(boolean on);\n\t\n}", "boolean isComment(Object object);", "public String description(){\n\t\treturn \"Mark: \" + mark + \"\\n\" + \"Comment: \" + comment;\n\t}", "@Override\r\n public boolean respond(Comment response, int id) {\n return false;\r\n }", "private DoComment(com.google.protobuf.GeneratedMessageLite.Builder builder) {\n super(builder);\n\n }", "@Override\r\n\tpublic boolean gbCommentModify(GroupBoardDto dto) {\n\t\treturn false;\r\n\t}", "public String getFeedback() {\n\t\treturn feedback;\n\t}", "public String getFeedback() {\n\t\treturn feedback;\n\t}", "public CommentsManipulationTest(String aName) {\n super(aName);\n }", "@Override\n public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean b) {\n }", "public final String getComment() {\n return comment;\n }", "@Override\r\n\tpublic String getPrintComment() {\n\t\treturn null;\r\n\t}", "public ST getComment() { \r\n\t\tST retVal = this.getTypedField(48, 0);\r\n\t\treturn retVal;\r\n }", "@Test\n public void testIllegalRating()\n {\n SalesItem salesIte1 = new SalesItem(\"Java For Complete Idiots, Vol 2\", 19900);\n assertEquals(false, salesIte1.addComment(\"Joshua Black\", \"Not worth the money. The font is too small.\", -5));\n }", "@Override\n public String getDescription() {\n return description;\n }", "@Override\n protected String getDescription() {\n return null;\n }", "@Override\n public String visit(JavadocComment n, Object arg) {\n return null;\n }", "@Override\n\tpublic void javadoc(JDefinedClass cls) {\n\n\t}", "@Override\n\tpublic String getComment() {\n\t\treturn model.getComment();\n\t}", "public interface CommentModel {\n\n List<CommentBean> loadComments(String docId, int index, int size);\n\n boolean insertComment(CommentBean commentBean);\n}", "public String getComment() {\n\t\treturn comment;\n\t}", "public String getComment() {\n\t\treturn comment;\n\t}", "@Override\n public void visit(ClassOrInterfaceDeclaration n, Object arg) {\n \tif(n.getJavaDoc()!=null){\n \t\tclassInfo.add(n.getName());\n\t \tString comment = n.getJavaDoc().getContent();\n\t \tcomment = comment.replaceAll(\"\\\\* @param (.*)\",\"\");\n\t \tcomment = comment.replaceAll(\"\\\\* @return (.*)\",\"\");\n\t \tcomment = comment.replaceAll(\"\\\\* @throws (.*)\",\"\");\n\t \tcomment = comment.replaceAll(\"\\\\* \",\"\");\n\t \tcomment = comment.replaceAll(\"(?s)\\\\*(.*)\",\"\");\n\t \tclassInfo.add(comment.trim()); \n \t}\n \t}", "public interface Notification {\n /**\n * Method to generate and draw notification message\n * @param task it's task for notification message\n */\n void notifyMessage(Task task);\n}", "public boolean supportsEntityComments() { return true; }", "public interface ActionFeedbackSuggester {\n\n\t/**\n\t * Is automatic feedback suggestion enabled\n\t *\n\t * @param action action\n\t * @return <code>true</code> Active\n\t */\n\tboolean isAutoFeedbackColors(Action action);\n\n\tvoid suggestFeedback(Action action);\n\n\tbyte suggestFeedbackChannel(FeedbackType type);\n\n\tPad getPad(Action action);\n}" ]
[ "0.6988434", "0.6944449", "0.670051", "0.6576237", "0.6569255", "0.6523992", "0.6522711", "0.6518419", "0.6518419", "0.6518419", "0.6518419", "0.6518419", "0.6518419", "0.62835294", "0.6249001", "0.62360764", "0.62169635", "0.6098049", "0.6083903", "0.607763", "0.6053334", "0.6053334", "0.6037984", "0.6032858", "0.60165405", "0.59814036", "0.5959005", "0.59455293", "0.5935688", "0.5918389", "0.59146786", "0.5880477", "0.5861022", "0.58604425", "0.58570117", "0.5841493", "0.58155507", "0.58132505", "0.5799391", "0.57899433", "0.5776643", "0.577327", "0.5772707", "0.5767735", "0.5735901", "0.57210696", "0.57090586", "0.56691545", "0.56691545", "0.56691545", "0.56691545", "0.56691545", "0.56691545", "0.56691545", "0.5667762", "0.56579936", "0.56522906", "0.5650601", "0.5649569", "0.56444985", "0.56433094", "0.5633596", "0.5622658", "0.5622651", "0.5608736", "0.56031615", "0.5602439", "0.55971706", "0.5595759", "0.5593331", "0.55923325", "0.55899537", "0.55843544", "0.558336", "0.558093", "0.55741954", "0.55740553", "0.5566434", "0.55619633", "0.5558389", "0.5549743", "0.5549743", "0.554332", "0.5542258", "0.55385417", "0.5535106", "0.5530668", "0.5524948", "0.55243033", "0.5522147", "0.55204535", "0.5518936", "0.55133516", "0.55118304", "0.55008924", "0.55008924", "0.55008703", "0.54936224", "0.5492802", "0.5491146" ]
0.57515633
44
set a comment for the item
public void setComment(String comment);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setComment(String new_comment){\n this.comment=new_comment;\n }", "public void setComment(String comment) {\n this.comment = comment;\n }", "public void setComment(String c) {\n comment = c ;\n }", "public void setComments(java.lang.String value);", "public void setComment(String comment){\n this.comment = comment;\n }", "public void setComments(String newValue);", "public void setComment(String comment)\n {\n this.comment = comment;\n }", "public void setComment(String comment) {\n this.comment = comment;\n }", "@Override\n public void comment(String comment)\n {\n }", "@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t */\n\tpublic void setItemHavingComment() {\n\t}", "public void setComment(java.lang.String comment) {\r\n this.comment = comment;\r\n }", "Builder addComment(String value);", "public void setComment(Address address, int commentType, String comment);", "public void setComment(String comment) {\n this.comment = comment;\n }", "public void setComment(String comment) {\n this.comment = comment;\n }", "public final void setComment(final String comment) {\n this.comment = comment;\n }", "Builder addComment(Comment value);", "public void setComment(String comment, int rating);", "public void comment(String data);", "public void setComment(java.lang.String comment) {\n this.comment = comment;\n }", "public void setComment(java.lang.String comment) {\n this.comment = comment;\n }", "public void setComment(java.lang.String comment) {\n this.comment = comment;\n }", "public Builder setComment(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000020;\n comment_ = value;\n onChanged();\n return this;\n }", "@PropertySetter(role = COMMENT)\n\t<E extends CtElement> E addComment(CtComment comment);", "void setCheckinComment(String comment);", "public void setComments(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), COMMENTS, value);\r\n\t}", "public void setComments( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), COMMENTS, value);\r\n\t}", "public void setComment(String comment) {\n\t\tthis.comment = comment;\n\t}", "public void setComment(String comment) {\n\t\tthis.comment = comment;\n\t}", "public void setComment(String p_comment) throws RuntimeException\n {\n setTitle(p_comment);\n }", "@Override\n\tpublic void setComment(String comment) {\n\t\tmodel.setComment(comment);\n\t}", "public void setComment(final String newComment) {\n this.comment = newComment;\n }", "public void set_comment(String comment) throws Exception{\n\t\tthis.comment = comment;\n\t}", "public void setComment(String comment) throws IllegalArgumentException,\n SipParseException {\n\tLogWriter.logMessage(LogWriter.TRACE_DEBUG,\"setComment() \" + comment );\n Via via=(Via)sipHeader;\n \n if (comment==null) \n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: null comment\" );\n else if (comment.length() == 0) \n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: 0 length comment\" );\n else via.setComment(comment);\n }", "@Test\n public void testSetComments_1()\n throws Exception {\n Project fixture = new Project();\n fixture.setWorkloadNames(\"\");\n fixture.setName(\"\");\n fixture.setScriptDriver(ScriptDriver.SilkPerformer);\n fixture.setWorkloads(new LinkedList());\n fixture.setComments(\"\");\n fixture.setProductName(\"\");\n String comments = \"\";\n\n fixture.setComments(comments);\n\n }", "public static void setComments(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.set(model, instanceResource, COMMENTS, value);\r\n\t}", "public void setComment(String path, String comment) {\n if (comment == null)\n configComments.remove(path);\n else\n configComments.put(path, comment);\n }", "@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t * \n\t * @param c\n\t */\n\tpublic void setComment(String c) {\n\t}", "public void setCommentId(int commentId);", "public DataModelDescriptorBuilder comment(String string) {\n this.comment = string;\n return this;\n }", "public static void setComments( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, COMMENTS, value);\r\n\t}", "public final void editComment() {\n EditDialog newInstance = EditDialog.newInstance(this.mAlbumItem);\n newInstance.setViewModel(this.viewModel);\n newInstance.show(this.mFragmentManager, (String) null);\n }", "void setComments(org.hl7.fhir.String comments);", "@Override\n\tpublic void comment() {\n\t\t\n\t}", "private void enterComment(String comment) {\n delegationDefaultCreationScreen.commentField.sendKeys(comment);\n }", "public void setComment(String comment) {\r\n\t\tthis.comment = comment == null ? null : comment.trim();\r\n\t}", "public void setComment(String comment) {\n this.comment = comment == null ? null : comment.trim();\n }", "public void setComment(String comment) {\n this.comment = comment == null ? null : comment.trim();\n }", "public void setComment(String comment) {\n this.comment = comment == null ? null : comment.trim();\n }", "public void setComment(String comment) {\n this.comment = comment == null ? null : comment.trim();\n }", "public void addComments(java.lang.String value) {\r\n\t\tBase.add(this.model, this.getResource(), COMMENTS, value);\r\n\t}", "@Override\n @IcalProperty(pindex = PropertyInfoIndex.COMMENT,\n adderName = \"comment\",\n analyzed = true,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true,\n freeBusyProperty = true,\n timezoneProperty = true)\n public void setComments(final Set<BwString> val) {\n comments = val;\n }", "public Builder setComments(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n comments_ = value;\n onChanged();\n return this;\n }", "public String getComment() {\r\n\t\treturn comment;\r\n\t}", "public void setComments(String value) {\n setAttributeInternal(COMMENTS, value);\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "void addComment(long mediaId, String text);", "public String getComment() {\n return this.comment;\n }", "public String getComment(){\n return this.comment;\n }", "public String getComment() {\n return comment ;\n }", "public void setComments(String comment) {\n\t\tthis.comments = comment;\n\t}", "public String getComment()\n {\n return comment;\n }", "private void applyComment()\n {\n Map<String, GWikiArtefakt<?>> map = new HashMap<String, GWikiArtefakt<?>>();\n page.collectParts(map);\n GWikiArtefakt<?> artefakt = map.get(\"ChangeComment\");\n if (artefakt instanceof GWikiChangeCommentArtefakt == false) {\n return;\n }\n\n GWikiChangeCommentArtefakt commentArtefakt = (GWikiChangeCommentArtefakt) artefakt;\n String oldText = commentArtefakt.getStorageData();\n String ntext;\n String uname = wikiContext.getWikiWeb().getAuthorization().getCurrentUserName(wikiContext);\n int prevVersion = page.getElementInfo().getProps().getIntValue(GWikiPropKeys.VERSION, 0);\n if (StringUtils.isNotBlank(comment) == true) {\n Date now = new Date();\n ntext = \"{changecomment:modifiedBy=\"\n + uname\n + \"|modifiedAt=\"\n + GWikiProps.date2string(now)\n + \"|version=\"\n + (prevVersion + 1)\n + \"}\\n\"\n + comment\n + \"\\n{changecomment}\\n\"\n + StringUtils.defaultString(oldText);\n } else {\n ntext = oldText;\n }\n ntext = StringUtils.trimToNull(ntext);\n commentArtefakt.setStorageData(ntext);\n }", "public void addComments( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), COMMENTS, value);\r\n\t}", "public void setComments(String comments) {\n _comments = comments;\n }", "public String getComment(){\n return comment;\n }", "org.hl7.fhir.String addNewComments();", "public static void comment(String comment) {\n openComment();\n Log.write(comment);\n closeComment();\n Log.writeln();\n }", "public void addComment(String c) {\n comments.add(c);\n }", "public void modifyComment(String text){\n if (activeEmployee.hasLicence(202)){\n DB.modifyComment(getData().id_comment, getData().id_task, text);\n update();\n } //consideramos que solo se puede modificar el texto no las id\n }", "public void setcheckoutComment(String text){\r\n\t\tString comment = getValue(text);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Checkout Comment should be entered as \"+comment);\r\n\t\ttry{\r\n\r\n\t\t\tsendKeys(locator_split(\"txtComment\"),comment);\r\n\t\t\tSystem.out.println(\"Checkout Comment is entered as \"+comment);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Checkout Comment is entered as \"+comment);\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Checkout Comment is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtComment\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "@Override\r\n\tpublic void setWholeComment(String currentComment) {\n\t\t\r\n\t}", "private void updateLiveComment(String comment) {\n MainActivity mainActivity = (MainActivity) this.getContext();\n mainActivity.setLiveComment(comment);\n }", "public String getComment() {\n\t\treturn comment;\n\t}", "public String getComment() {\n\t\treturn comment;\n\t}", "public boolean addNewCommentToWallItem(WallItemComment wallItemComment);", "void update(Comment comment);", "private void setFileComment(String fileComment){\n put(SlackParamsConstants.FILE_COMMENT, fileComment);\n }", "public void setCommentText(String commentText) {\n\t this.commentText = commentText;\n\t}", "public void setEquipcomment( java.lang.String newValue ) {\n __setCache(\"equipcomment\", newValue);\n }", "public void setComments(String comments) {\r\n this.comments = comments;\r\n }", "void createSingleFileComment(ChangedFile file, Integer line, String comment);", "public void addCommentField(String comment) {\n addCommentField(comment, false);\n }", "public void setComments (java.lang.String comments) {\r\n\t\tthis.comments = comments;\r\n\t}", "public String getComment() {\n return description;\n }", "public void setHopscomment( java.lang.String newValue ) {\n __setCache(\"hopscomment\", newValue);\n }", "public void addToCommentsList(Object newValue);", "public void addToCommentsList(Object newValue);", "public final String getComment() {\n return comment;\n }", "public void setComments(String comments) {\n this.comments = comments;\n }", "public String getComment();", "public String getComment();", "public String getComment();" ]
[ "0.73425925", "0.72609234", "0.7205977", "0.7186698", "0.7146257", "0.7127913", "0.7066143", "0.70034593", "0.69466186", "0.69428694", "0.6940052", "0.6924813", "0.69197786", "0.6910918", "0.6910918", "0.69037366", "0.6885423", "0.6882284", "0.6875417", "0.6844539", "0.6844539", "0.6844539", "0.68402314", "0.68380404", "0.6789168", "0.67600775", "0.67123926", "0.6704691", "0.6704691", "0.6657022", "0.6643457", "0.6601448", "0.65773326", "0.6563177", "0.6551255", "0.65466607", "0.6546527", "0.65284324", "0.6500176", "0.64488995", "0.6445221", "0.6434117", "0.64333063", "0.6431841", "0.6423381", "0.640562", "0.6359687", "0.6359687", "0.6359687", "0.6359687", "0.6359328", "0.635725", "0.63197356", "0.6315623", "0.6300646", "0.629879", "0.629879", "0.629879", "0.629879", "0.629879", "0.629879", "0.629879", "0.62910515", "0.6272444", "0.6267123", "0.6266517", "0.6266049", "0.6248063", "0.6241981", "0.6241243", "0.6237134", "0.6233072", "0.6230916", "0.623076", "0.6221951", "0.62192154", "0.621596", "0.6208337", "0.6205593", "0.6204724", "0.6204724", "0.6198088", "0.6195942", "0.6185689", "0.6168117", "0.6165313", "0.6139668", "0.6089143", "0.6080117", "0.60732156", "0.6072941", "0.6069994", "0.6065764", "0.6065764", "0.60630465", "0.60529846", "0.6048017", "0.6048017", "0.6048017" ]
0.78036475
1
set comment and rating for the item
public void setComment(String comment, int rating);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRating(int rating);", "public void setRating(int rating)\n {\n this.rating = rating;\n }", "public void setRating(int rating) {\r\n this.rating = rating;\r\n }", "public void setRating(int rating) {\n this.rating = rating;\n }", "public void ratePoItem(int pid, String bid, int rating, String review) throws Exception {\n String query = \"UPDATE POItem SET rating = ?, review = ? WHERE id = ? AND bid = ?\";\n try (Connection con = this.ds.getConnection();\n PreparedStatement p = con.prepareStatement(query)) {\n p.setInt(1, rating);\n p.setString(2, review);\n p.setInt(3, pid);\n p.setString(4, bid);\n p.executeUpdate();\n }\n }", "public void setRating(Integer rating) {\r\n this.rating = rating;\r\n }", "public void setRating(double rating){\n\t\tthis.rating = rating;\n\t}", "public void setRating(int rating) {\n\t\tthis.rating = rating;\n\t}", "public void setRating(Integer value)\n\t{\n\t}", "public void setRating(double rating) {\n\t\tthis.rating = rating;\n\t}", "void editRating(String rid, Rating2 rating2);", "public void setRating(float rating) {\n this.rating = rating;\n }", "public void setRating(double rating) throws RatingWasAlreadySetExecption {\n if (!isRated) {\n this.rating = rating;\n this.isRated = true;\n } else {\n throw new RatingWasAlreadySetExecption(\"Rating was set on an already rated tweet!\", this, rating);\n }\n\n }", "public static void setRating(Context context, int id, int rating){\n\n MovieSqlHelper movieDB = new MovieSqlHelper(context);\n ContentValues values=new ContentValues();\n values.put(DBConstants.RATING_C, rating);\n movieDB.getWritableDatabase().update(DBConstants.MOVIES_T,values,DBConstants.ID_C+\"=?\",new String[]{\"\"+id});\n movieDB.close();\n\n }", "Builder addContentRating(Text value);", "public void setRating(int rating) {\n this.rating = rating;\n if (this.rating < 0) {\n this.rating = 0;\n }\n }", "public void setRating(java.lang.String rating) {\n this.rating = rating;\n }", "Builder addContentRating(String value);", "public void setMyRating(double myRating) {\n this.myRating = myRating;\n }", "public void updateFeedback(UserProfile up, String itemCode, String rating) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n\n String query = \"UPDATE userItems \"\n + \"SET rating = ? \"\n + \"WHERE itemCode = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, rating);\n ps.setString(2, itemCode);\n ps.executeUpdate();\n } catch (SQLException se) {\n System.out.println(\"ERROR: Could not execute SQL statement in: \" + \"Item.changeRating()\");\n System.out.println(\"ERROR: Could not execute SQL statement: \" + se);\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n up.updateRating(itemCode, rating);\n\n }", "public static void setRatings (double irating){\n\t\t\t//ratings = irating;\n\t\t\tr = irating;\n\t}", "public void setItem(String itemDescription, int weight)\n {\n currentItem = new Item(itemDescription, weight); \n }", "@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t */\n\tpublic void setItemHavingComment() {\n\t}", "public void setRating(int rating) {\n if (rating > starCount) {\n rating = starCount;\n }\n int lastRating = this.rating;\n this.rating = rating;\n for (int i = 0; i < getChildCount(); i++) {\n ImageView iv = (ImageView) getChildAt(i);\n if (i < rating) {\n iv.setImageResource(checkedStarDrawable);\n } else {\n iv.setImageResource(normalStarDrawable);\n }\n }\n if (listener != null && lastRating != rating) {\n listener.onRatingChanged(rating, starCount);\n }\n }", "public void setRating(Rating rating) {\n double boundedRating = this.boundedRating(rating);\n this.normalisedRating = this.normaliseRating(boundedRating);\n this.ratingCount++;\n }", "public void setComment(String comment);", "public void setComment(String comment);", "public void setUserRating(String userRating) {\n this.userRating = userRating;\n }", "public void addComment(View v) {\n //Get review views\n SimpleRatingBar rating = (SimpleRatingBar) mLeaveReview.findViewById(R.id.comment_h_rating);\n EditText title = (EditText) mLeaveReview.findViewById(R.id.comment_h_title);\n EditText comment = (EditText) mLeaveReview.findViewById(R.id.comment_h_body);\n\n\n //Set params\n SharedPreferences sharedPref = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);\n VALUE_GID = currentBook.GID;\n VALUE_UID = sharedPref.getInt(\"UID\", -1);\n VALUE_PASSWORD = sharedPref.getString(\"PASSWORD\", null);\n VALUE_RATING = ((int) rating.getRating());\n VALUE_TITLE = title.getText().toString();\n VALUE_COMMENT = comment.getText().toString();\n\n //Verify info\n if (VALUE_GID == null || VALUE_UID == -1) {\n ErrorUtils.errorDialog(this, \"Error\", \"Information could not be retrieved from memory. Try logging out and logging back in.\");\n return;\n } else if (VALUE_PASSWORD == null) {\n Toast.makeText(this, \"No saved password was found. Please log out then log back in.\", Toast.LENGTH_LONG).show();\n } else if (VALUE_RATING <= 0 || VALUE_RATING > 5) {\n Toast.makeText(this, \"Please select a rating\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n\n //Build URI\n Uri.Builder builder = new Uri.Builder();\n builder.scheme(SCHEME)\n .authority(BASE_URL)\n .appendPath(PATH0)\n .appendPath(PATH1)\n .appendPath(PATH2)\n .appendQueryParameter(PARAM_ACTION, VALUE_ACTION_ADD_REVIEW)\n .appendQueryParameter(PARAM_GID, VALUE_GID)\n .appendQueryParameter(PARAM_UID, Integer.toString(VALUE_UID))\n .appendQueryParameter(PARAM_PASSWORD, VALUE_PASSWORD)\n .appendQueryParameter(PARAM_RATING, Integer.toString(VALUE_RATING));\n\n if (!(VALUE_TITLE.trim().length() == 0)) {\n builder.appendQueryParameter(PARAM_TITLE, VALUE_TITLE);\n }\n\n if (!(VALUE_COMMENT.trim().length() == 0)) {\n builder.appendQueryParameter(PARAM_COMMENT, VALUE_COMMENT);\n }\n\n builder.build();\n String urlString = builder.toString();\n\n downloadJSON(urlString);\n }", "public void modify(short stars, int reviewId, String text, String username, int filmId)\r\n\t{\r\n this.stars = stars;\r\n this.reviewId = reviewId;\r\n this.text = text;\r\n this.username = username;\r\n this.filmId = filmId;\r\n\t}", "public void setRatingID(int ratingID) {\n this.ratingID = ratingID;\n }", "public RatingAndReview(double rating, String review){\t\t\n this.rating = rating;\n this.review = review;\n\t}", "public void handleRating() {\r\n Users rater = ui.getUser();\r\n newRating = ratingEJB.findByUserAndRecipe(rater, recipe);\r\n boolean edit = false; // determine whether we need to edit\r\n\r\n // No rating for this user exists\r\n if (newRating == null && rating > 0 && rating <= 5) {\r\n newRating = new RecipeRating();\r\n newRating.setRater(rater);\r\n newRating.setRecipe(recipe);\r\n newRating.setRatingDate(new Date().getTime());\r\n } // A rating exists\r\n else {\r\n edit = true;\r\n }\r\n\r\n switch (rating) {\r\n case 1:\r\n this.newRating.setRatingValue(RatingValue.ONE_STAR);\r\n break;\r\n case 2:\r\n this.newRating.setRatingValue(RatingValue.TWO_STARS);\r\n break;\r\n case 3:\r\n this.newRating.setRatingValue(RatingValue.THREE_STARS);\r\n break;\r\n case 4:\r\n this.newRating.setRatingValue(RatingValue.FOUR_STARS);\r\n break;\r\n case 5:\r\n this.newRating.setRatingValue(RatingValue.FIVE_STARS);\r\n break;\r\n }// end switch\r\n\r\n if (edit) {\r\n this.newRating = ratingEJB.editRecipeRating(newRating);\r\n } else {\r\n this.newRating = ratingEJB.createRecipeRating(newRating);\r\n }\r\n }", "void updateRating(String name, String park, double rating);", "public void setRatingText(String ratingText) {\n this.ratingText = ratingText;\n }", "@Override\n public void onStarCheck(ToDoItem item) {\n dbHelper.setStarred(item, true);\n }", "public void setComments(String newValue);", "public void setHotOrNotRating(int rating) {\r\n this.rating += rating;\r\n ratingCount++;\r\n }", "private void addReview(){\n db = DatabaseHelper.getInstance(this).getWritableDatabase();\n btn = findViewById(R.id.rvBtn);\n btn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n editText = findViewById(R.id.rvEditText);\n ratingBar = findViewById(R.id.rvRatingBar);\n\n String comment = editText.getText().toString();\n double rating = ratingBar.getRating();\n\n if(rating == 0){\n Toast.makeText(BookReviewActivity.this, \"Please add your rating\", Toast.LENGTH_SHORT).show();\n } else if(comment.equals(\"\")){\n Toast.makeText(BookReviewActivity.this, \"Please add your comment\", Toast.LENGTH_SHORT).show();\n } else {\n db.execSQL(\"INSERT INTO REVIEW (Comment, Rate, BookID) VALUES ('\"+comment+\"','\"+rating+\"','\"+bookIDSelected+\"');\");\n Toast.makeText(BookReviewActivity.this, comment+\", \"+rating, Toast.LENGTH_SHORT).show();\n }\n\n loadReviews();\n\n }\n });\n }", "@Test\n public void testIllegalRating()\n {\n SalesItem salesIte1 = new SalesItem(\"Java For Complete Idiots, Vol 2\", 19900);\n assertEquals(false, salesIte1.addComment(\"Joshua Black\", \"Not worth the money. The font is too small.\", -5));\n }", "public void setRating(float r) {\n\t\trating = r;\n\t}", "public void setReview(double review) {\r\n this.review = review;\r\n }", "private void editRating() throws MovieDAOException {\n String title = displayNameAndGetTitle();\n\n // get rating\n String newRating = view.getNewRating();\n\n // edit rating\n DVD updatedDVD = service.editRating(title, newRating);\n \n view.displayInfo(updatedDVD);\n }", "public void setComments(java.lang.String value);", "public void setData(Post item) {\n a.setText(points + \" points\");\n this.dataItem = item;\n title.setText(item.getTitle());\n desc.setText(item.getDesc());\n upvoted.setEnabled(!item.isUpvoted());\n downvoted.setEnabled(!item.isDownvoted());\n // Picasso.with(itemView.getContext()).load(item.getImg()).into(img);\n // Picasso.with(itemView.getContext()).load(item.getImg()).into(img);\n\n\n\n }", "public Builder setRating(double value) {\n \n rating_ = value;\n onChanged();\n return this;\n }", "public void setEditedItem(Object item) {editedItem = item;}", "private void populateItem(HashMap<String, String> comment) {\r\n\r\n\t\tString userId = comment.get(\"userId\");\r\n\t\tString name = comment.get(\"userName\");\r\n\t\tString message = comment.get(\"message\");\r\n\t\tString dateTime = comment.get(\"dateTime\");\r\n\t\t\r\n\t\tballoonbody.setText(message);\r\n\r\n\t\ttry {\r\n\r\n\t\t\tmCalendar.setTime(mDateFormat.parse(dateTime));\r\n\r\n\t\t\tint year = mCalendar.get(Calendar.YEAR);\r\n\t\t\tint day = mCalendar.get(Calendar.DAY_OF_MONTH);\r\n\t\t\tint hour = mCalendar.get(Calendar.HOUR_OF_DAY);\r\n\t\t\tint minute = mCalendar.get(Calendar.MINUTE);\r\n\r\n\t\t\tString month = String.format(\"%tb\", mCalendar);\r\n\r\n\t\t\ttime.setText(new StringBuilder().append(pad(day))\r\n\t\t\t\t\t.append(\" \").append(month).append(\" \").append(pad(year))\r\n\t\t\t\t\t.append(\" \").append(pad(hour)).append(\":\").append(minute));\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t// try {\r\n\t\t// String image = mImages.get(userId);\r\n\t\t// byte[] temp = Base64.decode(image);\r\n\t\t// Bitmap bmpImage = BitmapFactory.decodeByteArray(temp, 0,\r\n\t\t// temp.length);\r\n\t\t// holder.image.setImageBitmap(bmpImage);\r\n\t\t// } catch (Exception e) {\r\n\t\t// // TODO: handle exception\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\r\n\t}", "public void addNote(String text, int rating) {\n\t\tString data = String.valueOf(rating) + \"\\r\\n\" + text;\n\t\tnew WebTraceTask(this, data).execute(WebTraceTask.ADD_NOTE);\n\t}", "@Test\n public void testSetRating() {\n final double delta = 0.0;\n final double expectedRating1 = 70.0;\n final double expectedRating2 = 65.0;\n final double expectedRating3 = 85.5;\n movie1.setRating(expectedRating1);\n movie2.setRating(expectedRating2);\n movie3.setRating(expectedRating1);\n movie4.setRating(expectedRating3);\n movie1.setRating(expectedRating2);\n assertEquals(expectedRating2, movie1.getRating(), delta);\n assertEquals(expectedRating2, movie2.getRating(), delta);\n assertEquals(expectedRating1, movie3.getRating(), delta);\n assertEquals(expectedRating3, movie4.getRating(), delta);\n }", "public static void setComments( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, COMMENTS, value);\r\n\t}", "public void setItem(Item item) {\n this.item = item;\n }", "public void setComment(String new_comment){\n this.comment=new_comment;\n }", "public void setItem (Item item)\n\t{\n\t\tthis.item = item;\n\t}", "public void setComment(String comment) {\n this.comment = comment;\n }", "public Rating(int movieID, String email, float rating){\n this.movieID = movieID;\n this.rating = rating;\n this.email = email;\n }", "public void actualizarMovie(long id, int rating, String comment, boolean view) {\n ContentValues values = new ContentValues();\n\n //Seteando body y author\n values.put(ColumnMovie.USER_RATING, rating);\n values.put(ColumnMovie.COMMENT, comment);\n values.put(ColumnMovie.VIEWED, view);\n\n //Clausula WHERE\n String selection = ColumnMovie.ID + \" = ?\";\n String[] selectionArgs = {Long.toString(id)};\n\n //Actualizando\n database.update(MOVIE_TABLE_NAME, values, selection, selectionArgs);\n }", "protected void setBalloonData(Item item, ViewGroup parent) {\n if (item.getTitle() != null) {\n title.setVisibility(VISIBLE);\n title.setText(item.getTitle());\n } else {\n title.setText(\"\");\n title.setVisibility(GONE);\n }\n if (item.getSnippet() != null) {\n snippet.setVisibility(VISIBLE);\n snippet.setText(item.getSnippet());\n } else {\n snippet.setText(\"\");\n snippet.setVisibility(GONE);\n }\n Bitmap bmp = FGActivity.getPictureThumb(\n Enum.valueOf(MARKER_TYPE.class, item.getUid()), item.getID());\n image.setImageBitmap(bmp);\n if (bmp == null) {\n image.setVisibility(GONE);\n } else {\n image.setVisibility(VISIBLE);\n }\n }", "public interface Commentable {\n /**\n * set a comment for the item\n * @param comment string to comment\n */\n public void setComment(String comment);\n\n /**\n * set comment and rating for the item\n * @param comment string comment\n * @param rating int rating\n */\n public void setComment(String comment, int rating);\n\n /**\n * set a rating for the item\n * @param rating int rating\n */\n public void setRating(int rating);\n\n /**\n * returns the comment of the item\n * @return string comment\n */\n public String getComment();\n\n /**\n * returns the rating of the item\n * @return int rating\n */\n public int getRating();\n\n /**\n * very dirty way, simplest mode to make few code and avoid problems with parcelable items\n * @param serializer\n */\n public void setSerializer(Object serializer);//needed to resume without involve the whole tree of classes\n\n}", "@Override\n\tprotected void discussionItemCreated(final String interHash, final Review review, final DBSession session) {\n\t\tfinal ReviewParam param = this.createReviewParam(interHash, review.getUser().getName());\n\t\tparam.setDiscussionItem(review);\n\t\tif (!review.getUser().isSpammer()) {\n\t\t\tinsert(\"updateReviewRatingsCacheInsert\", param, session);\n\t\t}\n\t}", "void addRating(Rating2 rating2);", "public void setRatings(Rating[] ratings) {\n this.ratings = ratings;\n }", "void update(Comment comment);", "public void setComments( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), COMMENTS, value);\r\n\t}", "public void rateDoctor(Doctor doctor, String rating)\n {\n ArrayList<String> temp = doctor.getDoctorRating();\n temp.add(rating);\n doctor.setDoctorRating(temp);\n }", "public void setRatingDate(Date ratingDate) {\n this.ratingDate = ratingDate;\n }", "@SuppressWarnings(\"unchecked\")\r\n public static synchronized void updateVoteItem(Item item, Vote vot) {\r\n\r\n// item.getItemProperty(\"id\").setValue(vot.getId()); //it is read only.\r\n item.getItemProperty(\"vote_date\").setValue(vot.getVote_date());\r\n item.getItemProperty(\"subject_id\").setValue(vot.getSubject_id());\r\n item.getItemProperty(\"internal_nr\").setValue(vot.getInternal_nr());\r\n item.getItemProperty(\"result_vote\").setValue(vot.getResult_vote().ordinal());\r\n// item.getItemProperty(\"for_vote\").setValue(vot.getFor_vote());\r\n// item.getItemProperty(\"against_vote\").setValue(vot.getAgainst_vote());\r\n// item.getItemProperty(\"refrain_vote\").setValue(vot.getRefrain_vote());\r\n// item.getItemProperty(\"absent\").setValue(vot.getAbsent());\r\n item.getItemProperty(\"visible\").setValue(vot.getVisible());\r\n }", "private RatingModel(int rating, BeerModel beerModel, UserModel userModel) {\n \t\tthis.domainObject = new Rating(new Date(System.currentTimeMillis()), beerModel.getDomainObject(), userModel.getDomainObject(), rating);\n \t\tthis.node = DBUtil.createNode(NodeType.RATING);\n \t\tDBUtil.createRelationship(this.node, RelType.CONTAINS, beerModel.getNode());\n \t\tDBUtil.createRelationship(userModel.getNode(), RelType.DOES, this.node);\n \t\tthis.setRating(rating);\n \t\tthis.setDate(this.domainObject.getDate());\n \t}", "public void setComment(String comment){\n this.comment = comment;\n }", "public int getRating()\n {\n return this.rating;\n }", "public void rateAndReview(String sEmail, String tEmail, String reviewBody, int rating,boolean flag) {\n\t\t\n\t\tRateAndReview r = new RateAndReview();\n\t\tr.setTutor(tEmail);\n\t\tr.setStudent(sEmail);\n\t\tr.setRating(rating);\n\t\tr.setReviewbody(reviewBody);\n\t\tr.setisPos(flag);\n\t\tr.setReview();\n\t\t\n\t}", "public void setReview(final Review review);", "public static void setComments(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.set(model, instanceResource, COMMENTS, value);\r\n\t}", "void setReviewStats()\n {\n if (hasInfo)\n {\n curReviewPageNum = 1;\n WalmartRequestHelper walmartRequestHelper = new WalmartRequestHelper(itemID, curReviewPageNum);\n\n curReviewURL = walmartRequestHelper.getRequestURL();\n\n Integer numStars[] = new Integer[5];\n\n for (int i = 0; i < 5; i++)\n {\n numStars[i] = 0;\n }\n\n try\n {\n Document reviewResultPage = Jsoup.connect(curReviewURL).userAgent(\"Mozilla\")\n .ignoreHttpErrors(true).ignoreContentType(true).get();\n\n // Handles the rare case where the API gives an error.\n if (reviewResultPage.getElementsByTag(\"title\").text().equals(\"Error\"))\n {\n return;\n }\n\n Elements unparsedRatings = reviewResultPage.getElementsByTag(\"ratingCounts\");\n\n // Review statistics are only generated if ratings can be found.\n if (unparsedRatings.size() != 0)\n {\n for (int i = 0; i < unparsedRatings.size(); i++)\n {\n String unparsedRatingCount = unparsedRatings.get(i).getElementsByTag(\"count\").text();\n\n if (!unparsedRatingCount.equals(\"\"))\n {\n numStars[i] = Integer.parseInt(unparsedRatings.get(i).text());\n }\n else\n {\n // No ratings could be found\n numStars[i] = 0;\n }\n }\n\n reviewStats = new ReviewStats(numStars);\n }\n else\n {\n reviewStats = new ReviewStats(numStars);\n }\n }\n catch (IOException ioe)\n {\n ioe.printStackTrace();\n }\n }\n }", "@Override\r\n\t\t\t\t\tpublic void onRatingChanged(RatingBar ratingBar,\r\n\t\t\t\t\t\t\tfloat rating, boolean fromUser) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(rating==1.0f){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttxtRatingtType.setText(\"POOR\");\r\n\t\t\t\t\t\t}else if(rating==2.0f){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttxtRatingtType.setText(\"FAIR\");\r\n\t\t\t\t\t\t}else if(rating==3.0f){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttxtRatingtType.setText(\"OK\");\r\n\t\t\t\t\t\t}else if(rating==4.0f){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttxtRatingtType.setText(\"GOOD\");\r\n\t\t\t\t\t\t}else if(rating==5.0f){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttxtRatingtType.setText(\"GREAT\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tedtComments.setEnabled(true);\r\n\t\t\t\t\t\tbtnSubmit.setEnabled(true);\r\n\r\n\t\t\t\t\t}", "public Item(){\n description = \"No description avaible for this item\";\n weight = 0;\n }", "Builder addComment(Comment value);", "public void setItem(T item) {\n this.item = 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}", "@Override\n\tpublic void setComment(String comment) {\n\t\tmodel.setComment(comment);\n\t}", "public void setComment(String comment)\n {\n this.comment = comment;\n }", "void setComments(org.hl7.fhir.String comments);", "public int get () { return rating; }", "@Override\n protected void populateViewHolder(MovieViewHolder movieViewHolder, Movie movie, int i) {\n\n movieViewHolder.vTitle.setText((String) movie.getName());\n movieViewHolder.vDescription.setText((String) movie.getDescription());\n Float rates = movie.getRating();\n movieViewHolder.vRatingbar.setRating(rates.floatValue() / 2);\n movieViewHolder.vRatingText.setText(\"(\" + rates.toString() + \")\");\n ImageLoader imageLoader = ImageLoader.getInstance();\n imageLoader.displayImage(movie.getUrl(),movieViewHolder.vIcon);\n }", "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 reviewAdapter(ArrayList<Review> reviews, LinearLayout parent, int lowerDataBound, int upperDataBound, boolean add){\n if(add) {\n //Loop through items and inflate them\n for (int i = lowerDataBound; i <= upperDataBound; i++) {\n //Try to remove old view\n try{\n parent.removeViewAt(i);\n }catch(Exception e){\n //If no old view exists, exception will be caught and program continues\n e.printStackTrace();\n }\n View view = getLayoutInflater().inflate(R.layout.review, parent, false);\n Review currentReview = reviews.get(i);\n\n final TextView title = (TextView) view.findViewById(R.id.comment_title);\n final TextView body = (TextView) view.findViewById(R.id.comment_body);\n final TextView more = (TextView) view.findViewById(R.id.comment_more);\n final TextView name = (TextView) view.findViewById(R.id.comment_name);\n final TextView time = (TextView) view.findViewById(R.id.comment_time);\n final SimpleRatingBar sRatingBar = (SimpleRatingBar) view.findViewById(R.id.comment_rating);\n\n //Set values\n title.setText(currentReview.title);\n body.setText(currentReview.comment);\n name.setText(currentReview.name);\n time.setText(currentReview.formatTimestamp(currentReview.timestamp));\n sRatingBar.setRating(currentReview.rating);\n\n int offset = (int)(getResources().getDimension(R.dimen.comment_profile_diameter) + getResources().getDimension(R.dimen.margin));\n title.setPadding(offset, 0, 0, 0);\n\n //If there is no title, set title to amount of stars\n if(title.getText() == null || title.getText() == \"\" || title.getText() == \"null\" || title.getText() == \" \"){\n String titleString = (int)currentReview.rating + \" stars\";\n title.setText(titleString);\n }\n\n\n\n //If they did not leave a comment, remove comment\n if(body.getText() == null || body.getText() == \"\" || body.getText() == \"null\")\n body.setVisibility(GONE);\n\n more.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if(body.getLineCount() < 4){\n body.setMaxLines(Integer.MAX_VALUE);\n more.setText(R.string.minimize);\n }else{\n body.setMaxLines(3);\n more.setText(R.string.read_more);\n }\n }\n });\n\n //Check if more button needed\n body.post(new Runnable() {\n @Override\n public void run() {\n //If there are less lines than the line limit, then hide the more button.\n if(body.getLineCount() < 4) {\n more.setVisibility(GONE);\n }\n body.setMaxLines(3);\n }\n });\n\n //Set typefaces\n title.setTypeface(handWriting);\n body.setTypeface(handWriting);\n more.setTypeface(handWriting);\n name.setTypeface(handWriting);\n time.setTypeface(handWriting);\n\n parent.addView(view, i);\n }\n }\n }", "public void set(Applicant applicant) {\n\t\tArrayList<Integer> ratings = applicant.getReferenceRatings();\n\t\tif (ratings.size() == 0) {\n\t\t} else {\n\t\t\tif (ratings.size() == 1) {\n\t\t\t\tref1Rating.setText(ratings.get(0).toString());\n\t\t\t}\n\t\t\tif (ratings.size() == 2) {\n\t\t\t\tref1Rating.setText(ratings.get(0).toString());\n\t\t\t\tref2Rating.setText(ratings.get(1).toString());\n\t\t\t} \n\t\t\tif (ratings.size() >= 3) {\n\t\t\t\tref1Rating.setText(ratings.get(0).toString());\n\t\t\t\tref2Rating.setText(ratings.get(1).toString());\n\t\t\t\tref3Rating.setText(ratings.get(2).toString());\n\t\t\t}\n\t\t}\n\t\tif (applicant.getReviewerRating() != null) {\n\t\t\trevRating.setText(applicant.getReviewerRating().toString());\n\t\t}\n\t\tif (applicant.getReviewerComment() != null && !applicant.getReviewerComment().equals(\"\")) {\n\t\t\trevComment.setText(applicant.getReviewerComment());\n\t\t}\n\t}", "public double getRating() {\n return rating_;\n }", "public void insertItemDetails(String itemName, Integer quantityOfItem, Double rateOfItem);", "public Integer getRating() {\n return this.rating;\n }", "public float getRating() {\n return rating;\n }", "public float getRating() {\n return rating;\n }", "public double getRating(){\n\t\treturn this.rating;\n\t}", "public Review() {\n this.review_id = \"\";\n this.user_id = \"\";\n this.business_id = \"\";\n this.stars = 0;\n this.useful = 0;\n this.funny = 0;\n this.cool = 0;\n this.date = LocalDateTime.now();\n this.text = \"\";\n }", "public void setComments(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), COMMENTS, value);\r\n\t}", "void assignItem(int bid, int item) {\n assignment[item] = 1;\n value = Math.min(maxValue, value + bid);\n assignRange();\n }", "public Rating(String game, String player, int rating, Date ratedOn) {\n this.game = game;\n this.player = player;\n this.rating = rating;\n this.ratedOn = ratedOn;\n }", "public void setItem(BudgetItemModel item) { model= item;}", "public int getRating() {\n\t\treturn this.rating;\n\t}" ]
[ "0.7001854", "0.6871212", "0.68385583", "0.6796028", "0.6702328", "0.66653645", "0.65133977", "0.65100384", "0.64111924", "0.6346869", "0.63358116", "0.6325636", "0.6313214", "0.6304311", "0.62812227", "0.62429744", "0.6237247", "0.61943805", "0.6193095", "0.61928445", "0.6149198", "0.61149883", "0.60763156", "0.60301447", "0.60086507", "0.600078", "0.600078", "0.59537464", "0.5944224", "0.5941566", "0.58840334", "0.58457226", "0.5820514", "0.580631", "0.5778567", "0.5778535", "0.57679516", "0.57598996", "0.573632", "0.5733482", "0.5726272", "0.5722337", "0.5687222", "0.5685323", "0.56833977", "0.56544757", "0.56493497", "0.5615982", "0.5575285", "0.55704796", "0.5549793", "0.5543605", "0.55376506", "0.5534473", "0.5525627", "0.55198467", "0.55181897", "0.5518147", "0.5440987", "0.5434315", "0.5431966", "0.54292446", "0.5420242", "0.54156744", "0.5399325", "0.53939164", "0.539267", "0.53857684", "0.5384435", "0.5383282", "0.53825825", "0.5375856", "0.53688055", "0.536431", "0.5355654", "0.53555566", "0.5336279", "0.53327", "0.5329892", "0.53285015", "0.5320668", "0.5303226", "0.5303196", "0.53013563", "0.52991635", "0.52991635", "0.5293108", "0.5282083", "0.5276439", "0.52732307", "0.526677", "0.5265941", "0.5265941", "0.52652687", "0.52624893", "0.5258102", "0.5246522", "0.5245696", "0.52434206", "0.52381945" ]
0.7931292
0
set a rating for the item
public void setRating(int rating);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRating(int rating)\n {\n this.rating = rating;\n }", "public void setRating(int rating) {\r\n this.rating = rating;\r\n }", "public void setRating(Integer value)\n\t{\n\t}", "public void setRating(int rating) {\n this.rating = rating;\n }", "public void setRating(Integer rating) {\r\n this.rating = rating;\r\n }", "public void setRating(int rating) {\n if (rating > starCount) {\n rating = starCount;\n }\n int lastRating = this.rating;\n this.rating = rating;\n for (int i = 0; i < getChildCount(); i++) {\n ImageView iv = (ImageView) getChildAt(i);\n if (i < rating) {\n iv.setImageResource(checkedStarDrawable);\n } else {\n iv.setImageResource(normalStarDrawable);\n }\n }\n if (listener != null && lastRating != rating) {\n listener.onRatingChanged(rating, starCount);\n }\n }", "public void setRating(double rating){\n\t\tthis.rating = rating;\n\t}", "public void setRating(Rating rating) {\n double boundedRating = this.boundedRating(rating);\n this.normalisedRating = this.normaliseRating(boundedRating);\n this.ratingCount++;\n }", "public void setRating(int rating) {\n this.rating = rating;\n if (this.rating < 0) {\n this.rating = 0;\n }\n }", "public void setRating(int rating) {\n\t\tthis.rating = rating;\n\t}", "public void setRating(float rating) {\n this.rating = rating;\n }", "public void setRating(double rating) {\n\t\tthis.rating = rating;\n\t}", "public void setRating(double rating) throws RatingWasAlreadySetExecption {\n if (!isRated) {\n this.rating = rating;\n this.isRated = true;\n } else {\n throw new RatingWasAlreadySetExecption(\"Rating was set on an already rated tweet!\", this, rating);\n }\n\n }", "public static void setRatings (double irating){\n\t\t\t//ratings = irating;\n\t\t\tr = irating;\n\t}", "public void setMyRating(double myRating) {\n this.myRating = myRating;\n }", "public Builder setRating(double value) {\n \n rating_ = value;\n onChanged();\n return this;\n }", "public void setHotOrNotRating(int rating) {\r\n this.rating += rating;\r\n ratingCount++;\r\n }", "public void setRating(java.lang.String rating) {\n this.rating = rating;\n }", "void updateRating(String name, String park, double rating);", "public static void setRating(Context context, int id, int rating){\n\n MovieSqlHelper movieDB = new MovieSqlHelper(context);\n ContentValues values=new ContentValues();\n values.put(DBConstants.RATING_C, rating);\n movieDB.getWritableDatabase().update(DBConstants.MOVIES_T,values,DBConstants.ID_C+\"=?\",new String[]{\"\"+id});\n movieDB.close();\n\n }", "public void setRating(float r) {\n\t\trating = r;\n\t}", "void editRating(String rid, Rating2 rating2);", "public void ratePoItem(int pid, String bid, int rating, String review) throws Exception {\n String query = \"UPDATE POItem SET rating = ?, review = ? WHERE id = ? AND bid = ?\";\n try (Connection con = this.ds.getConnection();\n PreparedStatement p = con.prepareStatement(query)) {\n p.setInt(1, rating);\n p.setString(2, review);\n p.setInt(3, pid);\n p.setString(4, bid);\n p.executeUpdate();\n }\n }", "@Test\n public void testSetRating() {\n final double delta = 0.0;\n final double expectedRating1 = 70.0;\n final double expectedRating2 = 65.0;\n final double expectedRating3 = 85.5;\n movie1.setRating(expectedRating1);\n movie2.setRating(expectedRating2);\n movie3.setRating(expectedRating1);\n movie4.setRating(expectedRating3);\n movie1.setRating(expectedRating2);\n assertEquals(expectedRating2, movie1.getRating(), delta);\n assertEquals(expectedRating2, movie2.getRating(), delta);\n assertEquals(expectedRating1, movie3.getRating(), delta);\n assertEquals(expectedRating3, movie4.getRating(), delta);\n }", "public void setUserRating(String userRating) {\n this.userRating = userRating;\n }", "public void handleRating() {\r\n Users rater = ui.getUser();\r\n newRating = ratingEJB.findByUserAndRecipe(rater, recipe);\r\n boolean edit = false; // determine whether we need to edit\r\n\r\n // No rating for this user exists\r\n if (newRating == null && rating > 0 && rating <= 5) {\r\n newRating = new RecipeRating();\r\n newRating.setRater(rater);\r\n newRating.setRecipe(recipe);\r\n newRating.setRatingDate(new Date().getTime());\r\n } // A rating exists\r\n else {\r\n edit = true;\r\n }\r\n\r\n switch (rating) {\r\n case 1:\r\n this.newRating.setRatingValue(RatingValue.ONE_STAR);\r\n break;\r\n case 2:\r\n this.newRating.setRatingValue(RatingValue.TWO_STARS);\r\n break;\r\n case 3:\r\n this.newRating.setRatingValue(RatingValue.THREE_STARS);\r\n break;\r\n case 4:\r\n this.newRating.setRatingValue(RatingValue.FOUR_STARS);\r\n break;\r\n case 5:\r\n this.newRating.setRatingValue(RatingValue.FIVE_STARS);\r\n break;\r\n }// end switch\r\n\r\n if (edit) {\r\n this.newRating = ratingEJB.editRecipeRating(newRating);\r\n } else {\r\n this.newRating = ratingEJB.createRecipeRating(newRating);\r\n }\r\n }", "public void setComment(String comment, int rating);", "public boolean setRating(int newRating) {\n\t\tif (newRating != this.rating && newRating <= 5 && this.rating >= 1) {\n\t\t\tthis.rating = newRating;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public void setRatingID(int ratingID) {\n this.ratingID = ratingID;\n }", "private void updateUserRatingStars(Long currentKey) {\r\n\t\tSwagItemRating swagItemRatingForKey = loginInfo.getSwagItemRating(currentKey);\r\n\t\tInteger userRating = (swagItemRatingForKey==null) ? 0 : swagItemRatingForKey.getUserRating();\r\n\t\t\r\n\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\tif (i<userRating) {\r\n\t\t\t\tstarImages.get(i).setSrc(\"/images/starOn.gif\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstarImages.get(i).setSrc(\"/images/starOff.gif\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setRatings(Rating[] ratings) {\n this.ratings = ratings;\n }", "public void setRating(int row) {\n\t\tint x = row; //x is used for a simpler line of code below (represents current row of excel sheet +1)\r\n\t\tlong daysOffset = daysSince1900(5);\r\n\t\t\r\n\t\tthis.rating = \"=IF(MIN(P\"+x+\":Q\"+x+\")>\"+daysOffset+\",-9,(SUM(R\"+x+\":W\"+x+\")-MAX(R\"+x+\":W\"+x+\")+MIN(R\"+x+\":W\"+x+\")-STDEV.S(R\"+x+\":W\"+x+\"))/6)\";\r\n\t}", "public void rateDoctor(Doctor doctor, String rating)\n {\n ArrayList<String> temp = doctor.getDoctorRating();\n temp.add(rating);\n doctor.setDoctorRating(temp);\n }", "public void updateRating(String name, double newRating) {\n\t\tfor(Movie movie: this.movieList) {\n\t\t\tif(movie.getName().equals(name)) movie.setRating(newRating);\n\t\t}\n\t}", "private void editRating() throws MovieDAOException {\n String title = displayNameAndGetTitle();\n\n // get rating\n String newRating = view.getNewRating();\n\n // edit rating\n DVD updatedDVD = service.editRating(title, newRating);\n \n view.displayInfo(updatedDVD);\n }", "public void updateFeedback(UserProfile up, String itemCode, String rating) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n\n String query = \"UPDATE userItems \"\n + \"SET rating = ? \"\n + \"WHERE itemCode = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, rating);\n ps.setString(2, itemCode);\n ps.executeUpdate();\n } catch (SQLException se) {\n System.out.println(\"ERROR: Could not execute SQL statement in: \" + \"Item.changeRating()\");\n System.out.println(\"ERROR: Could not execute SQL statement: \" + se);\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n up.updateRating(itemCode, rating);\n\n }", "void addRating(Rating2 rating2);", "public static void rate(Long propID, String userID, Integer newRatingValue)\r\n\t\t\tthrows ServiceException {\r\n\t\tRating rating = ofy.find(Rating.class, buildID(userID, propID));\r\n\r\n\t\t/*\r\n\t\t * if there was no previous rating and the new value indicates a rating\r\n\t\t * deletion, or if the previous rating and the new rating are the same,\r\n\t\t * then there is nothing to do. So, notify the client that it sent a\r\n\t\t * pointless update.\r\n\t\t */\r\n\t\tif ((rating == null && newRatingValue == null)\r\n\t\t\t\t|| ((rating != null && newRatingValue != null) && rating.eval == newRatingValue\r\n\t\t\t\t\t\t.intValue())) {\r\n\t\t\tthrow new ServiceException(\"cannot update rating: old rating (\"\r\n\t\t\t\t\t+ rating.eval + \") is the same as new rating (\"\r\n\t\t\t\t\t+ newRatingValue + \")\");\r\n\t\t}\r\n\r\n\t\tLock lock = Lock.getNodeLock(propID);\r\n\t\ttry {\r\n\t\t\tlock.lock();\r\n\r\n\t\t\tProposition prop = ofy.get(Proposition.class, propID);\r\n\r\n\t\t\t/* if the user has previously rated back out previous rating */\r\n\t\t\tif (rating != null) {\r\n\t\t\t\tprop.ratingSum -= rating.eval;\r\n\t\t\t\tprop.ratingCount--;\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * otherwise create a new rating object to hold new rating (note\r\n\t\t\t * that in the case where rating == null we always need a new rating\r\n\t\t\t * object here because we have ruled out the case where both rating\r\n\t\t\t * == null and newRatingValue == null by throwing the exception\r\n\t\t\t * above)\r\n\t\t\t */\r\n\t\t\telse {\r\n\t\t\t\trating = new Rating();\r\n\t\t\t\trating.setID(userID, propID);\r\n\t\t\t}\r\n\r\n\t\t\tif (newRatingValue != null) {\r\n\t\t\t\t/* update the proposition with the new evaluation */\r\n\t\t\t\tprop.ratingSum += newRatingValue;\r\n\t\t\t\tprop.ratingCount++;\r\n\r\n\t\t\t\t/* save the new evaluation */\r\n\t\t\t\trating.eval = newRatingValue;\r\n\t\t\t\tofy.put(rating);\r\n\t\t\t} else {\r\n\t\t\t\t/*\r\n\t\t\t\t * if newRatingValue == null we need to delete the rating object\r\n\t\t\t\t * (note this will only happen when there was already a rating\r\n\t\t\t\t * object in the database because we ruled out the possibility\r\n\t\t\t\t * of (rating == null && newRating == null) by throwing\r\n\t\t\t\t * exception above)\r\n\t\t\t\t */\r\n\t\t\t\tofy.delete(rating);\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * notice that I do not call the ArgMapServiceImpl.updateNode()\r\n\t\t\t * function here because I do not want to have the updated time\r\n\t\t\t * change. The updated time is used by the live refresh system to\r\n\t\t\t * determine when a client refresh is needed, and I don't want to\r\n\t\t\t * trigger a client refresh because, at the moment I'm not even\r\n\t\t\t * sending the ratingSum to the client (and don't plan to) (it's\r\n\t\t\t * marked 'transient', so it doesn't get sent.)\r\n\t\t\t */\r\n\t\t\tofy.put(prop);\r\n\r\n\t\t\t/*\r\n\t\t\t * TODO need to queue a task to recalculate the scores for all the\r\n\t\t\t * nodes that depend on this node's score or average rating.\r\n\t\t\t */\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}", "public int get () { return rating; }", "public float getRating() {\n return rating;\n }", "public float getRating() {\n return rating;\n }", "public double getRating(){\n\t\treturn this.rating;\n\t}", "double getRating();", "public double getRating() {\n return rating_;\n }", "public double getRating() {\n\t\treturn rating;\n\t}", "public void setRating(final String num)\n {\n maxPref = getActivity().getSharedPreferences(num, 1); //get the preferences\n editor = maxPref.edit(); //open them for editing\n\n maxBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {\n @Override\n public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {\n editor.putFloat(num, maxBar.getRating()); //get the new rating and put it in num\n editor.commit(); //commit the changes\n }\n });\n }", "public Integer getRating() {\n return this.rating;\n }", "public double getRating() {\n return rating_;\n }", "Builder addContentRating(String value);", "public int getRating()\n {\n return this.rating;\n }", "@Min(0)\n @Max(5)\n public int getRating() {\n return rating;\n }", "Integer rateSong(User user, Song toRate, Integer rating)\n\t\tthrows IllegalArgumentException, IndexOutOfBoundsException, NullPointerException;", "public void vote(int rating) {\n\t\tnew WebTraceTask(this, String.valueOf(rating)).execute(WebTraceTask.VOTE);\n\t}", "public void addRating(String name, double rating) {\n\t\tfor(Movie movie: this.movieList) {\n\t\t\tif(movie.getName().equals(name)) {\n\t\t\t\tmovie.setRating(rating);\n\t\t\t}\n\t\t}\n\t}", "public void setItem(String itemDescription, int weight)\n {\n currentItem = new Item(itemDescription, weight); \n }", "public float getRating() {\n\t\treturn rating;\n\t}", "public int getRating() {\n\t\treturn this.rating;\n\t}", "public void addRating(int userIndex, double rating) {\n if (!this.usersRatings.add(userIndex, rating))\n throw new IllegalArgumentException(\"Provided rating already exist in item: \" + id);\n\n min = Math.min(rating, min);\n max = Math.max(rating, max);\n average =\n (this.usersRatings.size() <= 1)\n ? rating\n : ((average * (this.usersRatings.size() - 1)) + rating) / this.usersRatings.size();\n }", "public int getRating();", "public int getStarRating(){\n return starRating;\n }", "public Builder setRate(int value) {\n \n rate_ = value;\n onChanged();\n return this;\n }", "public void setRatingValue(String ratingValue) {\n this.ratingValue = ratingValue;\n }", "public void setRatingDate(Date ratingDate) {\n this.ratingDate = ratingDate;\n }", "public abstract void setDiscountRate(double discountRate);", "public void setRatingType(typekey.APDExposureRatingType value);", "public float getRating() {\n return this.rating;\n }", "public void setSumratings(int sumratings) {\n\tthis.sumratings = sumratings;\n}", "public void setRate(int rate) { this.rate = rate; }", "public void setWeight(Item item, int value) {\n\t\tweight.put(item, value);\n\t}", "public void setRateStar(int value, Dialog dialog) {\n\t\tImageView[] imgViewArr = new ImageView[] { (ImageView) dialog.findViewById(R.id.ratingview1),\n\t\t\t\t(ImageView) dialog.findViewById(R.id.ratingview2), (ImageView) dialog.findViewById(R.id.ratingview3) };\n\n\t\tfor (int i = 0; i < value; ++i) {\n\t\t\timgViewArr[i].setImageResource(R.drawable.star_found);\n\t\t}\n\n\t\tfor (int i = value; i < 3; ++i) {\n\t\t\timgViewArr[i].setImageResource(R.drawable.star_lost);\n\t\t}\n\n\t}", "@Override\n public void onSmileySelected(@BaseRating.Smiley int smiley, boolean reselected) {\n switch (smiley) {\n case SmileRating.TERRIBLE:\n rate = 1;\n break;\n case SmileRating.BAD:\n rate = 2;\n break;\n case SmileRating.OKAY:\n rate = 3;\n break;\n case SmileRating.GOOD:\n rate = 4;\n break;\n case SmileRating.GREAT:\n rate = 5;\n break;\n }\n }", "public void setPlayerRating(long playerRating, IServerCallback callback) {\n\n try {\n JSONObject data = new JSONObject();\n data.put(Parameter.playerRating.name(), playerRating);\n\n ServerCall sc = new ServerCall(ServiceName.matchMaking, ServiceOperation.SET_PLAYER_RATING, data, callback);\n _client.sendRequest(sc);\n } catch (JSONException ignored) {\n }\n }", "public boolean setMovieRating(Movie movie, RatingEnum rating){\n if(movie == null) return false;\n movie.rating = rating;\n return true;\n }", "public void setStars(float stars) {\n this.stars = stars;\n }", "Builder addContentRating(Text value);", "public void addRating(double rating) throws RatingOutOfBoundsException{\n if (rating < minRating || rating > maxRating){\n throw new RatingOutOfBoundsException();\n }\n double totalRating = (averageRating * (double) count) + rating;\n count++;\n averageRating = totalRating / (double) count;\n }", "public abstract void setRate();", "public static int changeRating(String foodItem, String genre, int nextRating, Context c){\n ratingContext = c;\n String ratingFileName = getRatingFileName(genre);\n String ratingPathName = getRatingFilePath(genre);\n int rating = 0;\n int numOfAnswers = 0;\n String foodLocText = \"(\"+foodItem+\"=\";\n\n try{\n BufferedReader ratingReader = new BufferedReader(new InputStreamReader(ratingContext.getAssets().open(ratingFileName)));\n\n String ratings = ratingReader.readLine();\n\n int indOfFoodItem = ratings.indexOf(foodLocText);\n int indOfRatingString = indOfFoodItem+foodLocText.length();\n\n String ratingString = ratings.substring(indOfRatingString, indOfRatingString+1);\n String numOfAnswersSTring = ratings.substring(indOfRatingString+2, indOfRatingString+3);\n\n rating = Integer.parseInt(ratingString);\n numOfAnswers = Integer.parseInt(numOfAnswersSTring);\n\n int newRating = rating*numOfAnswers;\n newRating = newRating + nextRating;\n\n numOfAnswers++;\n\n rating = newRating/numOfAnswers;\n\n String firstHalf = ratings.substring(0, indOfFoodItem);\n String secondHalf = ratings.substring(indOfFoodItem);\n secondHalf = secondHalf.substring(secondHalf.indexOf(\")\")+1);\n\n ratings = firstHalf +foodLocText+ rating + numOfAnswers +\")\" + secondHalf;\n\n BufferedWriter ratingWriter = new BufferedWriter(new FileWriter(ratingPathName));\n\n ratingWriter.write(ratings);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n return nextRating;\n }", "public static void updateDriverRating(RatingActivity view, String driverID, boolean giveThumbsUp){\n App.getDbManager().getDriver(driverID, ((resultData, err) -> {\n if (err == null) {\n Driver tmpDriver = (Driver) resultData.get(\"user\");\n if(giveThumbsUp){\n tmpDriver.setNumThumbsUp(tmpDriver.getNumThumbsUp() + 1);\n }\n else{\n tmpDriver.setNumThumbsDown(tmpDriver.getNumThumbsDown()+1);\n }\n //Rating algorithm\n tmpDriver.setRating((tmpDriver.getNumThumbsUp() / (tmpDriver.getNumThumbsDown() +\n tmpDriver.getNumThumbsUp())) * 100);\n App.getDbManager().updateDriver(driverID,tmpDriver, (resultData1, err1) -> {\n if (err1 != null) {\n view.finish();\n }\n });\n }\n\n }));\n }", "public void updateRatingForTavernAndSaveReview(Tavern tavern, Review review){\n Tavern currentTavern = mapper.load(Tavern.class, tavern.getName());\n\n //2. update rating number\n SharedPreferences sharedPreferences = context.getSharedPreferences(\"InstallSettings\", MODE_PRIVATE);\n float oldRating = sharedPreferences.getFloat(tavern.getName(), 0);\n // new rating of user will be saved for the first time in DynamoDB\n if (oldRating == 0){\n float sum = currentTavern.getRatingSum();\n float count = currentTavern.getRatingCount();\n sum += review.getRating();\n count = count + 1;\n float newRating = sum / count;\n\n currentTavern.setRating(newRating);\n currentTavern.setRatingSum(sum);\n currentTavern.setRatingCount(count);\n }\n // rating of user will be adapted to the new value\n else {\n float sum = currentTavern.getRatingSum() - oldRating;\n sum += review.getRating();\n float newRating = sum / currentTavern.getRatingCount();\n\n currentTavern.setRating(newRating);\n currentTavern.setRatingSum(sum);\n }\n\n //3. save\n mapper.save(currentTavern);\n mapper.save(review);\n }", "public void setRating(java.lang.String[] rating) {\n this.rating = rating;\n }", "public void changeRating(String name, short newRating) {\n\t\tVisitor visitor = getVisitorByName(name);\n\t\tboolean recalculate = true;\n\t\tif(visitor != null) {\n\t\t\tif(visitor.getRating() == newRating) {\n\t\t\t\trecalculate = false;\n\t\t\t} else {\n\t\t\t\tvisitor.setRating(newRating);\n\t\t\t}\n\t\t} else {\n\t\t\taddVisitor(name, newRating);\n\t\t}\n\t\tif(recalculate) {\n\t\t\tcalculateRating();\n\t\t}\n\t}", "public void addRatingAndCalculate(double newRating) {\n totalRating += newRating;\n averageRating = totalRating/reviews.size();\n }", "public void setRate();", "public void ratings(){\n SimpleActivity activity = getSimpleActivity();\n RatingBar ratingBar = (RatingBar) activity.findViewById(R.id.ratingBar);\n friendsPreference = PreferenceManager.getDefaultSharedPreferences(activity);\n if (friendsPreference.getFloat(friendNameFragment+\"Rating\", 0)!=0) {\n ratingBar.setRating(friendsPreference.getFloat(friendNameFragment+\"Rating\", 0));\n }\n }", "public void setRate(Integer rate) {\r\n this.rate = rate;\r\n }", "public int getSeekerRating() {\n return getIntegerProperty(\"Rating\");\n }", "public double getRating(){\n\t\treturn this.user_rating;\n\t}", "public boolean updateRating(String t, int r)\n\t{\n\t\tif(r<0 || r>100 || !containsMovie(t))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t//update rating\n\t\tIterator<Movie> itr = list_of_movies.iterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tMovie temp_movie = itr.next();\n\t\t\tif(temp_movie.getTitle().equals(t))\n\t\t\t{\n\t\t\t\ttemp_movie.setRating(r);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn true;\n\t}", "private void Rating(int minAge)\r\n {\r\n this.minAge = minAge;\r\n }", "public void setReview(double review) {\r\n this.review = review;\r\n }", "public void setISOSpeedRatings(Integer value)\n\t{\n\t}", "public Rating(int movieID, String email, float rating){\n this.movieID = movieID;\n this.rating = rating;\n this.email = email;\n }", "public void setRatingText(String ratingText) {\n this.ratingText = ratingText;\n }", "public Rating(String game, String player, int rating, Date ratedOn) {\n this.game = game;\n this.player = player;\n this.rating = rating;\n this.ratedOn = ratedOn;\n }", "public void setMinRating(int minRating) {\n this.minRating = minRating;\n }", "private RatingModel(int rating, BeerModel beerModel, UserModel userModel) {\n \t\tthis.domainObject = new Rating(new Date(System.currentTimeMillis()), beerModel.getDomainObject(), userModel.getDomainObject(), rating);\n \t\tthis.node = DBUtil.createNode(NodeType.RATING);\n \t\tDBUtil.createRelationship(this.node, RelType.CONTAINS, beerModel.getNode());\n \t\tDBUtil.createRelationship(userModel.getNode(), RelType.DOES, this.node);\n \t\tthis.setRating(rating);\n \t\tthis.setDate(this.domainObject.getDate());\n \t}", "private void updateProduct(String productId, double reviewRating) {\n\t\tMap<String, Double> details = products.containsKey(productId)? products.get(productId): new HashMap<String, Double>();\n\t\tDouble numberOfReviews = details.containsKey(NUMBEROFREVIEWS)? details.get(NUMBEROFREVIEWS): 0.0;\n\t\tDouble totalRatings = details.containsKey(TOTALRATINGS)? details.get(TOTALRATINGS): 0.0;\n\n\t\tdetails.put(NUMBEROFREVIEWS, numberOfReviews + 1);\n\t\tdetails.put(TOTALRATINGS, totalRatings + reviewRating);\n\t\t\n\t\tList<Double> list = productRatings.containsKey(productId)? productRatings.get(productId): new ArrayList<Double>();\n\t\tlist.add(reviewRating);\n\t\t\n\t\tproducts.put(productId, details);\n\t\tproductRatings.put(productId, list);\n\t}", "private void increaseQualityByOne(Item item) {\n item.quality = item.quality + 1;\n }", "public void onRatingChanged(RatingBar ratingbar, float rating, boolean fromtouch) {\n\t\tfinal int numStar = ratingbar.getNumStars();\n\t\ttxt4.setText(\" \"+rating+\"/\"+numStar+\" \");\n\t\t}" ]
[ "0.7947639", "0.79247284", "0.7855962", "0.78522867", "0.7822658", "0.777543", "0.7662606", "0.7644664", "0.7642056", "0.759116", "0.7522286", "0.74860984", "0.74185777", "0.7310986", "0.7295264", "0.71304107", "0.7126988", "0.71057546", "0.71022105", "0.7090783", "0.70533913", "0.6834313", "0.6798153", "0.67876995", "0.6784069", "0.6654941", "0.66312623", "0.66196245", "0.658225", "0.648214", "0.63701886", "0.63622665", "0.6336256", "0.63345873", "0.63197345", "0.6314655", "0.6274778", "0.6255445", "0.6224235", "0.6208721", "0.6208721", "0.6202202", "0.62012595", "0.61943096", "0.61903423", "0.6183623", "0.61793387", "0.6177065", "0.6166034", "0.615265", "0.6151353", "0.61500126", "0.61339897", "0.6123837", "0.61160535", "0.6100456", "0.6096008", "0.6091764", "0.60859805", "0.6079337", "0.607371", "0.60680884", "0.60623604", "0.6058386", "0.604792", "0.60473585", "0.6040988", "0.60345334", "0.6028287", "0.6012625", "0.60053605", "0.5986454", "0.59844804", "0.59785515", "0.59643954", "0.59609073", "0.59579015", "0.594893", "0.59465", "0.594023", "0.59252816", "0.5911539", "0.5902603", "0.5888193", "0.5881986", "0.58562046", "0.58446956", "0.5831387", "0.5820356", "0.58162636", "0.5809885", "0.5803842", "0.5799966", "0.57835054", "0.57771784", "0.5776286", "0.5773576", "0.5770278", "0.5766737", "0.5762115" ]
0.8370158
0
returns the comment of the item
public String getComment();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getComment()\n {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public String getComment() {\n return comment;\n }", "public WallItemComment getWallItemComment(long wallItemCommentId);", "public String getComment() {\n return comment ;\n }", "public final String getComment() {\n return comment;\n }", "public String getComment() {\r\n\t\treturn comment;\r\n\t}", "public String getComment() {\n return this.comment;\n }", "@Override\n\tpublic String getComment() {\n\t\treturn model.getComment();\n\t}", "public String getComment() {\n\t\treturn comment;\n\t}", "public String getComment() {\n\t\treturn comment;\n\t}", "public java.lang.String getComment() {\r\n return comment;\r\n }", "String getComment();", "String getComment();", "public java.lang.String getComment() {\n return comment;\n }", "public java.lang.String getComment() {\n return comment;\n }", "public java.lang.String getComment() {\n return comment;\n }", "public String getComment(){\n return comment;\n }", "public String getComment(){\n return this.comment;\n }", "@Override\n\t\tpublic Object getItem(int arg0) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\treturn comments.get(arg0);\n\t\t}", "public String getComment() {\n \t\t\t\t\t\t\t\t\treturn null;\n \t\t\t\t\t\t\t\t}", "public String getComment() {\n return description;\n }", "public String getComment() {\n return variant == null ? null : variant.getComment(this);\n }", "public String getComment() {\n\t LogWriter.logMessage(LogWriter.TRACE_DEBUG,\"getComment() \" );\n Via via=(Via)sipHeader;\n return via.getComment();\n }", "public ST getComment() { \r\n\t\tST retVal = this.getTypedField(48, 0);\r\n\t\treturn retVal;\r\n }", "public String getComment() {\n Object ref = comment_;\n if (!(ref instanceof String)) {\n String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n comment_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getComment() {\n Object ref = comment_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n comment_ = s;\n }\n return s;\n }\n }", "public String getCommentContent() {\n return commentContent;\n }", "public String getComment() {\n\t\tif (comment != null)\n\t\t\treturn ProteomeXchangeFilev2_1.COM + TAB\n\t\t\t// + \"comment\" + TAB\n\t\t\t\t\t+ comment;\n\t\treturn null;\n\t}", "public String getComment() throws SQLException {\n\t\tloadFromDB();\n\t\treturn rev_comment;\n\t}", "String getComment() {\n//\t\t\tm1();\n\t\t\treturn \"small\";\n\t\t}", "public String getCommentText() {\n\t return this.commentText;\n\t}", "public String get_comment() throws Exception {\n\t\treturn this.comment;\n\t}", "public String getCommentText() {\r\n\r\n\t\treturn commentText;\r\n\t}", "public Optional<String> getComment() {\n\t\treturn Optional.ofNullable(_comment);\n\t}", "java.lang.String getComments();", "public com.google.protobuf.ByteString\n getCommentBytes() {\n Object ref = comment_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n comment_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getBookComment() {\n return bookComment;\n }", "public String getBookComment() {\n return bookComment;\n }", "public String toString () {\n if (this.comment != null) {\n return this.comment;\n }\n return super.toString ();\n }", "public com.google.protobuf.ByteString\n getCommentBytes() {\n Object ref = comment_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n comment_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getjComment() {\n return jComment;\n }", "public String getCommentId() {\n return commentId.toString();\n }", "@Override\n public String toString() {\n return \"Comment{\" +\n \"game='\" + game + '\\'' +\n \"player='\" + player + '\\'' +\n \", rating=\" + rating +\n \", ratedOn=\" + ratedOn +\n '}';\n }", "String getComment() {\n final StringBuilder sb = new StringBuilder();\n sb.append(indent(1)).append(\"/**\").append(EOL);\n sb.append(indent(1)).append(\" * \").append(\"{@code\").append(EOL);\n\n // Unwrapped so that you can search through the descriptor\n // file for a message and not have to worry about line breaks\n final String ws = formatString; // wrapText(formatString, 70);\n\n final String[] sa = ws.split(EOL);\n for (final String s : sa) {\n sb.append(indent(1)).append(\" * \").append(s).append(EOL);\n }\n\n sb.append(indent(1)).append(\" * \").append(\"}\").append(EOL);\n sb.append(indent(1)).append(\" */\").append(EOL);\n return sb.toString();\n }", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn commentList.get(position);\n\t}", "public String getComments() {\r\n return this.comments;\r\n }", "public String getComment(String path) {\n return getComment(path, null);\n }", "public String getComments() { \n\t\treturn getCommentsElement().getValue();\n\t}", "public String getFileComment()\r\n {\r\n return sFileComment;\r\n }", "com.google.protobuf.ByteString\n getCommentBytes();", "java.lang.String getCommentId();", "public String getComments() {\n return this.comments;\n }", "public String getComment(int commentType, Address address);", "public String getComment() throws RuntimeException\n {\n return getTitle();\n }", "public String getComments() {\n return _comments;\n }", "@Override\n\tpublic Fragment getItem(int arg0) {\n\t\treturn new Agree_comments();\n\t}", "public String getInfo()\r\n\t{\r\n\t\treturn theItem.getNote();\r\n\t}", "@Override\n\tpublic CommentModel getItem(int position) {\n\t\treturn comments.get(position);\n\t}", "public int getCommentId();", "public Long getCommentId() {\n return commentId;\n }", "public String getSampleComment();", "@Override\n\tpublic String toString() {\n\t\treturn \"Comment [id=\" + id + \", comment=\" + comment + \", user=\" + user\n\t\t\t\t+ \", entity=\" + entity + \", entityId=\" + entityId\n\t\t\t\t+ \", parrent=\" + parrent + \", likes=\" + likes + \"]\";\n\t}", "public String getComments() {\n\t\treturn this.comments;\n\t}", "org.hl7.fhir.String getComments();", "public Integer getCommentId() {\n return commentId;\n }", "public Integer getCommentId() {\n return commentId;\n }", "public String getComments() {\n return (String) getAttributeInternal(COMMENTS);\n }", "@Schema(description = \"A comment about the worklog in [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or updating a worklog.\")\n public Object getComment() {\n return comment;\n }", "public java.lang.String getHopscomment() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((java.lang.String) __getCache(\"hopscomment\")));\n }", "public String getComments() {\n return comments;\n }", "public Comment getDisplayComment() {\n return this;\n }", "String getCheckinComment();", "String getCommentStringValue(Object comment);", "@Lob\r\n @Column (name=\"RECORD_COMMENT\")\r\n\tpublic String getComment() {\r\n\t\treturn comment;\r\n\t}", "public String getAcCommentsMessage() {\n return acCommentsMessage;\n }", "public java.lang.String getComments() {\n java.lang.Object ref = comments_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n comments_ = s;\n }\n return s;\n }\n }", "public String getComments() {\n\t\treturn comments;\n\t}", "public java.lang.String getComments() {\n java.lang.Object ref = comments_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n comments_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "Comment getBase_Comment();", "public List<Comment> showComment() {\n\t\treturn cdi.showComment();\n\t}", "public String description(){\n\t\treturn \"Mark: \" + mark + \"\\n\" + \"Comment: \" + comment;\n\t}", "public CommentElements getCommentAccess() {\n\t\treturn (pComment != null) ? pComment : (pComment = new CommentElements());\n\t}", "public com.google.protobuf.ByteString\n getCommentsBytes() {\n java.lang.Object ref = comments_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n comments_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public java.lang.String getComments () {\r\n\t\treturn comments;\r\n\t}", "public ST getPsl48_Comment() { \r\n\t\tST retVal = this.getTypedField(48, 0);\r\n\t\treturn retVal;\r\n }", "public com.google.protobuf.ByteString\n getCommentsBytes() {\n java.lang.Object ref = comments_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n comments_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getColumnComment(int pos) { return columns[pos].getComment(); }", "public synchronized String getDescription(){\n \treturn item_description;\n }", "public java.lang.String getComments () {\n\t\treturn comments;\n\t}" ]
[ "0.74138385", "0.7379837", "0.7379837", "0.7379837", "0.7379837", "0.7379837", "0.7379837", "0.7379837", "0.7353038", "0.73526126", "0.7344236", "0.7340548", "0.73314893", "0.7293577", "0.72918576", "0.72918576", "0.7256651", "0.72294617", "0.72294617", "0.7215987", "0.7215987", "0.7215987", "0.71921253", "0.7175364", "0.7170334", "0.7141442", "0.7109487", "0.7096122", "0.7015676", "0.7009249", "0.69149894", "0.68805534", "0.6855446", "0.6849668", "0.682733", "0.6806748", "0.679924", "0.6795747", "0.6761861", "0.67354965", "0.66999584", "0.6628271", "0.66092265", "0.66092265", "0.65839905", "0.6583454", "0.65588796", "0.65551764", "0.6498727", "0.64981836", "0.6492811", "0.64844304", "0.6474421", "0.6471592", "0.64649373", "0.6461251", "0.64602816", "0.6455614", "0.6455287", "0.6452671", "0.6413893", "0.6404018", "0.6397252", "0.6393283", "0.6383638", "0.63833547", "0.638329", "0.63711214", "0.63658136", "0.63596845", "0.63492763", "0.63492763", "0.6342787", "0.63218623", "0.6318872", "0.6294699", "0.6294245", "0.62914354", "0.62380207", "0.6237506", "0.6200378", "0.6199503", "0.6176966", "0.61762565", "0.615392", "0.6127072", "0.6086606", "0.6067954", "0.60626906", "0.60558146", "0.6042541", "0.6024619", "0.6015968", "0.60141975", "0.60076797" ]
0.7310501
18
returns the rating of the item
public int getRating();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getRating();", "public double getRating(){\n\t\treturn this.rating;\n\t}", "public Integer getRating() {\n return this.rating;\n }", "public double getRating() {\n return rating_;\n }", "public double getRating() {\n return rating_;\n }", "public double getRating() {\n\t\treturn rating;\n\t}", "public int getRating()\n {\n return this.rating;\n }", "public int getRating() {\n\t\treturn this.rating;\n\t}", "public float getRating() {\n return this.rating;\n }", "public float getRating() {\n return rating;\n }", "public float getRating() {\n return rating;\n }", "public double getRating(){\n\t\treturn this.user_rating;\n\t}", "public float getRating() {\n\t\treturn rating;\n\t}", "public Integer getRating() {\r\n if (recipe != null && ui.isIsUserAuthenticated()) {\r\n RecipeRating temp = ratingEJB.findByUserAndRecipe(ui.getUser(), recipe);\r\n if (temp != null) {\r\n rating = temp.getRatingValue().getValue();\r\n }\r\n }\r\n return rating;\r\n }", "public Integer getGivenRating() {\n\t\treturn givenRating;\n\t}", "public int getStarRating(){\n return starRating;\n }", "public java.lang.String getRating() {\n return rating;\n }", "public int getSeekerRating() {\n return getIntegerProperty(\"Rating\");\n }", "public Integer getRating()\n\t{\n\t\treturn null;\n\t}", "public double rating() {\r\n double value = BASE_RATING * specialization * (1 / (1 + era)) \r\n * ((wins - losses + saves) / 30.0);\r\n return value;\r\n }", "public double getRatingAt(int pos) {\n return this.usersRatings.get(pos).getRating();\n }", "public double getTotalRating() {\n return totalRating;\n }", "public String getRating() {\r\n\t\tswitch (rating) {\r\n\t\tcase \"high\":\r\n\t\t\treturn \"high\";\r\n\t\tcase \"medium\":\r\n\t\t\treturn \"medium\";\r\n\t\tcase \"low\":\r\n\t\t\treturn \"low\";\r\n\t\tdefault: return \"none\";\r\n\t\t}\r\n\t}", "public int get () { return rating; }", "public int getRatings() {\n return ratings;\n }", "@Min(0)\n @Max(5)\n public int getRating() {\n return rating;\n }", "String getReviewrate();", "public double getParseRating() {\n return getDouble(KEY_RATING);\n }", "public String getUserRating() {\n return userRating;\n }", "public String getRatingValue() {\n return ratingValue;\n }", "public MediaRating getRating() {\n MediaRating mediaRating = ratings.get(MediaRating.USER);\n\n // then the default one (either NFO or DEFAULT)\n if (mediaRating == null) {\n mediaRating = ratings.get(MediaRating.NFO);\n }\n if (mediaRating == null) {\n mediaRating = ratings.get(MediaRating.DEFAULT);\n }\n\n // is there any rating?\n if (mediaRating == null && !ratings.isEmpty()) {\n mediaRating = ratings.values().iterator().next();\n }\n\n // last but not least a non null value\n if (mediaRating == null) {\n mediaRating = new MediaRating();\n }\n\n return mediaRating;\n }", "@Nullable\n public Float getRating() {\n return rating;\n }", "public Short getUserRating() {\r\n return userRating;\r\n }", "public float getRating(String productid) {\n\t\treturn 0;\r\n\t}", "public int getSumratings() {\n\treturn sumratings;\n}", "void getRating(String rid, final RatingResult result);", "public double getAverageRating() {\n return averageRating;\n }", "public double getAverageRating() {\n return averageRating;\n }", "public abstract double calcAvRating();", "public int getRatingID() {\n return ratingID;\n }", "public int getNoOfratings() {\n\treturn noofratings;\n}", "@Nullable\n final public Double getStarRating() {\n return mStarRating;\n }", "public int getMinRating() {\n return minRating;\n }", "public int getHotOrNotRating() {\r\n if (ratingCount == 0) return 0;\r\n return (rating/ratingCount);\r\n }", "public double getRatingAverage() {\n return average;\n }", "float getSteamSupplyRating2();", "public double getMinRating() {\n return min;\n }", "public int getRatingFirst() {\n return this.ratingFirst ? 1 : 0;\n }", "public String getRatingText() {\n return ratingText;\n }", "public double getOgRating() {\n return ogRating;\n }", "public void setRating(int rating) {\r\n this.rating = rating;\r\n }", "public Integer getRate() {\r\n return rate;\r\n }", "public void setRating(Integer rating) {\r\n this.rating = rating;\r\n }", "public void setRating(int rating)\n {\n this.rating = rating;\n }", "public void setRating(int rating) {\n this.rating = rating;\n }", "public Float getAverageRating() {\n\t return this.averageRating;\n\t}", "public int getStars() {\n return stars;\n }", "public int getStars() {\n return stars;\n }", "public void setRating(Integer value)\n\t{\n\t}", "public void setRating(int rating);", "public static double getRandomRating() {\n return (double) (RandomNumberGenerator.getRandomInt(0, 10) / 2d);\n }", "public static double difficultyRating()\n\t{\n\t\treturn 2.5;\n\t}", "public float getStars() {\n return this.stars;\n }", "public double getReview() {\r\n return review;\r\n }", "public int getStarvationRate ( ) {\n\t\treturn extract ( handle -> handle.getStarvationRate ( ) );\n\t}", "public int getStars() {\n\t\treturn this.stars;\n\t}", "private Map<Profile, Integer> rating(){\n\t\treturn allRatings;\n\t}", "public java.lang.String[] getRating() {\n return rating;\n }", "public java.math.BigDecimal getFiveStarRating() {\n return fiveStarRating;\n }", "public int getSpeedRating(){\n\t\treturn speedRating;\n\t}", "public int getWeight(Item item) {\n\t\treturn weight.get(item);\n\t}", "public double predict (\tint user, \n\t\t\t\t\t\t\tint item )\t\n\t{\n\t\treturn dao.getUserMeanRating(user);\n\t}", "public int getRate() {\n return rate_;\n }", "public float getUserRatingScore() {\n float scorePercent = Float.valueOf(userRating) * 10;\n\n return ((5 * scorePercent) / 100);\n }", "void getGivenUserRating(String uidRater, final RatingListResult result);", "public static double difficultyRating()\r\n {\r\n double howhard = 4.0;\r\n return howhard;\r\n }", "public double getAverageRating() {\n int[] ratings = new int[reviews.length];\n for(int i = 0; i < reviews.length; i++) {\n ratings[i] = reviews[i].getRating();\n }\n double average = (double) sumIntegerArray(ratings) / reviews.length;\n return Double.parseDouble(new DecimalFormat(\"#.#\").format(average));\n }", "public int getRate() {\n return rate_;\n }", "public void setRating(int rating) {\n\t\tthis.rating = rating;\n\t}", "@Override\n\tpublic List<Rating> getAllRating() {\n\t\treturn rr.getAllRating();\n\t}", "public double calculateOverallRating() {\n Rating[] ratingArray = this.ratings;\n double sum = 0.0;\n for(int i = 0; i < ratingArray.length; i++) {\n if (ratingArray[i] != null) { // Making sure it has a rating\n sum = sum + ratingArray[i].getScore();\n } else {\n sum = sum + 0.0;\n }\n }\n return sum;\n }", "public Date getRatingDate() {\n return ratingDate;\n }", "public void setRating(double rating){\n\t\tthis.rating = rating;\n\t}", "public double getRate() {\n return rate;\n }", "public double getRate() {\n return rate;\n }", "public sust.bookshelves.entity.Rating getRating(java.lang.Integer id) throws GenericBusinessException {\n sust.bookshelves.hibernatehelper.HibernateQueryHelper hibernateTemplate = new sust.bookshelves.hibernatehelper.HibernateQueryHelper();\n try {\n Rating bean = (Rating) hibernateTemplate.get(Rating.class, id);\n return bean;\n } finally {\n log.debug(\"finished getRating(java.lang.Integer id)\");\n }\n }", "public int getOpponentMinRating() {\n return getIntegerProperty(\"MinRating\");\n }", "public Rating[] getRatings(){\n return this.ratings;\n }", "public void setRating(float rating) {\n this.rating = rating;\n }", "public double getRating(int userID, int movieID) {\n\t\tUser x = null;\n\t\tint ind = Collections.binarySearch(users, new User(userID));\n\t\tif(ind >= 0)\n\t\t\tx = users.get(ind);\n\t\telse\n\t\t\treturn -1;\n\n\t\tint ind2 = Collections.binarySearch(x.getRatings(), new Rating(userID, movieID));\n\t\tif(ind2 >=0)\n\t\t\treturn x.getRatings().get(ind2).getRating();\n\n\t\treturn -1;\n\t}", "public double getPricePerItem()\r\n {\r\n return pricePerItem;\r\n }", "public short getStars()\r\n {\r\n return this.stars;\r\n }", "public double predictRatings(long userId, long itemId) throws TasteException{\n\t\tFastIDSet items = null;\n\t\tif(model.getItemIDsFromUser(userId) != null)\n\t\titems = model.getItemIDsFromUser(userId);\n\t\telse\n\t\t\treturn 0.0;\n\t\t\n\t\tLongPrimitiveIterator iter = items.iterator();\n\t\tdouble total=0.0,totalWeight = 0.0, sim = 0.0;\n\t\twhile(iter.hasNext()){\n\t\t\tlong ratedItem = iter.nextLong();\n\t\t\tfloat rating = model.getPreferenceValue(userId, ratedItem);\n\n\t\t\tsim = sim1.itemSimilarity(itemId, ratedItem);\n\t\t\tif(sim < 0.0 || Double.isNaN(sim))\n\t\t\t\tsim = 0.0;\n\t\t\t\n\t\t\ttotal = total + sim * rating;\n\t\t\ttotalWeight = totalWeight + sim;\n\t\t}\n\t\tif(totalWeight > 0.0)\n\t\ttotal = total / totalWeight;\n\t\telse\n\t\t\ttotal = 0.0;\n\t\tif(total > 5.0)\n\t\t\ttotal = 5.0;\n\t\treturn total;\n\t}", "public double prediction(String itemID){\r\n\t\tif(fuckUser){\r\n\t\t\treturn this.userAverageRate;\r\n\t\t}\r\n\t\tArrayList<Map.Entry<Integer, Double>> neighbor = this.getNeighbor(itemID);\r\n\t\t//If this user is the bad user, just give the prediction with the same rate as the others which the user has been rated.\r\n\t\tif(neighbor.size() == 0){\r\n\t\t\treturn this.userAverageRate;\r\n\t\t}\r\n\t\tdouble a = 0.0;\r\n\t\tdouble b = 0.0;\r\n\t\tfor(int i = 0; i < neighbor.size(); i++){\r\n\t\t\tdouble neighborRate = 0;\r\n\t\t\tint neighborID = neighbor.get(i).getKey();\r\n\t\t\tdouble neighborAver = average.get(neighbor.get(i).getKey());\r\n\t\t\tfor(int j = 0; j < read.rateMap.get(neighborID).size(); j++){\r\n\t\t\t\tif(read.rateMap.get(neighborID).get(j).getKey().equals(itemID)){\r\n\t\t\t\t\tneighborRate = read.rateMap.get(neighborID).get(j).getValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ta += neighbor.get(i).getValue() * (neighborRate - neighborAver);\r\n\t\t\tb += Math.abs(neighbor.get(i).getValue());\r\n\t\t}\r\n\t\tdouble res = this.userAverageRate + a / b;\r\n\t\treturn res;\r\n\t}", "public void setRating(double rating) {\n\t\tthis.rating = rating;\n\t}", "public double getRate() {\n\t\treturn rate;\n\t}", "public ArrayList<Rating> getAverageRating(int minimalRaters)\n {\n ArrayList<Rating> ans=new ArrayList<>();//this a new syntax of defining arraylist\n ArrayList<String> movies=MovieDatabase.filterBy(new TrueFilter());\n double sum=0.0;\n int numOfRaters=0;\n for(int k=0;k<movies.size();k++)\n {\n String moviID=movies.get(k);\n double curr=getAverageByID(moviID,minimalRaters);\n if(curr!=0.0)\n {\n ans.add(new Rating(moviID,curr));\n }\n }\n return ans;\n }", "public void setMyRating(double myRating) {\n this.myRating = myRating;\n }", "private ItemRatingResponse addRatingForItem(Rating rating,\n\t\t\tInteger currentNumberOfRatings, Float currentRating) {\n\t\tItemRatingResponse response = new ItemRatingResponse();\n\t\tresponse.setInvalidCaptcha(false);\n\n\t\t// this whole logic here is necessary to display via ajax fast new\n\t\t// rating and new number of ratings\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tparams.put(\"podcastId\", rating.getPodcastId());\n\t\tparams.put(\"email\", rating.getEmail());\n\t\tparams.put(\"episodeId\", rating.getEpisodeId());\n\t\tInteger oldRatingForEmail = userInteractionDao\n\t\t\t\t.selectRatingForEmail(params);\n\n\t\tFloat newRating = null;\n\t\tparams = new HashMap<String, Object>();\n\t\tif (oldRatingForEmail != null) {\n\t\t\t// it means email has already rated the podcast\n\t\t\tresponse.setNumberOfRatings(currentNumberOfRatings);\n\t\t\tif (currentNumberOfRatings == 0) {\n\t\t\t\tnewRating = rating.getRating().floatValue();\n\t\t\t} else {\n\t\t\t\tnewRating = currentRating\n\t\t\t\t\t\t+ (rating.getRating() - oldRatingForEmail)\n\t\t\t\t\t\t/ currentNumberOfRatings;\n\t\t\t}\n\t\t\tresponse.setUpdatedRating(Math.round(newRating));\n\t\t} else {\n\t\t\t// email has not rated yet\n\t\t\tresponse.setNumberOfRatings(currentNumberOfRatings + 1);\n\t\t\tif (currentNumberOfRatings == 0) {\n\t\t\t\tnewRating = rating.getRating().floatValue();\n\t\t\t} else {\n\t\t\t\tnewRating = (rating.getRating() + currentRating\n\t\t\t\t\t\t* currentNumberOfRatings)\n\t\t\t\t\t\t/ (currentNumberOfRatings + 1);\n\t\t\t}\n\t\t\tresponse.setUpdatedRating(Math.round(newRating));\n\t\t}\n\n\t\tuserInteractionDao.insertRating(rating);\n\n\t\treturn response;\n\t}", "private double getAverageByID(String id, int minimalRaters){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n RaterDatabase database = new RaterDatabase();\n database.initialize(ratingsfile);\n \n double avg_rating = 0.0;\n double running_total = 0.0;\n int count = 0;\n \n for (Rater rater : database.getRaters()){ \n \n if(rater.getItemsRated().contains(id)){\n \n double movie_rating = rater.getRating(id);\n \n running_total += movie_rating;\n \n count += 1;\n \n //System.out.println(movie_rating);\n\n }\n }\n\n if(count >= minimalRaters){\n avg_rating = running_total / count;\n }\n\n \n return avg_rating; \n \n }" ]
[ "0.8234478", "0.80350393", "0.7980102", "0.79293454", "0.79271716", "0.79258", "0.7860612", "0.7763224", "0.77629066", "0.7738143", "0.7738143", "0.768941", "0.7684007", "0.7458509", "0.7419617", "0.73795766", "0.73404676", "0.7325921", "0.7314049", "0.72839504", "0.7262208", "0.71653533", "0.713333", "0.71176046", "0.7081556", "0.7045445", "0.6972958", "0.6960811", "0.6948019", "0.691266", "0.68924445", "0.68887323", "0.6868093", "0.6861284", "0.6858638", "0.6829939", "0.6777096", "0.6777096", "0.67689073", "0.6763384", "0.67202693", "0.6673893", "0.66662616", "0.66478366", "0.6604928", "0.6540474", "0.651434", "0.65135926", "0.645521", "0.6445458", "0.6439184", "0.6429784", "0.6401731", "0.6393886", "0.6390221", "0.6375065", "0.6354927", "0.6354927", "0.6344056", "0.6324661", "0.6321501", "0.63211423", "0.63013846", "0.6292849", "0.6288211", "0.62701523", "0.62701184", "0.626983", "0.62584084", "0.6249348", "0.62453985", "0.62395155", "0.62358207", "0.62358135", "0.6222618", "0.62027484", "0.6194534", "0.61945075", "0.6194134", "0.6189465", "0.6184137", "0.6175942", "0.6166941", "0.6152849", "0.6152849", "0.6141528", "0.6131956", "0.6130318", "0.61293346", "0.6100911", "0.609991", "0.6091414", "0.6084411", "0.6081336", "0.6070398", "0.6052184", "0.60504407", "0.603729", "0.6027301", "0.6022667" ]
0.801551
2
very dirty way, simplest mode to make few code and avoid problems with parcelable items
public void setSerializer(Object serializer);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mo5336a(Parcelable parcelable) {\n }", "private void readFromParcel(Parcel in) \r\n\t{\n\t\tthis.id \t\t\t= in.readInt();\r\n\t\tthis.desc\t\t\t= in.readString();\r\n\t\tthis.titulo_imagem \t= in.readString();\r\n\t\tthis.titulo_som\t\t= in.readString();\r\n\t\tthis.ext\t\t\t= in.readString();\r\n\t\tthis.tipo\t\t\t= in.readString().charAt(0);\r\n\t\tthis.cmd\t\t\t= in.readInt();\r\n\t\tthis.atalho\t\t\t= (in.readInt() == 1) ? true : false;\r\n\t\tthis.pagina\t\t\t= in.readInt();\r\n\t\tthis.ordem\t\t\t= in.readInt();\r\n\t}", "public void mo1505a(Parcelable parcelable) {\n }", "@Override\n\t\t\tpublic void writeToParcel(Parcel arg0, int arg1) {\n\t\t\t\t\n\t\t\t}", "@Override // android.os.Parcelable\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public void writeToParcel(@org.jetbrains.annotations.NotNull android.os.Parcel r3, int r4) {\n /*\n r2 = this;\n java.lang.String r4 = \"parcel\"\n kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r3, r4)\n java.lang.String r4 = r2.title\n r3.writeString(r4)\n java.lang.String r4 = r2.description\n r3.writeString(r4)\n com.avito.android.remote.model.category_parameters.slot.cpa_tariff.CpaSlotButton r4 = r2.button\n r0 = 0\n r4.writeToParcel(r3, r0)\n java.util.Map<java.lang.String, java.lang.String> r4 = r2.attributesAndValues\n if (r4 == 0) goto L_0x003b\n r0 = 1\n java.util.Iterator r4 = a2.b.a.a.a.m0(r3, r0, r4)\n L_0x001e:\n boolean r0 = r4.hasNext()\n if (r0 == 0) goto L_0x003e\n java.lang.Object r0 = r4.next()\n java.lang.Object r1 = r0.getKey()\n java.lang.String r1 = (java.lang.String) r1\n r3.writeString(r1)\n java.lang.Object r0 = r0.getValue()\n java.lang.String r0 = (java.lang.String) r0\n r3.writeString(r0)\n goto L_0x001e\n L_0x003b:\n r3.writeInt(r0)\n L_0x003e:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.avito.android.remote.model.category_parameters.slot.cpa_tariff.CpaTariffSlotConfig.writeToParcel(android.os.Parcel, int):void\");\n }", "@Override\n public void writeToParcel(Parcel dest, int flags) {\n\n }", "@Override\n public void writeToParcel(Parcel parcel, int i) {\n }", "public interface IMedia extends Parcelable {\n\n enum Type {\n MOVIE(\"movie\"), TV(\"tv\");\n\n private String name;\n\n Type(String name) {\n this.name = name;\n }\n\n @Override\n public String toString() {\n return name;\n }\n }\n\n String getBackdropPath();\n\n int[] getGenreIds();\n\n Genre[] getGenres();\n\n long getId();\n\n String getOriginalTitle();\n\n String getTitle();\n\n String getOverview();\n\n String getReleaseDate();\n\n String getPosterPath();\n\n String getHomePage();\n\n float getPopularity();\n\n boolean isVideo();\n\n float getVoteAverage();\n\n int getVoteCount();\n\n VideosResponse getVideos();\n\n Type getType();\n\n Creator<IMedia> CREATOR = new Creator<IMedia>() {\n @Override\n public IMedia createFromParcel(Parcel parcel) {\n String type = parcel.readString();\n if(Type.MOVIE.name.equals(type)){\n return Movie.CREATOR.createFromParcel(parcel);\n }else{\n return TV.CREATOR.createFromParcel(parcel);\n }\n }\n\n @Override\n public IMedia[] newArray(int i) {\n return new IMedia[i];\n }\n };\n\n}", "public interface C0591c extends Parcelable {\n}", "public interface Choiceable extends Parcelable {\n\n String getTitleText();\n\n Long getId();\n\n}", "@Test\n public void inventoryViewModelIsParcelable() {\n setUpInventoryViewModel();\n isPackedAndUnpackedAsParcelSuccessfully();\n }", "@Override\r\n\tpublic void writeToParcel(Parcel dest, int flags)\r\n\t{\n\t\tdest.writeInt(this.id);\r\n\t\tdest.writeString(this.desc);\r\n\t\tdest.writeString(this.titulo_imagem);\r\n\t\tdest.writeString(this.titulo_som);\r\n\t\tdest.writeString(this.ext);\r\n\t\tdest.writeString(\"\" + this.tipo);\r\n\t\tdest.writeInt(this.cmd);\r\n\t\tdest.writeInt((this.atalho) ? 1 : 0);\r\n\t\tdest.writeInt(this.pagina);\r\n\t\tdest.writeInt(this.ordem);\r\n\t\t\r\n\t}", "@Override\n\t\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\t\t\n\t\t}", "public Item createFromParcel(Parcel source) {\n Item item = new Item();\n item.name = source.readString(); \n item.description = source.readString(); \n item.type = source.readString(); \n item.value = source.readString(); \n return item; \n }", "public interface Treasure extends Parcelable {\n Coins getValue();\n String getName();\n Treasure reroll();\n}", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\t\n\t}", "@Override public void writeToParcel(Parcel dest, int flags) { }", "@SuppressWarnings(\"unchecked\")\n protected <V extends Parcelable> V getParcelableExtra( final String name )\n {\n return (V) getIntent().getParcelableExtra( name );\n }", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\n\t}", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\n\t}", "private ParcelableNameValuePair(Parcel in) {\n\t\tname = in.readString();\n\t\tvalue = in.readString();\n\t}", "private void handleInstanceState(Bundle savedInstanceState) {\r\n if (savedInstanceState != null &&\r\n savedInstanceState.containsKey(SAVED_ADAPTER_ITEMS) &&\r\n savedInstanceState.containsKey(SAVED_ADAPTER_KEYS)) {\r\n mAdapterItems = Parcels.unwrap(savedInstanceState.getParcelable(SAVED_ADAPTER_ITEMS));\r\n mAdapterKeys = savedInstanceState.getStringArrayList(SAVED_ADAPTER_KEYS);\r\n } else {\r\n mAdapterItems = new ArrayList<RoomPojo>();\r\n mAdapterKeys = new ArrayList<String>();\r\n }\r\n\r\n\r\n }", "public interface Commentable {\n /**\n * set a comment for the item\n * @param comment string to comment\n */\n public void setComment(String comment);\n\n /**\n * set comment and rating for the item\n * @param comment string comment\n * @param rating int rating\n */\n public void setComment(String comment, int rating);\n\n /**\n * set a rating for the item\n * @param rating int rating\n */\n public void setRating(int rating);\n\n /**\n * returns the comment of the item\n * @return string comment\n */\n public String getComment();\n\n /**\n * returns the rating of the item\n * @return int rating\n */\n public int getRating();\n\n /**\n * very dirty way, simplest mode to make few code and avoid problems with parcelable items\n * @param serializer\n */\n public void setSerializer(Object serializer);//needed to resume without involve the whole tree of classes\n\n}", "@Override\n public void writeToParcel(Parcel dest, int flags)\n {\n dest.writeTypedList(mItems);\n }", "private void readFromParcel(Parcel in){\n name = in.readString();\n phone = in.readString();\n email = in.readString();\n }", "@Override\n public void writeToParcel(Parcel out, int flags){\n out.writeParcelable(history, flags);\n out.writeParcelable(historyValues, flags);\n out.writeParcelable(redoEffects, flags);\n out.writeParcelable(redoParams, flags);\n out.writeMap(images);\n }", "private void extractDataPackage() {\n ArrayList<Parcelable> arrayListBundle = new ArrayList<Parcelable>();\n arrayListBundle = getIntent().getParcelableArrayListExtra(\"usersList\");\n\n UserEntity userEntity;\n StringBuilder builder = new StringBuilder();\n\n for (Parcelable bundle : arrayListBundle) {\n\n //Tracking Data by UserEntity Object ;\n userEntity = (UserEntity) bundle;\n //Set StringBuilder Object ;\n builder.append(userEntity.getId() + \" : \" + userEntity.getUsername() + \" / \" + userEntity.getEmailAddress() + \" / \" + userEntity.getPhoneNumber() + \" / \" + userEntity.getJobTitle() + \"\\n\\n\");\n }\n extractedData = builder.toString();\n }", "@Override\n public void writeToParcel(Parcel dest, int flags) {\n\n dest.writeString(title);\n dest.writeString(content);\n dest.writeString(imagePath);\n dest.writeString(participants);\n dest.writeInt(id);\n }", "public interface TestConfig extends Parcelable {\n\n int getTestSize();\n\n String[] getSubjects();\n\n}", "public VKApiItem(Parcel in) {\n super(in);\n this.id = in.readInt();\n this.owner_id = in.readInt();\n this.title = in.readString();\n this.description = in.readString();\n this.price = in.readParcelable(VKApiPrice.class.getClassLoader());\n this.category = in.readParcelable(VKApiCategory.class.getClassLoader());\n this.date = in.readLong();\n this.availability = in.readInt();\n this.comments = in.readInt();\n this.views_count = in.readInt();\n }", "@Override\r\n\tpublic void writeToParcel(Parcel out, int flags) {\n\t\tout.writeTypedList(items);\r\n\t}", "public void datosBundle()\n {\n //creamos un Bundle para recibir los datos de MascotasFavoritas al presionar el boton de atras en la ActionBar\n Bundle datosBundleAtras = getActivity().getIntent().getExtras();\n //preguntamos si este objeto viene con datos o esta vacio\n if(datosBundleAtras!=null)\n {//si hay datos estos se los agregamos a un ArrayList de mascotas\n mascotas = (ArrayList<Mascota>) datosBundleAtras.getSerializable(\"listamascotasatras\");\n }else{\n //si el bundle No trae datos entonces se inicializara la lista con datos\n validarBundle=1;\n //return;\n }\n }", "private UserAccountInfoParcelableBean(Parcel in) {\n\t\tuserName = in.readString();\n\t\tpassword1 = in.readString();\n\t\tpassword2 = in.readString();\n\t\tfirstName = in.readString();\n\t\tlastName = in.readString();\n\t\teMailAddress = in.readString();\n\t\tuserType = in.readString();\n\t}", "@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 writeToParcel(Parcel parcel_out, int flags) {\n parcel_out.writeInt(id);\n parcel_out.writeString(name);\n parcel_out.writeString(slug);\n }", "private void getIntentValues() {\n\n// itemname= getIntent().getExtras().getString(IntentsConstants.item_name);\n// itemPrice = getIntent().getExtras().getDouble(IntentsConstants.item_price);\n Bundle bundle = getArguments();\n menusItem= (MenusItem) bundle.getSerializable(\"Item\");\n itemname=menusItem.getName();\n itemPrice=menusItem.getPrice();\n\n}", "public interface MapItem extends Serializable {\n /**\n * Ritorna la posizione.\n *\n * @return la posizione in un oggetto di tipo LatLng.\n */\n @NonNull\n LatLng getPosition() throws Exception;\n\n /**\n * Ritorna il titolo, o il nome, dell'item.\n *\n * @return il nome.\n */\n @NonNull\n String getTitle() throws Exception;\n\n /**\n * Ritorna la descrizione.\n *\n * @return la descrizione.\n */\n @NonNull\n String getDescription() throws Exception;\n\n static Function<CsvParser.Row, MapItem> byCsvColumnNames(String latitude, String longitude, String title, String description) {\n return row -> new MapItem() {\n @NonNull\n @Override\n public LatLng getPosition() throws ParserException {\n String lat = row.get(latitude), lng = row.get(longitude);\n return new LatLng(Double.parseDouble(lat), Double.parseDouble(lng));\n }\n\n @NonNull\n @Override\n public String getTitle() throws ParserException {\n return row.get(title);\n }\n\n @NonNull\n @Override\n public String getDescription() throws ParserException {\n return row.get(description);\n }\n };\n }\n}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n dicId = tabList.get(position).getDicId();\n dicName = tabList.get(position).getDicName();\n fatherId = tabList.get(position).getFatherId();\n startActivityForResult(new Intent(Act_CheckTabList.this,Act_CheckGroupItem.class)\n .putExtra(\"projectID\",projectID)\n .putExtra(\"dicId\",dicId)\n .putExtra(\"fatherId\",fatherId)\n //.putParcelableArrayListExtra(\"list\", (ArrayList<? extends Parcelable>) tabList)\n ,Act_CheckGroupItem.RESQUST_CODE_SELECT_CONTENT);\n }", "public void inserSinglePageItemArray(ArrayList<GameItemSingle> argList)\n {\n deletePreviousContent();\n this.getWritableDatabase().beginTransaction();\n\n\n for( GameItemSingle singlePageItem: argList)\n {\n\n ContentValues initialValues = new ContentValues();\n initialValues.put(KEY_ID,singlePageItem.get_id());\n initialValues.put(KEY_DATE,singlePageItem.get_date());\n\n initialValues.put(KEY_DATE_GMT,singlePageItem.getDate_gmt());\n initialValues.put(KEY_GUID_RENDERED,singlePageItem.getGuid_rendered());\n initialValues.put(KEY_MODIFIED,singlePageItem.get_modified());\n initialValues.put(KEY_MODIFIED_GMT,singlePageItem.getModified_gmt());\n initialValues.put(KEY_SLUG,singlePageItem.getSlug());\n initialValues.put(KEY_STATUS,singlePageItem.getStatus());\n initialValues.put(KEY_TYPE,singlePageItem.get_type());\n initialValues.put(KEY_LINK,singlePageItem.get_link());\n initialValues.put(KEY_TITLE_RENDERED,singlePageItem.getTitle_rendered());\n initialValues.put(KEY_CONTENT_RENDERED,singlePageItem.getContent_rendered());\n initialValues.put(KEY_AUTHOR,singlePageItem.getAuthor());\n initialValues.put(KEY_FEATURED_MEDIA,singlePageItem.getFeatured_media());\n initialValues.put(KEY_TEMPLATE,singlePageItem.getTemplate());\n\n initialValues.put(KEY_ACF_ANDROID_APP_URL,singlePageItem.getAcf_android_app_url());\n initialValues.put(KEY_ACF_IPHONE_APP_URL,singlePageItem.getAcf_ipone_app_url());\n initialValues.put(KEY_ACF_AMAZON_APP_URL,singlePageItem.getAcf_amazon_app_url());\n initialValues.put(KEY_ACF_WINDOWS_PHONE_APP_URL,singlePageItem.getAcf_windows_phone_app_url());\n initialValues.put(KEY_ACF_VIDEO_LINK,singlePageItem.getAcf_video_link());\n initialValues.put(KEY_ACF_SOCIAL_FB_URL ,singlePageItem.getAcf_social_fb_url());\n initialValues.put(KEY_ACF_PRESS_KIT_URL,singlePageItem.getAcf_press_kit_url());\n initialValues.put(KEY_APP_ICON,singlePageItem.getApp_icon());\n initialValues.put(KEY_ACF_STREAM_APP_URL,singlePageItem.getAcf_stream_app_url());\n initialValues.put(KEY_ACF_PRINTABLE_PDF,singlePageItem.getAcf_printable_pdf());\n initialValues.put(KEY_ACF_GAME_PRICE,singlePageItem.getAcf_game_price());\n initialValues.put(KEY_ACF_GAME_WALLPAPER,singlePageItem.getAcf_game_wallpaper());\n initialValues.put(KEY_ACF_PROMO_TEXT,singlePageItem.getAcf_promo_text());\n\n initialValues.put(KEY_SCREENSHOOT_MEDIUM1,singlePageItem.getScreenshootMedium1());\n initialValues.put(KEY_SCREENSHOOT_MEDIUM2,singlePageItem.getScreenshootMedium2());\n initialValues.put(KEY_SCREENSHOOT_MEDIUM3,singlePageItem.getScreenshootMedium3());\n initialValues.put(KEY_SCREENSHOOT_MEDIUM4,singlePageItem.getScreenshootMedium4());\n initialValues.put(KEY_SCREENSHOOT_MEDIUM5,singlePageItem.getScreenshootMedium5());\n initialValues.put(KEY_SCREENSHOOT_MEDIUM6,singlePageItem.getScreenshootMedium6());\n initialValues.put(KEY_SCREENSHOOT_MEDIUM7,singlePageItem.getScreenshootMedium7());\n initialValues.put(KEY_SCREENSHOOT_MEDIUM8,singlePageItem.getScreenshootMedium8());\n\n initialValues.put(KEY_SCREENSHOOT_FULL1,singlePageItem.getScreenshootFull1());\n initialValues.put(KEY_SCREENSHOOT_FULL2,singlePageItem.getScreenshootFull2());\n initialValues.put(KEY_SCREENSHOOT_FULL3,singlePageItem.getScreenshootFull3());\n initialValues.put(KEY_SCREENSHOOT_FULL4,singlePageItem.getScreenshootFull4());\n initialValues.put(KEY_SCREENSHOOT_FULL5,singlePageItem.getScreenshootFull5());\n initialValues.put(KEY_SCREENSHOOT_FULL6,singlePageItem.getScreenshootFull6());\n initialValues.put(KEY_SCREENSHOOT_FULL7,singlePageItem.getScreenshootFull7());\n initialValues.put(KEY_SCREENSHOOT_FULL8,singlePageItem.getScreenshootFull8());\n initialValues.put(KEY_FEATURED_IMAGE,singlePageItem.getFeatured_image());\n initialValues.put(KEY_APP_ICON,singlePageItem.getApp_icon());\n this.getWritableDatabase().insert(DATABASE_TABLE_SINGLE_PAGE, null, initialValues);\n }\n this.getWritableDatabase().setTransactionSuccessful();\n this.getWritableDatabase().endTransaction();\n }", "public final /* synthetic */ java.lang.Object createFromParcel(android.os.Parcel r11) {\n /*\n r10 = this;\n int r0 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.validateObjectHeader(r11)\n r1 = 0\n r2 = 0\n r4 = r2\n r7 = r4\n r9 = r7\n r5 = 0\n r6 = 0\n r8 = 0\n L_0x000c:\n int r1 = r11.dataPosition()\n if (r1 >= r0) goto L_0x0059\n int r1 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readHeader(r11)\n int r2 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.getFieldId(r1)\n r3 = 2\n if (r2 == r3) goto L_0x004f\n r3 = 3\n if (r2 == r3) goto L_0x004a\n r3 = 4\n if (r2 == r3) goto L_0x0045\n r3 = 5\n if (r2 == r3) goto L_0x003b\n r3 = 7\n if (r2 == r3) goto L_0x0036\n r3 = 8\n if (r2 == r3) goto L_0x0031\n com.google.android.gms.common.internal.safeparcel.SafeParcelReader.skipUnknownField(r11, r1)\n goto L_0x000c\n L_0x0031:\n java.lang.String r9 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createString(r11, r1)\n goto L_0x000c\n L_0x0036:\n boolean r8 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readBoolean(r11, r1)\n goto L_0x000c\n L_0x003b:\n android.os.Parcelable$Creator<com.google.android.gms.drive.DriveId> r2 = com.google.android.gms.drive.DriveId.CREATOR\n android.os.Parcelable r1 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createParcelable(r11, r1, r2)\n r7 = r1\n com.google.android.gms.drive.DriveId r7 = (com.google.android.gms.drive.DriveId) r7\n goto L_0x000c\n L_0x0045:\n int r6 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readInt(r11, r1)\n goto L_0x000c\n L_0x004a:\n int r5 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readInt(r11, r1)\n goto L_0x000c\n L_0x004f:\n android.os.Parcelable$Creator r2 = android.os.ParcelFileDescriptor.CREATOR\n android.os.Parcelable r1 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createParcelable(r11, r1, r2)\n r4 = r1\n android.os.ParcelFileDescriptor r4 = (android.os.ParcelFileDescriptor) r4\n goto L_0x000c\n L_0x0059:\n com.google.android.gms.common.internal.safeparcel.SafeParcelReader.ensureAtEnd(r11, r0)\n com.google.android.gms.drive.Contents r11 = new com.google.android.gms.drive.Contents\n r3 = r11\n r3.<init>(r4, r5, r6, r7, r8, r9)\n return r11\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.drive.zzc.createFromParcel(android.os.Parcel):java.lang.Object\");\n }", "private void readItems() {\n }", "public void getFromParcel(Parcel in)\n {\n this.clear();\n\n //Récupération du nombre d'objet\n int size = in.readInt();\n\n //On repeuple la liste avec de nouveau objet\n for(int i = 0; i < size; i++)\n {\n MeteoData meteoData = new MeteoData();\n meteoData.setDateDebut(in.readString());\n meteoData.setDateFin(in.readString());\n meteoData.setTemperature(in.readString());\n meteoData.setSymbole(in.readString());\n meteoData.setWindSpeed(in.readString());\n meteoData.setWindDirection(in.readString());\n meteoData.setWindDescription(in.readString());\n meteoData.setClouds(in.readString());\n meteoData.setHumidity(in.readString());\n this.add(meteoData);\n }\n\n\n }", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeInt(id);\n\t\tdest.writeString(baoBeiUrl);\n\t\tdest.writeString(baoBeiName);\n\t\tdest.writeString(baoBeiPhone);\n\t\tdest.writeString(baoBeiSelect);\n\t}", "@Override\n public void writeToParcel(Parcel parcel, int flags) {\n parcel.writeParcelable(mCourse,0);\n parcel.writeString(mTitle);\n parcel.writeString(mText);\n }", "private PassedData(Parcel p) {\n this.a = p.readInt();\n this.b = p.readLong();\n this.c = p.readString();\n }", "@Override\r\n public void writeToParcel(Parcel dest, int flags) {\n dest.writeString(this._id);\r\n dest.writeString(this.code);\r\n dest.writeString(this.company);\r\n dest.writeString(this.direction);\r\n dest.writeString(this.etaGet);\r\n dest.writeString(this.latitude);\r\n dest.writeString(this.locationEnd);\r\n dest.writeString(this.locationStart);\r\n dest.writeString(this.longitude);\r\n dest.writeString(this.name);\r\n dest.writeInt(this.order);\r\n dest.writeString(this.route);\r\n dest.writeString(this.sequence);\r\n dest.writeLong(this.updatedAt);\r\n }", "@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 protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) {\n }", "@Override\n public void writeToParcel(Parcel dest, int flags) {\n dest.writeString(operate_time);\n dest.writeString(operate_name);\n dest.writeString(resume_number);\n dest.writeString(name);\n dest.writeString(echo_yes);\n dest.writeString(sex);\n dest.writeString(year);\n dest.writeString(work_beginyear);\n dest.writeString(high_education);\n dest.writeString(location);\n dest.writeString(pic_filekey);\n dest.writeString(user_id);\n dest.writeString(resume_id);\n dest.writeString(moremajor);\n dest.writeString(isnew);\n }", "public f createFromParcel(Parcel parcel) {\r\n int i = 0;\r\n String str = null;\r\n int b = a.b(parcel);\r\n HashSet hashSet = new HashSet();\r\n String str2 = null;\r\n boolean z = false;\r\n String str3 = null;\r\n String str4 = null;\r\n String str5 = null;\r\n String str6 = null;\r\n String str7 = null;\r\n int i2 = 0;\r\n while (parcel.dataPosition() < b) {\r\n int a = a.a(parcel);\r\n switch (a.a(a)) {\r\n case e.MapAttrs_cameraBearing /*1*/:\r\n i2 = a.f(parcel, a);\r\n hashSet.add(Integer.valueOf(1));\r\n break;\r\n case e.MapAttrs_cameraTargetLat /*2*/:\r\n str7 = a.l(parcel, a);\r\n hashSet.add(Integer.valueOf(2));\r\n break;\r\n case e.MapAttrs_cameraTargetLng /*3*/:\r\n str6 = a.l(parcel, a);\r\n hashSet.add(Integer.valueOf(3));\r\n break;\r\n case e.MapAttrs_cameraTilt /*4*/:\r\n str5 = a.l(parcel, a);\r\n hashSet.add(Integer.valueOf(4));\r\n break;\r\n case e.MapAttrs_cameraZoom /*5*/:\r\n str4 = a.l(parcel, a);\r\n hashSet.add(Integer.valueOf(5));\r\n break;\r\n case e.MapAttrs_uiCompass /*6*/:\r\n str3 = a.l(parcel, a);\r\n hashSet.add(Integer.valueOf(6));\r\n break;\r\n case e.MapAttrs_uiRotateGestures /*7*/:\r\n z = a.c(parcel, a);\r\n hashSet.add(Integer.valueOf(7));\r\n break;\r\n case e.MapAttrs_uiScrollGestures /*8*/:\r\n str2 = a.l(parcel, a);\r\n hashSet.add(Integer.valueOf(8));\r\n break;\r\n case e.MapAttrs_uiTiltGestures /*9*/:\r\n str = a.l(parcel, a);\r\n hashSet.add(Integer.valueOf(9));\r\n break;\r\n case e.MapAttrs_uiZoomControls /*10*/:\r\n i = a.f(parcel, a);\r\n hashSet.add(Integer.valueOf(10));\r\n break;\r\n default:\r\n a.b(parcel, a);\r\n break;\r\n }\r\n }\r\n if (parcel.dataPosition() == b) {\r\n return new f(hashSet, i2, str7, str6, str5, str4, str3, z, str2, str, i);\r\n }\r\n throw new b(\"Overread allowed size end=\" + b, parcel);\r\n }", "private final boolean m123457a(Bundle bundle) {\n List list;\n if (bundle == null) {\n Bundle bundle2 = new Bundle();\n ArrayList arrayList = new ArrayList();\n C33153d a = C33153d.m106972a();\n if (a != null) {\n list = a.mo84910c();\n } else {\n list = null;\n }\n if (list != null) {\n C33153d a2 = C33153d.m106972a();\n C7573i.m23582a((Object) a2, \"MediaManager.instance()\");\n arrayList = (ArrayList) a2.mo84910c();\n }\n String stringExtra = getIntent().getStringExtra(\"file_path\");\n if (getIntent().hasExtra(\"open_sdk_import_media_list\")) {\n arrayList = getIntent().getParcelableArrayListExtra(\"open_sdk_import_media_list\");\n C7573i.m23582a((Object) arrayList, \"intent.getParcelableArra…PEN_SDK_IMPORT_MEDIALIST)\");\n }\n boolean z = false;\n if (!TextUtils.isEmpty(stringExtra) || !arrayList.isEmpty()) {\n String str = \"is_multi_mode\";\n if (arrayList.size() > 1) {\n z = true;\n }\n bundle2.putBoolean(str, z);\n bundle2.putString(\"single_video_path\", stringExtra);\n bundle2.putParcelableArrayList(\"multi_video_path_list\", arrayList);\n bundle2.putParcelable(\"page_intent_data\", getIntent());\n getSupportFragmentManager().mo2645a().mo2585a((int) R.id.cuv, (Fragment) C38650a.m123512a(bundle2)).mo2604c();\n } else {\n finish();\n return false;\n }\n }\n return true;\n }", "public Parcelable mo5381n() {\n throw null;\n }", "@Override\n\tprotected void onSaveInstanceState(Bundle savedInstanceState) {\n\t savedInstanceState.putParcelableArrayList(\"DEALS_PARCEL_ARRAY\", mDeals);\n\t savedInstanceState.putString(\"SEARCH_QUERY\", mQuery);\n\t savedInstanceState.putInt(\"ACTIVE_VIEW_PAGE\", mPager.getCurrentItem());\n\t savedInstanceState.putInt(\"DEALS_PAGE_LOADED\", mDealsPage);\n\t savedInstanceState.putInt(\"DEALS_SELECTED_CITY\", mSelectedCity);\n \t savedInstanceState.putDouble(\"DEALS_SELECTED_CITY_LONG\", mSelectedCityLong);\n\t savedInstanceState.putDouble(\"DEALS_SELECTED_CITY_LAT\", mSelectedCityLat);\n\t savedInstanceState.putDouble(\"DEALS_SELECTED_CITY_MAPZOOM\", mSelectedCityMapZoom);\n\t savedInstanceState.putIntegerArrayList(\"DEALS_SELECTED_CATEGORIES\", mSelectedCategories);\n\t savedInstanceState.putInt(\"DEALS_COUNT\", mDealsCount);\n savedInstanceState.putBoolean(\"NO_MORE_DEALS\", noMoreDeals);\n//\t if (mSplashDialog != null) {\n//\t\t savedInstanceState.putBoolean(\"SHOW_SPLASH_SCREEN\", true);\n//\t } else {\n//\t\t \n//\t }\n\t super.onSaveInstanceState(savedInstanceState);\n\t}", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeString(ID);\n\t\tdest.writeString(Title);\n\t\tdest.writeString(More);\n\t\tdest.writeString(Tag);\n\t\tdest.writeString(PosterUrl);\n\t\tdest.writeString(VideoUrl);\n\t\tdest.writeString(Director);\n\t\tdest.writeString(Actor);\n\t\tdest.writeString(Grade);\n\t\tdest.writeString(Contents);\n\t\tdest.writeString(RunningTime);\n\t\tdest.writeString(HD);\n\t\tdest.writeString(Price);\n\t}", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int pos, long id) {\n DashboardResModel.BookData bookData = (DashboardResModel.BookData) adapterView.getItemAtPosition(pos);\n Bundle bundle = new Bundle();\n bundle.putSerializable(\"data\", bookData);\n FragmentBookInfo fragment = new FragmentBookInfo();\n fragment.setArguments(bundle);\n ((MainActivity) getActivity()).loadFragment(fragment);\n }", "private void extractDataFromBundle() {\n Intent intent = getIntent();\n Bundle bundle = intent.getBundleExtra(MainActivity.PRACTICE_GAME_BUNDLE_KEY);\n\n mDifficulty = (Difficulty) bundle.getSerializable(MainActivity.DIFFICULTY_KEY);\n mPlayerGamePiece = (GamePiece) bundle.getSerializable(MainActivity.GAME_PIECE_KEY);\n\n }", "@Override\r\n protected void onSaveInstanceState(Bundle outState) {\r\n super.onSaveInstanceState(outState);\r\n outState.putParcelable(SAVED_ADAPTER_ITEMS, Parcels.wrap(mRoomRecyclerview.getItems()));\r\n outState.putStringArrayList(SAVED_ADAPTER_KEYS, mRoomRecyclerview.getKeys());\r\n }", "private void addItem() {\n\n ItemBean bean2 = new ItemBean();\n int drawableId2 = getResources().getIdentifier(\"ic_swrl\", \"drawable\", this.getPackageName());\n bean2.setAddress(drawableId2);\n bean2.setName(getResources().getString(R.string.swrl));\n itemList.add(bean2);\n\n ItemBean bean3 = new ItemBean();\n int drawableId3 = getResources().getIdentifier(\"ic_bianmin\", \"drawable\", this.getPackageName());\n bean3.setAddress(drawableId3);\n bean3.setName(getResources().getString(R.string.bianmin));\n itemList.add(bean3);\n\n ItemBean bean4 = new ItemBean();\n int drawableId4 = getResources().getIdentifier(\"ic_shenghuo\", \"drawable\", this.getPackageName());\n bean4.setAddress(drawableId4);\n bean4.setName(getResources().getString(R.string.shenghuo));\n itemList.add(bean4);\n\n ItemBean bean5 = new ItemBean();\n int drawableId5 = getResources().getIdentifier(\"ic_nxwd\", \"drawable\", this.getPackageName());\n bean5.setAddress(drawableId5);\n bean5.setName(getResources().getString(R.string.nxwd));\n// itemList.add(bean5);\n\n }", "protected ArticleListAdapter(Parcel in) {\n listOfArticles = in.createTypedArrayList(Article.CREATOR);\n }", "protected abstract LibraryItem getItemFromFields();", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeString(post_id);\n\t\tdest.writeString(weiba_id);\n\t\tdest.writeString(post_uid);\n\t\tdest.writeString(uname);\n\t\tdest.writeString(title);\n\t\tdest.writeString(content);\n\t\tdest.writeString(post_time);\n\t\tdest.writeString(reply_count);\n\t\tdest.writeString(read_count);\n\t\tdest.writeString(top);\n\t\tdest.writeString(recommend);\n\t\tdest.writeString(avatar_tiny);\n\t\tdest.writeInt(favorite);\n\t}", "@Override\r\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeInt(Id);\r\n\t\tdest.writeString(Name);\r\n\t\tdest.writeFloat(Mark);\r\n\t\tdest.writeString(Type);\r\n\t\tdest.writeParcelable(Image, flags);\r\n\t\tdest.writeString(City);\r\n\t\tdest.writeDouble(Latitude);\r\n\t\tdest.writeDouble(Longitude);\r\n\t}", "protected abstract void loadItemsInternal();", "@Override\r\n public void writeToParcel(Parcel out, int flags) {\r\n out.writeInt(id);\r\n out.writeString(category);\r\n out.writeString(subcategory);\r\n out.writeString(name);\r\n out.writeString(startDate.toString());\r\n out.writeString(endDate.toString());\r\n out.writeInt(datamined ? 1 : 0);\r\n\r\n int rewardCount = 0;\r\n for (int i = 0; i < rewards.length; i++) {\r\n if (rewards[i] != null) {\r\n rewardCount++;\r\n }\r\n }\r\n\r\n out.writeInt(rewardCount);\r\n\r\n for (int i = 0; i < rewards.length; i++) {\r\n if (rewards[i] != null) {\r\n out.writeString(rewards[i].getItem());\r\n out.writeInt(rewards[i].getQty());\r\n out.writeInt(rewards[i].isApproximate() ? 1 : 0);\r\n }\r\n }\r\n }", "@Override\n public void writeToParcel(Parcel dest, int flags) {\n super.writeToParcel(dest, flags);\n }", "public void readFromParcel(Parcel src) {\n\n\t}", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeInt(id);\n\t\tdest.writeInt(user_id);\n\t\tdest.writeString(title);\n\t\tdest.writeString(description);\n\t\tdest.writeSerializable(date);\n\t\tdest.writeSerializable(created_at);\n\t\tdest.writeSerializable(updated_at);\n\t}", "protected void onSaveInstanceState(Bundle savedInstance) {\n\n for (int i = 0; i < numInList; i++) {\n String name = shared.getString(\"ItemName\" + Integer.toString(i), \"\");\n float price = shared.getFloat(\"ItemPrice\" + Integer.toString(i), 0);\n int quantity = shared.getInt(\"ItemQuantity\"+i, 0);\n\n savedInstance.putInt(\"quantity\"+i, quantity);\n }\n }", "private ScheduleWaypoint(Parcel in) {\n\n buddies = new ArrayList<Schedule>();\n\n in.readParcelable(Schedule.class.getClassLoader());\n in.readList(buddies, Course.class.getClassLoader());\n }", "@Override\n public void writeToParcel(Parcel parcel, int i) {\n parcel.writeString(this.names);\n parcel.writeString(this.lastnames);\n parcel.writeInt(this.age);\n }", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeInt(user_id);\n\t\tdest.writeString(title);\n\t\tdest.writeString(desc);\n\t\tdest.writeString(location_ids);\n\t}", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeString(id);\n\t\tdest.writeString(title);\n\t\tdest.writeString(thumb);\n\t\tdest.writeString(path);\n\t}", "public void loadItemNotes(View view, Order_Item item) {\n Intent i = new Intent(getActivity(), item_notes.class);\n b.putSerializable(\"item\", item);\n i.putExtras(b);\n startActivity(i);\n }", "public void readFromParcel(Parcel in) {\n mStreams.clear();\n Parcelable[] parcebleArray = in.readParcelableArray(Stream.class.getClassLoader());\n if(parcebleArray != null) {\n for (Parcelable p : parcebleArray) {\n Stream s = (Stream) p;\n mStreams.add(s);\n }\n }\n }", "@Override\n public Fragment getItem(int position) {\n Fragment curFragment=null;\n Bundle bundle = new Bundle();\n switch (position){\n case 0:\n bundle.putParcelable(Constants.SHARE_DATA_KEYS.MAIN_RVIEW_OFFSET,mAlbumsMainState);\n bundle.putParcelableArray(Constants.SHARE_DATA_KEYS.CHILD_RVIEW_OFFSET,mAlbumsChildStates);\n mAlbums.setArguments(bundle);\n curFragment = mAlbums;\n break;\n case 1:\n bundle.putParcelable(Constants.SHARE_DATA_KEYS.MAIN_RVIEW_OFFSET,mPhotosState);\n mPhotos.setArguments(bundle);\n curFragment = mPhotos;\n break;\n case 2:\n bundle.putParcelable(Constants.SHARE_DATA_KEYS.MAIN_RVIEW_OFFSET,mTripListState);\n mTrips.setArguments(bundle);\n curFragment = mTrips;\n break;\n }\n return curFragment;\n }", "@Test\n public void dashboardViewModelIsParcelable() {\n setUpDashboardViewModel();\n Parcel parcel = Parcel.obtain();\n dashboardViewModel.writeToParcel(parcel, 0);\n parcel.setDataPosition(0);\n DashboardViewModel parceledViewModel = DashboardViewModel.CREATOR.createFromParcel(parcel);\n assertEquals(dashboardViewModel, parceledViewModel);\n }", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeList(lista);\n\t}", "void openViewMore(int code, ArrayList<ItemBox> list){\r\n Intent intent = new Intent(this, ViewMore.class);\r\n intent.putExtra(\"depart_code\", code);\r\n\r\n Bundle b = new Bundle();\r\n b.putSerializable(\"list\", list);\r\n intent.putExtra(\"bundle\", b);\r\n startActivity(intent);\r\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}", "protected modelCartelera(Parcel in) {\n nombre = in.readString();\n descripcion = in.readString();\n id = in.readInt();\n //imagenCartelera = in.readInt();\n }", "@Override\n public void writeToParcel(Parcel parcel, int flags) {\n parcel.writeInt(this.pid);\n parcel.writeInt(this.age);\n parcel.writeInt(this.color);\n parcel.writeInt(this.bpm);\n parcel.writeInt(this.rpm);\n parcel.writeInt(this.o2);\n parcel.writeInt(this.temperature);\n\n parcel.writeByte((byte) (this.nbcContam ? 1 : 0));\n\n parcel.writeString(this.fName);\n parcel.writeString(this.lName);\n parcel.writeString(this.ssn);\n parcel.writeString(this.sex);\n parcel.writeString(this.type);\n parcel.writeString(this.ipaddr);\n parcel.writeString(this.src);\n parcel.writeByte((byte) (this.isSelected ? 1 : 0));\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n //ALWAYS CALL THE SUPER METHOD - To be nice!\n super.onSaveInstanceState(outState);\n Log.d(TAG, \"onSaveInstanceState\");\n\t\t/* Here we put code now to save the state */\n outState.putParcelableArrayList(\"savedList\",bag);\n\n }", "@Override\n public void writeToParcel( Parcel dest, int flags )\n {\n dest.writeString( emoticonId );\n dest.writeString( emoticonName );\n dest.writeString( emoticonStatic );\n dest.writeString( emoticonDynamic );\n dest.writeString( packageId );\n dest.writeByteArray( emoticonStaticByte );\n dest.writeByteArray( emoticonDynamicByte );\n dest.writeString( userPhone );\n dest.writeBooleanArray( new boolean[]{ isOnlyBrowse } );\n }", "public void writeToParcel(Parcel parcel, int flags) {\n/* 1845 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Override\n public void writeToParcel(Parcel dest, int flags) {\n dest.writeList(listData);\n }", "Parcelle createParcelle();", "@Override\n\tpublic void onSaveInstanceState(Bundle savedInstanceState) {\n\t\tsavedInstanceState.putParcelableArrayList(cart, shoppingCart);\n\t}", "private void isPackedAndUnpackedAsParcelSuccessfully() {\n Parcel parcel = Parcel.obtain();\n contentViewModel.writeToParcel(parcel, 0);\n parcel.setDataPosition(0);\n ContentViewModel parceledViewModel = ContentViewModel.CREATOR.createFromParcel(parcel);\n assertEquals(contentViewModel, parceledViewModel);\n }", "public interface PIMItem {\n\n public static final int ATTR_NONE = 0;\n public static final int BINARY = 0;\n public static final int BOOLEAN = 1;\n public static final int DATE = 2;\n public static final int EXTENDED_ATTRIBUTE_MIN_VALUE = 0x1000000;\n public static final int EXTENDED_FIELD_MIN_VALUE = 0x1000000;\n public static final int INT = 3;\n public static final int STRING = 4;\n public static final int STRING_ARRAY = 5;\n\n public abstract PIMList getPIMList();\n\n public abstract void commit() throws PIMException;\n\n public abstract boolean isModified();\n\n public abstract int[] getFields();\n\n public abstract byte[] getBinary(int i, int j);\n\n public abstract void addBinary(int i, int j, byte abyte0[], int k, int l);\n\n public abstract void setBinary(int i, int j, int k, byte abyte0[], int l, int i1);\n\n public abstract long getDate(int i, int j);\n\n public abstract void addDate(int i, int j, long l);\n\n public abstract void setDate(int i, int j, int k, long l);\n\n public abstract int getInt(int i, int j);\n\n public abstract void addInt(int i, int j, int k);\n\n public abstract void setInt(int i, int j, int k, int l);\n\n public abstract String getString(int i, int j);\n\n public abstract void addString(int i, int j, String s);\n\n public abstract void setString(int i, int j, int k, String s);\n\n public abstract boolean getBoolean(int i, int j);\n\n public abstract void addBoolean(int i, int j, boolean flag);\n\n public abstract void setBoolean(int i, int j, int k, boolean flag);\n\n public abstract String[] getStringArray(int i, int j);\n\n public abstract void addStringArray(int i, int j, String as[]);\n\n public abstract void setStringArray(int i, int j, int k, String as[]);\n\n public abstract int countValues(int i);\n\n public abstract void removeValue(int i, int j);\n\n public abstract int getAttributes(int i, int j);\n\n public abstract void addToCategory(String s) throws PIMException;\n\n public abstract void removeFromCategory(String s);\n\n public abstract String[] getCategories();\n\n public abstract int maxCategories();\n}", "@Override public java.util.Map getExtra(int status) throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\njava.util.Map _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\n_data.writeInt(status);\nmRemote.transact(Stub.TRANSACTION_getExtra, _data, _reply, 0);\n_reply.readException();\njava.lang.ClassLoader cl = (java.lang.ClassLoader)this.getClass().getClassLoader();\n_result = _reply.readHashMap(cl);\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}", "public void writeToParcel(android.os.Parcel r4, int r5) {\n /*\n r3 = this;\n android.os.ParcelFileDescriptor r0 = r3.zzo\n r1 = 1\n if (r0 != 0) goto L_0x0031\n byte[] r0 = r3.zzr\n if (r0 == 0) goto L_0x0031\n java.io.FileOutputStream r0 = r3.zza()\n if (r0 == 0) goto L_0x0031\n java.io.BufferedOutputStream r2 = new java.io.BufferedOutputStream\n r2.<init>(r0)\n java.io.DataOutputStream r0 = new java.io.DataOutputStream\n r0.<init>(r2)\n byte[] r2 = r3.zzr // Catch:{ IOException -> 0x002e, all -> 0x0029 }\n int r2 = r2.length // Catch:{ IOException -> 0x002e, all -> 0x0029 }\n r0.writeInt(r2) // Catch:{ IOException -> 0x002e, all -> 0x0029 }\n byte[] r2 = r3.zzr // Catch:{ IOException -> 0x002e, all -> 0x0029 }\n r0.write(r2) // Catch:{ IOException -> 0x002e, all -> 0x0029 }\n zza(r0)\n r0 = 1\n goto L_0x0032\n L_0x0029:\n r4 = move-exception\n zza(r0)\n throw r4\n L_0x002e:\n zza(r0)\n L_0x0031:\n r0 = 0\n L_0x0032:\n if (r0 != 0) goto L_0x0035\n goto L_0x0036\n L_0x0035:\n r5 = r5 | r1\n L_0x0036:\n com.google.android.gms.safetynet.zzj.zza(r3, r4, r5)\n r4 = 0\n r3.zzo = r4\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.safetynet.SafeBrowsingData.writeToParcel(android.os.Parcel, int):void\");\n }", "public interface ParcelableNetworkListener extends IInterface {\n byte getListenerState() throws RemoteException;\n\n void onDataReceived(DefaultProgressEvent defaultProgressEvent) throws RemoteException;\n\n void onFinished(DefaultFinishEvent defaultFinishEvent) throws RemoteException;\n\n void onInputStreamGet(ParcelableInputStream parcelableInputStream) throws RemoteException;\n\n boolean onResponseCode(int i, ParcelableHeader parcelableHeader) throws RemoteException;\n\n /* compiled from: Taobao */\n public static abstract class Stub extends Binder implements ParcelableNetworkListener {\n private static final String DESCRIPTOR = \"anetwork.channel.aidl.ParcelableNetworkListener\";\n static final int TRANSACTION_getListenerState = 5;\n static final int TRANSACTION_onDataReceived = 1;\n static final int TRANSACTION_onFinished = 2;\n static final int TRANSACTION_onInputStreamGet = 4;\n static final int TRANSACTION_onResponseCode = 3;\n\n public IBinder asBinder() {\n return this;\n }\n\n public Stub() {\n attachInterface(this, DESCRIPTOR);\n }\n\n public static ParcelableNetworkListener asInterface(IBinder iBinder) {\n if (iBinder == null) {\n return null;\n }\n IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);\n if (queryLocalInterface == null || !(queryLocalInterface instanceof ParcelableNetworkListener)) {\n return new Proxy(iBinder);\n }\n return (ParcelableNetworkListener) queryLocalInterface;\n }\n\n /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v2, resolved type: anetwork.channel.aidl.DefaultProgressEvent} */\n /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v5, resolved type: anetwork.channel.aidl.DefaultFinishEvent} */\n /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v8, resolved type: anetwork.channel.aidl.ParcelableHeader} */\n /* JADX WARNING: type inference failed for: r0v1 */\n /* JADX WARNING: type inference failed for: r0v11 */\n /* JADX WARNING: type inference failed for: r0v12 */\n /* JADX WARNING: type inference failed for: r0v13 */\n /* JADX WARNING: Multi-variable type inference failed */\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public boolean onTransact(int r3, android.os.Parcel r4, android.os.Parcel r5, int r6) throws android.os.RemoteException {\n /*\n r2 = this;\n r0 = 1598968902(0x5f4e5446, float:1.4867585E19)\n r1 = 1\n if (r3 == r0) goto L_0x008c\n r0 = 0\n switch(r3) {\n case 1: goto L_0x0071;\n case 2: goto L_0x0056;\n case 3: goto L_0x0033;\n case 4: goto L_0x001f;\n case 5: goto L_0x000f;\n default: goto L_0x000a;\n }\n L_0x000a:\n boolean r3 = super.onTransact(r3, r4, r5, r6)\n return r3\n L_0x000f:\n java.lang.String r3 = \"anetwork.channel.aidl.ParcelableNetworkListener\"\n r4.enforceInterface(r3)\n byte r3 = r2.getListenerState()\n r5.writeNoException()\n r5.writeByte(r3)\n return r1\n L_0x001f:\n java.lang.String r3 = \"anetwork.channel.aidl.ParcelableNetworkListener\"\n r4.enforceInterface(r3)\n android.os.IBinder r3 = r4.readStrongBinder()\n anetwork.channel.aidl.ParcelableInputStream r3 = anetwork.channel.aidl.ParcelableInputStream.Stub.asInterface(r3)\n r2.onInputStreamGet(r3)\n r5.writeNoException()\n return r1\n L_0x0033:\n java.lang.String r3 = \"anetwork.channel.aidl.ParcelableNetworkListener\"\n r4.enforceInterface(r3)\n int r3 = r4.readInt()\n int r6 = r4.readInt()\n if (r6 == 0) goto L_0x004b\n android.os.Parcelable$Creator<anetwork.channel.aidl.ParcelableHeader> r6 = anetwork.channel.aidl.ParcelableHeader.CREATOR\n java.lang.Object r4 = r6.createFromParcel(r4)\n r0 = r4\n anetwork.channel.aidl.ParcelableHeader r0 = (anetwork.channel.aidl.ParcelableHeader) r0\n L_0x004b:\n boolean r3 = r2.onResponseCode(r3, r0)\n r5.writeNoException()\n r5.writeInt(r3)\n return r1\n L_0x0056:\n java.lang.String r3 = \"anetwork.channel.aidl.ParcelableNetworkListener\"\n r4.enforceInterface(r3)\n int r3 = r4.readInt()\n if (r3 == 0) goto L_0x006a\n android.os.Parcelable$Creator<anetwork.channel.aidl.DefaultFinishEvent> r3 = anetwork.channel.aidl.DefaultFinishEvent.CREATOR\n java.lang.Object r3 = r3.createFromParcel(r4)\n r0 = r3\n anetwork.channel.aidl.DefaultFinishEvent r0 = (anetwork.channel.aidl.DefaultFinishEvent) r0\n L_0x006a:\n r2.onFinished(r0)\n r5.writeNoException()\n return r1\n L_0x0071:\n java.lang.String r3 = \"anetwork.channel.aidl.ParcelableNetworkListener\"\n r4.enforceInterface(r3)\n int r3 = r4.readInt()\n if (r3 == 0) goto L_0x0085\n android.os.Parcelable$Creator<anetwork.channel.aidl.DefaultProgressEvent> r3 = anetwork.channel.aidl.DefaultProgressEvent.CREATOR\n java.lang.Object r3 = r3.createFromParcel(r4)\n r0 = r3\n anetwork.channel.aidl.DefaultProgressEvent r0 = (anetwork.channel.aidl.DefaultProgressEvent) r0\n L_0x0085:\n r2.onDataReceived(r0)\n r5.writeNoException()\n return r1\n L_0x008c:\n java.lang.String r3 = \"anetwork.channel.aidl.ParcelableNetworkListener\"\n r5.writeString(r3)\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: anetwork.channel.aidl.ParcelableNetworkListener.Stub.onTransact(int, android.os.Parcel, android.os.Parcel, int):boolean\");\n }\n\n /* compiled from: Taobao */\n private static class Proxy implements ParcelableNetworkListener {\n\n /* renamed from: a reason: collision with root package name */\n private IBinder f366a;\n\n Proxy(IBinder iBinder) {\n this.f366a = iBinder;\n }\n\n public IBinder asBinder() {\n return this.f366a;\n }\n\n public void onDataReceived(DefaultProgressEvent defaultProgressEvent) throws RemoteException {\n Parcel obtain = Parcel.obtain();\n Parcel obtain2 = Parcel.obtain();\n try {\n obtain.writeInterfaceToken(Stub.DESCRIPTOR);\n if (defaultProgressEvent != null) {\n obtain.writeInt(1);\n defaultProgressEvent.writeToParcel(obtain, 0);\n } else {\n obtain.writeInt(0);\n }\n this.f366a.transact(1, obtain, obtain2, 0);\n obtain2.readException();\n } finally {\n obtain2.recycle();\n obtain.recycle();\n }\n }\n\n public void onFinished(DefaultFinishEvent defaultFinishEvent) throws RemoteException {\n Parcel obtain = Parcel.obtain();\n Parcel obtain2 = Parcel.obtain();\n try {\n obtain.writeInterfaceToken(Stub.DESCRIPTOR);\n if (defaultFinishEvent != null) {\n obtain.writeInt(1);\n defaultFinishEvent.writeToParcel(obtain, 0);\n } else {\n obtain.writeInt(0);\n }\n this.f366a.transact(2, obtain, obtain2, 0);\n obtain2.readException();\n } finally {\n obtain2.recycle();\n obtain.recycle();\n }\n }\n\n public boolean onResponseCode(int i, ParcelableHeader parcelableHeader) throws RemoteException {\n Parcel obtain = Parcel.obtain();\n Parcel obtain2 = Parcel.obtain();\n try {\n obtain.writeInterfaceToken(Stub.DESCRIPTOR);\n obtain.writeInt(i);\n boolean z = true;\n if (parcelableHeader != null) {\n obtain.writeInt(1);\n parcelableHeader.writeToParcel(obtain, 0);\n } else {\n obtain.writeInt(0);\n }\n this.f366a.transact(3, obtain, obtain2, 0);\n obtain2.readException();\n if (obtain2.readInt() == 0) {\n z = false;\n }\n return z;\n } finally {\n obtain2.recycle();\n obtain.recycle();\n }\n }\n\n public void onInputStreamGet(ParcelableInputStream parcelableInputStream) throws RemoteException {\n Parcel obtain = Parcel.obtain();\n Parcel obtain2 = Parcel.obtain();\n try {\n obtain.writeInterfaceToken(Stub.DESCRIPTOR);\n obtain.writeStrongBinder(parcelableInputStream != null ? parcelableInputStream.asBinder() : null);\n this.f366a.transact(4, obtain, obtain2, 0);\n obtain2.readException();\n } finally {\n obtain2.recycle();\n obtain.recycle();\n }\n }\n\n public byte getListenerState() throws RemoteException {\n Parcel obtain = Parcel.obtain();\n Parcel obtain2 = Parcel.obtain();\n try {\n obtain.writeInterfaceToken(Stub.DESCRIPTOR);\n this.f366a.transact(5, obtain, obtain2, 0);\n obtain2.readException();\n return obtain2.readByte();\n } finally {\n obtain2.recycle();\n obtain.recycle();\n }\n }\n }\n }\n}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n orderItemBeans = new ArrayList<OrderItemBean>();\n // 初始化加载待执行血品\n GetMeicineListReq();\n getItem();\n // 初始化加载已完成血糖\n mFinishedShugars = new ArrayList<FinishedShugar>();\n loadGlucoseResults();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n \n /* Get the incoming data from the calling activity */\n String itemKey = getIntent().getStringExtra(\"com.gimranov.zandy.client.itemKey\");\n item = Item.load(itemKey);\n \n // When an item in the view has been updated via a sync, the temporary key may have\n // been swapped out, so we fall back on the DB ID\n if (item == null) {\n String itemDbId = getIntent().getStringExtra(\"com.gimranov.zandy.client.itemDbId\");\n \titem = Item.loadDbId(itemDbId);\n }\n \t\n // Set the activity title to the current item's title, if the title works\n if (item.getTitle() != null && !item.getTitle().equals(\"\"))\n \tthis.setTitle(item.getTitle());\n else\n \tthis.setTitle(\"Item Data\");\n \n ArrayList<Bundle> rows = item.toBundleArray();\n \n /* \n * We use the standard ArrayAdapter, passing in our data as a Bundle.\n * Since it's no longer a simple TextView, we need to override getView, but\n * we can do that anonymously.\n */\n setListAdapter(new ArrayAdapter<Bundle>(this, R.layout.list_data, rows) {\n \t@Override\n \tpublic View getView(int position, View convertView, ViewGroup parent) {\n \t\tView row;\n \t\t\n // We are reusing views, but we need to initialize it if null\n \t\tif (null == convertView) {\n LayoutInflater inflater = getLayoutInflater();\n \t\t\trow = inflater.inflate(R.layout.list_data, null);\n \t\t} else {\n \t\t\trow = convertView;\n \t\t}\n \n \t\t/* Our layout has just two fields */\n \t\tTextView tvLabel = (TextView) row.findViewById(R.id.data_label);\n \t\tTextView tvContent = (TextView) row.findViewById(R.id.data_content);\n \t\t\n \t \t/* Since the field names are the API / internal form, we\n \t \t * attempt to get a localized, human-readable version. */\n \t\ttvLabel.setText(Item.localizedStringForString(\n \t\t\t\t\tgetItem(position).getString(\"label\")));\n \t\t\n \t\tString content = getItem(position).getString(\"content\");\n \t\t\n \t\ttvContent.setText(content);\n \n \t\treturn row;\n \t}\n });\n \n ListView lv = getListView();\n lv.setTextFilterEnabled(true);\n lv.setOnItemClickListener(new OnItemClickListener() {\n \t// Warning here because Eclipse can't tell whether my ArrayAdapter is\n \t// being used with the correct parametrization.\n \t@SuppressWarnings(\"unchecked\")\n \t\t\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n \t\t\t// If we have a click on an entry, do something...\n \t\tArrayAdapter<Bundle> adapter = (ArrayAdapter<Bundle>) parent.getAdapter();\n \t\tBundle row = adapter.getItem(position);\n \t\tif (row.getString(\"label\").equals(\"url\")) {\n \t\t\trow.putString(\"url\", row.getString(\"content\"));\n \t\t\tremoveDialog(DIALOG_CONFIRM_NAVIGATE);\n \t\t\tshowDialog(DIALOG_CONFIRM_NAVIGATE, row);\n \t\t\treturn;\n \t\t} else if (row.getString(\"label\").equals(\"DOI\")) {\n \t\t\tString url = \"http://dx.doi.org/\"+Uri.encode(row.getString(\"content\"));\n \t\t\trow.putString(\"url\", url);\n \t\t\tremoveDialog(DIALOG_CONFIRM_NAVIGATE);\n \t\t\tshowDialog(DIALOG_CONFIRM_NAVIGATE, row);\n \t\t\treturn;\n \t\t} else if (row.getString(\"label\").equals(\"creators\")) {\n \t \tLog.d(TAG, \"Trying to start creators activity\");\n \t \tIntent i = new Intent(getBaseContext(), CreatorActivity.class);\n \t\t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \tstartActivity(i);\n \t \treturn;\n \t\t} else if (row.getString(\"label\").equals(\"tags\")) {\n \t \tLog.d(TAG, \"Trying to start tag activity\");\n \t \tIntent i = new Intent(getBaseContext(), TagActivity.class);\n \t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \tstartActivity(i);\n \t\t\treturn;\n \t \t\t} else if (row.getString(\"label\").equals(\"children\")) {\n \t \t \tLog.d(TAG, \"Trying to start attachment activity\");\n \t \t \tIntent i = new Intent(getBaseContext(), AttachmentActivity.class);\n \t \t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \t \tstartActivity(i);\n \t \t\t\treturn;\n \t \t\t}\n \t\t\n \t\t\t\tToast.makeText(getApplicationContext(), row.getString(\"content\"), \n \t\t\t\tToast.LENGTH_SHORT).show();\n \t}\n });\n \n /*\n * On long click, we bring up an edit dialog.\n */\n lv.setOnItemLongClickListener(new OnItemLongClickListener() {\n \t/*\n \t * Same annotation as in onItemClick(..), above.\n \t */\n \t@SuppressWarnings(\"unchecked\")\n \t\t\tpublic boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {\n \t\t\t// If we have a long click on an entry, we'll provide a way of editing it\n \t\tArrayAdapter<Bundle> adapter = (ArrayAdapter<Bundle>) parent.getAdapter();\n \t\tBundle row = adapter.getItem(position);\n \t\t// Show the right type of dialog for the row in question\n \t\tif (row.getString(\"label\").equals(\"itemType\")) {\n \t\t\t// XXX \n \tToast.makeText(getApplicationContext(), \"Item type cannot be changed.\", \n \t\t\t\tToast.LENGTH_SHORT).show();\n \t\t\t//removeDialog(DIALOG_ITEM_TYPE);\n \t\t\t//showDialog(DIALOG_ITEM_TYPE, row);\n \t\t\treturn true;\n \t\t} else if (row.getString(\"label\").equals(\"children\")) {\n \t \tLog.d(TAG, \"Not starting children activity on click-and-hold\");\n \t \treturn true;\n \t\t} else if (row.getString(\"label\").equals(\"creators\")) {\n \t \tLog.d(TAG, \"Trying to start creators activity\");\n \t \tIntent i = new Intent(getBaseContext(), CreatorActivity.class);\n \t\t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \tstartActivity(i);\n \t \treturn true;\n \t\t} else if (row.getString(\"label\").equals(\"tags\")) {\n \t \tLog.d(TAG, \"Trying to start tag activity\");\n \t \tIntent i = new Intent(getBaseContext(), TagActivity.class);\n \t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \tstartActivity(i);\n \t\t\treturn true;\n \t\t}\n \t\t\tremoveDialog(DIALOG_SINGLE_VALUE);\n \t\tshowDialog(DIALOG_SINGLE_VALUE, row);\n \t\treturn true;\n }\n });\n \n }", "@Override\n public void writeToParcel(Parcel parcel, int i) {\n parcel.writeString(id);\n parcel.writeString(title);\n parcel.writeString(overview);\n parcel.writeString(posterUrl);\n parcel.writeString(userRating);\n parcel.writeString(releaseDate);\n parcel.writeInt(runtime);\n parcel.writeByte((byte) (isFavorite ? 1 : 0));\n parcel.writeTypedList(castList);\n parcel.writeTypedList(reviews);\n parcel.writeTypedList(trailers);\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 }", "static com.qiyukf.nimlib.p470f.p471a.C5826a m23369a(android.os.Parcel r4) {\n /*\n com.qiyukf.nimlib.f.a.a r0 = new com.qiyukf.nimlib.f.a.a\n r1 = 0\n r0.m50001init(r1)\n int r2 = r4.readInt()\n r0.f18499a = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x001d\n byte[] r2 = r4.createByteArray()\n java.nio.ByteBuffer r2 = java.nio.ByteBuffer.wrap(r2)\n r0.f18501c = r2\n L_0x001d:\n int r2 = r4.readInt()\n r0.f18500b = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x0061\n byte[] r4 = r4.createByteArray()\n int r3 = r0.f18500b\n if (r3 <= 0) goto L_0x005c\n int r1 = r0.f18500b\n if (r1 != r2) goto L_0x0049\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4)\n r0.f18502d = r4\n java.nio.ByteBuffer r4 = r0.f18502d\n r4.position(r2)\n goto L_0x0068\n L_0x0049:\n int r1 = r0.f18500b\n java.nio.ByteBuffer r1 = java.nio.ByteBuffer.allocate(r1)\n r0.f18502d = r1\n java.nio.ByteBuffer r1 = r0.f18502d\n r1.put(r4)\n goto L_0x0068\n L_0x005c:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4, r1, r2)\n goto L_0x0065\n L_0x0061:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.allocate(r1)\n L_0x0065:\n r0.f18502d = r4\n L_0x0068:\n boolean r4 = m23372b(r0)\n if (r4 == 0) goto L_0x006f\n return r0\n L_0x006f:\n int r4 = r0.f18500b\n if (r4 <= 0) goto L_0x007d\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n r4.put(r1, r0)\n goto L_0x00a2\n L_0x007d:\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n java.lang.Object r4 = r4.get(r1)\n com.qiyukf.nimlib.f.a.a r4 = (com.qiyukf.nimlib.p470f.p471a.C5826a) r4\n if (r4 == 0) goto L_0x00a2\n java.nio.ByteBuffer r1 = r4.f18502d\n java.nio.ByteBuffer r0 = r0.f18502d\n r1.put(r0)\n boolean r0 = m23372b(r4)\n if (r0 == 0) goto L_0x00a2\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r0 = f18504a\n int r1 = r4.f18499a\n r0.remove(r1)\n return r4\n L_0x00a2:\n r4 = 0\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.qiyukf.nimlib.p470f.p471a.C5826a.C5829b.m23369a(android.os.Parcel):com.qiyukf.nimlib.f.a.a\");\n }", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeString(vooleAuth);\n\t\tdest.writeString(authCompile);\n\t\tdest.writeString(vooleAgent);\n\t\tdest.writeString(agentCompile);\n\t\tdest.writeString(agentLibs);\n\t\tdest.writeString(upgradeVersion);\n\t\tdest.writeString(terminaLogVersion);\n\t\tdest.writeString(apkStartType);\n\t\tdest.writeString(isAuth);\n\t\tdest.writeString(deviceid);\n\t\tdest.writeString(sn);\n\t\tdest.writeString(sdkModuleVersion);\n\t\tdest.writeString(sdkModuleType);\n\t\tdest.writeString(packageName);\n\t\tdest.writeParcelable(info, PARCELABLE_WRITE_RETURN_VALUE);\n\t}", "protected abstract void makeItem();", "private List<BaseModel> getPreparedItemDate() {\n\n List<BaseModel> itemList = new ArrayList<>();\n itemList.add(new Movie(\"Mad Max: Fury Road\", \"Action & Adventure\", \"2015\"));\n itemList.add(new User(R.mipmap.ic_launcher, \"Vinay\"));\n itemList.add(new RectHeader(\"http://hippy.in/wp-content/uploads/old-bollywood-movie-posters-for-sale-mughal-e-azam.jpg\", \" Mughal-E-Azam\"));\n itemList.add(new Header(\"Header \"));\n itemList.add(new User(R.drawable.ic_avatar_male_1, \"Yogendra\"));\n itemList.add(new Movie(\"Apane\", \"Family\", \"2009\"));\n itemList.add(new Header(\"Header \"));\n itemList.add(new User(R.drawable.ic_avatar_female, \"Shakila\"));\n itemList.add(new User(R.mipmap.ic_launcher, \"Kishor\"));\n itemList.add(new User(R.drawable.ic_avatar_male_1, \"Pawan\"));\n itemList.add(new Header(\"Header \"));\n itemList.add(new Movie(\"BOSS\", \"Actios\", \"2012\"));\n itemList.add(new RectHeader(\"https://cdn.shopify.com/s/files/1/0747/3829/products/mNS0678_1024x1024.jpg?v=1502489793\", \" Barfi\"));\n itemList.add(new Movie(\"YES\", \"Romanse\", \"2005\"));\n itemList.add(new Movie(\"Baby\", \"Actios\", \"2014\"));\n itemList.add(new RectHeader(\"https://cdn.shopify.com/s/files/1/0747/3829/products/mNS0681_1024x1024.jpg?v=1502406836\", \" BHaag Milkha Bhaag\"));\n itemList.add(new Header(\"Header \"));\n itemList.add(new RectHeader(\"https://static-koimoi.akamaized.net/wp-content/new-galleries/2015/11/ghayal-once-again-movie-poster-3.jpg\", \" Ghayal-Once-Again\"));\n itemList.add(new Header(\"Header \"));\n itemList.add(new User(R.drawable.ic_avatar_female, \"Kiran\"));\n itemList.add(new Header(\"Header \"));\n return itemList;\n }", "public void readFromParcel(Parcel in) {\n\t\tList<Shout> tempList = new ArrayList<Shout>();\r\n\t\tin.readList(tempList, Shout.class.getClassLoader());\r\n\t\tprocessedlast = in.readInt();\r\n\t}" ]
[ "0.6352748", "0.63305175", "0.63287014", "0.6285225", "0.6236257", "0.62093014", "0.6202414", "0.6179538", "0.6150787", "0.6113592", "0.6085015", "0.605195", "0.60475254", "0.60347116", "0.5970246", "0.59634316", "0.59491163", "0.5898552", "0.58952963", "0.58952963", "0.5878841", "0.58425564", "0.5819128", "0.5805934", "0.5788912", "0.57774657", "0.5775109", "0.57383704", "0.57212317", "0.57068473", "0.57050806", "0.5699915", "0.56996906", "0.5683511", "0.56538963", "0.5649666", "0.5630297", "0.5615467", "0.56149167", "0.56145906", "0.55941087", "0.55858475", "0.5576258", "0.5570845", "0.5567655", "0.5542781", "0.5538065", "0.552109", "0.5519224", "0.5517608", "0.5505441", "0.55006725", "0.5485918", "0.5472142", "0.5465095", "0.54619586", "0.5461664", "0.54611564", "0.5457002", "0.54543114", "0.5447531", "0.54411715", "0.5431285", "0.5431213", "0.54232347", "0.5395536", "0.5385955", "0.5377718", "0.53767806", "0.5376455", "0.53761894", "0.53705364", "0.5369779", "0.5368069", "0.5366434", "0.5358685", "0.53535783", "0.5352173", "0.5337571", "0.5329869", "0.53145045", "0.53127426", "0.5310549", "0.530884", "0.5302068", "0.53018975", "0.53006804", "0.52998203", "0.52985317", "0.52938694", "0.5293835", "0.52897465", "0.52888304", "0.5284993", "0.5281998", "0.5269425", "0.52669764", "0.52660906", "0.52586794", "0.5257393", "0.5249355" ]
0.0
-1
private EntityManager em = DAOGeneral.getManager(); Constructor that is invoked when page is invoked without a session.
public SnippetBook() { MyAuthenticatedWebSession app_session = MyAuthenticatedWebSession.getYourAppSession(); logger.info("web session is: "+app_session.toString()); EntityManager em = app_session.getEntityManager(); List<Snip> tmp_snip_list= em.createQuery( "SELECT s FROM Snip s WHERE users.id = :userID") .setParameter("userID", app_session.getAttribute("user")) .getResultList(); //TODO: set max result number //logger.info(((Snip)tmp_snip_list.get(0)).getCode()); /*AuthenticatedWebApplication.get(). Class<? extends Session> session_class = getSession();.getClass(); getSession().getApplication().getSessionStore(); */ // Add comment form add(new SnippetForm("commentForm")); // Add commentListView of existing comments add(new PropertyListView<Snip>("comments", snipList) { @Override public void populateItem(final ListItem<Snip> listItem) { //logger.info(listItem.toString()); listItem.add(new Label("date")); listItem.add(new MultiLineLabel("code")); } }).setVersioned(false); Collections.reverse(tmp_snip_list); snipList.addAll(tmp_snip_list); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected EntityManager getEntityManager() {\n\t return em;\n\t}", "@Override\n protected EntityManager getEntityManager() {\n return em;\n }", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn em;\n\t}", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn em;\n\t}", "protected EntityManager getEntityManager() {\n return em;\n }", "@Override\n\tpublic EntityManager getEntityManager() {\n\t return em;\n\t}", "static EntityManager getEntityManager(){\n return ENTITY_MANAGER_FACTORY.createEntityManager();\n }", "protected WorkToSubjectEntityDAO(EntityManager em) {\n\n this.em = em;\n }", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn entityManager;\n\t}", "private EntityManagerProvider(){}", "@Override\n public EntityManager getEntityManager() {\n return entityManager;\n }", "public EntityManager getEm() {\n\t\treturn em;\n\t}", "public EntityManager getEntityManager() {\n return this.em;\n }", "public RequisicaoDAO() {\n em = JPAUtil.initConnection();\n }", "protected abstract EntityManager getEntityManager();", "public SettlementBean() {\r\n entitymanagerbean = new EntityManagerBean();\r\n }", "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 }", "private AdminEntity() {\n \tsuper();\n\n this.emf = Persistence.createEntityManagerFactory(\"entityManager\");\n\tthis.em = this.emf.createEntityManager();\n\tthis.tx = this.em.getTransaction();\n }", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn null;\n\t}", "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}", "private static void init(){\n entityManager = HibernateUtil.getEntityManager();\n transaction = entityManager.getTransaction();\n }", "public EntityManager getEntityManager() {\r\n return entityManager;\r\n }", "public void setEntityManager(EntityManager em) {\n this.em = em;\n }", "protected EntityManager getEntityManager() {\n return emf.createEntityManager();\n }", "public final static EntityManager getEntityManager() {\r\n\t\treturn entityManager;\r\n\t}", "protected EntityManager getEntityManager() {\n return this.entityManager;\n }", "public CircuitJpaDAO(EntityManager entityManager) {\n\t\tem = entityManager;\n\t}", "abstract E getEntityManager();", "public EntityManager getEntityManager() {\r\n\t\treturn entityManager;\r\n\t}", "public EntityManager getEntityManager() {\r\n\t\treturn entityManager;\r\n\t}", "public EntityManager getEntityManager() {\r\n\t\treturn entityManager;\r\n\t}", "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}", "@PersistenceContext\r\n public void setEntityManager(EntityManager em) {\r\n this.em = em;\r\n }", "public void setEntityManager(EntityManager em) {\n\t\tthis.em = em;\n\t}", "@Inject\n\tpublic AlunoDAO(EntityManager entityManager) {\n\t\tthis.entityManager = entityManager;\n\t}", "public abstract void setEntityManager(EntityManager em);", "@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 }", "@PersistenceContext\r\n\tpublic void setEntityManager(EntityManager em) {\r\n\t\tthis.em = em;\r\n\t}", "public UserDAO(EntityManager instance){\n\t\t\tsuper(instance);\n\t\t}", "public EntityManager getEntityManager() {\n\t\treturn entityManager;\n\t}", "public EntityManager getEntityManager() {\n\t\treturn entityManager;\n\t}", "public EntityManager getEntityManager() {\n\t\treturn entityManager;\n\t}", "public EntityManager getEntityManager() {\n\t\treturn entityManager;\n\t}", "DAOClienteJPA(EntityManager entity) {\r\n this.entity = entity;\r\n }", "@Override\r\n\tpublic EntityManager getEntityManger() {\n\t\treturn em;\r\n\t}", "public BOEmpresa() {\r\n\t\tdaoEmpresa = new DAOEmpresaJPA();\r\n\t}", "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 EditorialBean() {\r\n editorialDAOImp = new EditorialDAOImp();\r\n editorial = new Editorial();\r\n }", "public static EntityManager getEntityManager() {\n EntityManager em = tl.get();\n return em;\n }", "public FuncaoCasoDAOImpl() {\n\t\tsetSession(HibernateUtil.getSessionFactory());\n\t}", "@NotNull\n public StationDaoJpa(final EntityManager em)\n {\n this.entityManager = em;\n }", "public void setEntityManager(final EntityManager em) {\n this.em = em;\n }", "public SPManager() {\n \tmyCon = new DBManager();\n }", "@Autowired\n\tpublic EmployeeDAOJpaImpl(EntityManager theEntityManager) {\n\t\tentityManager = theEntityManager;\n\t}", "@PersistenceContext(unitName=\"microrest-persistence\")\n public void setPersistenceContext(EntityManager em)\n {\n this.em = em;\n }", "@Override\n\t@PersistenceContext(unitName=\"PU-POC\")\t\n\tpublic void setEntityManager(EntityManager entityManager) {\n\t\tsuper.setEntityManager(entityManager);\n\t}", "@Autowired\n public SubCategoryDAOImpl(EntityManager theEntityManager) {\n\n entityManager = theEntityManager;\n }", "public void setEm(EntityManager em) {\n\t\tthis.entity = em;\n\t}", "public EmpleadoService() {\n super();\n emf = Persistence.createEntityManagerFactory(\"up_h2\");\n empDAO = new EmpleadoDAO(emf);\n }", "public EntityManager getEM() {\n\t\treturn this.entity;\n\t}", "public EntidadFinancieraDAO(EntityManager entityManager) {\r\n\t\tthis.entityManager = entityManager;\r\n\t}", "private static PersistenceSession getPersistenceSession() {\n return NakedObjectsContext.getPersistenceSession();\n }", "EntityManager createEntityManager();", "public EntityManager getEntityManager() {\n\t\treturn this.entityManager;\n\t}", "public UsuarioDao(EntityManager entityManager){\r\n\t\tsuper(entityManager);\r\n\t}", "SessionManagerImpl() {\n }", "public static EntityManagerFactory getConnection() {\r\n return emf;\r\n }", "protected\r\n JpaDaoFactory()\r\n {\r\n ISessionStrategy mySessionStrategy = new JpaSessionStrategy();\r\n ITransactionStrategy myTransactionStrategy = \r\n new JpaTransactionStrategy(mySessionStrategy);\r\n\r\n setSessionStrategy(mySessionStrategy);\r\n setTransactionStrategy(myTransactionStrategy);\r\n }", "public Session(){\n\t\tdb = ALiteOrmBuilder.getInstance().openWritableDatabase();\n\t\texternalsCallbacks = new ArrayList<EntityListener>();\n\t}", "public ImageController() {\n em = EMF.createEntityManager();\n }", "public AdminDAO()\n {\n con = DataBase.getConnection();//crear una conexión al crear un objeto AdminDAO\n }", "public TermDAOImpl(){\n connexion= new Connexion();\n }", "public TbAdminMenuDAOImpl() {\n super();\n }", "@Autowired\n\tpublic EmployeeDAOHibernateImpl(EntityManager entityManager) {\n\t\tthis.entityManager = entityManager;\n\t}", "public interface EntityManagerCreator {\n EntityManager createEntityManager();\n}", "private static AdapterManager getAdapterManager() {\r\n return getPersistenceSession().getAdapterManager();\r\n }", "public BookJPAImpl(TxDAOFactoryImpl factory) {\n\t\t//emf = Persistence.createEntityManagerFactory(\"sistemiDistribuitiLS\");\n\t\tthis.em = factory.getEntityManager();\n\t}", "public McqOfficialSession(){\n\t\tsuper(); \n\t}", "@Override\n\tpublic void init() throws ServletException {\n\t\tsuper.init();\n\t\tObject object=getServletContext().getAttribute(\"entitymanagerfactory\");\n\n\t\tif(object==null){\n\t\t\temf=Persistence.createEntityManagerFactory(\"10-em-jsp\");\n\t\t\tgetServletContext().setAttribute(\"entitymanagerfactory\", emf);\n\t\t}else {\n\t\t\temf=(EntityManagerFactory) object;\n\t\t}\n\t\tservice=new StudentService(emf.createEntityManager());\n\t}", "protected CompanyJPA() {\n\t}", "private DaoManager() {\n }", "public CustomerJPAImpl(EntityManagerFactory emfPassed) {\n\t\temf = emfPassed;\n\t}", "public UbahGolonganGUI(EntityManager em) {\n initComponents();\n this.em = em;\n this.binding();\n }", "private OrderFacade(){\n\t\tAbstractDAOFactory f = new MySQLDAOFactory();\n \tthis.odao = f.getOrderDAO();\n\t}", "@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 MainSessionBean() {\r\n init();\r\n }", "public static AuthorAcess createEntity(EntityManager em) {\n AuthorAcess authorAcess = new AuthorAcess()\n .requestLogin(DEFAULT_REQUEST_LOGIN);\n return authorAcess;\n }", "private ArticleMgr() {\r\n\r\n\t}", "public CommonDaoImpl(JpaEntityInformation<T, ID> entityInformation, EntityManager em) {\r\n\t\tsuper(entityInformation, em);\r\n\t\tthis.entityManager = em;\r\n//\t\tthis.entityInformation = entityInformation;\r\n\t}", "public Session getSession() throws DAOException {\n // Injection fails for this non-managed class.\n DAOException ex = null;\n String pu = PERSISTENCE_UNIT;\n if(session == null || !em.isOpen()) {\n session = null;\n try {\n em = (EntityManager)new InitialContext().lookup(pu);\n } catch(Exception loopEx) {\n ex = new DAOException(loopEx);\n logger.error(\"Persistence unit JNDI name \" + pu + \" failed.\");\n }\n }\n\n getHibernateSession();\n if(ex != null) {\n ex.printStackTrace();\n }\n return session;\n }", "public static About createEntity(EntityManager em) {\n About about = new About();\n return about;\n }", "public EpAssetsDAOImpl() {\n super();\n }", "public void setEntityManager(EntityManager entityManager) {\n\t\tthis.entityManager = entityManager;\n\t}", "public void setEntityManager(EntityManager entityManager) {\n\t\tthis.entityManager = entityManager;\n\t}", "@PostConstruct\r\n\tpublic void init(){\r\n\t\tcom = new Comentarios();\r\n\t\tlistComentarios = comDao.getComentarios();\r\n\t}", "public NationalityDAO() {\n //sessionFactory = HibernateUtil.getSessionFactory();\n session=HibernateUtil.openSession();\n }", "public empresaDAO(){\r\n \r\n }", "@Override\n public GenericManager<Societe, Long> getManager() {\n return manager;\n }", "private PersistenceManager getPersistenceManager() {\n if(pmf==null) {\n getFacetHolder().getServiceInjector().injectServicesInto(this);\n }\n return pmf.getPersistenceManagerFactory().getPersistenceManager();\n }" ]
[ "0.7041094", "0.69883984", "0.6941129", "0.6941129", "0.6809824", "0.6802529", "0.6739876", "0.67268175", "0.6683626", "0.66758156", "0.6600909", "0.6580875", "0.6575373", "0.65355855", "0.6531087", "0.6516418", "0.6514423", "0.6470734", "0.64706993", "0.6466512", "0.6459248", "0.6436782", "0.63847643", "0.6383013", "0.6325263", "0.6309214", "0.6291503", "0.62722725", "0.62545925", "0.62545925", "0.62545925", "0.6241193", "0.62314385", "0.6229358", "0.6229159", "0.620771", "0.6199411", "0.6199411", "0.6199411", "0.6190344", "0.618978", "0.61869794", "0.61869794", "0.61869794", "0.61869794", "0.6163117", "0.616298", "0.61481094", "0.61385655", "0.613356", "0.6124984", "0.61105806", "0.6100275", "0.6095923", "0.6080223", "0.6078015", "0.60739136", "0.6046264", "0.60384", "0.6035294", "0.6022413", "0.598302", "0.5974234", "0.59699076", "0.5947006", "0.59413934", "0.5915298", "0.5899335", "0.5883743", "0.58704895", "0.58684844", "0.5864994", "0.5855932", "0.58418775", "0.5816426", "0.5813754", "0.5799359", "0.5797841", "0.5783942", "0.57828164", "0.5780696", "0.5773987", "0.5765324", "0.5752803", "0.5749029", "0.5728754", "0.57272184", "0.57162446", "0.5699075", "0.56969595", "0.56875205", "0.56844395", "0.56774706", "0.5671803", "0.5665171", "0.5665171", "0.56630456", "0.5661678", "0.56610996", "0.5653149", "0.5648564" ]
0.0
-1
Show the resulting valid edit
@Override @Transactional public void onSubmit() { ValueMap values = getModelObject(); // check if the honey pot is filled if (StringUtils.isNotBlank((String)values.get("comment"))) { error("Caught a spammer!!!"); return; } // Construct a copy of the edited comment Snip snip = new Snip(); SnipMeta meta= new SnipMeta(); logger.info(this.getDefaultModel().toString()); logger.info(((List<String>) values.get("select_all")).toString()); meta.setTags((ArrayList<String>)values.get("select_all")); meta.setDescription((String) values.get("meta")); // Set date of comment to add snip.setDate(new Date()); snip.setCode((String)values.get("code")); snipList.add(0, snip); //TODO: eliminare lo show di tutti gli snipp da snipList magari con una FIFO meta.setSnip(snip); //--------- get session ad manager ------ MyAuthenticatedWebSession app_session = MyAuthenticatedWebSession.getYourAppSession(); logger.info("web session is: "+app_session.toString()); EntityManager em = app_session.getEntityManager(); //--------------------------------------------------- Users tmp_id = em.find(Users.class ,app_session.getAttribute("user")); //snip.setUser(app_session.getCurrentUser()); --less network more backend snip.setUser(tmp_id); em.getTransaction().begin(); em.setFlushMode(COMMIT); em.persist(snip); em.persist(meta); em.flush(); em.getTransaction().commit(); // Clear out the text component values.put("code", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showThatEditable() {\n\t\tTextView tv = new TextView(this);\n\t\ttv.setText(\"You may now edit this recipe!\");\n\t\tAlertDialog.Builder alert = new AlertDialog.Builder(this);\n\t\talert.setTitle(\"Edit Mode\");\n\t\talert.setView(tv);\n\t\talert.setNegativeButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int whichButton) {\n\t\t\t}\n\t\t});\n\t\talert.show();\n\t}", "private void edit() {\n\n\t}", "@Override\r\n\tpublic void edit() {\n\t\t\r\n\t}", "private void edit() {\n mc.displayGuiScreen(new GuiEditAccount(selectedAccountIndex));\n }", "public String editar()\r\n/* 59: */ {\r\n/* 60: 74 */ if ((getMotivoLlamadoAtencion() != null) && (getMotivoLlamadoAtencion().getIdMotivoLlamadoAtencion() != 0)) {\r\n/* 61: 75 */ setEditado(true);\r\n/* 62: */ } else {\r\n/* 63: 77 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_seleccionar\"));\r\n/* 64: */ }\r\n/* 65: 79 */ return \"\";\r\n/* 66: */ }", "public boolean shouldEditButtonBePresent();", "boolean isEdit();", "private void showThatNotEditable() {\n\t\tTextView tv = new TextView(this);\n\t\ttv.setText(\"Only the original creator may edit their recipe!\");\n\t\tAlertDialog.Builder alert = new AlertDialog.Builder(this);\n\t\talert.setTitle(\"Sorry\");\n\t\talert.setView(tv);\n\t\talert.setNegativeButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int whichButton) {\n\t\t\t}\n\t\t});\n\t\talert.show();\n\t}", "public void editOperation() {\n\t\t\r\n\t}", "public boolean canEdit() {\r\n\t\treturn !dslView.isContainsErrors();\r\n\t}", "public String edit() {\n return \"edit\";\n }", "public abstract void edit();", "public void DoEdit() {\n \n int Row[] = tb_User.getSelectedRows();\n if (Row.length > 1) {\n JOptionPane.showMessageDialog(null, \"You can choose only one user edit at same time!\");\n return;\n }\n if (tb_User.getSelectedRow() >= 0) {\n EditUser eu = new EditUser(this);\n eu.setVisible(true);\n\n } else {\n JOptionPane.showMessageDialog(null, \"You have not choose any User to edit\");\n }\n }", "public String edit() {\r\n\t\tuserEdit = (User) users.getRowData();\r\n\t\treturn \"edit\";\r\n\t}", "private void editMode() {\n\t\t// Set the boolean to true to indicate in edit mode\n\t\teditableEditTexts();\n\t\thideEditDelete();\n\t\thideEmail();\n\t\tshowSaveAndAdd();\n\t\tshowThatEditable();\n\t}", "protected boolean isEdit(){\n\t\treturn getArguments().getBoolean(ARG_KEY_IS_EDIT);\n\t}", "@Override\n protected void validateEdit(Fornecedor post) {\n\n }", "@Override\n public void checkEditing() {\n }", "public void edit() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"editButton\").click();\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 }", "@Test\r\n\tpublic void validEditTest() {\n\t\tadminUserEdit.clickAdminLink();\r\n\t\tadminUserEdit.clickUserListLink();\r\n\t\tadminUserEdit.clickEditUserLink();\r\n\t\t\r\n\t\t// Assertion\r\n\t\tString Actual = adminUserEdit.Assertion();\r\n\t\tString Expected = \"Hari\";\r\n\t\tassertEquals(Actual, Expected);\r\n\t\tscreenShot.captureScreenShot(\"TC019\");\r\n\t}", "public edit() {\n initComponents();\n }", "@Override\r\n\t\tpublic boolean editItem() {\n\t\t\treturn false;\r\n\t\t}", "@Override\n\t\t\t\tpublic String isValid(Object value) {\n\t\t\t\t\treturn \"Editing not allowed!\";\n\t\t\t\t}", "protected abstract void showEditedEntity(Entity e);", "private void performDirectEdit() {\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}", "public void validorolin() {\n if (roli.equals(\"Menaxher\")) {\n madministrimi.setVisible(false);\n }\n\n }", "public String editar()\r\n/* 86: */ {\r\n/* 87:112 */ if (getDimensionContable().getId() != 0)\r\n/* 88: */ {\r\n/* 89:113 */ this.dimensionContable = this.servicioDimensionContable.cargarDetalle(this.dimensionContable.getId());\r\n/* 90:114 */ String[] filtro = { \"indicadorValidarDimension\" + getDimension(), \"true\" };\r\n/* 91:115 */ this.listaCuentaContableBean.agregarFiltro(filtro);\r\n/* 92:116 */ this.listaCuentaContableBean.setIndicadorSeleccionarTodo(true);\r\n/* 93:117 */ verificaDimension();\r\n/* 94:118 */ setEditado(true);\r\n/* 95: */ }\r\n/* 96: */ else\r\n/* 97: */ {\r\n/* 98:120 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_seleccionar\"));\r\n/* 99: */ }\r\n/* 100:123 */ return \"\";\r\n/* 101: */ }", "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}", "@Test \n\tpublic void edit() \n\t{\n\t\tassertTrue(true);\n\t}", "void onEditClicked();", "public void verValidarCandidato()\r\n\t{\r\n\t\tcandidato = new ValidarCandidato(this);\r\n\t\tcandidato.setVisible(true);\r\n\t}", "@Override\n\tpublic void editAction(int id) {\n\t\t\n\t}", "private void displayEditMenu()\r\n {\r\n System.out.println();\r\n System.out.println(\"--------- Edit Menu ------------\");\r\n System.out.println(\"(1) Edit Car Colour\");\r\n System.out.println(\"(2) Edit Car Price\");\r\n System.out.println(\"(3) Back to Main Menu\");\r\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"<html><center><u><strong>Edité par :</strong></u><br>RAHMANI ABD EL KADER<br>SEIF EL ISLEM<br> Groupe 1 Section 1</center></html>\", \"A propros\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t}", "public void clickedPresentationEdit() {\n\t\tif(mainWindow.getSelectedRowPresentation().length <= 0) ApplicationOutput.printLog(\"YOU DID NOT SELECT ANY PRESENTATION\");\n\t\telse if(mainWindow.getSelectedRowPresentation().length > 1) ApplicationOutput.printLog(\"Please select only one presentation to edit\");\n\t\telse {\n\t\t\tshowPresentationDetails(mainWindow.getSelectedRowPresentation()[0]);\n\t\t}\t\n\t}", "public void mmEditClick(ActionEvent event) throws Exception{\r\n displayEditProfile();\r\n }", "public String edit() throws Exception {\r\n\t\tgetNavigationPanel(2);\r\n\t\tExpensesCategoryModel model = new ExpensesCategoryModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tmodel.getExpenseSearch(expenses);\r\n\t\tmodel.getData(expenses, request);\r\n\t\texpenses.setOnLoadFlag(true);\r\n\t\texpenses.setCancelFlg(\"true\");\r\n\t\texpenses.setPageFlag(\"true\");\r\n\r\n\t\texpenses.setPanelFlag(\"2\");\r\n\t\texpenses.setRetrnFlag(\"success\");\r\n\r\n\t\tmodel.terminate();\r\n\t\treturn \"success\";\r\n\r\n\t}", "public String toEdit() {\n\t\t HttpServletRequest request = (HttpServletRequest) FacesContext\n\t\t\t\t\t.getCurrentInstance().getExternalContext().getRequest();\n\t\t\t String idf = request.getParameter(\"idf\");\n\t log.info(\"----------------------------IDF--------------\"+idf);\n\t\t\treturn \"paramEdit?faces-redirect=true&idf=\"+idf;\n\t\n\t}", "public boolean isEditable() {\n \t\treturn true;\n \t}", "public Resolution displayEdit() throws Exception {\r\n List<Organization> list = myIsern.getOrganizationsList();\r\n Organization editOrganization = new Organization();\r\n boolean found = false;\r\n for (Organization organization : list) {\r\n if (organization.getName().equals(this.name.replace('_', ' '))) {\r\n editOrganization = organization;\r\n found = true;\r\n }\r\n }\r\n\r\n if (found) {\r\n this.type = editOrganization.getType();\r\n this.contact = editOrganization.getContact();\r\n this.affiliatedResearchers = this.converter.listToString(editOrganization\r\n .getAffiliatedResearchers().getAffiliatedResearcher());\r\n this.country = editOrganization.getCountry();\r\n this.researchKeywords = this.converter.listToString(editOrganization.getResearchKeywords()\r\n .getResearchKeyword());\r\n this.researchDescription = editOrganization.getResearchDescription();\r\n this.homePage = editOrganization.getHomePage();\r\n\r\n this.editing = true;\r\n }\r\n return new ForwardResolution(EDIT_ORG_PAGE);\r\n }", "public java.lang.Boolean getEdit() {\n return edit;\n }", "public Boolean getEditar() {\r\n\t\treturn editar;\r\n\t}", "public abstract void checkEditing();", "public boolean hasEditError() {\n return (errors.hasError(Error.EDITED_PROFILE_INCOMPLETE)\n || errors.hasError(Error.EDITED_FRONTEND_INVALID)\n || errors.hasError(Error.EDITED_COLLECTION_INVALID)\n || errors.hasError(Error.EDITED_PROFILE_NAME_EXISTS));\n }", "public Boolean getEditFlag() {\n return editFlag;\n }", "@Override\r\n protected boolean canEdit(Object element) {\n return true;\r\n }", "@FXML\n\tprivate void handleEdit() {\n\t\tCustomer customer = customerTable.getSelectionModel().getSelectedItem();\n\t\tshowCustomerInfoDialog(customer);\n\t}", "boolean isEditable();", "public void edit_actionPerformed(ActionEvent e) {\n\t\t\n\t\tif (edit.isSelected()) {\n\t\t\t\n\t\t\teditor.validate();\n\t\t\teditor.repaint();\n\t\t\t\n\t\t\t//Reset edit components values\n\t\t\tresetEdit();\n\t\t\t\n\t\t\t//Configure editor panel\n\t\t\tinitEditorPanel();\n\t\t\t\n\t\t\tmyParent.editCM = true;\n\t\t\tmyParent.extendCM = false;\n\t\t\tmyParent.mullionsPanel.selectedHV = 0;\n\n //Setting type action event\n myParent.setActionTypeEvent(MenuActionEventDraw.EDIT_COUPLER_MULLION.getValue());\n\t\t\t\n\t\t\tvC.setSelected(false);\n\t\t\thC.setSelected(false);\n\t\t\tvC.setEnabled(false);\n\t\t\thC.setEnabled(false);\n\t\t\t\n\t\t\tcouplerTypeC.setEnabled(false);\n\t\t\t\n\t\t\tedit.setEnabled(false);\n\t\t\tcancel.setVisible(true);\n\t\t\tcancel.setEnabled(true);\n\t\t\tthis.enableDisableBySeries();\n\t\t\t\n\t\t\twhichFeature.validate();\n\t\t\twhichFeature.repaint();\n\t\t}\n\t}", "@Action\n public void acOk() {\n if (checkFormattedTextFieldNullNoSupposed(jftfCoord1, -1e5, 1e5)) {\n return;\n }\n if (checkFormattedTextFieldNullNoSupposed(jftfCoord2, -1e5, 1e5)) {\n return;\n }\n if (checkTextField(jtfName)) {\n return;\n }\n getTempObj().setType(jcbType.getSelectedIndex());\n getTempObj().setCoord1(getDoubleFromFormattedTextField(jftfCoord1));\n getTempObj().setCoord2(getDoubleFromFormattedTextField(jftfCoord2));\n getTempObj().setName(jtfName.getText());\n setChangeObj(true);\n }", "public boolean isEditable() {\n \treturn model.isEditable();\n }", "public void displayEditResponse(DVD editedDVD) {\n if (editedDVD != null) {\n io.readString(\"DVD successfully edited. Please hit enter to continue.\");\n } else {\n io.print(\"No such DVD. Edit Failed\");\n io.readString(\"Please hit enter to continue.\");\n }\n }", "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 void showEditForm(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n int id = Integer.parseInt(request.getParameter(\"id\"));\n Customer customerEdit = CustomerDao.getCustomer(id);\n RequestDispatcher dispatcher = request.getRequestDispatcher(\"customer/editCustomer.jsp\");\n dispatcher.forward(request, response);\n }", "private void commitEdit (int validValue)\r\n\t{\r\n\t\tm_value = validValue;\r\n\t}", "private void showOldAuthorData() {\n try {\n Author author = authorService.getAuthorById(selectedId);\n nameTxt.setText(author.getName());\n surnameTxt.setText(author.getSurname());\n } catch (Exception ex) {\n Logger.getLogger(EditAuthorFrame.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public void setEdit(java.lang.Boolean edit) {\n this.edit = edit;\n }", "public String loadMainEdit(){\r\n\t\treturn \"edit\";\r\n }", "public void editar() {\n try {\n ClienteDao fdao = new ClienteDao();\n fdao.Atualizar(cliente);\n\n JSFUtil.AdicionarMensagemSucesso(\"Cliente editado com sucesso!\");\n\n } catch (RuntimeException e) {\n JSFUtil.AdicionarMensagemErro(\"ex.getMessage()\");\n e.printStackTrace();\n }\n }", "public void editProfile(View v) {\n //Create map of all old info\n final Map tutorInfo = getTutorInfo();\n\n InputMethodManager imm = (InputMethodManager) this.getSystemService(Service.INPUT_METHOD_SERVICE);\n\n //Create animations\n final Animation animTranslate = AnimationUtils.loadAnimation(this, R.anim.translate);\n final Animation revTranslate = AnimationUtils.loadAnimation(this, R.anim.reverse_translate);\n\n //Enable Bio EditText, change color\n EditText bioField = (EditText) findViewById(R.id.BioField);\n bioField.clearFocus();\n bioField.setTextIsSelectable(true);\n bioField.setEnabled(true);\n bioField.setBackgroundResource(android.R.color.black);\n imm.showSoftInput(bioField, 0);\n\n //Hide edit button\n v.startAnimation(animTranslate);\n v.setVisibility(View.GONE);\n\n //Show add subject button\n Button addSubjButton = (Button) findViewById(R.id.addSubjButton);\n addSubjButton.setVisibility(View.VISIBLE);\n\n\n //Show save button\n Button saveButton = (Button) findViewById(R.id.save_button);\n saveButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n saveDialogue(tutorInfo);\n }\n });\n saveButton.startAnimation(revTranslate);\n saveButton.setVisibility(View.VISIBLE);\n\n enableSkillButtons();\n }", "public java.lang.String getEditInfoResult() {\r\n return localEditInfoResult;\r\n }", "public static void courseEditOption(){\n System.out.println(\"Choose 0 to repeat the option List\");\n System.out.println(\"Choose 1 to add new Course to the List\");\n System.out.println(\"Choose 2 to edit the exisiting List\");\n System.out.println(\"Choose 3 to quit editing\");\n }", "public Edit() {\n initComponents();\n }", "protected final void doEdit(Transaction trans, boolean startEdit) {\n\t\tenableForm(false);\n\t\tgetForm().getButton(EDIT).setEnabled(true);\n\n\t\tfillFormWith(trans);\n\n\t\tsetIsInEditMode(true);\n\t\tsetEditModeTransaction(trans);\n\n\t\tif (startEdit == true) {\n\t\t\tenableForm(true);\n\t\t\tgetForm().getButton(EDIT).setEnabled(false);\n\t\t\tgetForm().getButton(PENDING).requestFocus();\n\t\t}\n\t}", "@Override\n public void edit(ReporteAccidente rep) {\n repr.save(rep);\n }", "protected boolean showUnsavedChanges ()\n {\n return showConfirm(\"m.unsaved_changes\", \"t.unsaved_changes\");\n }", "public boolean showPersonEditDialog(Cliente cliente) {\r\n\t try {\r\n\t // Load the fxml file and create a new stage for the popup dialog.\r\n\t FXMLLoader loader = new FXMLLoader();\r\n\t loader.setLocation(MainApp.class.getResource(\"view/ClienteEditDialog.fxml\"));\r\n\t AnchorPane page = (AnchorPane) loader.load();\r\n\r\n\t // Create the dialog Stage.\r\n\t Stage dialogStage = new Stage();\r\n\t dialogStage.setTitle(\"Editar Cliente\");\r\n\t dialogStage.initModality(Modality.WINDOW_MODAL);\r\n\t dialogStage.initOwner(primaryStage);\r\n\t Scene scene = new Scene(page);\r\n\t dialogStage.setScene(scene);\r\n\r\n\t // Set the person into the controller.\r\n\t ClienteEditDialogController controller = loader.getController();\r\n\t controller.setDialogStage(dialogStage);\r\n\t controller.setCliente(cliente);\r\n\r\n\t // Show the dialog and wait until the user closes it\r\n\t dialogStage.showAndWait();\r\n\r\n\t return controller.isOkClicked();\r\n\t } catch (IOException e) {\r\n\t e.printStackTrace();\r\n\t return false;\r\n\t }\r\n\t}", "public void setEdit(boolean bool){\r\n edit = bool;\r\n }", "public String editarRutina(Rutina tp) {\n\t\t//newRutina = ts;\n\t\tvEditing = true;\n\t\tvTitulo = \"EDITAR\";\n\t\treturn \"nueva-rutina?faces-redirect=true&id=\"+tp.getIdRutina();\n\t}", "@Override\r\n\tprotected boolean hasEditSupport() {\n\t\treturn false;\r\n\t}", "public String updateEmpregado() {\n this.empregadosFacade.edit(this.empregado);\n updateMB(empregado);\n\n return \"areaPessoal.xhtml?faces-redirect=true\";\n }", "public void Dbdisplay_For_Edit() {\n String Reg = editAccessionNoText.getText();\n\n try {\n con = DbConnection();\n\n st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n\n ResultSet rs = st.executeQuery(\"select * from bookdetails where AccessionNo ='\" + Reg + \"'\");\n while (rs.next()) {\n editISBNNoText.setText(rs.getString(\"ISBNNo\"));\n editCLAccessiontext.setText(rs.getString(\"CL Accession\"));\n editBookTitletext.setText(rs.getString(\"BookTitle\"));\n editAuthorNametext.setText(rs.getString(\"Author Name\"));\n editEditionText.setText(rs.getString(\"Edition\"));\n editBookshelfNotext.setText(rs.getString(\"Book Self No\"));\n editColumnNotext.setText(rs.getString(\"Row No\"));\n editRowNotext.setText(rs.getString(\"Column No\"));\n\n }\n\n } catch (Exception ex) {\n Logger.getLogger(StudentInformation.class\n .getName()).log(Level.SEVERE, null, ex);\n\n }\n }", "private void displayValidity() {\n if (allValid) spnValid.setText(\"All fields are valid!\");\n else spnValid.setText(\"There are invalid fields. Please go back and check these.\");\n }", "private void iniFormEditar()\r\n\t{\r\n\t\tthis.operacion = Variables.OPERACION_EDITAR;\r\n\t\t\r\n\t\t/*Verificamos que tenga permisos*/\r\n\t\tboolean permisoNuevoEditar = this.permisos.permisoEnFormulaior(VariablesPermisos.FORMULARIO_CONCILIACION, VariablesPermisos.OPERACION_NUEVO_EDITAR);\r\n\t\t\r\n\t\tif(permisoNuevoEditar){\r\n\t\t\t\r\n\t\t\tthis.btnEditar.setVisible(false);\r\n\t\t\tthis.conciliar.setVisible(true);\r\n\t\t\tthis.btnEliminar.setVisible(false);\r\n\t\t\tthis.conciliar.setCaption(\"Guardar\");\r\n\t\t\t\r\n\t\t\tthis.nroDocum.setEnabled(false);\r\n\t\t\tthis.fecDoc.setEnabled(true);\r\n\t\t\tthis.observaciones.setEnabled(true);\r\n\t\t\t\r\n\t\t\tthis.botones.setWidth(\"187\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\r\n\t\t\t/*Mostramos mensaje Sin permisos para operacion*/\r\n\t\t\tMensajes.mostrarMensajeError(Variables.USUSARIO_SIN_PERMISOS);\r\n\t\t}\r\n\t}", "public void editarMateria() {\n materia.setIdDepartamento(departamento);\n ejbFacade.edit(materia);\n RequestContext requestContext = RequestContext.getCurrentInstance();\n requestContext.execute(\"PF('MateriaEditDialog').hide()\");\n ejbFacade.limpiarCache();\n items = ejbFacade.findAll();\n departamento = new Departamento();\n materia = new Materia();\n// FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se editó con éxito\"));\n// requestContext.execute(\"PF('mensajeRegistroExitoso').show()\");\n\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se editó con éxito\");\n FacesContext.getCurrentInstance().addMessage(null, msg);\n\n requestContext.update(\"msg\");//Actualiza la etiqueta growl para que el mensaje pueda ser mostrado\n\n requestContext.update(\"MateriaListForm\");\n requestContext.update(\"MateriaCreateForm\");\n\n }", "@Override\n public boolean isInEditMode() {\n return mEditable;\n }", "@Override\n public boolean isInEditMode() {\n return mEditable;\n }", "String getEditore();", "@Execute(validator = true, input = \"error.jsp\", urlPattern = \"editpage/{crudMode}/{id}\")\n /* CRUD COMMENT: END */\n /* CRUD: BEGIN\n @Execute(validator = true, input = \"error.jsp\", urlPattern = \"editpage/{crudMode}/{${table.primaryKeyPath}}\")\n CRUD: END */\n public String editpage() {\n if (crudTableForm.crudMode != CommonConstants.EDIT_MODE) {\n throw new ActionMessagesException(\"errors.crud_invalid_mode\",\n new Object[] { CommonConstants.EDIT_MODE,\n crudTableForm.crudMode });\n }\n \n loadCrudTable();\n \n return \"edit.jsp\";\n }", "@GetMapping(\"/edit\")\r\n public String editView() {\r\n return \"modify\";\r\n }", "public void editDogButtonClicked() {\r\n if (areFieldsNotBlank()) {\r\n viewModel.editDog();\r\n viewHandler.openView(\"home\");\r\n dogNameField.setStyle(null);\r\n }\r\n }", "public EditInfo() {\n initComponents();\n }", "public Result viaje_edit(Long id){\n \n Viaje viaje=Viaje.find.byId(id);\n List<Cabezal> cabezales = Cabezal.find.where().eq(\"activo\",true).findList();\n List<Cliente> clientes = Cliente.find.where().eq(\"activo\",true).findList();\n List<Motorista> motoristas = Motorista.find.where().eq(\"activo\",true).findList();\n \n if(viaje==null){\n return redirect(routes.LogisticaController.viajes());\n }\n\n return ok(viaje_edit.render(viaje,cabezales,motoristas,clientes));\n\n }", "protected boolean showCantUndo ()\n {\n return showConfirm(\"m.cant_undo\", \"t.cant_undo\");\n }", "@Override\r\n public boolean isEditable(AuthenticationInfo obj) {\n if (CFG_GUI.CFG.isPresentationModeEnabled()) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic void edit(HttpServletRequest request,HttpServletResponse response) {\n\t\tint id=Integer.parseInt(request.getParameter(\"id\"));\n\t\tQuestionVo qv=new QuestionVo().getInstance(id);\n\t\tcd.edit(qv);\n\t\ttry{\n\t\t\tresponse.sendRedirect(\"Admin/question.jsp\");\n\t\t\t}\n\t\t\tcatch(Exception e){}\n\t}", "private void edit() {\n if (String.valueOf(tgl_pengobatanField.getText()).equals(null)\n || String.valueOf(waktu_pengobatanField.getText()).equals(null)) {\n Toast.makeText(getApplicationContext(),\n \"Ada Yang Belum Terisi\", Toast.LENGTH_SHORT).show();\n } else {\n SQLite.update(Integer.parseInt(idField.getText().toString().trim()),nama_pasien2,nama_dokter2, tgl_pengobatanField.getText().toString().trim(),waktu_pengobatanField.getText().toString(),\n keluhan_pasienField.getText().toString().trim(),hasil_diagnosaField.getText().toString().trim(),\n biayaField.getText().toString().trim());\n blank();\n finish();\n }\n }", "public String edit(Entidades entidade) {\n\t\tif(verificaPermissao()) {\n\t\t\tEntidadesDAO.saveOrUpdate(entidade);\n\t\t\tthis.entidades = new Entidades();\n\t\t}\n\t\treturn \"/Consulta/consulta_entidades\";\n\t}", "@FXML\r\n private void editar(ActionEvent event) {\n selecionado = tabelaCliente.getSelectionModel()\r\n .getSelectedItem();\r\n\r\n //Se tem algum cliente selecionado\r\n if (selecionado != null) { //tem clienteonado\r\n //Pegar os dados do cliente e jogar nos campos do\r\n //formulario\r\n textFieldNumeroCliente.setText(\r\n String.valueOf( selecionado.getIdCliente() ) );\r\n textfieldNome.setText( selecionado.getNome() ); \r\n textFieldEmail.setText(selecionado.getEmail());\r\n textFieldCpf.setText(selecionado.getCpf());\r\n textFieldRg.setText(selecionado.getRg());\r\n textFieldRua.setText(selecionado.getRua());\r\n textFieldCidade.setText(selecionado.getCidade());\r\n textFieldBairro.setText(selecionado.getBairro());\r\n textFieldNumeroCasa.setText(selecionado.getNumeroCasa());\r\n textFieldDataDeNascimento.setValue(selecionado.getDataNascimemto());\r\n textFieldTelefone1.setText(selecionado.getTelefone1());\r\n textFieldTelefone2.setText(selecionado.getTelefone2());\r\n textFieldCep.setText(selecionado.getCep());\r\n \r\n \r\n \r\n }else{ //não tem cliente selecionado na tabela\r\n mensagemErro(\"Selecione um cliente.\");\r\n }\r\n\r\n }", "private void cambiarEstadoCamposInfoMedica(boolean editar) {\n\t\tif (editar) {\n\t\t\ttituloInfoMedica.setEditable(true);\n\t\t\t\n\t\t\tfechaInfoMedica.setVisible(false);\n\t\t\tfechaElegirInfoMedica.setVisible(true);\n\t\t\t\n\t\t\ttextDescripcion.setEditable(true);\n\t\t\ttextTratamiento.setEditable(true);\n\t\t\t\n\t\t\tbtnGuardarInfoMedica.setVisible(true);\n\t\t} else {\n\t\t\ttituloInfoMedica.setEditable(false);\n\t\t\t\n\t\t\tfechaInfoMedica.setVisible(true);\n\t\t\tfechaElegirInfoMedica.setVisible(false);\n\t\t\t\n\t\t\ttextDescripcion.setEditable(false);\n\t\t\ttextTratamiento.setEditable(false);\n\t\t\t\n\t\t\tbtnGuardarInfoMedica.setVisible(false);\n\t\t}\n\t}", "public Editar_Entrada() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setResizable(false);\n this.setTitle(\"CPU System Service S.A.S - FACTURAS DE ENTRADA\");\n //CargarCmbCliente();\n txtSec.setEnabled(false);\n txtIdCli.setEnabled(false);\n traerDatos();\n txtEstado.setEnabled(false);\n txtGarantia.setEnabled(false);\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t if (tf.isEditValid()) { //The text is invalid.\n\t\t\t //The text is valid,\n\t\t try {\n\t\t\t\t\t\t\ttf.commitEdit();\n\t\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t} //so use it.\n\t\t tf.postActionEvent(); //stop editing\n\t\t\t }\n\t\t\t\t}", "public String btn_edit_action()\n {\n int n = this.getDataTableSemental().getRowCount();\n ArrayList<SementalDTO> selected = new ArrayList();\n for (int i = 0; i < n; i++) { //Obtener elementos seleccionados\n this.getDataTableSemental().setRowIndex(i);\n SementalDTO aux = (SementalDTO) this.\n getDataTableSemental().getRowData();\n if (aux.isSelected()) {\n selected.add(aux);\n }\n }\n if(selected == null || selected.size() == 0){\n //En caso de que no se seleccione ningun elemento\n MessageBean.setErrorMessageFromBundle(\"not_selected\", this.getMyLocale());\n return null;\n }\n else if(selected.size() == 1){ //En caso de que solo se seleccione un elemento\n \n getgermplasm$SementalSessionBean().setSementalDTO(selected.get(0));\n \n getgermplasm$SemenGatheringSessionBean().resetPagination();\n \n //Llamada al jsp encargado de la edicion de accessiones\n return \"edit\";\n \n }\n else{ //En caso de que sea seleccion multiple\n MessageBean.setErrorMessageFromBundle(\"not_yet\", this.getMyLocale());\n return null;\n }\n }", "private boolean isEditValid ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint value = Integer.parseInt (super.getText ());\r\n\t\t\tboolean isValid = isInsideValidRange (value);\r\n\r\n\t\t\tif (isValid)\r\n\t\t\t{\r\n\t\t\t\tcommitEdit (value);\r\n\t\t\t}\r\n\r\n\t\t\treturn (isValid);\r\n\t\t}\r\n\t\tcatch (NumberFormatException e)\r\n\t\t{\r\n\t\t\t// Parse failed; therefore invalid\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t}", "public void onClick(View view) {\n Log.d(\"Edit\",\"EDITED\");\n }", "public static void editButtonAction(ActionContext actionContext){\n Table dataTable = actionContext.getObject(\"dataTable\");\n Shell shell = actionContext.getObject(\"shell\");\n Thing store = actionContext.getObject(\"store\");\n \n TableItem[] items = dataTable.getSelection();\n if(items == null || items.length == 0){\n MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);\n box.setText(\"警告\");\n box.setMessage(\"请先选择一条记录!\");\n box.open();\n return;\n }\n \n store.doAction(\"openEditForm\", actionContext, \"record\", items[0].getData());\n }", "public abstract void acceptEditing();", "public boolean getEdited() {\r\n return this.edited;\r\n }", "@FXML\n void handleEdit(ActionEvent event) {\n if (checkFields()) {\n\n try {\n //create a pseudo new environment with the changes but same id\n Environment newEnvironment = new Environment(oldEnvironment.getId(), editTxtName.getText(), editTxtDesc.getText(), editClrColor.getValue());\n\n //edit the oldenvironment\n Environment.edit(oldEnvironment, newEnvironment);\n } catch (SQLException exception) {\n //failed to save a environment, IO with database failed\n Manager.alertException(\n resources.getString(\"error\"),\n resources.getString(\"error.10\"),\n this.dialogStage,\n exception\n );\n }\n //close the stage\n dialogStage.close();\n } else {\n //fields are not filled valid\n Manager.alertWarning(\n resources.getString(\"add.invalid\"),\n resources.getString(\"add.invalid\"),\n resources.getString(\"add.invalid.content\"),\n this.dialogStage);\n }\n Bookmark.refreshBookmarksResultsProperty();\n }" ]
[ "0.73575115", "0.72330564", "0.7004577", "0.6775767", "0.66926587", "0.6636516", "0.6560771", "0.6531381", "0.65281", "0.6500563", "0.6480932", "0.64170885", "0.6416468", "0.6347081", "0.63169795", "0.6314029", "0.6305645", "0.62585616", "0.6245871", "0.6232414", "0.6232309", "0.62154603", "0.61990833", "0.61607933", "0.61357415", "0.61351335", "0.6134786", "0.6127668", "0.6117629", "0.61175287", "0.6110519", "0.60917145", "0.6089247", "0.6083971", "0.60536844", "0.6046865", "0.6020904", "0.60092956", "0.6007488", "0.6004551", "0.5990144", "0.59844404", "0.5947544", "0.59345204", "0.5920306", "0.59170043", "0.5912526", "0.59107196", "0.5906902", "0.5906507", "0.5895295", "0.58941853", "0.58746535", "0.58673906", "0.5864689", "0.5863673", "0.5861912", "0.5860913", "0.5857826", "0.5857297", "0.584912", "0.5844379", "0.583425", "0.5829114", "0.58273906", "0.5826865", "0.5821484", "0.58056283", "0.58039033", "0.5796427", "0.57961667", "0.57896525", "0.5784515", "0.57813984", "0.57726413", "0.57642174", "0.57558155", "0.57535493", "0.57535493", "0.5749855", "0.5747258", "0.5741838", "0.5732856", "0.5729845", "0.5728768", "0.5727188", "0.57261544", "0.57253337", "0.57138515", "0.570097", "0.56982684", "0.5697834", "0.56977284", "0.569356", "0.56916034", "0.56866187", "0.56856", "0.5676472", "0.5672632", "0.56668085", "0.56659234" ]
0.0
-1
Notifies the service to update the local checkpoint for the shard with the provided allocation ID. If the checkpoint is lower than the currently known one, this is a noop. If the allocation ID is not in sync, it is ignored. This is to prevent late arrivals from shards that are removed to be readded.
public synchronized void updateLocalCheckpoint(final String allocationId, final long checkpoint) { final int indexOfKey = inSyncLocalCheckpoints.indexOf(allocationId); if (indexOfKey >= 0) { final long current = inSyncLocalCheckpoints.indexGet(indexOfKey); if (current < checkpoint) { inSyncLocalCheckpoints.indexReplace(indexOfKey, checkpoint); if (logger.isTraceEnabled()) { logger.trace("updated local checkpoint of [{}] to [{}] (was [{}])", allocationId, checkpoint, current); } } else { logger.trace( "skipping update of local checkpoint [{}], current checkpoint is higher (current [{}], incoming [{}], type [{}])", allocationId, current, checkpoint, allocationId); } } else { logger.trace("[{}] isn't marked as in sync. ignoring local checkpoint of [{}].", allocationId, checkpoint); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void markAllocationIdAsInSync(final String allocationId) {\n if (assignedAllocationIds.contains(allocationId) == false) {\n // master has removed this allocation, ignore\n return;\n }\n logger.trace(\"marked [{}] as in sync\", allocationId);\n inSyncLocalCheckpoints.put(allocationId, UNASSIGNED_SEQ_NO);\n }", "public void flushCheckpoint(long checkpoint)\r\n/* 124: */ {\r\n/* 125:155 */ this.checkpoint = checkpoint;\r\n/* 126: */ }", "synchronized void updateCheckpointOnReplica(final long checkpoint) {\n /*\n * The global checkpoint here is a local knowledge which is updated under the mandate of the primary. It can happen that the primary\n * information is lagging compared to a replica (e.g., if a replica is promoted to primary but has stale info relative to other\n * replica shards). In these cases, the local knowledge of the global checkpoint could be higher than sync from the lagging primary.\n */\n if (this.globalCheckpoint <= checkpoint) {\n this.globalCheckpoint = checkpoint;\n logger.trace(\"global checkpoint updated from primary to [{}]\", checkpoint);\n }\n }", "@Test\n public void testUpdateCheckpointLeaseUpdated() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n leaseRefresher.renewLease(coordinator.getCurrentlyHeldLease(leaseKey));\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n lease.leaseCounter(lease.leaseCounter() + 1);\n // Counter and owner changed, but checkpoint did not.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "@Test\n public void testUpdateCheckpoint() throws Exception {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n // Run the taker and renewer in-between getting the Lease object and calling checkpoint\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n if (lease == null) {\n List<Lease> leases = leaseRefresher.listLeases();\n for (Lease kinesisClientLease : leases) {\n System.out.println(kinesisClientLease);\n }\n }\n\n assertNotNull(lease);\n final ExtendedSequenceNumber initialCheckpoint = new ExtendedSequenceNumber(\"initialCheckpoint\");\n final ExtendedSequenceNumber pendingCheckpoint = new ExtendedSequenceNumber(\"pendingCheckpoint\");\n final ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n final byte[] checkpointState = \"checkpointState\".getBytes();\n\n // lease's leaseCounter is wrong at this point, but it shouldn't matter.\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), initialCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtInitialCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, leaseFromDDBAtInitialCheckpoint);\n\n dynamoDBCheckpointer.prepareCheckpoint(lease.leaseKey(), pendingCheckpoint, lease.concurrencyToken().toString(), checkpointState);\n\n final Lease leaseFromDDBAtPendingCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.pendingCheckpoint(pendingCheckpoint);\n lease.pendingCheckpointState(checkpointState);\n assertEquals(lease, leaseFromDDBAtPendingCheckpoint);\n\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtNewCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(newCheckpoint);\n lease.pendingCheckpoint(null);\n lease.pendingCheckpointState(null);\n assertEquals(lease, leaseFromDDBAtNewCheckpoint);\n }", "@Test\n public void testUpdateCheckpointBadConcurrencyToken() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, UUID.randomUUID()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n // Owner should be the only thing that changed.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "public void overflowNotification(RecordLocation safeLocation) {\n checkpoint(false, true);\n }", "static synchronized void makeNewCheckpoint() {\n HashMap<String, String> newCheckpoint = new HashMap<>(localState);\n checkpoints.put(Thread.currentThread(), newCheckpoint);\n }", "protected void checkpoint() {\n checkpoint = internalBuffer().readerIndex();\n }", "public long flushCheckpoint()\r\n/* 119: */ {\r\n/* 120:150 */ return this.checkpoint;\r\n/* 121: */ }", "@Override\n public void markShardCopyAsStaleIfNeeded(ShardId shardId, String allocationId, long primaryTerm, ActionListener<Void> listener) {\n listener.onResponse(null);\n }", "public synchronized void updateAllocationIdsFromMaster(final Set<String> activeAllocationIds,\n final Set<String> initializingAllocationIds) {\n assignedAllocationIds.removeIf(\n aId -> activeAllocationIds.contains(aId) == false && initializingAllocationIds.contains(aId) == false);\n assignedAllocationIds.addAll(activeAllocationIds);\n assignedAllocationIds.addAll(initializingAllocationIds);\n for (String activeId : activeAllocationIds) {\n if (inSyncLocalCheckpoints.containsKey(activeId) == false) {\n inSyncLocalCheckpoints.put(activeId, UNASSIGNED_SEQ_NO);\n }\n }\n inSyncLocalCheckpoints.removeAll(key -> assignedAllocationIds.contains(key) == false);\n }", "void prepareSortedLedgerStorageCheckpoint(long numBytesFlushed) throws IOException;", "private void savePartialAllocation(MappingVec allocation, VirtualMachineVec leftover_vms) {\n assert(allocation != null);\n assert(leftover_vms != null);\n this.partial_allocation = allocation;\n this.leftover_vms = leftover_vms;\n }", "void checkpoint() throws IOException;", "void prepareRelocate(Identity id, long newNodeId) throws IOException;", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "public synchronized void writeCheckpoint() {\n\t\tflush();\n\t\tpw.println(\"CHECKPOINT \" \n\t\t\t\t\t+ TransactionManager.instance().transactionList());\n\t\tflush();\n\t}", "@Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }", "@Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }", "@Override\n public void statusChanged(ASCIIString cellId, Flease lease) {\n synchronized (result) {\n result.set(new Flease(cellId, lease.getLeaseHolder(), lease.getLeaseTimeout_ms(),lease.getMasterEpochNumber()));\n result.notify();\n }\n }", "@Override\n\tpublic void checkWayBillChange(String id) {\n\t\t\n\t}", "public DistributedDbLock(@Nonnull LockId id, @Nonnull AbstractLockAllocator allocator) {\n super(id, allocator);\n setupMetrics(Metrics.METRIC_LATENCY_LOCK,\n Metrics.METRIC_LATENCY_UNLOCK,\n Metrics.METRIC_COUNTER_CALLS,\n Metrics.METRIC_COUNTER_ERROR);\n }", "private void setPrimaryKey(final ResourceAllocation allocation) {\n final Map<String, Object> values = new HashMap<String, Object>();\n values.put(Constants.RES_ID, allocation.getReserveId());\n values.put(Constants.BL_ID_FIELD_NAME, allocation.getBlId());\n values.put(Constants.FL_ID_FIELD_NAME, allocation.getFlId());\n values.put(Constants.RM_ID_FIELD_NAME, allocation.getRmId());\n values.put(Constants.DATE_START_FIELD_NAME, allocation.getStartDate());\n values.put(Constants.TIME_START_FIELD_NAME, allocation.getStartTime());\n values.put(Constants.TIME_END_FIELD_NAME, allocation.getEndTime());\n values.put(Constants.RESOURCE_ID_FIELD, allocation.getResourceId());\n values.put(Constants.QUANTITY_FIELD, allocation.getQuantity());\n\n allocation.setId(getPrimaryKey(values, Constants.RSRES_ID_FIELD_NAME));\n }", "public void checkpoint(boolean sync, boolean fullCheckpoint) {\n try {\n if (journal == null )\n throw new IllegalStateException(\"Journal is closed.\");\n \n long now = System.currentTimeMillis();\n CountDownLatch latch = null;\n synchronized(this) {\n latch = nextCheckpointCountDownLatch;\n lastCheckpointRequest = now;\n if( fullCheckpoint ) {\n this.fullCheckPoint = true; \n }\n }\n \n checkpointTask.wakeup();\n \n if (sync) {\n log.debug(\"Waking for checkpoint to complete.\");\n latch.await();\n }\n }\n catch (InterruptedException e) {\n log.warn(\"Request to start checkpoint failed: \" + e, e);\n }\n }", "boolean updateLease(Lease lease, UUID concurrencyToken, String operation, String singleStreamShardId)\n throws DependencyException, InvalidStateException, ProvisionedThroughputException;", "public synchronized long getCheckpoint() {\n return globalCheckpoint;\n }", "public String toCheckpoint() {\n return null;\n }", "private void scheduleClustering(HoodieFlinkTable<?> table, long checkpointId) {\n Option<HoodieInstant> firstRequested = Option.fromJavaOptional(\n ClusteringUtils.getPendingClusteringInstantTimes(table.getMetaClient()).stream()\n .filter(instant -> instant.getState() == HoodieInstant.State.REQUESTED).findFirst());\n if (!firstRequested.isPresent()) {\n // do nothing.\n LOG.info(\"No clustering plan for checkpoint \" + checkpointId);\n return;\n }\n\n String clusteringInstantTime = firstRequested.get().getTimestamp();\n\n // generate clustering plan\n // should support configurable commit metadata\n HoodieInstant clusteringInstant = HoodieTimeline.getReplaceCommitRequestedInstant(clusteringInstantTime);\n Option<Pair<HoodieInstant, HoodieClusteringPlan>> clusteringPlanOption = ClusteringUtils.getClusteringPlan(\n table.getMetaClient(), clusteringInstant);\n\n if (!clusteringPlanOption.isPresent()) {\n // do nothing.\n LOG.info(\"No clustering plan scheduled\");\n return;\n }\n\n HoodieClusteringPlan clusteringPlan = clusteringPlanOption.get().getRight();\n\n if (clusteringPlan == null || (clusteringPlan.getInputGroups() == null)\n || (clusteringPlan.getInputGroups().isEmpty())) {\n // do nothing.\n LOG.info(\"Empty clustering plan for instant \" + clusteringInstantTime);\n } else {\n // Mark instant as clustering inflight\n table.getActiveTimeline().transitionReplaceRequestedToInflight(clusteringInstant, Option.empty());\n table.getMetaClient().reloadActiveTimeline();\n\n for (HoodieClusteringGroup clusteringGroup : clusteringPlan.getInputGroups()) {\n LOG.info(\"Execute clustering plan for instant {} as {} file slices\", clusteringInstantTime, clusteringGroup.getSlices().size());\n output.collect(new StreamRecord<>(\n new ClusteringPlanEvent(clusteringInstantTime, ClusteringGroupInfo.create(clusteringGroup), clusteringPlan.getStrategy().getStrategyParams())\n ));\n }\n }\n }", "public void checkpoint(boolean hasUncommittedData) throws SQLException;", "@Override\n\tpublic void setCheckpoint(java.util.Date checkpoint) {\n\t\t_userSync.setCheckpoint(checkpoint);\n\t}", "public void setId(long param) {\n localIdTracker = param != java.lang.Long.MIN_VALUE;\r\n\r\n this.localId = param;\r\n }", "public boolean doCheckpoint() {\n CountDownLatch latch = null;\n boolean fullCheckpoint;\n synchronized(this) { \n latch = nextCheckpointCountDownLatch;\n nextCheckpointCountDownLatch = new CountDownLatch(1);\n fullCheckpoint = this.fullCheckPoint;\n this.fullCheckPoint=false; \n } \n try {\n \n log.debug(\"Checkpoint started.\");\n RecordLocation newMark = null;\n \n ArrayList futureTasks = new ArrayList(queues.size()+topics.size());\n \n //\n // We do many partial checkpoints (fullCheckpoint==false) to move topic messages\n // to long term store as soon as possible. \n // \n // We want to avoid doing that for queue messages since removes the come in the same\n // checkpoint cycle will nullify the previous message add. Therefore, we only\n // checkpoint queues on the fullCheckpoint cycles.\n //\n if( fullCheckpoint ) { \n Iterator iterator = queues.values().iterator();\n while (iterator.hasNext()) {\n try {\n final JournalMessageStore ms = (JournalMessageStore) iterator.next();\n FutureTask task = new FutureTask(new Callable() {\n public Object call() throws Exception {\n return ms.checkpoint();\n }});\n futureTasks.add(task);\n checkpointExecutor.execute(task); \n }\n catch (Exception e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n }\n }\n \n Iterator iterator = topics.values().iterator();\n while (iterator.hasNext()) {\n try {\n final JournalTopicMessageStore ms = (JournalTopicMessageStore) iterator.next();\n FutureTask task = new FutureTask(new Callable() {\n public Object call() throws Exception {\n return ms.checkpoint();\n }});\n futureTasks.add(task);\n checkpointExecutor.execute(task); \n }\n catch (Exception e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n }\n \n try {\n for (Iterator iter = futureTasks.iterator(); iter.hasNext();) {\n FutureTask ft = (FutureTask) iter.next();\n RecordLocation mark = (RecordLocation) ft.get();\n // We only set a newMark on full checkpoints.\n if( fullCheckpoint ) {\n if (mark != null && (newMark == null || newMark.compareTo(mark) < 0)) {\n newMark = mark;\n }\n }\n }\n } catch (Throwable e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n \n \n if( fullCheckpoint ) {\n try {\n if (newMark != null) {\n log.debug(\"Marking journal at: \" + newMark);\n journal.setMark(newMark, true);\n }\n }\n catch (Exception e) {\n log.error(\"Failed to mark the Journal: \" + e, e);\n }\n \n if (longTermPersistence instanceof JDBCPersistenceAdapter) {\n // We may be check pointing more often than the checkpointInterval if under high use\n // But we don't want to clean up the db that often.\n long now = System.currentTimeMillis();\n if( now > lastCleanup+checkpointInterval ) {\n lastCleanup = now;\n ((JDBCPersistenceAdapter) longTermPersistence).cleanup();\n }\n }\n }\n \n log.debug(\"Checkpoint done.\");\n }\n finally {\n latch.countDown();\n }\n synchronized(this) {\n return this.fullCheckPoint;\n } \n \n }", "void checkpoint(Node node) throws RepositoryException;", "private Version checkpointSuperChunkId(long superChunkId,\n Version metadataVersion) {\n if ((lobProps.getNumChunks() != null) ||\n (lobProps.getLOBSize() != null)) {\n throw new IllegalStateException(\"Inconsistent lob props for \"\n + \"metadata checkpoint:\" + lobProps.toString());\n }\n lobProps.setLastSuperChunkId(superChunkId);\n return updateMetadata(metadataVersion);\n }", "public boolean reserveFlight(int id, int customerID, int flightNumber)\n throws RemoteException, DeadlockException;", "public void pumpingUpdate(String id) {\n }", "public void pumpingUpdate(String id) {\n }", "private void seekLandmarks(final long timeStamp, final AddressIF addr,\n\t\t\t\tfinal Barrier barrier,\n\t\t\t\tfinal Map<Long, HSHRecord> pendingHSHLandmarks,\n\t\t\t\tStringBuffer errorBuffer) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tif (Ninaloader.me.equals(addr)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tLandmarkRequestMsg msg = new LandmarkRequestMsg(Ninaloader.me,\n\t\t\t\t\ttimeStamp);\n\t\t\tbarrier.fork();\n\t\t\tcomm.sendRequestMessage(msg, addr,\n\t\t\t\t\tnew ObjCommRRCB<LandmarkResponseMsg>() {\n\t\t\t\t\t\tprotected void cb(CBResult result,\n\t\t\t\t\t\t\t\tfinal LandmarkResponseMsg responseMsg,\n\t\t\t\t\t\t\t\tAddressIF node, Long ts) {\n\t\t\t\t\t\t\tswitch (result.state) {\n\t\t\t\t\t\t\tcase OK: {\n\t\t\t\t\t\t\t\t// System.out.println(\"$Landmark Request is acked! We have received ACK from\"+addr);\n\n\t\t\t\t\t\t\t\t// we override previous landmarks\n\t\t\t\t\t\t\t\tif (!pendingHSHLandmarks.containsKey(Long\n\t\t\t\t\t\t\t\t\t\t.valueOf(timeStamp))) {\n\t\t\t\t\t\t\t\t\tpendingHSHLandmarks.put(Long\n\t\t\t\t\t\t\t\t\t\t\t.valueOf(timeStamp), new HSHRecord(\n\t\t\t\t\t\t\t\t\t\t\tLong.valueOf(timeStamp)));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpendingHSHLandmarks\n\t\t\t\t\t\t\t\t\t\t.get(Long.valueOf(timeStamp))\n\t\t\t\t\t\t\t\t\t\t.addLandmarks(addr);\n\t\t\t\t\t\t\t\tpendingHSHLandmarks\n\t\t\t\t\t\t\t\t\t\t.get(Long.valueOf(timeStamp)).alreadyComputedClustering = 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\tcase ERROR:\n\t\t\t\t\t\t\tcase TIMEOUT: {\n\t\t\t\t\t\t\t\tString error = addr.toString(false)\n\t\t\t\t\t\t\t\t\t\t+ \"has not received requirement, as: \"\n\t\t\t\t\t\t\t\t\t\t+ result.toString();\n\t\t\t\t\t\t\t\tlog.warn(error);\n\n\t\t\t\t\t\t\t\t// remove pending neighbor\n\t\t\t\t\t\t\t\t// addDownNeighbor(addr);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbarrier.join();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t}", "private void maybeIncrementLeaderHW(Replica leaderReplica) {\n Set<LogOffsetMetadata> allLogEndOffsets = Sc.map(inSyncReplicas, r -> r.logEndOffset());\n LogOffsetMetadata newHighWatermark = allLogEndOffsets.stream().min(LogOffsetMetadata::compare).get();\n LogOffsetMetadata oldHighWatermark = leaderReplica.highWatermark();\n if (oldHighWatermark.precedes(newHighWatermark)) {\n StringBuilder s = new StringBuilder();\n inSyncReplicas.forEach(r -> s.append(String.format(\"id%s.logEnd=%s\", r.brokerId, r.logEndOffset())));\n logger.info(String.format(\"=== maybeIncrementLeaderHW.id%s.highWatermark =%s log[%s]\", leaderReplica.brokerId, newHighWatermark, s));\n// Utils.printStack();\n leaderReplica.highWatermark_(newHighWatermark);\n debug(String.format(\"High watermark for partition <%s,%d> updated to %s\", topic, partitionId, newHighWatermark));\n // some delayed requests may be unblocked after HW changed;\n TopicAndPartition requestKey = new TopicAndPartition(this.topic, this.partitionId);\n replicaManager.unblockDelayedFetchRequests(requestKey);\n replicaManager.unblockDelayedProduceRequests(requestKey);\n } else {\n debug(String.format(\"Skipping update high watermark since Old hw %s is larger than new hw %s for partition <%s,%d>. All leo's are %s\",\n oldHighWatermark, newHighWatermark, topic, partitionId, allLogEndOffsets.toString()));\n }\n }", "public void checkpointStateChanged(final CheckpointState newCheckpointState) {\n \t\tthis.taskManager.checkpointStateChanged(this.environment.getJobID(), this.vertexID, newCheckpointState);\n \t}", "@Test\n public void testClearLocalPartitionIdsStatistics() {\n ObjectPartitionStatisticsImpl stat1 = getPartitionStatistics(1);\n ObjectPartitionStatisticsImpl stat10 = getPartitionStatistics(10);\n ObjectPartitionStatisticsImpl stat100 = getPartitionStatistics(100);\n\n IgniteStatisticsStore store = repo.statisticsStore();\n store.saveLocalPartitionStatistics(K1, stat1);\n store.saveLocalPartitionStatistics(K1, stat10);\n store.saveLocalPartitionStatistics(K1, stat100);\n\n assertNotNull(repo.getLocalPartitionStatistics(K1, 10));\n\n repo.clearLocalPartitionsStatistics(K1, setOf(1, 2, 10));\n\n assertNull(repo.getLocalPartitionStatistics(K1, 10));\n assertNotNull(repo.getLocalPartitionStatistics(K1, 100));\n }", "private void updateIfStale() {\n if (DateTimeUtils.currentTimeMillis() - globalLastDrainMillis >= maxStaleMillis) {\n synchronized (counterShards) {\n if (DateTimeUtils.currentTimeMillis() - globalLastDrainMillis >= maxStaleMillis) {\n drainThreadToShared();\n globalLastDrainMillis = DateTimeUtils.currentTimeMillis();\n }\n }\n }\n }", "@Override public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException {\n IgniteThread cpThread = new IgniteThread(cctx.igniteInstanceName(), \"db-checkpoint-thread\", checkpointer);\n\n cpThread.start();\n\n checkpointerThread = cpThread;\n\n CheckpointProgressSnapshot chp = checkpointer.wakeupForCheckpoint(0, \"node started\");\n\n if (chp != null)\n chp.cpBeginFut.get();\n }", "public void handle(PBFTCheckpoint checkpoint){\n\n JDSUtility.debug(\"[PBFTServer:handle(checkpoint)] s\" + getLocalServerID() + \", at time \" + getClockValue() + \", received \" + checkpoint);\n\n if(isValid(checkpoint)){\n \n long seqn = checkpoint.getSequenceNumber();\n long lcwm = getLCWM();\n long hcwm = getHCWM();\n long now = getClockValue();\n\n getCheckpointInfo().put(checkpoint);\n \n Object lpid = getLocalProcessID();\n \n CheckpointSubject cs = getDecision(checkpoint);\n \n if(getCheckpointInfo().hasEnough(seqn) && cs != null && lcwm < seqn && seqn <= hcwm){\n\n if(seqn > hcwm){\n\n JDSUtility.debug(\"[handle(checkpoint)] s\"+ lpid +\", at time \"+ now +\", detected a stable checkpoint certificate with SEQN{\"+ seqn +\"} > HCWM{\"+ hcwm +\"}.\");\n JDSUtility.debug(\"[handle(checkpoint)] s\"+ lpid +\", at time \"+ now +\", is going to start a start transfer procedure.\");\n\n emitFetch();\n return;\n\n }//end if I've a unsynchronized state\n\n if(getCheckpointInfo().getMine(lpid, seqn) != null){ \n doCheckpoint(seqn); \n }\n \n }//end if has a decision\n \n }//end if isValid(checkpoint)\n \n }", "public void put(int id) {\n\t\tignoreLocations.put(id, System.currentTimeMillis());\n\t}", "public void markAsDone(int reqId, int workerId, int workDoneAmount) {\n if (!globalWorkStore.containsKey(reqId)) {\n // System.out.println(\"Worker \" + workerId + \" illegal reqId \" + workDoneAmount + \" work for request id \" + reqId);\n return;\n }\n Map<Integer,Integer> workAssignment = globalWorkStore.get(reqId);\n if (!workAssignment.containsKey(workerId)) {\n // printFreeResourceMap(workAssignment);\n // System.out.println(\"Worker \" + workerId + \" illegal worker \" + workDoneAmount + \" work for request id \" + reqId);\n return;\n }\n int workAllocated = workAssignment.get(workerId);\n if (workAllocated < workDoneAmount) {\n System.out.printf(\"App id %d, request id %d, worker id %d:\\n\", appId, reqId, workerId);\n printFreeResourceMap(globalWorkStore.get(reqId));\n System.out.println(\"Work allocated \" + workAllocated + \" but work done \" + workDoneAmount);\n }\n // assert workAllocated >= workDoneAmount : \"Work allocated \" + workAllocated + \" but work done \" + workDoneAmount; \n workDoneAmount = Math.min(workDoneAmount, workAllocated);\n if (workAllocated - workDoneAmount == 0) {\n workAssignment.remove(workerId);\n // System.out.println(\"Worker \" + workerId + \" has done \" + workDoneAmount + \" work for request id \" + reqId + \" and deleted, remaining \" + workAssignment.size());\n }\n else {\n workAssignment.replace(workerId, workAllocated - workDoneAmount);\n // System.out.println(\"Worker \" + workerId + \" has done \" + workDoneAmount + \" work for request id \" + reqId + \" out of \" + workAllocated + \", remaining \" + workAssignment.size());\n }\n replenishResource(workerId, workDoneAmount);\n if (globalWorkStore.get(reqId).isEmpty()) {\n // System.out.printf(\"Request %d serviced\\n\", reqId);\n globalWorkStore.remove(reqId);\n this.simulatorRef.incrTotalRequestsServiced();\n }\n return;\n }", "public static synchronized void setOwnerId(int id) {\r\n /* If this is the first time, that's fine, but if a change were made again */\r\n /* then we have an not-in-sync issue with journal files! */\r\n if (owner_id == master_pid) {\r\n owner_id = id;\r\n SlaveJvm.sendMessageToMaster(SocketMessage.ONE_TIME_STATUS, \"Data Validation Owner ID found in journal: \" + id);\r\n return;\r\n }\r\n\r\n /* The next time however, the ID is not allowed to change: */\r\n if (id != owner_id) {\r\n common.ptod(\"Current master process id: \" + master_pid);\r\n common.ptod(\"Current owner id: \" + owner_id);\r\n common.ptod(\"Second request to set owner id: \" + id);\r\n common.failure(\"Owner ID not in sync, are we mixing up journal files?\");\r\n }\r\n }", "@Override\n public void freeId( long id )\n {\n }", "private MetadataCheckpointPolicy getNoOpCheckpointPolicy() {\n DurableLogConfig dlConfig = DurableLogConfig\n .builder()\n .with(DurableLogConfig.CHECKPOINT_COMMIT_COUNT, Integer.MAX_VALUE)\n .with(DurableLogConfig.CHECKPOINT_TOTAL_COMMIT_LENGTH, Long.MAX_VALUE)\n .build();\n\n return new MetadataCheckpointPolicy(dlConfig, Runnables.doNothing(), executorService());\n }", "public void setFirstPartitionId(int id)\n\t{\n\t\tthis.firstPartitionId = id;\n\t}", "private void restoreToCheckpoint(Parameters checkpoint) {\n assert geometricParts.diskShardCount() == 0 : \"Restore to Checkpoint should only be called at startup!\";\n\n this.lastAddedDocumentIdentifier = checkpoint.getString(\"lastDoc/identifier\");\n this.lastAddedDocumentNumber = (int) checkpoint.getLong(\"lastDoc/number\");\n this.indexBlockCount = (int) checkpoint.getLong(\"indexBlockCount\");\n Parameters shards = checkpoint.getMap(\"shards\");\n for (String indexPath : shards.getKeys()) {\n this.geometricParts.add((int) shards.getLong(indexPath), indexPath);\n }\n }", "@NotNull private GridCacheDatabaseSharedManager.CheckpointProgress updateCurrentCheckpointProgress() {\n final CheckpointProgress curr;\n\n synchronized (this) {\n curr = scheduledCp;\n\n curr.state(LOCK_TAKEN);\n\n if (curr.reason == null)\n curr.reason = \"timeout\";\n\n // It is important that we assign a new progress object before checkpoint mark in page memory.\n scheduledCp = new CheckpointProgress(checkpointFreq);\n\n curCpProgress = curr;\n }\n return curr;\n }", "public void xmlBlockGone(int id) {\n synchronized (this) {\n decRefsLocked((long) id);\n }\n }", "@Override public void checkpointReadLock() {\n if (checkpointLock.writeLock().isHeldByCurrentThread())\n return;\n\n long timeout = checkpointReadLockTimeout;\n\n long start = U.currentTimeMillis();\n\n boolean interruped = false;\n\n try {\n for (; ; ) {\n try {\n if (timeout > 0 && (U.currentTimeMillis() - start) >= timeout)\n failCheckpointReadLock();\n\n try {\n if (timeout > 0) {\n if (!checkpointLock.readLock().tryLock(timeout - (U.currentTimeMillis() - start),\n TimeUnit.MILLISECONDS))\n failCheckpointReadLock();\n }\n else\n checkpointLock.readLock().lock();\n }\n catch (InterruptedException e) {\n interruped = true;\n\n continue;\n }\n\n if (stopping) {\n checkpointLock.readLock().unlock();\n\n throw new IgniteException(new NodeStoppingException(\"Failed to perform cache update: node is stopping.\"));\n }\n\n if (checkpointLock.getReadHoldCount() > 1 || safeToUpdatePageMemories() || checkpointerThread == null)\n break;\n else {\n checkpointLock.readLock().unlock();\n\n if (timeout > 0 && U.currentTimeMillis() - start >= timeout)\n failCheckpointReadLock();\n\n try {\n checkpointer.wakeupForCheckpoint(0, \"too many dirty pages\").cpBeginFut\n .getUninterruptibly();\n }\n catch (IgniteFutureTimeoutCheckedException e) {\n failCheckpointReadLock();\n }\n catch (IgniteCheckedException e) {\n throw new IgniteException(\"Failed to wait for checkpoint begin.\", e);\n }\n }\n }\n catch (CheckpointReadLockTimeoutException e) {\n log.error(e.getMessage(), e);\n\n timeout = 0;\n }\n }\n }\n finally {\n if (interruped)\n Thread.currentThread().interrupt();\n }\n\n if (ASSERTION_ENABLED)\n CHECKPOINT_LOCK_HOLD_COUNT.set(CHECKPOINT_LOCK_HOLD_COUNT.get() + 1);\n }", "void deleteTrackerAssignedOld(final Integer id);", "@Override\n public void setFollowableNotifiableStatusByFSTID(Long fstId, Followable.FollowableNotifiable notifiable) {\n logger.debug(\"setFollowableNotifiableStatusByFSTID(fstId: {}, notifiable: {})\", fstId, notifiable);\n // get FST\n FollowStateTracker fst = fstRepository.findById(fstId)\n .orElseThrow( () -> new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Le suivi n'existe pas.\") );\n // process update\n this.setFollowableNotifiableStatusByFST(fst, notifiable);\n }", "void notifyDepositChanges(int id, ResourceContainer resourceContainer, boolean added);", "@Test\n public void testLocationReference() throws Exception {\n {\n MemoryBackendCheckpointStorageAccess storage =\n new MemoryBackendCheckpointStorageAccess(\n new JobID(), null, null, DEFAULT_MAX_STATE_SIZE);\n CheckpointStorageLocation location = storage.initializeLocationForCheckpoint(42);\n assertTrue(location.getLocationReference().isDefaultReference());\n }\n\n // non persistent memory state backend for checkpoint\n {\n MemoryBackendCheckpointStorageAccess storage =\n new MemoryBackendCheckpointStorageAccess(\n new JobID(), randomTempPath(), null, DEFAULT_MAX_STATE_SIZE);\n CheckpointStorageLocation location = storage.initializeLocationForCheckpoint(42);\n assertTrue(location.getLocationReference().isDefaultReference());\n }\n\n // memory state backend for savepoint\n {\n MemoryBackendCheckpointStorageAccess storage =\n new MemoryBackendCheckpointStorageAccess(\n new JobID(), null, null, DEFAULT_MAX_STATE_SIZE);\n CheckpointStorageLocation location =\n storage.initializeLocationForSavepoint(1337, randomTempPath().toString());\n assertTrue(location.getLocationReference().isDefaultReference());\n }\n }", "public void ack(Object msgId) {\n Message msg = this.pendingMessages.remove(msgId);\n JmsMessageId oldest = this.toCommit.first();\n if (msgId.equals(oldest)) {\n if (msg != null) {\n try {\n log.debug(\"Committing...\");\n msg.acknowledge();\n log.debug(\"JMS Message acked: \" + msgId);\n this.toCommit.remove(msgId);\n } catch (JMSException e) {\n log.warn(\"Error acknowldging JMS message: \" + msgId, e);\n }\n } else {\n log.warn(\"Couldn't acknowledge unknown JMS message ID: \" + msgId);\n }\n } else {\n this.toCommit.remove(msgId);\n }\n\n }", "public void updateJobLease(Lease jobLease) throws DatabaseException, IllegalArgumentException;", "private void processCheckpoint() throws HsqlException {\n\n boolean defrag;\n String token;\n\n session.checkAdmin();\n session.checkDDLWrite();\n\n defrag = false;\n token = tokenizer.getSimpleToken();\n\n if (token.equals(Token.T_DEFRAG)) {\n defrag = true;\n } else if (token.equals(Token.T_SEMICOLON)) {\n\n // only semicolon is accepted here\n } else if (token.length() != 0) {\n throw Trace.error(Trace.UNEXPECTED_TOKEN, token);\n }\n\n database.logger.checkpoint(defrag);\n }", "public void setAllocationSize(long allocSize) {\n \t\n \t// Check if the allocation size has changed\n \t\n \tif ( getAllocationSize() != allocSize) {\n \t\t\n \t\t// Update the allocation size\n \t\t\n \t\tsuper.setAllocationSize(allocSize);\n \t\t\n \t\t// Queue a low priority state update\n \t\t\n \t\tqueueLowPriorityUpdate( UpdateAllocSize);\n \t}\n }", "TrackerAssignedOld loadTrackerAssignedOld(final Integer id);", "public void setIdLocal(int idLocal) {\r\n this.idLocal = idLocal;\r\n }", "public void setIdentifier(FactIdentifier param) {\r\n localIdentifierTracker = true;\r\n\r\n this.localIdentifier = param;\r\n\r\n\r\n }", "public void doPreSaveActions() {\n\t\tcalculateBlockedPartitions();\n\t}", "@Override\n\tpublic Serializable checkpointInfo() throws Exception {\n\t\treturn null;\n\t}", "public void addNeeded(long id) {\n\t\tidTracker.set(id);\n\t}", "public void onAlivenessChange(long nodehash, boolean b) { synchronized (this.nodedb) {\n\t\tNodeDB.NodeInfo n = this.nodedb.get(nodehash);\n\t\tif (n == null) return;\n\t\tif (n.alive == b) return;\n\t\tif ((n.isLocal) && !b) throw new RuntimeException(\"Local liveness change!!\");\n\n\t\tn.timestamp = System.currentTimeMillis();\n\t\tn.alive = b;\n\t\t\n\t\tGossipThread.getInstance().replicateNodeInfo(n);\n\t}}", "private void removeOldMember(InternalDistributedMember id) {\n super.markDepartedMember(id);\n }", "void ensureNode(int nodeId);", "public void setBatchId(String batchId) {\r\n this.batchId = batchId == null ? null : batchId.trim();\r\n }", "boolean markConfirmed(long billId);", "public void setActive(int id){\r\n\t\tif(_elementList.containsKey(id)){\r\n\t\t\t_elementList.get(id).isHit=false;\r\n\t\t\t_elementList.get(id).isActive=true;\t\t\t\r\n\t//\t\tSystem.out.println(\"active Checkpoint id\"+id);\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"Error CheckpointPool.setActive(\"+Integer.toHexString(id)+\") there is no such checkpoint\");\r\n\t\t}\r\n\t}", "void setAllocationState(@Nonnull Client client,\n @Nonnull Set<TCSResource<?>> alloc,\n @Nonnull List<Set<TCSResource<?>>> remainingClaim);", "private int indexOfExistingBatchId(int batchId, String action) {\n int index = indexOfBatchId(batchId);\n hardAssert(index >= 0 && index < queue.size(), \"Batches must exist to be %s\", action);\n return index;\n }", "public boolean reserveFlight(int id, int customerID, int flightNumber)\n throws RemoteException;", "public void setBatchId(String batchId) {\n this.batchId = batchId == null ? null : batchId.trim();\n }", "public void setId(int param){\r\n \r\n // setting primitive attribute tracker to true\r\n localIdTracker =\r\n param != java.lang.Integer.MIN_VALUE;\r\n \r\n this.localId=param;\r\n \r\n\r\n }", "@Test\n public void tesInvalidateMissingBlock() throws Exception {\n long blockSize = 1024;\n int heatbeatInterval = 1;\n HdfsConfiguration c = new HdfsConfiguration();\n c.setInt(DFSConfigKeys.DFS_HEARTBEAT_INTERVAL_KEY, heatbeatInterval);\n c.setLong(DFS_BLOCK_SIZE_KEY, blockSize);\n MiniDFSCluster cluster = new MiniDFSCluster.Builder(c).\n numDataNodes(1).build();\n try {\n cluster.waitActive();\n DFSTestUtil.createFile(cluster.getFileSystem(), new Path(\"/a\"),\n blockSize, (short)1, 0);\n\n String bpid = cluster.getNameNode().getNamesystem().getBlockPoolId();\n DataNode dn = cluster.getDataNodes().get(0);\n FsDatasetImpl fsdataset = (FsDatasetImpl) dn.getFSDataset();\n List<ReplicaInfo> replicaInfos = fsdataset.getFinalizedBlocks(bpid);\n assertEquals(1, replicaInfos.size());\n\n ReplicaInfo replicaInfo = replicaInfos.get(0);\n String blockPath = replicaInfo.getBlockURI().getPath();\n String metaPath = replicaInfo.getMetadataURI().getPath();\n File blockFile = new File(blockPath);\n File metaFile = new File(metaPath);\n\n // Mock local block file not found when disk with some exception.\n fsdataset.invalidateMissingBlock(bpid, replicaInfo);\n\n // Assert local block file wouldn't be deleted from disk.\n assertTrue(blockFile.exists());\n // Assert block info would be removed from ReplicaMap.\n assertEquals(\"null\",\n fsdataset.getReplicaString(bpid, replicaInfo.getBlockId()));\n BlockManager blockManager = cluster.getNameNode().\n getNamesystem().getBlockManager();\n GenericTestUtils.waitFor(() ->\n blockManager.getLowRedundancyBlocksCount() == 1, 100, 5000);\n\n // Mock local block file found when disk back to normal.\n FsVolumeSpi.ScanInfo info = new FsVolumeSpi.ScanInfo(\n replicaInfo.getBlockId(), blockFile.getParentFile().getAbsoluteFile(),\n blockFile.getName(), metaFile.getName(), replicaInfo.getVolume());\n fsdataset.checkAndUpdate(bpid, info);\n GenericTestUtils.waitFor(() ->\n blockManager.getLowRedundancyBlocksCount() == 0, 100, 5000);\n } finally {\n cluster.shutdown();\n }\n }", "@Override\n public void boardThePlane(int passengerId) {\n this.lock.lock();\n try {\n // update passenger state\n this.repository.updatePassengerState(PassengerState.IN_FLIGHT, passengerId);\n\n // add passenger to queue\n this.passengers.add(passengerId);\n this.passengersStillMissing--;\n this.lastPassengerToBoard = passengerId;\n\n // wake up hostess\n this.hostessWaitForLastPassengerBoard.signal();\n } finally {\n this.lock.unlock();\n }\n }", "public void init(long availSnapshotId) {\n this.availSnapshotInfoRef.set(new SnapshotInfo(availSnapshotId, availSnapshotId));\n }", "public void setDepID(java.lang.String param) {\r\n localDepIDTracker = param != null;\r\n\r\n this.localDepID = param;\r\n }", "void updateLandmarks() {\n\n\t\t\tregisterUpdateLandmarksTimer();\n\n\t\t\tint m = 2;\n\t\t\tfinal int expectedLandmarks = NumberOfLandmarks + m;\n\t\t\tIterator<Long> ier = pendingHSHLandmarks.keySet().iterator();\n\n\t\t\tSet<AddressIF> tmpList = new HashSet<AddressIF>(1);\n\t\t\tLong curRecord = null;\n\n\t\t\t// get a non-empty list of landmarks\n\t\t\twhile (ier.hasNext()) {\n\t\t\t\tLong nxt = ier.next();\n\t\t\t\tif (pendingHSHLandmarks.get(nxt).IndexOfLandmarks != null\n\t\t\t\t\t\t&& pendingHSHLandmarks.get(nxt).IndexOfLandmarks.size() > 0) {\n\t\t\t\t\ttmpList\n\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(nxt).IndexOfLandmarks);\n\t\t\t\t\tcurRecord = nxt;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if empty, we need to update landmarks immediately\n\t\t\tif (tmpList.size() == 0) {\n\t\t\t\t// remove the record\n\t\t\t\tif (curRecord != null) {\n\t\t\t\t\tpendingHSHLandmarks.get(curRecord).clear();\n\t\t\t\t\tpendingHSHLandmarks.remove(curRecord);\n\t\t\t\t} else {\n\t\t\t\t\t// null curRecord\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tfinal Long Timer = curRecord;\n\t\t\t\t// ping landmarks, if several of them fails, p percentage p=0.2\n\t\t\t\t// , we remove the records, and restart the landmark process\n\t\t\t\t// =================================================================\n\t\t\t\tfinal List<AddressIF> aliveLandmarks = new ArrayList<AddressIF>(\n\t\t\t\t\t\t1);\n\n\t\t\t\tNNManager.collectRTTs(tmpList, new CB2<Set<NodesPair>, String>() {\n\t\t\t\t\tprotected void cb(CBResult ncResult, Set<NodesPair> nps,\n\t\t\t\t\t\t\tString errorString) {\n\t\t\t\t\t\t// send data request message to the core node\n\t\t\t\t\t\tlong timer=System.currentTimeMillis();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (nps != null && nps.size() > 0) {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"\\n==================\\n Alive No. of landmarks: \"\n\t\t\t\t\t\t\t\t\t\t\t+ nps.size()\n\t\t\t\t\t\t\t\t\t\t\t+ \"\\n==================\\n\");\n\n\t\t\t\t\t\t\tIterator<NodesPair> NP = nps.iterator();\n\t\t\t\t\t\t\twhile (NP.hasNext()) {\n\t\t\t\t\t\t\t\tNodesPair tmp = NP.next();\n\t\t\t\t\t\t\t\tif (tmp != null && tmp.rtt >= 0) {\n\n\t\t\t\t\t\t\t\t\tAddressIF peer = (AddressIF)tmp.endNode;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//====================================================\n\t\t\t\t\t\t\t\t\tif (!ncManager.pendingLatency.containsKey(peer)) {\n\t\t\t\t\t\t\t\t\t\tncManager.pendingLatency.put(peer,\n\t\t\t\t\t\t\t\t\t\t\t\tnew RemoteState<AddressIF>(peer));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tncManager.pendingLatency.get(peer).addSample(tmp.rtt, timer);\n\t\t\t\t\t\t\t\t\t//=====================================================\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (!pendingHSHLandmarks.containsKey(Timer)\n\t\t\t\t\t\t\t\t\t\t\t|| pendingHSHLandmarks.get(Timer).IndexOfLandmarks == null) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tint index = pendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t\t.indexOf(peer);\n\n\t\t\t\t\t\t\t\t\tif (index < 0) {\n\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// found the element, and it is smaller\n\t\t\t\t\t\t\t\t\t\t// than\n\t\t\t\t\t\t\t\t\t\t// rank, i.e., it is closer to the\n\t\t\t\t\t\t\t\t\t\t// target\n\t\t\t\t\t\t\t\t\t\taliveLandmarks.add(peer);\n\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// wrong measurements\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// empty\n\t\t\t\t\t\t\t// all nodes fail, so there are no alive nodes\n\t\t\t\t\t\t\tif (pendingHSHLandmarks.containsKey(Timer)) {\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.remove(Timer);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// some landmarks are offline, we clear records and\n\t\t\t\t\t\t// start\n\t\t\t\t\t\tif (pendingHSHLandmarks.containsKey(Timer)) {\n\n\t\t\t\t\t\t\tif (aliveLandmarks.size() < 0.8 * expectedLandmarks) {\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.remove(Timer);\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// the landmarks are healthy, so we can sleep\n\t\t\t\t\t\t\t\t// awhile\n\t\t\t\t\t\t\t\t// TODO: remove dead landmarks, and resize the\n\t\t\t\t\t\t\t\t// landmarks\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t.clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t.addAll(aliveLandmarks);\n\n\t\t\t\t\t\t\t\t// pendingHSHLandmarks.get(Timer).readyForUpdate=false;\n\t\t\t\t\t\t\t\tfinal Set<AddressIF> nodes = new HashSet<AddressIF>(\n\t\t\t\t\t\t\t\t\t\t1);\n\n\t\t\t\t\t\t\t\tnodes\n\t\t\t\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(Timer).IndexOfLandmarks);\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).readyForUpdate = true;\n\n\t\t\t\t\t\t\t\t//update the rtts\n\t\t\t\t\t\t\t\t updateRTTs(Timer.longValue(),nodes, new\n\t\t\t\t\t\t\t\t CB1<String>(){ protected void cb(CBResult\n\t\t\t\t\t\t\t\t ncResult, String errorString){ switch\n\t\t\t\t\t\t\t\t (ncResult.state) { case OK: {\n\t\t\t\t\t\t\t\t System.out.println(\"$: Update completed\");\n\t\t\t\t\t\t\t\t System.out.println();\n\t\t\t\t\t\t\t\t if(errorString.length()<=0){\n\t\t\t\t\t\t\t\t pendingHSHLandmarks\n\t\t\t\t\t\t\t\t .get(Timer).readyForUpdate=true; }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break; } case ERROR: case TIMEOUT: { break; }\n\t\t\t\t\t\t\t\t } nodes.clear(); } });\n\t\t\t\t\t\t\t\t \n\n\t\t\t\t\t\t\t\treturn;\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\n\t\t\t}\n\n\t\t\t// ==================================================================\n\n\t\t\t// expected landmarks, K+m\n\n\t\t\tfinal Set<AddressIF> pendingNodes = new HashSet<AddressIF>(1);\n\n\t\t\tgetRandomNodes(pendingNodes, expectedLandmarks);\n\n\t\t\t// remove myself\n\t\t\tif (pendingNodes.contains(Ninaloader.me)) {\n\t\t\t\tpendingNodes.remove(Ninaloader.me);\n\t\t\t}\n\n\t\t\tSystem.out.println(\"$: HSH: Total number of landmarks are: \"\n\t\t\t\t\t+ pendingNodes.size());\n\n\t\t\tif (pendingNodes.size() == 0) {\n\t\t\t\tString errorString = \"$: HSH no valid nodes\";\n\t\t\t\tSystem.out.println(errorString);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tBarrier barrierUpdate = new Barrier(true);\n\t\t\tfinal StringBuffer errorBuffer = new StringBuffer();\n\n\t\t\tfinal long TimeStamp = System.currentTimeMillis();\n\n\t\t\tfor (AddressIF addr : pendingNodes) {\n\t\t\t\tseekLandmarks(TimeStamp, addr, barrierUpdate,\n\t\t\t\t\t\tpendingHSHLandmarks, errorBuffer);\n\t\t\t}\n\n\t\t\tEL.get().registerTimerCB(barrierUpdate, new CB0() {\n\t\t\t\tprotected void cb(CBResult result) {\n\t\t\t\t\tString errorString;\n\t\t\t\t\tif (errorBuffer.length() == 0) {\n\t\t\t\t\t\terrorString = new String(\"Success\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorString = new String(errorBuffer);\n\t\t\t\t\t}\n\n\t\t\t\t\t// finish the landmark seeking process\n\n\t\t\t\t\tif (!pendingHSHLandmarks.containsKey(Long\n\t\t\t\t\t\t\t.valueOf(TimeStamp))\n\t\t\t\t\t\t\t|| pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks == null) {\n\t\t\t\t\t\tSystem.out.println(\"$: NULL elements! \");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks\n\t\t\t\t\t\t\t.size() < (0.7 * expectedLandmarks)) {\n\t\t\t\t\t\tpendingHSHLandmarks.get(Long.valueOf(TimeStamp))\n\t\t\t\t\t\t\t\t.clear();\n\t\t\t\t\t\tpendingHSHLandmarks.remove(Long.valueOf(TimeStamp));\n\t\t\t\t\t\tSystem.out.println(\"$: not enough landmark nodes\");\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\tpendingHSHLandmarks.get(Long.valueOf(TimeStamp)).readyForUpdate = true;\n\t\t\t\t\t\tSystem.out.println(\"$: enough landmark nodes\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tfinal Set<AddressIF> nodes = new HashSet<AddressIF>(1);\n\t\t\t\t\t\tnodes\n\t\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks);\n\t\t\t\t\t\tupdateRTTs(Long.valueOf(TimeStamp), nodes, new CB1<String>() {\n\t\t\t\t\t\t\tprotected void cb(CBResult ncResult, String errorString) {\n\t\t\t\t\t\t\t\tswitch (ncResult.state) {\n\t\t\t\t\t\t\t\tcase OK: {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"$: Update completed\");\n\t\t\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase ERROR:\n\t\t\t\t\t\t\t\tcase TIMEOUT: {\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\t}\n\t\t\t\t\t\t\t\tnodes.clear();\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}\n\t\t\t});\n\t\t}", "Clock.Entry tryCommit(Transaction transaction, long id);", "public abstract void setIdHistoricalWrapper(Long id);", "private void setTransactionContextHolder(\n HazelcastMQContextHolder hazelcastMQContextHolder,\n boolean newHolder) {\n this.hazelcastMQContextHolder = hazelcastMQContextHolder;\n this.newHazelcastMQContextHolder = newHolder;\n }", "public Boolean makeLeader(Integer controllerId,\n PartitionStateInfo partitionStateInfo, Integer correlationId,\n kafka.server.OffsetManager offsetManager) {\n return Utils.inWriteLock(leaderIsrUpdateLock, () -> {\n Set<Integer> allReplicas = partitionStateInfo.allReplicas;\n LeaderIsrAndControllerEpoch leaderIsrAndControllerEpoch = partitionStateInfo.leaderIsrAndControllerEpoch;\n LeaderAndIsr leaderAndIsr = leaderIsrAndControllerEpoch.leaderAndIsr;\n // record the epoch of the controller that made the leadership decision. This is useful while updating the isr;\n // to maintain the decision maker controller's epoch in the zookeeper path;\n Integer controllerEpoch = leaderIsrAndControllerEpoch.controllerEpoch;\n // add replicas that are new;\n allReplicas.forEach(replica -> getOrCreateReplica(replica));\n Set<Replica> newInSyncReplicas = Sc.toSet(Sc.map(leaderAndIsr.isr, r -> getOrCreateReplica(r)));\n // remove assigned replicas that have been removed by the controller;\n// (assignedReplicas().stream().map(r->r.brokerId)-- allReplicas).foreach(removeReplica(_));\n Set<Integer> replicaBrokerIdList = Sc.map(assignedReplicas(), r -> r.brokerId);\n allReplicas.stream().filter(r -> !replicaBrokerIdList.contains(r)).forEach(this::removeReplica);\n inSyncReplicas = newInSyncReplicas;\n leaderEpoch = leaderAndIsr.leaderEpoch;\n zkVersion = leaderAndIsr.zkVersion;\n leaderReplicaIdOpt = Optional.of(localBrokerId);\n // construct the high watermark metadata for the new leader replica;\n Replica newLeaderReplica = getReplica().get();\n newLeaderReplica.convertHWToLocalOffsetMetadata();\n // reset log end offset for remote replicas;\n assignedReplicas().forEach(r -> {\n if (r.brokerId != localBrokerId) {\n r.logEndOffset_(LogOffsetMetadata.UnknownOffsetMetadata);\n }\n });\n // we may need to increment high watermark since ISR could be down to 1;\n maybeIncrementLeaderHW(newLeaderReplica);\n if (topic == OffsetManager.OffsetsTopicName)\n offsetManager.loadOffsetsFromLog(partitionId);\n return true;\n });\n }", "@Override\n\tpublic int updateByPrimaryKey(Checkingin record) {\n\t\treturn 0;\n\t}", "private void maintainMergeLocal() {\n logger.info(\"Maintaining Merge Local\");\n try {\n Bin mergeBin;\n synchronized (geometricParts) {\n mergeBin = geometricParts.findMergeCandidates();\n }\n if (!mergeBin.isEmpty()) {\n File indexShard = getNextIndexShardFolder(mergeBin.size + 1);\n // otherwise there's something to merge\n logger.info(\"Performing merge!\");\n\n\n // merge the shards\n Parameters p = this.globalParameters.clone();\n // override each of these particular parameters\n p.set(\"indexPath\", indexShard.getAbsolutePath());\n p.set(\"inputPath\", new ArrayList<>(mergeBin.getBinPaths()));\n p.set(\"renumberDocuments\", false);\n\n App.run(\"merge-index\", p, System.out);\n\n // should make sure that these two are uninteruppable\n synchronized (geometricParts) {\n geometricParts.add(mergeBin.size + 1, indexShard.getAbsolutePath());\n geometricParts.removeShards(mergeBin);\n updateIndex();\n }\n\n // now can delete the merged indexshard folders...\n for (String file : mergeBin.getBinPaths()) {\n FSUtil.deleteDirectory(new File(file));\n }\n\n logger.info(\"Done merging.\");\n }\n } catch (Exception ex) {\n Logger.getLogger(GeometricIndex.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void maybeFlush() {\n final long batchCount = this.batchCount.get();\n if (batchCount <= 0) {\n return;\n }\n\n if (outstandingCount.get() != 0\n && batchSerializedSize.get() < 65536\n && (batchCount < 16 || !requestObserver.isReady())) {\n return;\n }\n\n flush();\n }", "private void m145777g() {\n if (!this.f119477j.mo115499a() && !this.f119478k) {\n if (this.f119477j.f119582h) {\n nativeSetWalHook(this.f119482o);\n } else if (mo115435b(\"PRAGMA wal_autocheckpoint\", null, null) != 100) {\n mo115435b(\"PRAGMA wal_autocheckpoint=100\", null, null);\n }\n }\n }", "public void setAsStartingPoint() {\n\t\tnodeStatus = Status.occupied;\n\t}", "JournalOutputStream getCheckpointOutputStream(long latestSequenceNumber) throws IOException;", "private void verifyWorkerWritable(long workerId) throws Exception {\n // First see the worker usage\n MasterWorkerInfo worker = mBlockMaster.getWorker(workerId);\n long used = worker.getUsedBytes();\n // Commit a new block to the worker\n long newBlockId = 999L;\n long newBlockSize = 1024L;\n\n mBlockMaster.commitBlock(workerId, used + newBlockSize,\n \"MEM\", \"MEM\", newBlockId, newBlockSize);\n\n List<WorkerInfo> workers = mBlockMaster.getWorkerInfoList();\n WorkerInfo workerInfo = BlockMasterTestUtils.findWorkerInfo(workers, workerId);\n BlockMasterTestUtils.verifyBlockOnWorkers(\n mBlockMaster, newBlockId, newBlockSize, ImmutableList.of(workerInfo));\n }", "private void markPendingRequestAsSeen(String reqID) throws JSONException{\n\t JSONObject jo = BAPreferences.ConfigPreference().getPendingRequestAsJsonObject(reqID);//new JSONObject(req);\n\t jo.put(\"seen\", true);\n\t BAPreferences.ConfigPreference().setPendingRequest(reqID, jo);\n\t //editor.putString(jo.getString(\"RequestID\"), jo.toString());\n\t //editor.commit();\n\t \n\t //\n\t this.singletonEvents.onSetPendingGCMRequestToSeen.Raise(this, null);\n\t}", "private void notifyTaskStarted(int action) {\n Intent intent = new Intent(LocalAction.ACTION_BACKUP_SERVICE_STARTED);\n intent.putExtra(ACTION, action);\n intent.putExtra(CALLER_ID, mCallerId);\n mBroadcastManager.sendBroadcast(intent);\n // update the notification if required\n if (mNotificationBuilder != null) {\n mNotificationBuilder.setContentTitle(getNotificationContentTitle(action, false));\n startForeground(NotificationContract.NOTIFICATION_ID_BACKUP_PROGRESS, mNotificationBuilder.build());\n }\n }", "@Test\n public void handleResetLogUnitOldEpoch() {\n sendAndValidateResetLogUnit(0L, 1L, Layout.INVALID_EPOCH);\n\n // Verify that no operation was added to the BatchProcessor and that\n // no invalidating took place.\n verify(mBatchProcessor, never()).addTask(any(BatchWriterOperation.Type.class), any(RequestMsg.class));\n verify(mCache, never()).invalidateAll();\n verify(mStreamLog, never()).reset();\n }", "@PutMapping(\"/points/{customerId}\")\n @ResponseStatus(HttpStatus.NO_CONTENT)\n public void updatePointsOnAccount(@PathVariable(\"customerId\") int customerId, @RequestBody @Valid LevelUpViewModel lvm) {\n\n if (customerId != lvm.getCustomerId()) {\n throw new IllegalArgumentException(String.format(\"Id %s in the PathVariable does not match the Id %s in the RequestBody \", customerId, lvm.getCustomerId()));\n }\n\n serviceLayer.updatePoints(lvm);\n }" ]
[ "0.6473404", "0.5550946", "0.5384732", "0.53195953", "0.53189856", "0.5258512", "0.5144136", "0.510205", "0.50633395", "0.49794102", "0.49195683", "0.48520777", "0.46700713", "0.45364654", "0.44592166", "0.443182", "0.442402", "0.43478253", "0.4336916", "0.4336916", "0.4336916", "0.43124208", "0.43112394", "0.4243659", "0.42351273", "0.4220121", "0.42106804", "0.4184963", "0.41400707", "0.41180658", "0.41096815", "0.41079724", "0.409037", "0.40899792", "0.40886736", "0.4069786", "0.40325674", "0.40325674", "0.40265763", "0.40249282", "0.40023956", "0.40002644", "0.39920354", "0.39866245", "0.39711738", "0.39703333", "0.39514774", "0.39385626", "0.39317477", "0.3922777", "0.39160702", "0.39057997", "0.3897311", "0.38957554", "0.38946414", "0.38794792", "0.38793215", "0.38594872", "0.38530204", "0.3841949", "0.3840762", "0.3838041", "0.3831104", "0.38200825", "0.3797759", "0.37966672", "0.37912795", "0.37911966", "0.3748669", "0.37412107", "0.37405077", "0.37377733", "0.3736103", "0.372956", "0.3724465", "0.37242025", "0.37172493", "0.37167192", "0.37102082", "0.3708458", "0.3707459", "0.36971694", "0.3695022", "0.36943403", "0.36758775", "0.367432", "0.3673147", "0.36670017", "0.36597145", "0.3659285", "0.3658144", "0.3657837", "0.3657693", "0.3654989", "0.3654032", "0.36529306", "0.36500493", "0.36498457", "0.36480477", "0.3639627" ]
0.7558305
0
Returns the global checkpoint for the shard.
public synchronized long getCheckpoint() { return globalCheckpoint; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Checkpoint lastCheckpoint(){\n if(!checkpointRecordFile.exists()){\n return null;\n }\n return lastCheckpoint(rootDir);\n }", "private static HashMap<String, String> getLastCheckpoint() {\n return checkpoints.remove(Thread.currentThread());\n }", "private Parameters createCheckpoint() {\n Parameters checkpoint = Parameters.create();\n checkpoint.set(\"lastDoc/identifier\", this.lastAddedDocumentIdentifier);\n checkpoint.set(\"lastDoc/number\", this.lastAddedDocumentNumber);\n checkpoint.set(\"indexBlockCount\", this.indexBlockCount);\n Parameters shards = Parameters.create();\n for (Bin b : this.geometricParts.radixBins.values()) {\n for (String indexPath : b.getBinPaths()) {\n shards.set(indexPath, b.size);\n }\n }\n checkpoint.set(\"shards\", shards);\n return checkpoint;\n }", "public String toCheckpoint() {\n return null;\n }", "@Override\n\tpublic java.util.Date getCheckpoint() {\n\t\treturn _userSync.getCheckpoint();\n\t}", "public long flushCheckpoint()\r\n/* 119: */ {\r\n/* 120:150 */ return this.checkpoint;\r\n/* 121: */ }", "synchronized void updateCheckpointOnReplica(final long checkpoint) {\n /*\n * The global checkpoint here is a local knowledge which is updated under the mandate of the primary. It can happen that the primary\n * information is lagging compared to a replica (e.g., if a replica is promoted to primary but has stale info relative to other\n * replica shards). In these cases, the local knowledge of the global checkpoint could be higher than sync from the lagging primary.\n */\n if (this.globalCheckpoint <= checkpoint) {\n this.globalCheckpoint = checkpoint;\n logger.trace(\"global checkpoint updated from primary to [{}]\", checkpoint);\n }\n }", "@Override\n\tpublic Serializable checkpointInfo() throws Exception {\n\t\treturn null;\n\t}", "protected void checkpoint() {\n checkpoint = internalBuffer().readerIndex();\n }", "public String getCheckpointName() {\n\t\tfor(FreeVar current : specification.getBindings())\n\t\t{\n\t\t\tif(current.isBound())\n\t\t\t{\n\t\t\t\treturn getTopLevelType(current.binding());\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public List<Checkpoint> availableCheckpoints(){\n if(!checkpointRecordFile.exists()){\n return Collections.emptyList();\n }\n\n return availableCheckpoints(rootDir);\n }", "public static Checkpoint lastCheckpoint(File rootDir){\n List<Checkpoint> all = availableCheckpoints(rootDir);\n if(all.isEmpty()){\n return null;\n }\n return all.get(all.size()-1);\n }", "JournalOutputStream getCheckpointOutputStream(long latestSequenceNumber) throws IOException;", "static String getLastCheckpointAsString() {\n HashMap<String, String> checkpoint = getLastCheckpoint();\n if (checkpoint == null) {\n return \"0 \";\n } else {\n StringBuilder sb = new StringBuilder();\n sb.append(checkpoint.size()).append(\" \");\n for (String name : checkpoint.keySet()) {\n sb.append(name).append(\"#####\");\n sb.append(checkpoint.get(name)).append(\"#####\");\n }\n return sb.toString();\n }\n }", "public String getConsistencyFilePath()\n {\n String consistency_file_path = getPreferenceStore().getString(CONSISTENCY_FILE_PATH);\n return consistency_file_path;\n }", "@Override public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException {\n IgniteThread cpThread = new IgniteThread(cctx.igniteInstanceName(), \"db-checkpoint-thread\", checkpointer);\n\n cpThread.start();\n\n checkpointerThread = cpThread;\n\n CheckpointProgressSnapshot chp = checkpointer.wakeupForCheckpoint(0, \"node started\");\n\n if (chp != null)\n chp.cpBeginFut.get();\n }", "public File getFileForCheckpoint(Checkpoint checkpoint){\n return getFileForCheckpoint(checkpoint.getCheckpointNum());\n }", "private static CheckpointBo getCheckpoint(ICheckpointDao dao, String id, Date defaultTimestamp) {\n CheckpointBo checkpoint = dao.getCheckpoint(id);\n return checkpoint != null ? checkpoint : CheckpointBo.newInstance(id, defaultTimestamp);\n }", "private int getSavedOption(){\n SharedPreferences preferences = getSharedPreferences(PREFERENCE_FILE_NAME, MODE_PRIVATE);\n\n return preferences.getInt(SAVED_WORKSPACE_POSITION_PREFERENCE_FIELD, -1);\n }", "@Nullable\n public ModelCheckpoints getState(@NotNull SModel model) {\n if (isCheckpointModel(model)) {\n // FIXME provisional fix.\n // Assume if input comes from a checkpoint, it's the one already loaded, look at\n // transients first, then among persisted. Perhaps, shall extract CP identity from the model and use it to find proper MCp.\n // Alternatively, shall keep model reference of the origin along with CP model, so that can navigate to an appropriate MCp/CpV\n // using model reference as for the general scenario. However, don't want to persist origin model ref in a CP model, and didn't\n // come up with a nice way to satisfy that (filtering model attributes are not to my liking).\n for (ModelCheckpoints mcp : myTransientCheckpoints.values()) {\n CheckpointState cps = mcp.findStateWith(model);\n if (cps != null) {\n return mcp;\n }\n }\n for (CheckpointVault cpv : myPersistedCheckpoints.values()) {\n ModelCheckpoints mcp = cpv.getCheckpointsIfOwns(model);\n if (mcp != null) {\n return mcp;\n }\n }\n return null;\n }\n ModelCheckpoints mcp = getTransientCheckpoints(model.getReference());\n if (mcp != null) {\n return mcp;\n }\n // FIXME once accessed, perhaps ModelCheckpoints instance shall be kept in myTransientCheckpoints or myExposedPersisted?\n return getPersistedCheckpoints(model).getCheckpointsFor((m, cp) -> {\n // XXX for now, expose whole ModelCheckpoints at once, although just specific CheckpointState\n // (accessed later though MC.find) would suffice\n SModel exposed = createBlankCheckpointModel(model.getReference(), null /*FIXME need distinct method to create CP model from existing*/, cp);\n new CloneUtil(m, exposed).cloneModelWithImports();\n assert exposed instanceof ModelWithAttributes;\n assert m instanceof ModelWithAttributes;\n ((ModelWithAttributes) m).forEachAttribute(((ModelWithAttributes) exposed)::setAttribute);\n myModule.addModelToKeep(exposed.getReference(), true);\n CheckpointIdentity persistedCheckpoint = readIdentityAttributes((ModelWithAttributes) m, GENERATION_PLAN, CHECKPOINT);\n CheckpointIdentity prevCheckpoint = readIdentityAttributes((ModelWithAttributes) m, PREV_GENERATION_PLAN, PREV_CHECKPOINT);\n assert cp.equals(persistedCheckpoint) : String.format(\"CP consistency issue: expected to read CP %s, but model comes with CP value %s\", cp, persistedCheckpoint);\n return new CheckpointState(exposed, prevCheckpoint, cp);\n });\n }", "public boolean doCheckpoint() {\n CountDownLatch latch = null;\n boolean fullCheckpoint;\n synchronized(this) { \n latch = nextCheckpointCountDownLatch;\n nextCheckpointCountDownLatch = new CountDownLatch(1);\n fullCheckpoint = this.fullCheckPoint;\n this.fullCheckPoint=false; \n } \n try {\n \n log.debug(\"Checkpoint started.\");\n RecordLocation newMark = null;\n \n ArrayList futureTasks = new ArrayList(queues.size()+topics.size());\n \n //\n // We do many partial checkpoints (fullCheckpoint==false) to move topic messages\n // to long term store as soon as possible. \n // \n // We want to avoid doing that for queue messages since removes the come in the same\n // checkpoint cycle will nullify the previous message add. Therefore, we only\n // checkpoint queues on the fullCheckpoint cycles.\n //\n if( fullCheckpoint ) { \n Iterator iterator = queues.values().iterator();\n while (iterator.hasNext()) {\n try {\n final JournalMessageStore ms = (JournalMessageStore) iterator.next();\n FutureTask task = new FutureTask(new Callable() {\n public Object call() throws Exception {\n return ms.checkpoint();\n }});\n futureTasks.add(task);\n checkpointExecutor.execute(task); \n }\n catch (Exception e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n }\n }\n \n Iterator iterator = topics.values().iterator();\n while (iterator.hasNext()) {\n try {\n final JournalTopicMessageStore ms = (JournalTopicMessageStore) iterator.next();\n FutureTask task = new FutureTask(new Callable() {\n public Object call() throws Exception {\n return ms.checkpoint();\n }});\n futureTasks.add(task);\n checkpointExecutor.execute(task); \n }\n catch (Exception e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n }\n \n try {\n for (Iterator iter = futureTasks.iterator(); iter.hasNext();) {\n FutureTask ft = (FutureTask) iter.next();\n RecordLocation mark = (RecordLocation) ft.get();\n // We only set a newMark on full checkpoints.\n if( fullCheckpoint ) {\n if (mark != null && (newMark == null || newMark.compareTo(mark) < 0)) {\n newMark = mark;\n }\n }\n }\n } catch (Throwable e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n \n \n if( fullCheckpoint ) {\n try {\n if (newMark != null) {\n log.debug(\"Marking journal at: \" + newMark);\n journal.setMark(newMark, true);\n }\n }\n catch (Exception e) {\n log.error(\"Failed to mark the Journal: \" + e, e);\n }\n \n if (longTermPersistence instanceof JDBCPersistenceAdapter) {\n // We may be check pointing more often than the checkpointInterval if under high use\n // But we don't want to clean up the db that often.\n long now = System.currentTimeMillis();\n if( now > lastCleanup+checkpointInterval ) {\n lastCleanup = now;\n ((JDBCPersistenceAdapter) longTermPersistence).cleanup();\n }\n }\n }\n \n log.debug(\"Checkpoint done.\");\n }\n finally {\n latch.countDown();\n }\n synchronized(this) {\n return this.fullCheckPoint;\n } \n \n }", "private CheckpointVault getPersistedCheckpoints(SModel model) {\n // FIXME synchronization - synchronized or concurrent map?\n CheckpointVault cpv = myPersistedCheckpoints.get(model.getReference());\n if (cpv == null) {\n cpv = new CheckpointVault(myStreamProvider.getStreamManager(model));\n cpv.readCheckpointRegistry();\n myPersistedCheckpoints.put(model.getReference(), cpv);\n }\n return cpv;\n }", "public ShardState getShardState() {\n return state;\n }", "private MetadataCheckpointPolicy getNoOpCheckpointPolicy() {\n DurableLogConfig dlConfig = DurableLogConfig\n .builder()\n .with(DurableLogConfig.CHECKPOINT_COMMIT_COUNT, Integer.MAX_VALUE)\n .with(DurableLogConfig.CHECKPOINT_TOTAL_COMMIT_LENGTH, Long.MAX_VALUE)\n .build();\n\n return new MetadataCheckpointPolicy(dlConfig, Runnables.doNothing(), executorService());\n }", "private static GeneticProgram loadCheckpoint(String arg) {\n CheckpointLoader cpl = new CheckpointLoader(arg);\n GeneticProgram gp = cpl.instantiate();\n if (gp == null) {\n System.err.println(\"Could not load checkpoint.\");\n System.exit(-1);\n }\n return gp;\n }", "private void restoreToCheckpoint(Parameters checkpoint) {\n assert geometricParts.diskShardCount() == 0 : \"Restore to Checkpoint should only be called at startup!\";\n\n this.lastAddedDocumentIdentifier = checkpoint.getString(\"lastDoc/identifier\");\n this.lastAddedDocumentNumber = (int) checkpoint.getLong(\"lastDoc/number\");\n this.indexBlockCount = (int) checkpoint.getLong(\"indexBlockCount\");\n Parameters shards = checkpoint.getMap(\"shards\");\n for (String indexPath : shards.getKeys()) {\n this.geometricParts.add((int) shards.getLong(indexPath), indexPath);\n }\n }", "static synchronized void makeNewCheckpoint() {\n HashMap<String, String> newCheckpoint = new HashMap<>(localState);\n checkpoints.put(Thread.currentThread(), newCheckpoint);\n }", "public File getFileForCheckpoint(int checkpointNum) {\n return getFileForCheckpoint(rootDir, checkpointNum);\n }", "public ComputationGraph loadCheckpointCG(Checkpoint checkpoint){\n return loadCheckpointCG(checkpoint.getCheckpointNum());\n }", "private int indexUntilCheckpointCount() {\n int total = 0;\n for (int i = 0; i < MAX_CHECKPOINTS_BEHIND; i++) {\n final int numDocs = randomIntBetween(1, 5);\n for (int j = 0; j < numDocs; ++j) {\n indexDoc();\n }\n total += numDocs;\n refresh(INDEX_NAME);\n }\n return total;\n }", "public int getStueck() {\r\n\t\treturn stueck;\r\n\t}", "public java.lang.Byte getCheckStep () {\n\t\treturn checkStep;\n\t}", "int getBacklog();", "edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation getStoreChunkLocation();", "public String getSaveLocation() {\n return saveLocation;\n }", "public Double getMinimal_transaction_scoring() {\n return minimal_transaction_scoring;\n }", "private long getInitLastLoggedZxid() {\n if (self.getLearnerType() == LearnerType.PARTICIPANT) {\n return self.getLastLoggedZxid();\n } else {\n return Long.MIN_VALUE;\n }\n }", "public final void mT__82() throws RecognitionException {\n try {\n int _type = T__82;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:65:7: ( 'checkpoint' )\n // InternalDSL.g:65:9: 'checkpoint'\n {\n match(\"checkpoint\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void save(){\n checkpoint = chapter;\n }", "void checkpoint() throws IOException;", "@DISPID(49)\r\n\t// = 0x31. The runtime will prefer the VTID if present\r\n\t@VTID(47)\r\n\tjava.util.Date lastCheckpointDateTime();", "public float getSavedPenX() {\n return savedPen.getLevelValue(PLevel.Type.X);\n }", "ClusterState state() {\n return clusterStateSupplier.get();\n }", "public Integer getStorekeeperid() {\n return storekeeperid;\n }", "public int getSaveVersion()\n {\n return saveVersion;\n }", "public static String getSharedPrefs() {\n return SHARED_PREFS;\n }", "public int retrieveCoin()\n {\n int coin1;\n SharedPreferences preferences = getSharedPreferences(\"COIN_PREFS\", 0);\n\n coin1 = preferences.getInt(\"coin\", 0);\n return coin1;\n }", "public edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation getStoreChunkLocation() {\n if (msgCase_ == 7) {\n return (edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation) msg_;\n }\n return edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation.getDefaultInstance();\n }", "public String clusterState() {\n return this.clusterState;\n }", "public double getCheckingBalance() {\n return checkingBalance;\n }", "com.google.protobuf.ByteString getSnapshotLocationBytes();", "public void checkpoint(boolean sync, boolean fullCheckpoint) {\n try {\n if (journal == null )\n throw new IllegalStateException(\"Journal is closed.\");\n \n long now = System.currentTimeMillis();\n CountDownLatch latch = null;\n synchronized(this) {\n latch = nextCheckpointCountDownLatch;\n lastCheckpointRequest = now;\n if( fullCheckpoint ) {\n this.fullCheckPoint = true; \n }\n }\n \n checkpointTask.wakeup();\n \n if (sync) {\n log.debug(\"Waking for checkpoint to complete.\");\n latch.await();\n }\n }\n catch (InterruptedException e) {\n log.warn(\"Request to start checkpoint failed: \" + e, e);\n }\n }", "public void flushCheckpoint(long checkpoint)\r\n/* 124: */ {\r\n/* 125:155 */ this.checkpoint = checkpoint;\r\n/* 126: */ }", "public int topKnight() {\r\n\t\treturn knights[numKnights - 1];\r\n\t}", "public edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation getStoreChunkLocation() {\n if (storeChunkLocationBuilder_ == null) {\n if (msgCase_ == 7) {\n return (edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation) msg_;\n }\n return edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation.getDefaultInstance();\n } else {\n if (msgCase_ == 7) {\n return storeChunkLocationBuilder_.getMessage();\n }\n return edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation.getDefaultInstance();\n }\n }", "public static ComputationGraph loadCheckpointCG(File rootDir, Checkpoint checkpoint){\n return loadCheckpointCG(rootDir, checkpoint.getCheckpointNum());\n }", "int getPokeStorage();", "public Object onRetainNonConfigurationInstance()\n \t{\n \t\tfinal int location = sessionScrollLocation;\n \t\treturn location;\n \t}", "public int minKnight() {\r\n\t\treturn enviroment;\r\n\t}", "public static OperatorChecker getDefault() {\n synchronized (MccMncConfig.class) {\n if (sChecker != null) {\n OperatorChecker operatorChecker = sChecker;\n return operatorChecker;\n }\n }\n }", "public Node getSaveNode() {\n return getSaveNode(true);\n }", "@DISPID(40)\r\n\t// = 0x28. The runtime will prefer the VTID if present\r\n\t@VTID(39)\r\n\tboolean checkpointRestartEnabled();", "@Override\r\n\tpublic double getStoredGazeScore() {\n\t\treturn this.gazeScore;\r\n\t}", "private String checkpointString(int cp, long time) {\n\t\treturn \"Checkpoint \" + ChatColor.GRAY + String.valueOf(cp) + ChatColor.WHITE + \" = \" + ChatColor.GRAY + _.getGameController().getTimeString(0, time) + ChatColor.WHITE;\n\t}", "int getCurrentXOfSS();", "public sRectangle getSavedSRectangleBound()\n {\n return savedSRectangleBound;\n }", "@DISPID(41)\r\n\t// = 0x29. The runtime will prefer the VTID if present\r\n\t@VTID(40)\r\n\tjava.lang.String checkpointRestartValue();", "private static SharedPreferences getSharedPreference(Context context){\n return PreferenceManager.getDefaultSharedPreferences(context);\n }", "public CoreState getCurrentStatus() {\n return doStuffStrategy.determineCurrentStatus(this, 3000);\r\n }", "public synchronized void writeCheckpoint() {\n\t\tflush();\n\t\tpw.println(\"CHECKPOINT \" \n\t\t\t\t\t+ TransactionManager.instance().transactionList());\n\t\tflush();\n\t}", "public int getDownloadssincelastStart() {\r\n return sessionDownloads.get();\r\n }", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "public CloudState getCloudState();", "public edu.usfca.cs.dfs.StorageMessages.StoreChunkLocationOrBuilder getStoreChunkLocationOrBuilder() {\n if ((msgCase_ == 7) && (storeChunkLocationBuilder_ != null)) {\n return storeChunkLocationBuilder_.getMessageOrBuilder();\n } else {\n if (msgCase_ == 7) {\n return (edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation) msg_;\n }\n return edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation.getDefaultInstance();\n }\n }", "public boolean getSAVETRIP() {\n\t\tsharedPreferences = context.getSharedPreferences(\"TRIP\",\n\t\t\t\tcontext.MODE_PRIVATE);\n\t\treturn sharedPreferences.getBoolean(\"SAVETRIP\", false);\n\t}", "public int getTotal_rain_global(){\n\t\treturn total_rain_global;\n\t}", "public java.lang.String getSFF() {\r\n return localSFF;\r\n }", "public edu.usfca.cs.dfs.StorageMessages.StoreChunkLocationOrBuilder getStoreChunkLocationOrBuilder() {\n if (msgCase_ == 7) {\n return (edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation) msg_;\n }\n return edu.usfca.cs.dfs.StorageMessages.StoreChunkLocation.getDefaultInstance();\n }", "public static int getCurrentScore(Context context)\n {\n SharedPreferences preferences = context.getSharedPreferences(\n context.getString(R.string.preference_key),Context.MODE_PRIVATE);\n return preferences.getInt(CURRENT_SCORE_KEY,0);\n }", "public StaveGlyph getStave()\n {\n if(parent != null) return parent.getStave();\n else return null;\n }", "public int getRecord(){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext()); return prefs.getInt(\"record\", -1);\n }", "public String saveCurrentGameState() {\r\n\t\treturn null;\r\n\t}", "public int getFINEAMTProm () {\n\t\treturn promedioFINEAMT;\n\t}", "@Override public long checkpointReadLockTimeout() {\n return checkpointReadLockTimeout;\n }", "public int getSeed()\n {\n return map.getSeed();\n }", "public byte[] getSeedActive()\n {\n return this.seedActive;\n }", "public int getPokeStorage() {\n return pokeStorage_;\n }", "public ComputationGraph loadCheckpointCG(int checkpointNum) {\n return loadCheckpointCG(rootDir, checkpointNum);\n }", "private String getHeaviestLoadPartition() {\n HashMap<String, Integer> numPartitionConnections = new HashMap<>();\n List<String> channels = producerConnectionsManager.getChannels();\n for (String channel : channels) {\n String partition = Partition.get(channel);\n if (!numPartitionConnections.containsKey(partition)) {\n numPartitionConnections.put(partition, 0);\n }\n numPartitionConnections.put(partition, numPartitionConnections.get(partition) +\n producerConnectionsManager.getConnections(channel).size());\n }\n\n String heaviestLoadPartition = null;\n int heaviestLoad = 0;\n Iterator<String> partitions = numPartitionConnections.keySet().iterator();\n while (partitions.hasNext()) {\n String partition = partitions.next();\n if (numPartitionConnections.get(partition) > heaviestLoad) {\n heaviestLoad = numPartitionConnections.get(partition);\n heaviestLoadPartition = partition;\n }\n }\n return heaviestLoadPartition;\n }", "private long getPeerEpoch() {\n if (self.getLearnerType() == LearnerType.PARTICIPANT) {\n try {\n return self.getCurrentEpoch();\n } catch (IOException e) {\n RuntimeException re = new RuntimeException(e.getMessage());\n re.setStackTrace(e.getStackTrace());\n throw re;\n }\n } else {\n return Long.MIN_VALUE;\n }\n }", "public long storageOffset() {\n return TH.THTensor_(storageOffset)(this);\n }", "public float getSavedPressure() {\n return savedPen.getLevelValue(PLevel.Type.PRESSURE);\n }", "private Location getLastKnownLocation(){\n \t \tLocation loc = LocationUtil.getBestLastKnowLocation(ctx);\t\n \t \tStatus.getCurrentStatus().setLocation(loc);\t\n \t \treturn loc;\n \t}", "public MultiLayerNetwork loadCheckpointMLN(Checkpoint checkpoint){\n return loadCheckpointMLN(checkpoint.getCheckpointNum());\n }", "public int getPokeStorage() {\n return pokeStorage_;\n }", "public GameSaveLoad getD_GameSaveLoad() {\n return d_GameSaveLoad;\n }", "edu.usfca.cs.dfs.StorageMessages.BackUp getBackup();", "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 getCheckOut() {\n return checkOut;\n }", "protected HashSet initReqProcessedHash() {\n HashSet procHash = new HashSet();\n try {\n // Opens the checkpoint file and creates the set of already processed\n // requests.\n BufferedReader reader = new BufferedReader(new FileReader(chkptFile));\n String line = null;\n while ((line = reader.readLine()) != null) {\n procHash.add(line);\n }\n reader.close();\n log.info(i18n.getString(\"previousCheckPoint\"));\n } catch (IOException e) {\n log.info(i18n.getString(\"noPreviousCheckPoint\"));\n }\n return procHash;\n }" ]
[ "0.6068443", "0.5821556", "0.57984257", "0.5706482", "0.55592984", "0.548863", "0.5420951", "0.53661793", "0.52422893", "0.51925015", "0.51258683", "0.5116392", "0.51139766", "0.5112382", "0.50556505", "0.5019973", "0.49790356", "0.49599892", "0.49299964", "0.49218217", "0.4913791", "0.4913191", "0.488604", "0.4871731", "0.484956", "0.4817387", "0.48100886", "0.477416", "0.4696951", "0.46211338", "0.46211225", "0.4604787", "0.46020457", "0.46018034", "0.45967603", "0.45751643", "0.45600113", "0.45582852", "0.45308754", "0.45289248", "0.45273042", "0.45263365", "0.45241883", "0.4519113", "0.45147404", "0.45087516", "0.449747", "0.4484988", "0.44839442", "0.446669", "0.4452837", "0.44525436", "0.4450322", "0.44385284", "0.44257006", "0.4416204", "0.44134033", "0.4406188", "0.44019", "0.43982205", "0.43945432", "0.43936342", "0.43903857", "0.43867764", "0.4382692", "0.43823406", "0.43787202", "0.43770275", "0.4367619", "0.43614015", "0.4353893", "0.4340536", "0.43159547", "0.43156424", "0.43115324", "0.43106413", "0.43098152", "0.43030223", "0.43010116", "0.429925", "0.42950702", "0.42935124", "0.4291819", "0.428459", "0.42840874", "0.4283762", "0.42755172", "0.42695314", "0.4265587", "0.42642686", "0.42590043", "0.4253862", "0.42515042", "0.42500123", "0.42397347", "0.4237073", "0.4235408", "0.42302263", "0.42260814", "0.42188254" ]
0.7667132
0
Updates the global checkpoint on a replica shard after it has been updated by the primary.
synchronized void updateCheckpointOnReplica(final long checkpoint) { /* * The global checkpoint here is a local knowledge which is updated under the mandate of the primary. It can happen that the primary * information is lagging compared to a replica (e.g., if a replica is promoted to primary but has stale info relative to other * replica shards). In these cases, the local knowledge of the global checkpoint could be higher than sync from the lagging primary. */ if (this.globalCheckpoint <= checkpoint) { this.globalCheckpoint = checkpoint; logger.trace("global checkpoint updated from primary to [{}]", checkpoint); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flushCheckpoint(long checkpoint)\r\n/* 124: */ {\r\n/* 125:155 */ this.checkpoint = checkpoint;\r\n/* 126: */ }", "protected void checkpoint() {\n checkpoint = internalBuffer().readerIndex();\n }", "private void restoreToCheckpoint(Parameters checkpoint) {\n assert geometricParts.diskShardCount() == 0 : \"Restore to Checkpoint should only be called at startup!\";\n\n this.lastAddedDocumentIdentifier = checkpoint.getString(\"lastDoc/identifier\");\n this.lastAddedDocumentNumber = (int) checkpoint.getLong(\"lastDoc/number\");\n this.indexBlockCount = (int) checkpoint.getLong(\"indexBlockCount\");\n Parameters shards = checkpoint.getMap(\"shards\");\n for (String indexPath : shards.getKeys()) {\n this.geometricParts.add((int) shards.getLong(indexPath), indexPath);\n }\n }", "@Override public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException {\n IgniteThread cpThread = new IgniteThread(cctx.igniteInstanceName(), \"db-checkpoint-thread\", checkpointer);\n\n cpThread.start();\n\n checkpointerThread = cpThread;\n\n CheckpointProgressSnapshot chp = checkpointer.wakeupForCheckpoint(0, \"node started\");\n\n if (chp != null)\n chp.cpBeginFut.get();\n }", "public long flushCheckpoint()\r\n/* 119: */ {\r\n/* 120:150 */ return this.checkpoint;\r\n/* 121: */ }", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "Update withReplicaCount(int count);", "void checkpoint(Node node) throws RepositoryException;", "@Override\n public void markShardCopyAsStaleIfNeeded(ShardId shardId, String allocationId, long primaryTerm, ActionListener<Void> listener) {\n listener.onResponse(null);\n }", "void checkpoint() throws IOException;", "public void checkpoint(boolean sync, boolean fullCheckpoint) {\n try {\n if (journal == null )\n throw new IllegalStateException(\"Journal is closed.\");\n \n long now = System.currentTimeMillis();\n CountDownLatch latch = null;\n synchronized(this) {\n latch = nextCheckpointCountDownLatch;\n lastCheckpointRequest = now;\n if( fullCheckpoint ) {\n this.fullCheckPoint = true; \n }\n }\n \n checkpointTask.wakeup();\n \n if (sync) {\n log.debug(\"Waking for checkpoint to complete.\");\n latch.await();\n }\n }\n catch (InterruptedException e) {\n log.warn(\"Request to start checkpoint failed: \" + e, e);\n }\n }", "@Override\n\tpublic void setCheckpoint(java.util.Date checkpoint) {\n\t\t_userSync.setCheckpoint(checkpoint);\n\t}", "static synchronized void makeNewCheckpoint() {\n HashMap<String, String> newCheckpoint = new HashMap<>(localState);\n checkpoints.put(Thread.currentThread(), newCheckpoint);\n }", "public synchronized long getCheckpoint() {\n return globalCheckpoint;\n }", "@Test\n public void testUpdateCheckpointLeaseUpdated() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n leaseRefresher.renewLease(coordinator.getCurrentlyHeldLease(leaseKey));\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n lease.leaseCounter(lease.leaseCounter() + 1);\n // Counter and owner changed, but checkpoint did not.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "@Test\n public void testUpdateCheckpoint() throws Exception {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n // Run the taker and renewer in-between getting the Lease object and calling checkpoint\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n if (lease == null) {\n List<Lease> leases = leaseRefresher.listLeases();\n for (Lease kinesisClientLease : leases) {\n System.out.println(kinesisClientLease);\n }\n }\n\n assertNotNull(lease);\n final ExtendedSequenceNumber initialCheckpoint = new ExtendedSequenceNumber(\"initialCheckpoint\");\n final ExtendedSequenceNumber pendingCheckpoint = new ExtendedSequenceNumber(\"pendingCheckpoint\");\n final ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n final byte[] checkpointState = \"checkpointState\".getBytes();\n\n // lease's leaseCounter is wrong at this point, but it shouldn't matter.\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), initialCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtInitialCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, leaseFromDDBAtInitialCheckpoint);\n\n dynamoDBCheckpointer.prepareCheckpoint(lease.leaseKey(), pendingCheckpoint, lease.concurrencyToken().toString(), checkpointState);\n\n final Lease leaseFromDDBAtPendingCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(initialCheckpoint);\n lease.pendingCheckpoint(pendingCheckpoint);\n lease.pendingCheckpointState(checkpointState);\n assertEquals(lease, leaseFromDDBAtPendingCheckpoint);\n\n assertTrue(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, lease.concurrencyToken()));\n\n final Lease leaseFromDDBAtNewCheckpoint = leaseRefresher.getLease(lease.leaseKey());\n lease.leaseCounter(lease.leaseCounter() + 1);\n lease.checkpoint(newCheckpoint);\n lease.pendingCheckpoint(null);\n lease.pendingCheckpointState(null);\n assertEquals(lease, leaseFromDDBAtNewCheckpoint);\n }", "private void maybeIncrementLeaderHW(Replica leaderReplica) {\n Set<LogOffsetMetadata> allLogEndOffsets = Sc.map(inSyncReplicas, r -> r.logEndOffset());\n LogOffsetMetadata newHighWatermark = allLogEndOffsets.stream().min(LogOffsetMetadata::compare).get();\n LogOffsetMetadata oldHighWatermark = leaderReplica.highWatermark();\n if (oldHighWatermark.precedes(newHighWatermark)) {\n StringBuilder s = new StringBuilder();\n inSyncReplicas.forEach(r -> s.append(String.format(\"id%s.logEnd=%s\", r.brokerId, r.logEndOffset())));\n logger.info(String.format(\"=== maybeIncrementLeaderHW.id%s.highWatermark =%s log[%s]\", leaderReplica.brokerId, newHighWatermark, s));\n// Utils.printStack();\n leaderReplica.highWatermark_(newHighWatermark);\n debug(String.format(\"High watermark for partition <%s,%d> updated to %s\", topic, partitionId, newHighWatermark));\n // some delayed requests may be unblocked after HW changed;\n TopicAndPartition requestKey = new TopicAndPartition(this.topic, this.partitionId);\n replicaManager.unblockDelayedFetchRequests(requestKey);\n replicaManager.unblockDelayedProduceRequests(requestKey);\n } else {\n debug(String.format(\"Skipping update high watermark since Old hw %s is larger than new hw %s for partition <%s,%d>. All leo's are %s\",\n oldHighWatermark, newHighWatermark, topic, partitionId, allLogEndOffsets.toString()));\n }\n }", "public void save(){\n checkpoint = chapter;\n }", "@Override\n public void updateWithReplica(StorageLocation replicaLocation) {\n File diskFile = null;\n try {\n diskFile = new File(replicaLocation.getUri());\n } catch (IllegalArgumentException e) {\n diskFile = null;\n }\n\n if (null == diskFile) {\n setDirInternal(null);\n } else {\n setDirInternal(diskFile.getParentFile());\n }\n }", "public boolean doCheckpoint() {\n CountDownLatch latch = null;\n boolean fullCheckpoint;\n synchronized(this) { \n latch = nextCheckpointCountDownLatch;\n nextCheckpointCountDownLatch = new CountDownLatch(1);\n fullCheckpoint = this.fullCheckPoint;\n this.fullCheckPoint=false; \n } \n try {\n \n log.debug(\"Checkpoint started.\");\n RecordLocation newMark = null;\n \n ArrayList futureTasks = new ArrayList(queues.size()+topics.size());\n \n //\n // We do many partial checkpoints (fullCheckpoint==false) to move topic messages\n // to long term store as soon as possible. \n // \n // We want to avoid doing that for queue messages since removes the come in the same\n // checkpoint cycle will nullify the previous message add. Therefore, we only\n // checkpoint queues on the fullCheckpoint cycles.\n //\n if( fullCheckpoint ) { \n Iterator iterator = queues.values().iterator();\n while (iterator.hasNext()) {\n try {\n final JournalMessageStore ms = (JournalMessageStore) iterator.next();\n FutureTask task = new FutureTask(new Callable() {\n public Object call() throws Exception {\n return ms.checkpoint();\n }});\n futureTasks.add(task);\n checkpointExecutor.execute(task); \n }\n catch (Exception e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n }\n }\n \n Iterator iterator = topics.values().iterator();\n while (iterator.hasNext()) {\n try {\n final JournalTopicMessageStore ms = (JournalTopicMessageStore) iterator.next();\n FutureTask task = new FutureTask(new Callable() {\n public Object call() throws Exception {\n return ms.checkpoint();\n }});\n futureTasks.add(task);\n checkpointExecutor.execute(task); \n }\n catch (Exception e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n }\n \n try {\n for (Iterator iter = futureTasks.iterator(); iter.hasNext();) {\n FutureTask ft = (FutureTask) iter.next();\n RecordLocation mark = (RecordLocation) ft.get();\n // We only set a newMark on full checkpoints.\n if( fullCheckpoint ) {\n if (mark != null && (newMark == null || newMark.compareTo(mark) < 0)) {\n newMark = mark;\n }\n }\n }\n } catch (Throwable e) {\n log.error(\"Failed to checkpoint a message store: \" + e, e);\n }\n \n \n if( fullCheckpoint ) {\n try {\n if (newMark != null) {\n log.debug(\"Marking journal at: \" + newMark);\n journal.setMark(newMark, true);\n }\n }\n catch (Exception e) {\n log.error(\"Failed to mark the Journal: \" + e, e);\n }\n \n if (longTermPersistence instanceof JDBCPersistenceAdapter) {\n // We may be check pointing more often than the checkpointInterval if under high use\n // But we don't want to clean up the db that often.\n long now = System.currentTimeMillis();\n if( now > lastCleanup+checkpointInterval ) {\n lastCleanup = now;\n ((JDBCPersistenceAdapter) longTermPersistence).cleanup();\n }\n }\n }\n \n log.debug(\"Checkpoint done.\");\n }\n finally {\n latch.countDown();\n }\n synchronized(this) {\n return this.fullCheckPoint;\n } \n \n }", "private void updateIfStale() {\n if (DateTimeUtils.currentTimeMillis() - globalLastDrainMillis >= maxStaleMillis) {\n synchronized (counterShards) {\n if (DateTimeUtils.currentTimeMillis() - globalLastDrainMillis >= maxStaleMillis) {\n drainThreadToShared();\n globalLastDrainMillis = DateTimeUtils.currentTimeMillis();\n }\n }\n }\n }", "public void overflowNotification(RecordLocation safeLocation) {\n checkpoint(false, true);\n }", "void restart(String resourceGroupName, String resourceName, String replicaName);", "public synchronized void writeCheckpoint() {\n\t\tflush();\n\t\tpw.println(\"CHECKPOINT \" \n\t\t\t\t\t+ TransactionManager.instance().transactionList());\n\t\tflush();\n\t}", "public void checkpoint(boolean hasUncommittedData) throws SQLException;", "public synchronized void updateLocalCheckpoint(final String allocationId, final long checkpoint) {\n final int indexOfKey = inSyncLocalCheckpoints.indexOf(allocationId);\n if (indexOfKey >= 0) {\n final long current = inSyncLocalCheckpoints.indexGet(indexOfKey);\n if (current < checkpoint) {\n inSyncLocalCheckpoints.indexReplace(indexOfKey, checkpoint);\n if (logger.isTraceEnabled()) {\n logger.trace(\"updated local checkpoint of [{}] to [{}] (was [{}])\", allocationId, checkpoint, current);\n }\n } else {\n logger.trace(\n \"skipping update of local checkpoint [{}], current checkpoint is higher (current [{}], incoming [{}], type [{}])\",\n allocationId,\n current,\n checkpoint,\n allocationId);\n }\n } else {\n logger.trace(\"[{}] isn't marked as in sync. ignoring local checkpoint of [{}].\", allocationId, checkpoint);\n }\n }", "public int update(StoreFeedBack storeFeedBack);", "default void process_final_updates(MutableBeaconState state) {\n /* current_epoch = get_current_epoch(state)\n next_epoch = current_epoch + 1 */\n EpochNumber current_epoch = get_current_epoch(state);\n EpochNumber next_epoch = current_epoch.increment();\n\n /* Reset eth1 data votes\n if (state.slot + 1) % SLOTS_PER_ETH1_VOTING_PERIOD == 0:\n state.eth1_data_votes = [] */\n if (state.getSlot().increment().modulo(getConstants().getSlotsPerEth1VotingPeriod())\n .equals(SlotNumber.ZERO)) {\n state.getEth1DataVotes().clear();\n }\n\n /* Update effective balances with hysteresis\n for index, validator in enumerate(state.validator_registry):\n balance = state.balances[index]\n HALF_INCREMENT = EFFECTIVE_BALANCE_INCREMENT // 2\n if balance < validator.effective_balance or validator.effective_balance + 3 * HALF_INCREMENT < balance:\n validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE) */\n Gwei half_increment = getConstants().getEffectiveBalanceIncrement().dividedBy(2);\n for (ValidatorIndex index : state.getValidatorRegistry().size()) {\n ValidatorRecord validator = state.getValidatorRegistry().get(index);\n Gwei balance = state.getBalances().get(index);\n if (balance.less(validator.getEffectiveBalance())\n || validator.getEffectiveBalance().plus(half_increment.times(3)).less(balance)) {\n state.getValidatorRegistry().update(index,\n v -> ValidatorRecord.Builder.fromRecord(v)\n .withEffectiveBalance(\n UInt64s.min(\n balance.minus(Gwei.castFrom(balance.modulo(getConstants().getEffectiveBalanceIncrement()))),\n getConstants().getMaxEffectiveBalance()))\n .build());\n }\n }\n\n /* Update start shard\n state.latest_start_shard = (state.latest_start_shard + get_shard_delta(state, current_epoch)) % SHARD_COUNT */\n state.setLatestStartShard(state.getLatestStartShard()\n .plusModulo(get_shard_delta(state, current_epoch), getConstants().getShardCount()));\n\n /* Set active index root\n index_root_position = (next_epoch + ACTIVATION_EXIT_DELAY) % LATEST_ACTIVE_INDEX_ROOTS_LENGTH\n state.latest_active_index_roots[index_root_position] = hash_tree_root(\n get_active_validator_indices(state, next_epoch + ACTIVATION_EXIT_DELAY)\n ) */\n EpochNumber index_root_position = next_epoch.plusModulo(getConstants().getActivationExitDelay(),\n getConstants().getLatestActiveIndexRootsLength());\n state.getLatestActiveIndexRoots().set(index_root_position,\n hash_tree_root(\n get_active_validator_indices(state, next_epoch.plus(getConstants().getActivationExitDelay()))));\n\n /* Set total slashed balances\n state.latest_slashed_balances[next_epoch % LATEST_SLASHED_EXIT_LENGTH] = (\n state.latest_slashed_balances[current_epoch % LATEST_SLASHED_EXIT_LENGTH]\n ) */\n state.getLatestSlashedBalances().set(next_epoch.modulo(getConstants().getLatestSlashedExitLength()),\n state.getLatestSlashedBalances().get(current_epoch.modulo(getConstants().getLatestSlashedExitLength())));\n\n /* Set randao mix\n state.latest_randao_mixes[next_epoch % LATEST_RANDAO_MIXES_LENGTH] = get_randao_mix(state, current_epoch) */\n state.getLatestRandaoMixes().set(next_epoch.modulo(getConstants().getLatestRandaoMixesLength()),\n get_randao_mix(state, current_epoch));\n\n /* Set historical root accumulator\n if next_epoch % (SLOTS_PER_HISTORICAL_ROOT // SLOTS_PER_EPOCH) == 0:\n historical_batch = HistoricalBatch(\n block_roots=state.latest_block_roots,\n state_roots=state.latest_state_roots,\n )\n state.historical_roots.append(hash_tree_root(historical_batch)) */\n if (next_epoch.modulo(getConstants().getSlotsPerHistoricalRoot().dividedBy(getConstants().getSlotsPerEpoch()))\n .equals(EpochNumber.ZERO)) {\n HistoricalBatch historical_batch =\n new HistoricalBatch(state.getLatestBlockRoots().vectorCopy(), state.getLatestStateRoots().vectorCopy());\n state.getHistoricalRoots().add(hash_tree_root(historical_batch));\n }\n\n /* Rotate current/previous epoch attestations\n state.previous_epoch_attestations = state.current_epoch_attestations\n state.current_epoch_attestations = [] */\n state.getPreviousEpochAttestations().replaceAll(state.getCurrentEpochAttestations().listCopy());\n state.getCurrentEpochAttestations().clear();\n }", "protected abstract void shardOperationOnPrimary(\n Request shardRequest,\n IndexShard primary,\n ActionListener<PrimaryResult<ReplicaRequest, Response>> listener\n );", "@Override\n\tpublic void update() {\n\t\tif(isSaveScore()){\n\t\t\tsaveScore();\n\t\t\tmanager.reconstruct();\n\t\t}\n\t\tmanager.move();\n\t}", "@Test\n public void testReplicaMapAfterDatanodeRestart() throws Exception {\n Configuration conf = new HdfsConfiguration();\n MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf, new File(GenericTestUtils.getRandomizedTempPath())).nnTopology(MiniDFSNNTopology.simpleFederatedTopology(2)).build();\n try {\n cluster.waitActive();\n NameNode nn1 = cluster.getNameNode(0);\n NameNode nn2 = cluster.getNameNode(1);\n Assert.assertNotNull(\"cannot create nn1\", nn1);\n Assert.assertNotNull(\"cannot create nn2\", nn2);\n // check number of volumes in fsdataset\n DataNode dn = cluster.getDataNodes().get(0);\n FsDatasetImpl dataSet = ((FsDatasetImpl) (DataNodeTestUtils.getFSDataset(dn)));\n List<FsVolumeSpi> volumes = null;\n try (FsDatasetSpi.FsVolumeReferences referredVols = dataSet.getFsVolumeReferences()) {\n // number of volumes should be 2 - [data1, data2]\n Assert.assertEquals(\"number of volumes is wrong\", 2, referredVols.size());\n volumes = new ArrayList(referredVols.size());\n for (FsVolumeSpi vol : referredVols) {\n volumes.add(vol);\n }\n }\n ArrayList<String> bpList = new ArrayList(Arrays.asList(cluster.getNamesystem(0).getBlockPoolId(), cluster.getNamesystem(1).getBlockPoolId()));\n Assert.assertTrue(\"Cluster should have 2 block pools\", ((bpList.size()) == 2));\n createReplicas(bpList, volumes, cluster.getFsDatasetTestUtils(dn));\n ReplicaMap oldReplicaMap = new ReplicaMap(new AutoCloseableLock());\n oldReplicaMap.addAll(dataSet.volumeMap);\n cluster.restartDataNode(0);\n cluster.waitActive();\n dn = cluster.getDataNodes().get(0);\n dataSet = ((FsDatasetImpl) (dn.getFSDataset()));\n testEqualityOfReplicaMap(oldReplicaMap, dataSet.volumeMap, bpList);\n } finally {\n cluster.shutdown();\n }\n }", "protected void checkUpdate() {\n \t\t// only update from remote server every so often.\n \t\tif ( ( System.currentTimeMillis() - lastUpdated ) > refreshInterval ) return;\n \t\t\n \t\tClusterTask task = getSessionUpdateTask();\n \t\tObject o = CacheFactory.doSynchronousClusterTask( task, this.nodeId );\n \t\tthis.copy( (Session) o );\n \t\t\n \t\tlastUpdated = System.currentTimeMillis();\n \t}", "@NotNull private GridCacheDatabaseSharedManager.CheckpointProgress updateCurrentCheckpointProgress() {\n final CheckpointProgress curr;\n\n synchronized (this) {\n curr = scheduledCp;\n\n curr.state(LOCK_TAKEN);\n\n if (curr.reason == null)\n curr.reason = \"timeout\";\n\n // It is important that we assign a new progress object before checkpoint mark in page memory.\n scheduledCp = new CheckpointProgress(checkpointFreq);\n\n curCpProgress = curr;\n }\n return curr;\n }", "@Transactional\r\n\tpublic void updateScore(Trip trip) {\n\t\t\r\n\t}", "void restart(String resourceGroupName, String resourceName, String replicaName, Context context);", "@Override public void postGlobal() {\n for(int i=1;i<_chkSums.length;++i) _chkSums[i] += _chkSums[i-1];\n }", "public void checkpointRecoveryPointOffsets() {\n Table<String, TopicAndPartition, Log> recoveryPointsByDir = Utils.groupBy(this.logsByTopicPartition(), new Function2<TopicAndPartition, Log, String>() {\n @Override\n public String apply(TopicAndPartition _1, Log _2) {\n return _2.dir.getParent();\n }\n });\n for (File dir : logDirs) {\n Map<TopicAndPartition, Log> recoveryPoints = recoveryPointsByDir.row(dir.toString());\n if (recoveryPoints != null)\n this.recoveryPointCheckpoints.get(dir).write(Utils.map(recoveryPoints, new Function2<TopicAndPartition, Log, Tuple2<TopicAndPartition, Long>>() {\n @Override\n public Tuple2<TopicAndPartition, Long> apply(TopicAndPartition arg1, Log log) {\n return Tuple2.make(arg1, log.recoveryPoint);\n }\n }));\n }\n }", "private void notifyReplicaNode(SystemMetadata cnSystemMetadata, NodeReference nodeId)\n throws InvalidToken, NotAuthorized, NotImplemented, ServiceFailure, NotFound, InvalidRequest {\n\n // Characterize the replica MemberNode\n Node replicaNode = nodeCommunications.getNodeRegistryService().getNode(nodeId);\n if (!replicaNode.getType().equals(NodeType.MN)) \n return; //quietly\n \n \n boolean isV1Tier3 = false;\n boolean isV2Tier3 = false;\n boolean hasTier3 = false;\n // Find out if a tier 3 node, if not then do not callback since it is not implemented\n for (Service service : replicaNode.getServices().getServiceList()) {\n if (service.getName() != null && service.getName().equals(\"MNStorage\") && service.getAvailable()) {\n if (service.getVersion().equalsIgnoreCase(\"V1\")) {\n isV1Tier3 = true;\n hasTier3 = true;\n } else if (service.getVersion().equalsIgnoreCase(\"V2\")) {\n isV2Tier3 = true;\n hasTier3 = true;\n }\n }\n }\n if (!hasTier3)\n return; //quietly\n \n // If this far, notify the replicaNode\n \n // removed the sanity checks on notification - there isn't a clear reason for them, \n // and more likely to fail for trivial reasons (NPEs, IOExceptions) and cause some trouble. \n // (was added 11/11/2011, part of #1979, today is 10/22/2015)\n // (the code used to retrieve the systemMetadata from the replica node\n // and make sure the modified time was different)\n \n \n NodeComm nodeComm = null;\n try {\n // get a nodeComm to occupy one of the communication slots in the pool\n // but it's going to be simpler logic to ignore existing MnRead from\n // the NodeComm, and get an MNode from a D1Client instead\n // TODO: this should be refactored to allow use of mock objects for\n // unit testing (we shouldn't be going outside of the NodeComm bundle)\n nodeComm = NodeCommSyncObjectFactory.getInstance().getNodeComm(nodeId);\n \n if (isV2Tier3) {\n org.dataone.client.v2.itk.D1Client.getMN(replicaNode.getBaseURL())\n .systemMetadataChanged(session, \n cnSystemMetadata.getIdentifier(),\n cnSystemMetadata.getSerialVersion().longValue(), \n cnSystemMetadata.getDateSysMetadataModified());\n logger.info(buildStandardLogMessage(null,\" Notified (v2) \" + nodeId.getValue()));\n } \n else if (isV1Tier3) {\n org.dataone.client.v1.itk.D1Client.getMN(replicaNode.getBaseURL())\n .systemMetadataChanged(session, \n cnSystemMetadata.getIdentifier(),\n cnSystemMetadata.getSerialVersion().longValue(), \n cnSystemMetadata.getDateSysMetadataModified());\n logger.info(buildStandardLogMessage(null,\" Notified (v1) \" + nodeId.getValue()));\n }\n } catch (NodeCommUnavailable e) {\n throw new ServiceFailure(\"0000\", \"In notifyReplicaNode: \" + e.getMessage());\n } finally {\n if (nodeComm != null)\n nodeComm.setState(NodeCommState.AVAILABLE);\n }\n }", "private Parameters createCheckpoint() {\n Parameters checkpoint = Parameters.create();\n checkpoint.set(\"lastDoc/identifier\", this.lastAddedDocumentIdentifier);\n checkpoint.set(\"lastDoc/number\", this.lastAddedDocumentNumber);\n checkpoint.set(\"indexBlockCount\", this.indexBlockCount);\n Parameters shards = Parameters.create();\n for (Bin b : this.geometricParts.radixBins.values()) {\n for (String indexPath : b.getBinPaths()) {\n shards.set(indexPath, b.size);\n }\n }\n checkpoint.set(\"shards\", shards);\n return checkpoint;\n }", "private void doMasterUpdates() \n throws Exception {\n\n int txnRounds = 0;\n int tempRound = roundPerSync;\n\n UpdateRange range = new UpdateRange();\n\n openStore();\n\n Transaction txn = null;\n while (runnable) {\n if (Utils.VERBOSE) {\n System.out.println\n (\"Updating rounds left on Master: \" + totalRounds);\n }\n\n /* Traverse the database and do updates. */\n for (int i = range.getStart(); i <= range.getEnd(); i++) {\n /* Create a new transaction for every txnOps operations. */\n if ((i - 1) % txnOps == 0) {\n txn = master.beginTransaction(null, null);\n txnRounds++;\n }\n\n /* Do updates. */\n if (range.doDelete(i)) {\n doDeleteWork(primaryIndex, txn, i);\n } else {\n /* Updates and inserts are actually putting a record. */\n doPutWork(primaryIndex, txn, range, i, txnRounds);\n }\n }\n\n /* Shift the range so that it can traverse the database again. */\n range.shift();\n\n /* Exit the loop if the updates have been finished. */\n if (--totalRounds == 0) {\n runnable = false;\n }\n\n /* If a round of traverses finishes, synch the group. */\n if (--tempRound == 0 || !runnable) {\n dbStore.close();\n Utils.doSyncAndCheck(repEnvInfo);\n if (runnable) {\n openStore();\n }\n tempRound = roundPerSync;\n }\n }\n }", "private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }", "private void updateScore(int point) {\n SharedPreferences preferences = getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putInt(SCORE_KEY, mScore);\n\n }", "public void testAddReplicaWhileWritesBlocked() throws Exception {\n final String primaryNode = internalCluster().startNode();\n createIndex(INDEX_NAME);\n ensureYellowAndNoInitializingShards(INDEX_NAME);\n final String replicaNode = internalCluster().startNode();\n ensureGreen(INDEX_NAME);\n\n final IndexShard primaryShard = getIndexShard(primaryNode, INDEX_NAME);\n final List<String> replicaNodes = new ArrayList<>();\n replicaNodes.add(replicaNode);\n assertEqualSegmentInfosVersion(replicaNodes, primaryShard);\n\n final CountDownLatch latch = new CountDownLatch(1);\n final AtomicInteger totalDocs = new AtomicInteger(0);\n try (final Releasable ignored = blockReplication(replicaNodes, latch)) {\n Thread indexingThread = new Thread(() -> { totalDocs.getAndSet(indexUntilCheckpointCount()); });\n indexingThread.start();\n indexingThread.join();\n latch.await();\n indexDoc();\n totalDocs.incrementAndGet();\n refresh(INDEX_NAME);\n // index again while we are stale.\n assertBusy(() -> {\n expectThrows(OpenSearchRejectedExecutionException.class, () -> {\n indexDoc();\n totalDocs.incrementAndGet();\n });\n });\n final String replica_2 = internalCluster().startNode();\n assertAcked(\n client().admin()\n .indices()\n .prepareUpdateSettings(INDEX_NAME)\n .setSettings(Settings.builder().put(SETTING_NUMBER_OF_REPLICAS, 2))\n );\n replicaNodes.add(replica_2);\n }\n ensureGreen(INDEX_NAME);\n waitForSearchableDocs(totalDocs.get(), replicaNodes);\n refresh(INDEX_NAME);\n // wait for the replicas to catch up after block is released.\n assertReplicaCheckpointUpdated(primaryShard);\n\n // index another doc showing there is no pressure enforced.\n indexDoc();\n refresh(INDEX_NAME);\n waitForSearchableDocs(totalDocs.incrementAndGet(), replicaNodes.toArray(new String[] {}));\n verifyStoreContent();\n }", "@DISPID(40)\r\n\t// = 0x28. The runtime will prefer the VTID if present\r\n\t@VTID(39)\r\n\tboolean checkpointRestartEnabled();", "void updateLandmarks() {\n\n\t\t\tregisterUpdateLandmarksTimer();\n\n\t\t\tint m = 2;\n\t\t\tfinal int expectedLandmarks = NumberOfLandmarks + m;\n\t\t\tIterator<Long> ier = pendingHSHLandmarks.keySet().iterator();\n\n\t\t\tSet<AddressIF> tmpList = new HashSet<AddressIF>(1);\n\t\t\tLong curRecord = null;\n\n\t\t\t// get a non-empty list of landmarks\n\t\t\twhile (ier.hasNext()) {\n\t\t\t\tLong nxt = ier.next();\n\t\t\t\tif (pendingHSHLandmarks.get(nxt).IndexOfLandmarks != null\n\t\t\t\t\t\t&& pendingHSHLandmarks.get(nxt).IndexOfLandmarks.size() > 0) {\n\t\t\t\t\ttmpList\n\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(nxt).IndexOfLandmarks);\n\t\t\t\t\tcurRecord = nxt;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if empty, we need to update landmarks immediately\n\t\t\tif (tmpList.size() == 0) {\n\t\t\t\t// remove the record\n\t\t\t\tif (curRecord != null) {\n\t\t\t\t\tpendingHSHLandmarks.get(curRecord).clear();\n\t\t\t\t\tpendingHSHLandmarks.remove(curRecord);\n\t\t\t\t} else {\n\t\t\t\t\t// null curRecord\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tfinal Long Timer = curRecord;\n\t\t\t\t// ping landmarks, if several of them fails, p percentage p=0.2\n\t\t\t\t// , we remove the records, and restart the landmark process\n\t\t\t\t// =================================================================\n\t\t\t\tfinal List<AddressIF> aliveLandmarks = new ArrayList<AddressIF>(\n\t\t\t\t\t\t1);\n\n\t\t\t\tNNManager.collectRTTs(tmpList, new CB2<Set<NodesPair>, String>() {\n\t\t\t\t\tprotected void cb(CBResult ncResult, Set<NodesPair> nps,\n\t\t\t\t\t\t\tString errorString) {\n\t\t\t\t\t\t// send data request message to the core node\n\t\t\t\t\t\tlong timer=System.currentTimeMillis();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (nps != null && nps.size() > 0) {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"\\n==================\\n Alive No. of landmarks: \"\n\t\t\t\t\t\t\t\t\t\t\t+ nps.size()\n\t\t\t\t\t\t\t\t\t\t\t+ \"\\n==================\\n\");\n\n\t\t\t\t\t\t\tIterator<NodesPair> NP = nps.iterator();\n\t\t\t\t\t\t\twhile (NP.hasNext()) {\n\t\t\t\t\t\t\t\tNodesPair tmp = NP.next();\n\t\t\t\t\t\t\t\tif (tmp != null && tmp.rtt >= 0) {\n\n\t\t\t\t\t\t\t\t\tAddressIF peer = (AddressIF)tmp.endNode;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//====================================================\n\t\t\t\t\t\t\t\t\tif (!ncManager.pendingLatency.containsKey(peer)) {\n\t\t\t\t\t\t\t\t\t\tncManager.pendingLatency.put(peer,\n\t\t\t\t\t\t\t\t\t\t\t\tnew RemoteState<AddressIF>(peer));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tncManager.pendingLatency.get(peer).addSample(tmp.rtt, timer);\n\t\t\t\t\t\t\t\t\t//=====================================================\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (!pendingHSHLandmarks.containsKey(Timer)\n\t\t\t\t\t\t\t\t\t\t\t|| pendingHSHLandmarks.get(Timer).IndexOfLandmarks == null) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tint index = pendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t\t.indexOf(peer);\n\n\t\t\t\t\t\t\t\t\tif (index < 0) {\n\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// found the element, and it is smaller\n\t\t\t\t\t\t\t\t\t\t// than\n\t\t\t\t\t\t\t\t\t\t// rank, i.e., it is closer to the\n\t\t\t\t\t\t\t\t\t\t// target\n\t\t\t\t\t\t\t\t\t\taliveLandmarks.add(peer);\n\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// wrong measurements\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// empty\n\t\t\t\t\t\t\t// all nodes fail, so there are no alive nodes\n\t\t\t\t\t\t\tif (pendingHSHLandmarks.containsKey(Timer)) {\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.remove(Timer);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// some landmarks are offline, we clear records and\n\t\t\t\t\t\t// start\n\t\t\t\t\t\tif (pendingHSHLandmarks.containsKey(Timer)) {\n\n\t\t\t\t\t\t\tif (aliveLandmarks.size() < 0.8 * expectedLandmarks) {\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.remove(Timer);\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// the landmarks are healthy, so we can sleep\n\t\t\t\t\t\t\t\t// awhile\n\t\t\t\t\t\t\t\t// TODO: remove dead landmarks, and resize the\n\t\t\t\t\t\t\t\t// landmarks\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t.clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t.addAll(aliveLandmarks);\n\n\t\t\t\t\t\t\t\t// pendingHSHLandmarks.get(Timer).readyForUpdate=false;\n\t\t\t\t\t\t\t\tfinal Set<AddressIF> nodes = new HashSet<AddressIF>(\n\t\t\t\t\t\t\t\t\t\t1);\n\n\t\t\t\t\t\t\t\tnodes\n\t\t\t\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(Timer).IndexOfLandmarks);\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).readyForUpdate = true;\n\n\t\t\t\t\t\t\t\t//update the rtts\n\t\t\t\t\t\t\t\t updateRTTs(Timer.longValue(),nodes, new\n\t\t\t\t\t\t\t\t CB1<String>(){ protected void cb(CBResult\n\t\t\t\t\t\t\t\t ncResult, String errorString){ switch\n\t\t\t\t\t\t\t\t (ncResult.state) { case OK: {\n\t\t\t\t\t\t\t\t System.out.println(\"$: Update completed\");\n\t\t\t\t\t\t\t\t System.out.println();\n\t\t\t\t\t\t\t\t if(errorString.length()<=0){\n\t\t\t\t\t\t\t\t pendingHSHLandmarks\n\t\t\t\t\t\t\t\t .get(Timer).readyForUpdate=true; }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break; } case ERROR: case TIMEOUT: { break; }\n\t\t\t\t\t\t\t\t } nodes.clear(); } });\n\t\t\t\t\t\t\t\t \n\n\t\t\t\t\t\t\t\treturn;\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\n\t\t\t}\n\n\t\t\t// ==================================================================\n\n\t\t\t// expected landmarks, K+m\n\n\t\t\tfinal Set<AddressIF> pendingNodes = new HashSet<AddressIF>(1);\n\n\t\t\tgetRandomNodes(pendingNodes, expectedLandmarks);\n\n\t\t\t// remove myself\n\t\t\tif (pendingNodes.contains(Ninaloader.me)) {\n\t\t\t\tpendingNodes.remove(Ninaloader.me);\n\t\t\t}\n\n\t\t\tSystem.out.println(\"$: HSH: Total number of landmarks are: \"\n\t\t\t\t\t+ pendingNodes.size());\n\n\t\t\tif (pendingNodes.size() == 0) {\n\t\t\t\tString errorString = \"$: HSH no valid nodes\";\n\t\t\t\tSystem.out.println(errorString);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tBarrier barrierUpdate = new Barrier(true);\n\t\t\tfinal StringBuffer errorBuffer = new StringBuffer();\n\n\t\t\tfinal long TimeStamp = System.currentTimeMillis();\n\n\t\t\tfor (AddressIF addr : pendingNodes) {\n\t\t\t\tseekLandmarks(TimeStamp, addr, barrierUpdate,\n\t\t\t\t\t\tpendingHSHLandmarks, errorBuffer);\n\t\t\t}\n\n\t\t\tEL.get().registerTimerCB(barrierUpdate, new CB0() {\n\t\t\t\tprotected void cb(CBResult result) {\n\t\t\t\t\tString errorString;\n\t\t\t\t\tif (errorBuffer.length() == 0) {\n\t\t\t\t\t\terrorString = new String(\"Success\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorString = new String(errorBuffer);\n\t\t\t\t\t}\n\n\t\t\t\t\t// finish the landmark seeking process\n\n\t\t\t\t\tif (!pendingHSHLandmarks.containsKey(Long\n\t\t\t\t\t\t\t.valueOf(TimeStamp))\n\t\t\t\t\t\t\t|| pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks == null) {\n\t\t\t\t\t\tSystem.out.println(\"$: NULL elements! \");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks\n\t\t\t\t\t\t\t.size() < (0.7 * expectedLandmarks)) {\n\t\t\t\t\t\tpendingHSHLandmarks.get(Long.valueOf(TimeStamp))\n\t\t\t\t\t\t\t\t.clear();\n\t\t\t\t\t\tpendingHSHLandmarks.remove(Long.valueOf(TimeStamp));\n\t\t\t\t\t\tSystem.out.println(\"$: not enough landmark nodes\");\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\tpendingHSHLandmarks.get(Long.valueOf(TimeStamp)).readyForUpdate = true;\n\t\t\t\t\t\tSystem.out.println(\"$: enough landmark nodes\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tfinal Set<AddressIF> nodes = new HashSet<AddressIF>(1);\n\t\t\t\t\t\tnodes\n\t\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks);\n\t\t\t\t\t\tupdateRTTs(Long.valueOf(TimeStamp), nodes, new CB1<String>() {\n\t\t\t\t\t\t\tprotected void cb(CBResult ncResult, String errorString) {\n\t\t\t\t\t\t\t\tswitch (ncResult.state) {\n\t\t\t\t\t\t\t\tcase OK: {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"$: Update completed\");\n\t\t\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase ERROR:\n\t\t\t\t\t\t\t\tcase TIMEOUT: {\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\t}\n\t\t\t\t\t\t\t\tnodes.clear();\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}\n\t\t\t});\n\t\t}", "public void checkpointStateChanged(final CheckpointState newCheckpointState) {\n \t\tthis.taskManager.checkpointStateChanged(this.environment.getJobID(), this.vertexID, newCheckpointState);\n \t}", "@Test\n public void testUpdateCheckpointBadConcurrencyToken() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, UUID.randomUUID()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n // Owner should be the only thing that changed.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "public void updateShard(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.UpdateClusterShardRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.operation.OperationOuterClass.Operation> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateShardMethod(), responseObserver);\n }", "Update withPartitionCount(int count);", "public void doPreSaveActions() {\n\t\tcalculateBlockedPartitions();\n\t}", "@Test\n public void persistedCorfuTableCheckpointTest() {\n String path = PARAMETERS.TEST_TEMP_DIR;\n\n CorfuRuntime rt = getDefaultRuntime();\n\n final UUID tableId = UUID.randomUUID();\n final PersistenceOptionsBuilder persistenceOptions = PersistenceOptions.builder()\n .dataPath(Paths.get(path + tableId + \"writer\"));\n final int numKeys = 303;\n\n try (PersistedCorfuTable<String, String> table = rt.getObjectsView()\n .build()\n .setTypeToken(PersistedCorfuTable.<String, String>getTypeToken())\n .setStreamID(tableId)\n .setSerializer(Serializers.JSON)\n .setArguments(persistenceOptions.build(), Serializers.JSON)\n .open()) {\n\n for (int x = 0; x < numKeys; x++) {\n table.insert(String.valueOf(x), \"payload\" + x);\n }\n assertThat(table.size()).isEqualTo(numKeys);\n\n MultiCheckpointWriter mcw = new MultiCheckpointWriter();\n mcw.addMap(table);\n Token token = mcw.appendCheckpoints(rt, \"Author1\");\n rt.getAddressSpaceView().prefixTrim(token);\n rt.getAddressSpaceView().gc();\n }\n\n CorfuRuntime newRt = getNewRuntime();\n\n persistenceOptions.dataPath(Paths.get(path + tableId + \"reader\"));\n try (PersistedCorfuTable<String, String> table = newRt.getObjectsView().build()\n .setTypeToken(PersistedCorfuTable.<String, String>getTypeToken())\n .setStreamID(tableId)\n .setSerializer(Serializers.JSON)\n .setArguments(persistenceOptions.build(), Serializers.JSON)\n .open()) {\n\n assertThat(Iterators.elementsEqual(table.entryStream().iterator(),\n table.entryStream().iterator())).isTrue();\n assertThat(table.size()).isEqualTo(numKeys);\n\n }\n }", "@Override\n public void onNewClusterState(ClusterState state) {\n transportService.sendRequest(\n clusterService.localNode(),\n transportReplicaAction,\n replicaRequest,\n new ActionListenerResponseHandler<>(onCompletionListener, ReplicaResponse::new)\n );\n }", "public void updateShard(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.UpdateClusterShardRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.operation.OperationOuterClass.Operation> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getUpdateShardMethod(), getCallOptions()), request, responseObserver);\n }", "void documentModifyStatusUpdated(SingleDocumentModel model);", "void documentModifyStatusUpdated(SingleDocumentModel model);", "public void onAlivenessChange(long nodehash, boolean b) { synchronized (this.nodedb) {\n\t\tNodeDB.NodeInfo n = this.nodedb.get(nodehash);\n\t\tif (n == null) return;\n\t\tif (n.alive == b) return;\n\t\tif ((n.isLocal) && !b) throw new RuntimeException(\"Local liveness change!!\");\n\n\t\tn.timestamp = System.currentTimeMillis();\n\t\tn.alive = b;\n\t\t\n\t\tGossipThread.getInstance().replicateNodeInfo(n);\n\t}}", "void callForBackup() {\n List<Resource> redundantList = resourceRepository.findAllByIsRedundantIsTrue();\n System.out.println(\"Invoking redundant instance from list: \" + redundantList);\n if (redundantList != null && redundantList.size() > 0) {\n Resource redundantResource = redundantList.get(0);\n redundantResource.setRedundant(false);\n resourceRepository.save(redundantResource);\n }\n }", "GlobalUpdateStatus update(ServerConfiguration serverConfig, @Nullable ProgressMonitor monitor);", "int updateByPrimaryKey(CptDataStore record);", "abstract ClusterTask getSessionUpdateTask();", "public void updateContext() {\n LOG.debug(\"Updating context...\");\n List<Long> sids;\n try {\n sids = getOrderedListOfChainNodes(root, true);\n } catch (KeeperException | InterruptedException ignore) {\n LOG.error(\"Failed to update context.Exception: \", ignore);\n return;\n }\n // this should not be case on replica server\n if (sids.size() == 0) {\n // head = tail = -1 = chain empty :: used by TailChainClient\n headSid.set(-1);\n tailSid.set(-1);\n predecessorSid.set(-1);\n successorSid.set(-1);\n return;\n }\n headSid.set(sids.get(0));\n tailSid.set(sids.get(sids.size() - 1));\n // position of this replica in chain\n int myIndex = sids.indexOf(mySid);\n // if client is calling this method\n if (myIndex == -1) {\n return;\n }\n // except head replica all other nodes have predecessor replica\n if (myIndex == 0) {\n predecessorSid.set(-1); // -1 indicates no predecessor\n } else {\n predecessorSid.set(sids.get(myIndex - 1));\n }\n // except tail replica all other nodes have successor replica\n if (myIndex == sids.size() - 1) {\n successorSid.set(-1); // -1 indicates no successor\n } else {\n successorSid.set(sids.get(myIndex + 1));\n }\n }", "private void writePref() {\n SharedPreferences.Editor editor = sp.edit();\n long currentTime = System.currentTimeMillis();\n editor.putLong(UPDATE, currentTime);\n editor.commit();\n System.out.println(\"Time of current update: \" + getDateFromLong(currentTime));\n }", "private void updateSharedState()\r\n {\r\n // TODO update the shared state\r\n // e.g.: sharedState.setTurnHolder(gameModel.getTurnHolder());\r\n }", "private Version checkpointSuperChunkId(long superChunkId,\n Version metadataVersion) {\n if ((lobProps.getNumChunks() != null) ||\n (lobProps.getLOBSize() != null)) {\n throw new IllegalStateException(\"Inconsistent lob props for \"\n + \"metadata checkpoint:\" + lobProps.toString());\n }\n lobProps.setLastSuperChunkId(superChunkId);\n return updateMetadata(metadataVersion);\n }", "@Test\n public void testActiveApexIsRevertedOnCheckpointRollback_Commit() throws Exception {\n int sessionId = retrieveLastSessionId();\n assertSessionApplied(sessionId);\n assertThat(InstallUtils.getInstalledVersion(SHIM_APEX_PACKAGE_NAME)).isEqualTo(2);\n // Commit a new staged session\n sessionId = Install.single(TestApp.Apex3).setStaged().commit();\n assertSessionReady(sessionId);\n storeSessionId(sessionId);\n }", "public abstract void rebalance();", "public void checkForUpdates(){\n if (mPrefs.getBoolean(PREF_ENABLED, true) && isStale()){\n// forceCheckForUpdates();\n }\n }", "BatchUpdateClusterResult batchUpdateCluster(BatchUpdateClusterRequest batchUpdateClusterRequest);", "private void updateGeoRepStatus(GlusterVolumeEntity volume, GlusterGeoRepSession session) {\n\n List<HashSet<GeoRepSessionStatus>> list = new ArrayList<>();\n // grouped node status\n int replicaCount = volume.getReplicaCount() == 0 ? 1 : volume.getReplicaCount();\n for (int i = 0; i < volume.getBricks().size(); i = i + replicaCount) {\n HashSet<GeoRepSessionStatus> subVolumeStatusSet = new HashSet<>();\n int j = 0;\n while (j < replicaCount) {\n Guid brickId = volume.getBricks().get(i + j).getId();\n subVolumeStatusSet.add(getStatusForBrickFromSession(session, brickId));\n j++;\n }\n list.add(subVolumeStatusSet);\n }\n\n session.setStatus(GeoRepSessionStatus.ACTIVE);\n // iterate through grouped status to set consolidated status\n for (HashSet<GeoRepSessionStatus> subVolumeStatusValues : list) {\n if (subVolumeStatusValues.contains(GeoRepSessionStatus.ACTIVE)) {\n // healthy\n continue;\n } else if (subVolumeStatusValues.contains(GeoRepSessionStatus.FAULTY)) {\n session.setStatus(GeoRepSessionStatus.FAULTY);\n // if any one of the sub-volume is faulty, the overall session status if faulty\n return;\n }\n // override status in case of these values\n if (ArrayUtils.contains(overridableStatuses, session.getStatus())) {\n if (subVolumeStatusValues.size() == 1) {\n session.setStatus((GeoRepSessionStatus) subVolumeStatusValues.toArray()[0]);\n } else {\n // if status values in sub-volume are not the same, what do we do?\n // this should not happen, so we'll log it for now\n log.info(\"Multiple status values found in volume '{}'\", session.getMasterVolumeName());\n }\n }\n }\n\n }", "@Override public void postGlobal() {\n for(int i=1;i<_chkMins.length;++i)\n _chkMins[i] = _chkMins[i-1] < _chkMins[i] ? _chkMins[i-1] : _chkMins[i];\n }", "void updateIfNeeded()\n throws Exception;", "public void resumeUpdates();", "public void markFinalizePartitionCounters() {\n finalizePartitionCounters = true;\n }", "void undo(RefactoringSession session, Document doc) {\n if (!DocumentUtilities.isWriteLocked(doc)) {\n undo(session);\n } else {\n AtomicLockDocument ald = LineDocumentUtils.as(doc, AtomicLockDocument.class);\n if (ald == null) {\n undo(session);\n } else {\n final boolean orig = setSupressSaveAll(true);\n\n class L implements AtomicLockListener, Runnable {\n @Override\n public void atomicLock(AtomicLockEvent evt) {\n }\n\n @Override\n public void atomicUnlock(AtomicLockEvent evt) {\n setSupressSaveAll(orig);\n SAVE_RP.post(this);\n ald.removeAtomicLockListener(this);\n }\n\n @Override\n public void run() {\n LifecycleManager.getDefault().saveAll();\n }\n }\n final L l = new L();\n ald.addAtomicLockListener(l);\n undo(session);\n }\n }\n }", "@Override public void postGlobal() {\n for(int i=1;i<_chkProds.length;++i) _chkProds[i] *= _chkProds[i-1];\n }", "@Override\n public boolean statusUpdate(TaskAttemptID taskId, TaskStatus taskStatus)\n throws IOException, InterruptedException {\n superStepCount = taskStatus.getSuperstepCount();\n return true;\n }", "private void checkCheckpointCollisions() {\n\t\tint len = checkpoints.size();\n\t\t\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tCheckpoint checkpoint = checkpoints.get(i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(OverlapTester.overlapRectangles(checkpoint.bounds, player.bounds)) {\n\t\t\t\t\trespawnPoint = new Vector2(checkpoint.position.x, checkpoint.position.y);\n\t\t\t\t\tfor(int c = 0; c < len; c++) {\n\t\t\t\t\t\tcheckpoints.get(c).active = false;\n\t\t\t\t\t}\n\t\t\t\t\tcheckpoint.active = true;\n\t\t\t\t} \n\t\t\t} catch (Exception e) {}\n\t\t}\n\t}", "FailoverShardResult failoverShard(FailoverShardRequest failoverShardRequest);", "int updateByPrimaryKeySelective(CptDataStore record);", "private void maintain(){\n ArrayList<Integer> shutDown = new ArrayList<Integer>();\n for (String addr : slaveMap.keySet()){\n if (!responderList.containsKey(slaveMap.get(addr))){\n shutDown.add(slaveMap.get(addr));\n }\n }\n //print\n for (Integer id : shutDown){\n synchronized (slaveList) {\n slaveList.remove(id);\n }\n }\n //TODO: one a slave lost control, what should ArcherDFS do?\n }", "boolean setReplicaCount(Type type, int number);", "@Test\n public void undoCkpointTest() throws Exception {\n final int tableSize = PARAMETERS.NUM_ITERATIONS_LOW;\n final int trimPosition = tableSize / 2;\n final int snapshotPosition = trimPosition + 2;\n\n CountDownLatch latch = new CountDownLatch(1);\n\n t(1, () -> {\n\n CorfuRuntime rt = getNewRuntime();\n try {\n PersistentCorfuTable<String, Long> tableA = openTable(rt, streamNameA);\n\n // first, populate the map\n for (int i = 0; i < tableSize; i++) {\n tableA.insert(String.valueOf(i), (long) i);\n }\n\n // now, take a checkpoint and perform a prefix-trim\n MultiCheckpointWriter<PersistentCorfuTable<String, Long>> mcw1 = new MultiCheckpointWriter<>();\n mcw1.addMap(tableA);\n mcw1.appendCheckpoints(rt, author);\n\n // Trim the log\n Token token = new Token(rt.getLayoutView().getLayout().getEpoch(), trimPosition);\n rt.getAddressSpaceView().prefixTrim(token);\n rt.getAddressSpaceView().gc();\n rt.getAddressSpaceView().invalidateServerCaches();\n rt.getAddressSpaceView().invalidateClientCache();\n\n latch.countDown();\n } finally {\n rt.shutdown();\n }\n });\n\n AtomicBoolean trimExceptionFlag = new AtomicBoolean(false);\n\n // start a new runtime\n t(2, () -> {\n latch.await();\n CorfuRuntime rt = getNewRuntime();\n\n PersistentCorfuTable<String, Long> localm2A = openTable(rt, streamNameA);\n\n // start a snapshot TX at position snapshotPosition\n Token timestamp = new Token(0L, snapshotPosition - 1);\n rt.getObjectsView().TXBuild()\n .type(TransactionType.SNAPSHOT)\n .snapshot(timestamp)\n .build()\n .begin();\n\n // finally, instantiate the map for the snapshot and assert is has the right state\n try {\n localm2A.get(String.valueOf(0));\n } catch (TransactionAbortedException te) {\n assertThat(te.getAbortCause()).isEqualTo(AbortCause.TRIM);\n // this is an expected behavior!\n trimExceptionFlag.set(true);\n }\n\n try {\n if (!trimExceptionFlag.get()) {\n assertThat(localm2A.size())\n .isEqualTo(snapshotPosition);\n\n // check map positions 0..(snapshot-1)\n for (int i = 0; i < snapshotPosition; i++) {\n assertThat(localm2A.get(String.valueOf(i)))\n .isEqualTo(i);\n }\n\n // check map positions snapshot..(mapSize-1)\n for (int i = snapshotPosition; i < tableSize; i++) {\n assertThat(localm2A.get(String.valueOf(i))).isNull();\n }\n }\n } finally {\n rt.shutdown();\n }\n });\n }", "public yandex.cloud.api.operation.OperationOuterClass.Operation updateShard(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.UpdateClusterShardRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getUpdateShardMethod(), getCallOptions(), request);\n }", "int updateByPrimaryKey(TbJobProcessNodeRelationEntity record);", "void updateHouseStatus(long houseId, int status);", "private void forceUpdate() {\n this.lastChecksum = -1;\n update();\n }", "public void updateScrambleLocation(LatLng latLng)\n {\n SharedPreferences.Editor editor = sharedPrefs.edit();\n editor.putLong(\"Latitude\", Double.doubleToLongBits(latLng.latitude));\n editor.putLong(\"Longitude\", Double.doubleToLongBits(latLng.longitude));\n editor.commit();\n }", "private void processV2AuthoritativeUpdate(SystemMetadata mnSystemMetadata, SystemMetadataValidator validator)\n throws RetryableException, UnrecoverableException, SynchronizationFailed {\n\n logger.debug(task.taskLabel() + \" entering processV2AuthoritativeUpdate...\");\n boolean validated = false;\n try {\n if (validator.hasValidUpdates(mnSystemMetadata)) {\n Identifier pid = mnSystemMetadata.getIdentifier();\n validated = true;\n\n if (CollectionUtils.isNotEmpty(validator.getReferenceSystemMetadata().getReplicaList())) {\n // copy the replica information from the CN copy to the new copy\n // (the CN is authoritative for this property and the MNs aren't expected\n // to maintain them.)\n mnSystemMetadata.setReplicaList(validator.getReferenceSystemMetadata().getReplicaList());\n logger.debug(task.taskLabel() + \" Copied over existing Replica section from CN..\");\n } else {\n // if somehow the replica section is empty, recreate it based on\n // this authoritative replica.\n // (replication depends on at least the authoritativeMN to\n // be listed in the replica section with a status of COMPLETED)\n mnSystemMetadata = populateInitialReplicaList(mnSystemMetadata);\n logger.debug(task.taskLabel() + \" replica section empty, so initialized new ReplicaList\");\n }\n\n // copy over the SerialVersion from the CN version or initialize\n BigInteger cnSerialVersion = validator.getReferenceSystemMetadata().getSerialVersion();\n if (cnSerialVersion == null) {\n cnSerialVersion = BigInteger.ONE;\n logger.debug(task.taskLabel() + \" serialVersion empty, so initialized to 1.\");\n }\n mnSystemMetadata.setSerialVersion(cnSerialVersion);\n\n logFormatTypeChanges(mnSystemMetadata.getFormatId(), validator.getReferenceSystemMetadata().getFormatId());\n\n // persist the new systemMetadata\n nodeCommunications.getCnCore().updateSystemMetadata(session, pid, mnSystemMetadata);\n\n logger.debug(task.taskLabel() + \" Updated CN with new SystemMetadata\");\n // propagate the changes\n notifyReplicaNodes(pid, false);\n \n } else {\n logger.info(buildStandardLogMessage(null, \" No changes to update.\"));\n }\n } catch (ServiceFailure e) {\n if (validated) {\n // from cn.updateSystemMetadata\n V2TransferObjectTask.extractRetryableException(e);\n throw new UnrecoverableException(\"Failed to update CN with new valid SystemMetadata!\", e);\n } else {\n // could be content problem in new sysmeta, or an IO problem.\n throw SyncFailedTask.createSynchronizationFailed(task.getPid(), \"Problems validating the new SystemMetadata!\", e);\n }\n\n } catch (InvalidRequest e) {\n if (validated) {\n // from cn.updateSystemMetadata, shouldn't ever get here if validated, so not an MN fault\n throw new UnrecoverableException(\"Failed to update CN with new valid SystemMetadata!\", e);\n } else {\n // thrown because of invalid changes\n throw SyncFailedTask.createSynchronizationFailed(task.getPid(), \"The new SystemMetadata contains invalid changes.\", e);\n }\n\n } catch (InvalidSystemMetadata e) {\n // from cn.updateSystemMetadata\n throw SyncFailedTask.createSynchronizationFailed(task.getPid(), \"The new SystemMetadata was rejected as invalid by the CN.\", e);\n } catch (NotImplemented | NotAuthorized | InvalidToken e) {\n // from cn.updateSystemMetadata\n throw new UnrecoverableException(\"Failed to update CN with new valid SystemMetadata!\", e);\n }\n }", "private void updateSlaveNodeAndVolumeId(GlusterGeoRepSession session) {\n List<VDS> slaveHosts = getVdsDao().getAllForHostname(session.getSlaveHostName());\n if (!CollectionUtils.isEmpty(slaveHosts)) {\n session.setSlaveNodeUuid(slaveHosts.get(0).getId());\n GlusterVolumeEntity slaveVol =\n getVolumeDao().getByName(slaveHosts.get(0).getVdsGroupId(),\n session.getSlaveVolumeName());\n if (slaveVol != null) {\n session.setSlaveVolumeId(slaveVol.getId());\n }\n }\n }", "int updateByPrimaryKey(Online record);", "private void notifyReplicaNodes(Identifier pid, boolean notifyAuthNode) {\n\n logger.info(buildStandardLogMessage(null, \" Entering notifyReplicaNodes...\"));\n SystemMetadata cnSystemMetadata = hzSystemMetaMap.get(pid);\n if (cnSystemMetadata != null) {\n List<Replica> prevReplicaList = cnSystemMetadata.getReplicaList();\n\n for (Replica replica : prevReplicaList) {\n NodeReference replicaNodeId = replica.getReplicaMemberNode();\n try {\n if (notifyAuthNode) {\n // notify all nodes\n notifyReplicaNode(cnSystemMetadata, replicaNodeId);\n } else {\n // only notify MNs that are not the AuthMN\n if (!replicaNodeId.getValue().equals(task.getNodeId())) {\n notifyReplicaNode(cnSystemMetadata, replicaNodeId);\n }\n }\n } catch (InvalidToken | NotAuthorized | NotImplemented |\n ServiceFailure | NotFound | InvalidRequest be) {\n // failed notifications shouldn't result in a sync failure\n // nor a retry, so we will log the exception and keep going\n logger.error(buildStandardLogMessage(be, \"Failed to notify replica member node \" +\n replicaNodeId.getValue()), be);\n }\n }\n } else {\n logger.error(buildStandardLogMessage(null,\"null returned from Hazelcast \"\n + hzSystemMetaMapString + \" Map\"));\n }\n }", "int updateByPrimaryKeySelective(TbJobProcessNodeRelationEntity record);", "@Override\n public void preApplication(final MasterContext<MASTER_RESULT, WORKER_RESULT> context) {\n initialize(context.getProps());\n\n // Master election which is used here to use the same zookeeper instance.\n if(NumberFormatUtils.getInt(context.getProps().getProperty(GuaguaConstants.GUAGUA_MASTER_NUMBER),\n GuaguaConstants.DEFAULT_MASTER_NUMBER) > 1) {\n new MasterElectionCommand(context.getAppId()).execute();\n }\n new FailOverCommand(context).execute();\n\n if(context.getCurrentIteration() != GuaguaConstants.GUAGUA_INIT_STEP) {\n // if not init step, return, because of no need initialize twice for fail-over task\n return;\n }\n\n new BasicCoordinatorCommand() {\n @Override\n public void doExecute() throws KeeperException, InterruptedException {\n String appId = context.getAppId();\n int currentIteration = context.getCurrentIteration();\n final String appWorkersNode = getWorkerBaseNode(appId, currentIteration).toString();\n final int workers = context.getWorkers();\n\n new RetryCoordinatorCommand(isFixedTime(), getSleepTime()) {\n @Override\n public boolean retryExecution() throws KeeperException, InterruptedException {\n try {\n List<String> childrenExt = getZooKeeper().getChildrenExt(appWorkersNode, false, false,\n false);\n int initDoneWorkers = childrenExt.size();\n // to avoid log flood\n if(System.nanoTime() % 20 == 0) {\n LOG.info(\"workers already initialized: {}, still {} workers are not synced.\",\n initDoneWorkers, (context.getWorkers() - initDoneWorkers));\n LOG.info(\"DEBUG: left workers:{}\", notInList(childrenExt, context.getWorkers()));\n }\n return isTerminated(initDoneWorkers, workers, context.getMinWorkersRatio(),\n context.getMinWorkersTimeOut());\n } catch (KeeperException.NoNodeException e) {\n // to avoid log flood\n if(System.nanoTime() % 10 == 0) {\n LOG.warn(\"No such node:{}\", appWorkersNode);\n }\n return false;\n }\n }\n }.execute();\n\n LOG.info(\"All workers are initiliazed successfully.\");\n\n String znode = null;\n try {\n // create worker znode 1: '/_guagua/<jobId>/workers/1' to avoid re-create znode from workers\n znode = getWorkerBaseNode(context.getAppId(), context.getCurrentIteration() + 1).toString();\n getZooKeeper().createExt(znode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, false);\n // create master init znode\n znode = getMasterBaseNode(context.getAppId()).toString();\n getZooKeeper().createExt(znode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, false);\n znode = getCurrentMasterNode(context.getAppId(), context.getCurrentIteration()).toString();\n getZooKeeper().createExt(znode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, false);\n } catch (KeeperException.NodeExistsException e) {\n LOG.warn(\"Node exists: {}\", znode);\n }\n }\n }.execute();\n }", "@Override\r\n\tpublic int update() throws Exception {\n\t\treturn 0;\r\n\t}", "public boolean checkpoint() {\n\t\ttry {\n\t\t\toutputStream.flush();\n\t\t} catch (IOException e) {\n\t\t\tif (RTS_COMMON.Option.VERBOSE)\n\t\t\t\te.printStackTrace();\n\t\t\treturn (false);\n\t\t}\n\t\treturn (true);\n\t}", "@Override\n\tpublic void onPause() {\n\n\t\t// Save the current setting for updates\n\t\tmEditor.putBoolean(LocationUtils.KEY_UPDATES_REQUESTED, mUpdatesRequested);\n\t\tmEditor.commit();\n\n\t\tsuper.onPause();\n\t}", "@Test (timeout=180000)\n public void testHbckWithRegionReplica() throws Exception {\n TableName table =\n TableName.valueOf(\"testHbckWithRegionReplica\");\n try {\n setupTableWithRegionReplica(table, 2);\n TEST_UTIL.getHBaseAdmin().flush(table.getName());\n assertNoErrors(doFsck(conf, false));\n } finally {\n cleanupTable(table);\n }\n }", "boolean updateLease(Lease lease, UUID concurrencyToken, String operation, String singleStreamShardId)\n throws DependencyException, InvalidStateException, ProvisionedThroughputException;", "int updateByPrimaryKey(SvcStoreBeacon record);", "public void preComputeBestReplicaMapping() {\n Map<String, Map<String, Map<String, String>>> collectionToShardToCoreMapping = getZkClusterData().getCollectionToShardToCoreMapping();\n\n for (String collection : collectionNames) {\n Map<String, Map<String, String>> shardToCoreMapping = collectionToShardToCoreMapping.get(collection);\n\n for (String shard : shardToCoreMapping.keySet()) {\n Map<String, String> coreToNodeMap = shardToCoreMapping.get(shard);\n\n for (String core : coreToNodeMap.keySet()) {\n String currentCore = core;\n String node = coreToNodeMap.get(core);\n SolrCore currentReplica = new SolrCore(node, currentCore);\n try {\n currentReplica.loadStatus();\n //Ok this replica is the best. Let us just use that for all the cores\n fillUpAllCoresForShard(currentReplica, coreToNodeMap);\n break;\n } catch (Exception e) {\n logger.info(ExceptionUtils.getFullStackTrace(e));\n continue;\n }\n }\n shardToBestReplicaMapping.put(shard, coreToBestReplicaMappingByHealth);\n }\n\n }\n }" ]
[ "0.6076575", "0.6018492", "0.57934207", "0.56978077", "0.5696277", "0.56734467", "0.56623757", "0.54469365", "0.5406213", "0.5350238", "0.531504", "0.5276884", "0.5243401", "0.5227994", "0.5118696", "0.50910836", "0.5039242", "0.5038713", "0.50335556", "0.49924254", "0.4954142", "0.4929251", "0.49234876", "0.49180752", "0.48762918", "0.48669928", "0.48194772", "0.4805428", "0.4752067", "0.47297812", "0.4696517", "0.46838716", "0.46728596", "0.46657705", "0.46632424", "0.4661852", "0.46493292", "0.4642469", "0.46381626", "0.46322054", "0.46236485", "0.46235022", "0.4614474", "0.45682403", "0.45645943", "0.4557372", "0.45526537", "0.45452115", "0.45387077", "0.45289904", "0.45104232", "0.45097345", "0.44975606", "0.44832692", "0.44832692", "0.44814312", "0.44750577", "0.44426093", "0.4439308", "0.44354576", "0.4427932", "0.44030687", "0.43948045", "0.43934244", "0.4389478", "0.43885574", "0.4382392", "0.4381172", "0.43805292", "0.43729594", "0.43671244", "0.43644136", "0.4354436", "0.43446222", "0.43442744", "0.4336783", "0.43365166", "0.43302533", "0.43218663", "0.4312586", "0.43124267", "0.43103695", "0.43094257", "0.43054688", "0.43043056", "0.4301985", "0.4298873", "0.4297197", "0.4282571", "0.42750645", "0.42681342", "0.4266297", "0.42588502", "0.42502752", "0.42432377", "0.42414793", "0.42376435", "0.42375043", "0.4233266", "0.4231056" ]
0.82425183
0
Notifies the service of the current allocation ids in the cluster state. This method trims any shards that have been removed.
public synchronized void updateAllocationIdsFromMaster(final Set<String> activeAllocationIds, final Set<String> initializingAllocationIds) { assignedAllocationIds.removeIf( aId -> activeAllocationIds.contains(aId) == false && initializingAllocationIds.contains(aId) == false); assignedAllocationIds.addAll(activeAllocationIds); assignedAllocationIds.addAll(initializingAllocationIds); for (String activeId : activeAllocationIds) { if (inSyncLocalCheckpoints.containsKey(activeId) == false) { inSyncLocalCheckpoints.put(activeId, UNASSIGNED_SEQ_NO); } } inSyncLocalCheckpoints.removeAll(key -> assignedAllocationIds.contains(key) == false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void deleteFromCloud() {\n\t\tfor (CustomerRequest r: mPendingRequests) {\n\t\t\tr.deleteFromCloud();\n\t\t}\n\n\t\t// We keep the orders in the cloud for later analytics\n\n\t\tsuper.deleteFromCloud();\n\t}", "public void deleteCopiedPendingLedgerEntries();", "public void removeAllProducers() {\n producers.clear();\n }", "public void clearQueuedPassengers(){\n this._queuedPassengers = 0;\n }", "private synchronized void performHouseKeeping() {\r\n\t\tSet<Map.Entry<Integer,QueueManager>> eS = queueManagers.entrySet();\r\n\t\tfor( Iterator<Map.Entry<Integer,QueueManager>> i = eS.iterator(); i.hasNext(); ) {\r\n\t\t\tMap.Entry<Integer,QueueManager> qMME = i.next();\r\n\t\t\tQueueManager qM = qMME.getValue();\r\n\t\t\tif( qM.houseKeepingAndTestForDelete() ) {\r\n\t\t\t\ti.remove();\r\n\t\t\t\tLOGGER.debug(\"Removed QueueManager with magic number \"+qM.getMagicNumber()+\" due to inactivity\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "boolean misfireIfRunning(Collection<Integer> shardingItems);", "public void removeUnavailableRooms(){\n\t}", "public void invalidateAll() {\n segment.clear();\n }", "public abstract void deletedConcepts(long ms, int n);", "private void maintain(){\n ArrayList<Integer> shutDown = new ArrayList<Integer>();\n for (String addr : slaveMap.keySet()){\n if (!responderList.containsKey(slaveMap.get(addr))){\n shutDown.add(slaveMap.get(addr));\n }\n }\n //print\n for (Integer id : shutDown){\n synchronized (slaveList) {\n slaveList.remove(id);\n }\n }\n //TODO: one a slave lost control, what should ArcherDFS do?\n }", "public void clean() {\n Long now = System.currentTimeMillis();\n for (Iterator<Long> iterator = this.deleted.iterator(); iterator.hasNext();) {\n Long l = iterator.next();\n if (l < now) {\n iterator.remove();\n }\n }\n }", "private void purgeStaleClients() {\n\t\tsynchronized (clients) {\n\t\t\tclients = clients.values().stream()\n\t\t\t .filter(od -> this.server.getClients().stream().anyMatch(c -> c.getName().equals(od.deviceId))\n\t\t\t || !od.purgeable())\n\t\t\t .collect(Collectors.toMap(od -> od.name, od -> od));\n\t\t}\n\t}", "public void removeShards(Bin shards) {\n for (String path : shards.getBinPaths()) {\n activeIndexes.remove(path);\n }\n //search all bins and remove.\n for (Integer i : radixBins.keySet()) {\n radixBins.get(i).removeAll(shards);\n }\n }", "private void cleanup() throws RemoteException {\n log.info(\"GP run complete.\");\n running = false;\n\n log.info(\"Releasing clients.\");\n for (IClient client : clients)\n client.release();\n clients.clear();\n\n writeCheckpoint(\"final_generation\");\n }", "@Override\r\n\tpublic void deleteAllInBatch() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "protected void applyPendingDeletes ()\n {\n while (!m_aDeleteStack.isEmpty ())\n removeMonitoredFile (m_aDeleteStack.pop ());\n }", "public void freeLights(){\n\t\t//android.util.Log.d(TAG,\"freeLights()\");\n\t\tfinal int size = this.lights.size();\n\t\tfor(int index=0; index < size; index++){\n\t\t\tthis.lights.delete(this.lights.keyAt(index));\n\t\t}\n\t}", "@Override\n\tpublic void deleteAllInBatch() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAllInBatch() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\r\n\tpublic final void purge() {\r\n\t\tthis.members.clear();\r\n\t\tthis.age++;\r\n\t\tthis.gensNoImprovement++;\r\n\t\tthis.spawnsRequired = 0;\r\n\r\n\t}", "@Override\n public void markShardCopyAsStaleIfNeeded(ShardId shardId, String allocationId, long primaryTerm, ActionListener<Void> listener) {\n listener.onResponse(null);\n }", "private void clearSharedTo() {\n \n sharedTo_ = 0;\n }", "private void handleWhiteboardCleared() {\n for (SocketConnection tobeNotified : SocketManager.getInstance()\n .getNotManagerConnectionList()) {\n tobeNotified.send(this.message);\n }\n }", "private void reallocateUnConsumedEsnRecords() {\n\t\tesnInfoRepository\n\t\t\t\t.findAllByIsConsumed(false).stream().filter(item -> (Days\n\t\t\t\t\t\t.daysBetween(new DateTime(item.getDateClaimed()), new DateTime()).isGreaterThan(Days.days(2))))\n\t\t\t\t.forEach(item -> {\n\t\t\t\t\titem.setUserClaimed(null);\n\t\t\t\t\titem.setDateClaimed(null);\n\t\t\t\t});\n\t}", "private void removeInconsistency(LPGInconsistency inconsistency, Set<LPGInconsistency> currentInconsistencies){\n\t\tcurrentInconsistencies.remove(inconsistency);\n\t\tinconsistencyCount--;\n\t}", "private void maintain() {\n SoftObject obj;\n int count = 0;\n\n while ((obj = (SoftObject)queue.poll()) != null) {\n count++;\n collection.remove(obj);\n }\n\n if (count != 0) {\n // some temporary debugging fluff\n System.err.println(\"vm reclaimed \" + count + \" objects\");\n }\n }", "public void clearBids(){\n this.bids.clear();\n setRequested();\n }", "public void removeAllFightsystems()\r\n {\n\r\n }", "@Override\n\tpublic void deleteAll() {\n\n\t}", "@Override\n\tpublic void deleteAll() {\n\n\t}", "@Override\n\tpublic void deleteAll() {\n\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\r\n\t}", "public void unloadItems() {\n if (dishwasherState == State.ON) {\n throw new InvalidStateException(\"The washing cycle hasn't been run yet\");\n } else if (dishwasherState == State.RUNNING) {\n throw new InvalidStateException(\"Please wait until washing cycle is finished\");\n }\n items = 0;\n dishwasherState = State.ON;\n System.out.println(\"The dishwasher is ready to go\");\n }", "public synchronized void dropChanges() {\n\t\tmPendingDeleteCount = 0;\n\t}", "void clearDeletedItemsTable();", "public void removeAll() {\r\n\r\n\t\tint size = getRowCount();\r\n\r\n\t\tthis.dataObjects = new Vector(0);\r\n\t\tdataVector = new Vector(0);\r\n\r\n\t\t// Generate notification\r\n\t\tfireTableRowsDeleted(0, size);\r\n\r\n\t}", "public void listShards(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.ListClusterShardsRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.ListClusterShardsResponse> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListShardsMethod(), responseObserver);\n }", "public void resetIds()\r\n {\r\n this.ids = null;\r\n }", "@Override\n\tpublic long deleteAll() {\n\t\treturn deleteAll(false);\n\t}", "public void reallocateBuckets() { }", "private void cleanUpConsumedEsnRecords() {\n\t\tesnInfoRepository.findAllByIsConsumed(true).removeIf(item -> (Days\n\t\t\t\t.daysBetween(new DateTime(item.getDateImported()), new DateTime()).isGreaterThan(Days.days(30))));\n\t}", "public void clean(){\n\t\tsynchronized(this.lock){\n\t\t\tint index=0;\n\t\t\tfor(ResourceStatus<T> resourceStatus:this.resourcesStatus){\n\t\t\t\tif(resourceStatus!=null){\n\t\t\t\t\tif(!resourceStatus.isInUse()){\n\t\t\t\t\t\tlong lastTime=resourceStatus.getLastNotInUseTime();\n\t\t\t\t\t\tlong currentTime=System.currentTimeMillis();\n\t\t\t\t\t\tT resource=resourceStatus.getResource();\n\t\t\t\t\t\tif((currentTime-lastTime)>=this.resourceAliveTime){\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tdestroyResource(resource);\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tlogger.error(Constants.Base.EXCEPTION, e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.resourcesStatus[index]=null;\n\t\t\t\t\t\t\tthis.currentSize--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t}", "public void clear() {\n synchronized (mLock) {\n mNumStartRangingCalls = 0;\n mOverallStatusHistogram.clear();\n mPerPeerTypeInfo[PEER_AP] = new PerPeerTypeInfo();\n mPerPeerTypeInfo[PEER_AWARE] = new PerPeerTypeInfo();\n }\n }", "public void removeAll() {\n/* 105 */ this.connectionToTimes.clear();\n/* */ }", "public void deallocate()\n\t{\n\t\t//for(int i = 0; i <= maxsize; i++){\n\t\t//\t notusemap[i].addAll(inusemap[i]);\n\t\t//\t inusemap[i].clear();\n\t\t//}\n\t}", "@Override\n\tpublic void deleteAllStudents() {\n\t\t\n\t}", "public void purgeQueue() {\r\n\t\tfDirtyRegions.clear();\r\n\t}", "public void removeAll() {\n start = null;\n _size = 0;\n }", "void removeRowsLock();", "void cleanUpExpiredSessions() {\n try (TarantoolClient client = clientSource.getClient()) {\n client.select(getSpace(client), SPACE_EXPIRY_INDEX, Integer.MAX_VALUE, 0, Iter.LE);\n client.setLong(System.currentTimeMillis());\n Result result = client.execute();\n Set<UUID> ids = new HashSet<>();\n while (result.next()) {\n ids.add(new UUID(result.getLong(2), result.getLong(3)));\n }\n ids.forEach(id -> deleteById(id, client));\n if (logger.isDebugEnabled()) {\n logger.debug(\"Cleaned up \" + ids.size() + \" expired sessions\");\n }\n }\n }", "@Override\n public void purgeFlows() {\n setOfFlowsToAdd.clear();\n setOfFlowsToDelete.clear();\n }", "private void clean() {\n // TODO: Your code here.\n for (Long id : vertices()) {\n if (adj.get(id).size() == 1) {\n adj.remove(id);\n }\n }\n }", "public void clear() {\n counters.clear();\n }", "private void clearRequests() {\n requests_ = emptyProtobufList();\n }", "private void reclaimSpace(int space)\r\n/* 269: */ {\r\n/* 270:295 */ assert (space >= 0);\r\n/* 271:296 */ this.availableSharedCapacity.addAndGet(space);\r\n/* 272: */ }", "public void deleteAll() {\n\t\t\n\t}", "public void removeAll() {\n\t\tsynchronized (mNpcs) {\n\t\t\tmNpcs = Collections.synchronizedList(new ArrayList<Npc>());\n\t\t\tmDemonCount = 0;\n\t\t\tmHumanCount = 0;\n\t\t}\n\t}", "void invalidateAll();", "public void clear()\n\t\t{\n\t\t\tindices.clear();\n\t\t}", "public void clearProducerDestinations() {\n this.producerDestinations_ = emptyProtobufList();\n }", "public void listShards(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.ListClusterShardsRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.ListClusterShardsResponse> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getListShardsMethod(), getCallOptions()), request, responseObserver);\n }", "private void onPeersCleared()\n {\n for (PeerListener listener : getListeners()) {\n listener.onPeersCleared();\n }\n }", "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (FactNonPrintedMaterial factNonPrintedMaterial : findAll()) {\n\t\t\tremove(factNonPrintedMaterial);\n\t\t}\n\t}", "public void terminateAllRemainingInstances() {\n for (Iterator<MemberContext> iterator = activeMembers.iterator(); iterator.hasNext(); ) {\n MemberContext member = iterator.next();\n iterator.remove();\n terminateForcefully(member.getMemberId());\n }\n\n // Forcefully deleting remaining pending members\n for (Iterator<MemberContext> iterator = pendingMembers.iterator(); iterator.hasNext(); ) {\n MemberContext member = iterator.next();\n iterator.remove();\n terminateForcefully(member.getMemberId());\n }\n\n /// Forcefully deleting remaining termination pending members\n for (Iterator<MemberContext> iterator = terminationPendingMembers.iterator(); iterator.hasNext(); ) {\n MemberContext member = iterator.next();\n // Remove the current element from the iterator and the list.\n iterator.remove();\n terminateForcefully(member.getMemberId());\n }\n\n\n // Forcefully deleting remaining obsolete members\n for (Map.Entry<String, MemberContext> entry : obsoletedMembers.entrySet()) {\n MemberContext ObsoleteMemberContext = entry.getValue();\n obsoletedMembers.remove(entry.getKey());\n terminateForcefully(ObsoleteMemberContext.getMemberId());\n }\n }", "public abstract void delete(Iterable<Long> ids);", "public void deleteAll();", "public void deleteAll();", "public void deleteAll();", "public void markSrvWeightDelete() throws JNCException {\n markLeafDelete(\"srvWeight\");\n }", "public void deleteAll() {\n\n\t}", "public void deleteAll()\n\t{\n\t}", "public void deleteAll()\n\t{\n\t}", "@Override\n public void releaseAll()\n {\n for ( int i = 0; i < exclusiveLockCounts.length; i++ )\n {\n PrimitiveLongIntMap exclusiveLocks = exclusiveLockCounts[i];\n PrimitiveLongIntMap sharedLocks = sharedLockCounts[i];\n\n // Begin releasing exclusive locks, as we may hold both exclusive and shared locks on the same resource,\n // and so releasing exclusive locks means we can \"throw away\" our shared lock (which would normally have been\n // re-instated after releasing the exclusive lock).\n if(exclusiveLocks != null)\n {\n int size = exclusiveLocks.size();\n exclusiveLocks.visitKeys( releaseExclusiveAndClearSharedVisitor.initialize( sharedLocks, lockMaps[i] ));\n if(size <= 32)\n {\n // If the map is small, its fast and nice to GC to clear it. However, if its large, it is\n // 1) Faster to simply allocate a new one and\n // 2) Safer, because we guard against clients getting giant maps over time\n exclusiveLocks.clear();\n }\n else\n {\n exclusiveLockCounts[i] = Primitive.longIntMap();\n }\n }\n\n // Then release all remaining shared locks\n if(sharedLocks != null)\n {\n int size = sharedLocks.size();\n sharedLocks.visitKeys( releaseSharedDontCheckExclusiveVisitor.initialize( lockMaps[i] ) );\n if(size <= 32)\n {\n // If the map is small, its fast and nice to GC to clear it. However, if its large, it is\n // 1) Faster to simply allocate a new one and\n // 2) Safer, because we guard against clients getting giant maps over time\n sharedLocks.clear();\n }\n else\n {\n sharedLockCounts[i] = Primitive.longIntMap();\n }\n }\n }\n }", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.ListClusterShardsResponse> listShards(\n yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.ListClusterShardsRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getListShardsMethod(), getCallOptions()), request);\n }", "public void clearAll() {\r\n msgMapping.clear();\r\n }", "private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }", "@Override\n\tprotected void modify(Locations locations) {\n\t\tfor (PeerAddress toRemove : unreachablePeers) {\n\t\t\tlocations.removePeerAddress(toRemove);\n\t\t}\n\n\t}", "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (AddressChangeReqDetails addressChangeReqDetails : findAll()) {\n\t\t\tremove(addressChangeReqDetails);\n\t\t}\n\t}", "private void removeRequests(int index) {\n ensureRequestsIsMutable();\n requests_.remove(index);\n }", "public void clearPartitions() {\n\t\tthis.bucketIterator = null;\r\n\t\tthis.probeIterator = null;\r\n\r\n\t\tfor (int i = this.partitionsBeingBuilt.size() - 1; i >= 0; --i) {\r\n\t\t\tfinal BinaryHashPartition p = this.partitionsBeingBuilt.get(i);\r\n\t\t\ttry {\r\n\t\t\t\tp.clearAllMemory(this.availableMemory);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tLOG.error(\"Error during partition cleanup.\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.partitionsBeingBuilt.clear();\r\n\r\n\t\t// clear the partitions that are still to be done (that have files on disk)\r\n\t\tfor (final BinaryHashPartition p : this.partitionsPending) {\r\n\t\t\tp.clearAllMemory(this.availableMemory);\r\n\t\t}\r\n\t}", "public void delete(Long[] ids) throws ProcessingException;", "private void clear() {\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = 0;\n\n generations = 0;\n }", "public void removeOldRecords();", "public void cleanup() {\n this.index = new TreeMap<String, PostingsList>();\n this.count = 0;\n }", "public void invalidateAll() {\n synchronized (this) {\n long l10;\n this.H = l10 = 512L;\n }\n this.requestRebind();\n }", "public void clearState(){\r\n\t\tinsideSemiringWeightsTable.clear();\r\n\t}", "void removeAllSpawn();", "void clear() {\n this.mapped_vms.clear();\n this.mapped_anti_coloc_job_ids.clear();\n this.used_cpu = BigInteger.ZERO;\n this.used_mem = BigInteger.ZERO;\n }", "@Override\n\tpublic void deleteAllCalls() {\n\t\t\n\t}" ]
[ "0.5390505", "0.5316857", "0.5235045", "0.5215106", "0.5212032", "0.5200254", "0.50953454", "0.50810796", "0.50726634", "0.50706404", "0.5010391", "0.5005096", "0.49891874", "0.49777743", "0.4977254", "0.49624124", "0.49624124", "0.49624124", "0.49624124", "0.49496228", "0.4946794", "0.49345964", "0.49345964", "0.49131927", "0.49131927", "0.49131927", "0.49131927", "0.49131927", "0.49131927", "0.49131927", "0.49131927", "0.49115518", "0.49066058", "0.4887327", "0.4886577", "0.4885662", "0.4884307", "0.48825952", "0.48805547", "0.4873671", "0.4872827", "0.4872827", "0.4872827", "0.48604766", "0.4854646", "0.48460895", "0.4845404", "0.48347306", "0.4824412", "0.48178387", "0.48170197", "0.48169485", "0.48151964", "0.48043948", "0.48025453", "0.47877476", "0.47840542", "0.47786573", "0.4778625", "0.4770453", "0.47634995", "0.47623083", "0.47576913", "0.47491446", "0.47477522", "0.474256", "0.4734073", "0.4721915", "0.47137836", "0.471316", "0.4707954", "0.47058108", "0.46947998", "0.46904898", "0.46867004", "0.46865305", "0.46851748", "0.4681646", "0.4681646", "0.4681646", "0.46815056", "0.46777827", "0.46733725", "0.46733725", "0.4672999", "0.46707517", "0.4666875", "0.46641636", "0.46636412", "0.46563193", "0.46542317", "0.46536547", "0.46505743", "0.46474797", "0.46469432", "0.4642366", "0.46290067", "0.46283862", "0.46273464", "0.4621762", "0.46203542" ]
0.0
-1
Marks the shard with the provided allocation ID as insync with the primary shard. This should be called at the end of recovery where the primary knows all operations below the global checkpoint have been completed on this shard.
public synchronized void markAllocationIdAsInSync(final String allocationId) { if (assignedAllocationIds.contains(allocationId) == false) { // master has removed this allocation, ignore return; } logger.trace("marked [{}] as in sync", allocationId); inSyncLocalCheckpoints.put(allocationId, UNASSIGNED_SEQ_NO); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void markShardCopyAsStaleIfNeeded(ShardId shardId, String allocationId, long primaryTerm, ActionListener<Void> listener) {\n listener.onResponse(null);\n }", "public synchronized void updateAllocationIdsFromMaster(final Set<String> activeAllocationIds,\n final Set<String> initializingAllocationIds) {\n assignedAllocationIds.removeIf(\n aId -> activeAllocationIds.contains(aId) == false && initializingAllocationIds.contains(aId) == false);\n assignedAllocationIds.addAll(activeAllocationIds);\n assignedAllocationIds.addAll(initializingAllocationIds);\n for (String activeId : activeAllocationIds) {\n if (inSyncLocalCheckpoints.containsKey(activeId) == false) {\n inSyncLocalCheckpoints.put(activeId, UNASSIGNED_SEQ_NO);\n }\n }\n inSyncLocalCheckpoints.removeAll(key -> assignedAllocationIds.contains(key) == false);\n }", "private void setPrimaryKey(final ResourceAllocation allocation) {\n final Map<String, Object> values = new HashMap<String, Object>();\n values.put(Constants.RES_ID, allocation.getReserveId());\n values.put(Constants.BL_ID_FIELD_NAME, allocation.getBlId());\n values.put(Constants.FL_ID_FIELD_NAME, allocation.getFlId());\n values.put(Constants.RM_ID_FIELD_NAME, allocation.getRmId());\n values.put(Constants.DATE_START_FIELD_NAME, allocation.getStartDate());\n values.put(Constants.TIME_START_FIELD_NAME, allocation.getStartTime());\n values.put(Constants.TIME_END_FIELD_NAME, allocation.getEndTime());\n values.put(Constants.RESOURCE_ID_FIELD, allocation.getResourceId());\n values.put(Constants.QUANTITY_FIELD, allocation.getQuantity());\n\n allocation.setId(getPrimaryKey(values, Constants.RSRES_ID_FIELD_NAME));\n }", "public synchronized void updateLocalCheckpoint(final String allocationId, final long checkpoint) {\n final int indexOfKey = inSyncLocalCheckpoints.indexOf(allocationId);\n if (indexOfKey >= 0) {\n final long current = inSyncLocalCheckpoints.indexGet(indexOfKey);\n if (current < checkpoint) {\n inSyncLocalCheckpoints.indexReplace(indexOfKey, checkpoint);\n if (logger.isTraceEnabled()) {\n logger.trace(\"updated local checkpoint of [{}] to [{}] (was [{}])\", allocationId, checkpoint, current);\n }\n } else {\n logger.trace(\n \"skipping update of local checkpoint [{}], current checkpoint is higher (current [{}], incoming [{}], type [{}])\",\n allocationId,\n current,\n checkpoint,\n allocationId);\n }\n } else {\n logger.trace(\"[{}] isn't marked as in sync. ignoring local checkpoint of [{}].\", allocationId, checkpoint);\n }\n }", "void prepareRelocate(Identity id, long newNodeId) throws IOException;", "private void markCGForDeletion(BlockConsistencyGroup consistencyGroup) {\n if (!consistencyGroup.getInactive()) {\n consistencyGroup.setStorageController(null);\n consistencyGroup.setInactive(true);\n _dbClient.updateObject(consistencyGroup);\n }\n }", "protected final void updateTopologyId(TopologyAffectedCommand command) throws InterruptedException {\n if (command.getTopologyId() == -1) {\n CacheTopology cacheTopology = stateTransferManager.getCacheTopology();\n if (cacheTopology != null) {\n command.setTopologyId(cacheTopology.getTopologyId());\n }\n }\n }", "private void confirmSegment(long seq) {\n\n // It is no longer outstanding\n sentOutUnacknowledgedSegStartSeqNumbers.remove(seq);\n\n // Add it to the progression\n acknowledgedSegStartSeqNumbers.add(seq);\n\n // Cancel its resend event\n cancelResendEvent(seq);\n\n }", "public void markEnodebIdReplace() throws JNCException {\n markLeafReplace(\"enodebId\");\n }", "private void savePartialAllocation(MappingVec allocation, VirtualMachineVec leftover_vms) {\n assert(allocation != null);\n assert(leftover_vms != null);\n this.partial_allocation = allocation;\n this.leftover_vms = leftover_vms;\n }", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_dmGtStatus.setPrimaryKey(primaryKey);\n\t}", "public void setChunkAsReclaimed(){\n this.setState(State.RECLAIMED);\n this.remNetworkCopy(Server.getInstance().getId());\n }", "public void sync(){\n byte[] block = new byte[512];\n SysLib.int2bytes(totalBlocks, block, 0);\n SysLib.int2bytes(totalInodes, block, 4);\n SysLib.int2bytes(freeList, block, 8);\n SysLib.rawwrite(0, block);\n }", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_state.setPrimaryKey(primaryKey);\n\t}", "void indicateRunning()\n {\n try {\n runningLock = lockChannel.lock(STARTING, RUNNING - STARTING, false);\n notYetRunningLock.release();\n }\n catch (IOException e) {\n throw new RuntimeException(\"Cannot lock pid file: \" + e);\n }\n\n notYetRunningLock = null;\n }", "public void reserve(int customerId){\n\t\treserved = true;\n\t\tthis.customerId = customerId;\n\t}", "public DistributedDbLock(@Nonnull LockId id, @Nonnull AbstractLockAllocator allocator) {\n super(id, allocator);\n setupMetrics(Metrics.METRIC_LATENCY_LOCK,\n Metrics.METRIC_LATENCY_UNLOCK,\n Metrics.METRIC_COUNTER_CALLS,\n Metrics.METRIC_COUNTER_ERROR);\n }", "public void sync()\n {\n byte[] blockData = new byte[Disk.blockSize];\n SysLib.int2bytes(totalBlocks, blockData, 0);\n SysLib.int2bytes(inodeBlocks, blockData, 4);\n SysLib.int2bytes(freeList, blockData, 8);\n SysLib.rawwrite(0, blockData);\n }", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_dlSyncEvent.setPrimaryKey(primaryKey);\n\t}", "public void markEnodebIdMerge() throws JNCException {\n markLeafMerge(\"enodebId\");\n }", "void setAllocationState(@Nonnull Client client,\n @Nonnull Set<TCSResource<?>> alloc,\n @Nonnull List<Set<TCSResource<?>>> remainingClaim);", "@RequiresLock(\"SeaLock\")\r\n protected void invalidate_internal() {\n }", "@Override\n public void freeId( long id )\n {\n }", "@Override\n\tpublic void setPrimaryKey(int primaryKey) {\n\t\t_locMstLocation.setPrimaryKey(primaryKey);\n\t}", "synchronized void updateCheckpointOnReplica(final long checkpoint) {\n /*\n * The global checkpoint here is a local knowledge which is updated under the mandate of the primary. It can happen that the primary\n * information is lagging compared to a replica (e.g., if a replica is promoted to primary but has stale info relative to other\n * replica shards). In these cases, the local knowledge of the global checkpoint could be higher than sync from the lagging primary.\n */\n if (this.globalCheckpoint <= checkpoint) {\n this.globalCheckpoint = checkpoint;\n logger.trace(\"global checkpoint updated from primary to [{}]\", checkpoint);\n }\n }", "public void setAllocationSize(long allocSize) {\n \t\n \t// Check if the allocation size has changed\n \t\n \tif ( getAllocationSize() != allocSize) {\n \t\t\n \t\t// Update the allocation size\n \t\t\n \t\tsuper.setAllocationSize(allocSize);\n \t\t\n \t\t// Queue a low priority state update\n \t\t\n \t\tqueueLowPriorityUpdate( UpdateAllocSize);\n \t}\n }", "public int prepare(Xid id) {\n try {\n log.debug(\"Unblocking commit\");\n l.await();\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n return XAResource.XA_OK;\n }", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_dmGTShipPosition.setPrimaryKey(primaryKey);\n\t}", "public void insertInorderBarrier() {\n\t\t\n\t}", "@Test\n public void testUpdateCheckpointBadConcurrencyToken() throws LeasingException {\n TestHarnessBuilder builder = new TestHarnessBuilder();\n builder.withLease(leaseKey, null).build();\n\n coordinator.runLeaseTaker();\n coordinator.runLeaseRenewer();\n Lease lease = coordinator.getCurrentlyHeldLease(leaseKey);\n\n assertNotNull(lease);\n\n ExtendedSequenceNumber newCheckpoint = new ExtendedSequenceNumber(\"newCheckpoint\");\n assertFalse(dynamoDBCheckpointer.setCheckpoint(lease.leaseKey(), newCheckpoint, UUID.randomUUID()));\n\n Lease fromDynamo = leaseRefresher.getLease(lease.leaseKey());\n\n // Owner should be the only thing that changed.\n lease.leaseOwner(coordinator.workerIdentifier());\n assertEquals(lease, fromDynamo);\n }", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_candidate.setPrimaryKey(primaryKey);\n\t}", "public void lock() {\n islandLocked = true;\n }", "public void markAsRequiringMappingUpdate() {\n assert assertInvariants(ItemProcessingState.TRANSLATED);\n currentItemState = ItemProcessingState.WAIT_FOR_MAPPING_UPDATE;\n requestToExecute = null;\n assert assertInvariants(ItemProcessingState.WAIT_FOR_MAPPING_UPDATE);\n }", "public void markFinalizePartitionCounters() {\n finalizePartitionCounters = true;\n }", "void ensureNode(int nodeId);", "public void markCriticalOnsetReplace() throws JNCException {\n markLeafReplace(\"criticalOnset\");\n }", "public abstract String lock(String oid) throws OIDDoesNotExistException, LockNotAvailableException;", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_changesetEntry.setPrimaryKey(primaryKey);\n\t}", "void markInactive();", "ManagementLockObject refresh();", "@Override\n public void syncState() {\n scheduledCounter.check();\n }", "public void setAtomicId(AtomicInteger atomicId) { this.atomicId = atomicId; }", "@Override\n public void abortTx() {\n \tfor (VBox vbox : overwrittenAncestorWriteSet) {\n \t // revert the in-place entry that had overwritten\n \t vbox.inplace = vbox.inplace.next;\n \t}\n \n this.orec.version = OwnershipRecord.ABORTED;\n for (OwnershipRecord mergedLinear : linearNestedOrecs) {\n mergedLinear.version = OwnershipRecord.ABORTED;\n }\n \tfor (ParallelNestedTransaction mergedTx : mergedTxs) {\n \t mergedTx.orec.version = OwnershipRecord.ABORTED;\n \t}\n \t\n\t// give the read set arrays, which were used exclusively by this nested or its children, back to the thread pool\n\tCons<VBox[]> parentArrays = this.getRWParent().bodiesRead;\n\tCons<VBox[]> myArrays = this.bodiesRead;\n\twhile (myArrays != parentArrays) {\n\t returnToPool(myArrays.first());\n\t myArrays = myArrays.rest();\n\t}\n\t\n \tbodiesRead = null;\n \tboxesWritten = null;\n \tboxesWrittenInPlace = null;\n \tperTxValues = null;\n \toverwrittenAncestorWriteSet = null;\n \tmergedTxs = null;\n \tlinearNestedOrecs = null;\n \tcurrent.set(this.getParent());\n }", "public void markCriticalAbateMerge() throws JNCException {\n markLeafMerge(\"criticalAbate\");\n }", "public void markCriticalAbateReplace() throws JNCException {\n markLeafReplace(\"criticalAbate\");\n }", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_userSync.setPrimaryKey(primaryKey);\n\t}", "public void markEnodebIdDelete() throws JNCException {\n markLeafDelete(\"enodebId\");\n }", "protected void setIdentity(long identity)\n\t{\n\t\tthis.identity=new Long(identity);\n\t}", "public static synchronized void setOwnerId(int id) {\r\n /* If this is the first time, that's fine, but if a change were made again */\r\n /* then we have an not-in-sync issue with journal files! */\r\n if (owner_id == master_pid) {\r\n owner_id = id;\r\n SlaveJvm.sendMessageToMaster(SocketMessage.ONE_TIME_STATUS, \"Data Validation Owner ID found in journal: \" + id);\r\n return;\r\n }\r\n\r\n /* The next time however, the ID is not allowed to change: */\r\n if (id != owner_id) {\r\n common.ptod(\"Current master process id: \" + master_pid);\r\n common.ptod(\"Current owner id: \" + owner_id);\r\n common.ptod(\"Second request to set owner id: \" + id);\r\n common.failure(\"Owner ID not in sync, are we mixing up journal files?\");\r\n }\r\n }", "public void markPlmnIdMerge() throws JNCException {\n markLeafMerge(\"plmnId\");\n }", "private void ensureChangesAllowed() {\n if (lifecycle.started() == false) {\n throw new IllegalStateException(\"Can't make changes to indices service, node is closed\");\n }\n }", "public void sync()\n\t{\n\t\tbyte[] buffer = new byte[Disk.blockSize];\n\n\t\t// Write the totalBlocks, totalInodes, and freeList.\n\t\tSysLib.int2bytes(totalBlocks, buffer, 0);\n\t\tSysLib.int2bytes(totalInodes, buffer, 4);\n\t\tSysLib.int2bytes(freeList, buffer, 8);\n\t\tSysLib.int2bytes(lastFreeBlock, buffer, 12);\n\n\t\t// Write the block back to disk.\n\t\tSysLib.rawwrite(0, buffer);\n\t}", "protected final boolean reinsert(int paramInt)\n/* */ {\n/* 117 */ this.m_flagTable[paramInt] = false;\n/* 118 */ return assignSlot(this.m_keyTable[paramInt]) != paramInt;\n/* */ }", "private void testPrimaryChange(ExceptionRunnable topologyChange) throws Exception {\n MagicKey backupKey = new MagicKey(cache(0), cache(1));\n MagicKey nonOwnerKey = new MagicKey(cache(0), cache(2));\n\n // node0 is the primary owner\n assertPrimaryOwner(backupKey, 0);\n tm(0).begin();\n cache(0).put(backupKey, \"value-0\");\n Transaction tx0 = tm(0).suspend();\n\n tm(0).begin();\n advancedCache(0).lock(nonOwnerKey);\n Transaction tx1 = tm(0).suspend();\n\n // expect keys to be locked on primary owner\n assertLocked(0, backupKey);\n assertLocked(0, nonOwnerKey);\n\n // switch primary owner: node1\n factory.setOwnerIndexes(new int[][]{{1, 0}, {1, 0}});\n\n topologyChange.run();\n\n assertPrimaryOwner(backupKey, 1);\n assertPrimaryOwner(nonOwnerKey, 1);\n\n AdvancedCache<Object, Object> zeroTimeoutCache1 = advancedCache(1).withFlags(Flag.ZERO_LOCK_ACQUISITION_TIMEOUT);\n assertPutTimeout(backupKey, zeroTimeoutCache1);\n assertLockTimeout(backupKey, zeroTimeoutCache1);\n assertPutTimeout(nonOwnerKey, zeroTimeoutCache1);\n assertLockTimeout(nonOwnerKey, zeroTimeoutCache1);\n\n tm(0).resume(tx0);\n tm(0).commit();\n\n tm(0).resume(tx1);\n tm(0).commit();\n\n assertEquals(\"value-0\", cache(0).get(backupKey));\n assertEquals(\"value-0\", cache(1).get(backupKey));\n assertNull(cache(0).get(nonOwnerKey));\n assertNull(cache(1).get(nonOwnerKey));\n }", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_contentupdate.setPrimaryKey(primaryKey);\n\t}", "public abstract void setStatusId(long statusId);", "private void maintainMergeLocal() {\n logger.info(\"Maintaining Merge Local\");\n try {\n Bin mergeBin;\n synchronized (geometricParts) {\n mergeBin = geometricParts.findMergeCandidates();\n }\n if (!mergeBin.isEmpty()) {\n File indexShard = getNextIndexShardFolder(mergeBin.size + 1);\n // otherwise there's something to merge\n logger.info(\"Performing merge!\");\n\n\n // merge the shards\n Parameters p = this.globalParameters.clone();\n // override each of these particular parameters\n p.set(\"indexPath\", indexShard.getAbsolutePath());\n p.set(\"inputPath\", new ArrayList<>(mergeBin.getBinPaths()));\n p.set(\"renumberDocuments\", false);\n\n App.run(\"merge-index\", p, System.out);\n\n // should make sure that these two are uninteruppable\n synchronized (geometricParts) {\n geometricParts.add(mergeBin.size + 1, indexShard.getAbsolutePath());\n geometricParts.removeShards(mergeBin);\n updateIndex();\n }\n\n // now can delete the merged indexshard folders...\n for (String file : mergeBin.getBinPaths()) {\n FSUtil.deleteDirectory(new File(file));\n }\n\n logger.info(\"Done merging.\");\n }\n } catch (Exception ex) {\n Logger.getLogger(GeometricIndex.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void setPrimaryKey(long primaryKey) {\n\t\t_tempNoTiceShipMessage.setPrimaryKey(primaryKey);\n\t}", "public void markCriticalAbateDelete() throws JNCException {\n markLeafDelete(\"criticalAbate\");\n }", "@Override\n public void unlock(int myId) {\n Y = -1; \n flag[myId] = false;\n \n }", "public void sync(boolean flush) throws IOException\n {\n segmentManager.sync(flush);\n }", "public void moveToId(int offset) {\n\t\tcp.moveToId(offset);\n\t}", "public void setSharedInd(String sharedInd) {\n\t\t\n\t}", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_scienceApp.setPrimaryKey(primaryKey);\n\t}", "private void reacquireLocks() {\n getCommander().requestLockOn( getPart() );\n for ( Long id : expansions ) {\n try {\n ModelObject expanded = getQueryService().find( ModelObject.class, id );\n if ( !( expanded instanceof Segment || expanded instanceof Plan ) )\n getCommander().requestLockOn( expanded );\n } catch ( NotFoundException e ) {\n LOG.warn( \"Expanded model object not found at: \" + id );\n }\n }\n }", "public void markCriticalOnsetMerge() throws JNCException {\n markLeafMerge(\"criticalOnset\");\n }", "public void setAsStartingPoint() {\n\t\tnodeStatus = Status.occupied;\n\t}", "ManagementLockObject refresh(Context context);", "public void reinstateObjectFromArchive(int key, int identifier) throws PersistenceException {\n super.reinstateArchiveObject(key, identifier);\n }", "void markAbandoned();", "private void saveAfterLock(Reservation reservation) throws InterruptedException {\n log.error(\"Error saving reservation, waiting to retry.\");\n Thread.sleep(1000);\n if (!isOverlapping(reservation)) {\n reservationRepository.save(reservation);\n } else {\n throwConcurrentModificationException();\n }\n }", "public void lock(int key);", "public synchronized void commit(int trxnId)\n {\n ResourceManager rm;\n for (Enumeration e = transactionTouch.keys(); e.hasMoreElements();) {\n rm = (ResourceManager)e.nextElement();\n try {\n rm.commit(trxnId);\n } catch (Exception x)\n {\n System.out.println(\"EXCEPTION:\");\n System.out.println(x.getMessage());\n x.printStackTrace();\n }\n }\n transactionTouch.remove(trxnId);\n lm.UnlockAll(trxnId);\n }", "public void synced() {\n Preconditions.checkNotNull(state);\n state.setState(ENodeState.Synced);\n }", "@Override\n\tprotected void unLockNbr() {\n\t\t\n\t}", "public void deleteBarrier() {\n if(stater == 3) return;\n stater = 3;\n }", "public void setSyncID(byte syncID) {\n synchronized (this.syncID) {\n this.syncID[0] = syncID;\n }\n }", "void lockInode(Inode inode, LockMode mode);", "@Override\n public void setPrimaryKey(int primaryKey) {\n _entityCustomer.setPrimaryKey(primaryKey);\n }", "public void flushCheckpoint(long checkpoint)\r\n/* 124: */ {\r\n/* 125:155 */ this.checkpoint = checkpoint;\r\n/* 126: */ }", "public void doPreSaveActions() {\n\t\tcalculateBlockedPartitions();\n\t}", "public void reportSuccessfulPreemption(TaskAttemptId attemptID);", "public void setStatusId(long statusId);", "public void setPrimaryKey(long primaryKey) {\n _sTransaction.setPrimaryKey(primaryKey);\n }", "public void ack(Object msgId) {\n Message msg = this.pendingMessages.remove(msgId);\n JmsMessageId oldest = this.toCommit.first();\n if (msgId.equals(oldest)) {\n if (msg != null) {\n try {\n log.debug(\"Committing...\");\n msg.acknowledge();\n log.debug(\"JMS Message acked: \" + msgId);\n this.toCommit.remove(msgId);\n } catch (JMSException e) {\n log.warn(\"Error acknowldging JMS message: \" + msgId, e);\n }\n } else {\n log.warn(\"Couldn't acknowledge unknown JMS message ID: \" + msgId);\n }\n } else {\n this.toCommit.remove(msgId);\n }\n\n }", "public void locking(int id) {\n\t\tAccount account=userDao.getAccount(id);\r\n\t\tStatus status=userDao.getStatus(\"¶³½á\");\r\n\t\taccount.setStatus(status);\r\n\t\tuserDao.updateAccount(account);\r\n\t}", "SoftLockID createSoftLockID(TransactionID transactionID, Object key, Element newElement, Element oldElement, boolean pinned);", "private void flushCurrentIndexBlock() throws IOException {\n if (currentMemoryIndex.documentsInIndex() < 1) {\n return;\n }\n\n logger.info(\"Flushing current memory Index. id = \" + indexBlockCount);\n\n final MemoryIndex flushingMemoryIndex = currentMemoryIndex;\n final File shardFolder = getNextIndexShardFolder(1);\n\n try {\n // reset the current index\n // - this makes the flush operation thread safe while continuing to add new documents.\n resetCurrentMemoryIndex();\n } catch (Exception ex) {\n throw new IOException(ex);\n }\n\n try {\n // first flush the index to disk\n FlushToDisk.flushMemoryIndex(flushingMemoryIndex, shardFolder.getAbsolutePath(), false);\n\n // indicate that the flushing part of this thread is done\n synchronized (geometricParts) {\n // add flushed index to the set of bins -- needs to be a synconeous action\n geometricParts.add(0, shardFolder.getAbsolutePath());\n updateIndex();\n flushingMemoryIndex.close();\n }\n\n } catch (IOException e) {\n logger.severe(e.toString());\n }\n }", "public void reinstateKeyFromArchive(int key) throws PersistenceException {\n super.reinstateArchiveKey(key);\n }", "public void markAsNotPersisted() {\n systemId=NOT_PERSISTED;\n externalSystemId=null;\n serialVersion=0;\n }", "public synchronized void abort(int trxnId)\n {\n ResourceManager rm;\n for (Enumeration e = transactionTouch.keys(); e.hasMoreElements();) {\n rm = (ResourceManager)e.nextElement();\n try {\n rm.abort(trxnId);\n } catch (Exception x)\n {\n System.out.println(\"EXCEPTION:\");\n System.out.println(x.getMessage());\n x.printStackTrace();\n }\n }\n transactionTouch.remove(trxnId);\n lm.UnlockAll(trxnId);\n }", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_esfTournament.setPrimaryKey(primaryKey);\n\t}", "@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_employee.setPrimaryKey(primaryKey);\n\t}", "public abstract void setHoldGeneratedOriginEntries(boolean holdGeneratedOriginEntries);", "PendingDelete(ShardId shardId, IndexSettings settings) {\n this.index = shardId.getIndex();\n this.shardId = shardId.getId();\n this.settings = settings;\n this.deleteIndex = false;\n }", "@Override\n public void returnToStable(int id){\n rl.lock();\n numHorses_stable++; //increment number of horses in stable;\n try{\n System.out.println(\"H : Returning horse \" + id + \" to stable...\");\n while(keep_waiting){\n stable_horses.await();\n }\n } catch (InterruptedException ex) {\n Logger.getLogger(Stable.class.getName()).log(Level.SEVERE, null, ex);\n }\n finally{\n rl.unlock();\n }\n }", "public void markCriticalOnsetDelete() throws JNCException {\n markLeafDelete(\"criticalOnset\");\n }", "public void reset() {\n clearAllocationNodes(firstAllocationNode);\n firstAllocationNode.reset(/* startPosition= */ 0, allocationLength);\n readAllocationNode = firstAllocationNode;\n writeAllocationNode = firstAllocationNode;\n totalBytesWritten = 0;\n allocator.trim();\n }", "@Override\n public void preAllocateIds(int requestSize) {\n // do nothing by default\n }", "public void put(int id) {\n\t\t\tbuffers[cursor] = id;\r\n\t\t\tgetNode(id).setHeapIndex(cursor);\r\n\t\t\tsiftUp(cursor);\r\n\t\t\tcursor ++;\r\n//\t\t\tcheck();\r\n//\t\t\tSystem.out.println(\"after put ==============:\" + cursor);\r\n\t\t}" ]
[ "0.5378697", "0.53580976", "0.5333123", "0.50785583", "0.49434257", "0.48679218", "0.48538423", "0.4787702", "0.47237065", "0.47066373", "0.46399844", "0.46348453", "0.46286282", "0.46267155", "0.45938265", "0.45923945", "0.45456862", "0.45452136", "0.45296946", "0.4511324", "0.44986522", "0.44929326", "0.4479229", "0.44695255", "0.44509396", "0.44254455", "0.44180313", "0.44108737", "0.4410774", "0.44031158", "0.4389103", "0.43865293", "0.4385475", "0.43751988", "0.43750823", "0.43741813", "0.43525904", "0.4345611", "0.43234825", "0.43172935", "0.43107718", "0.4304169", "0.43037686", "0.4297273", "0.429115", "0.4268034", "0.42669916", "0.42596483", "0.42489687", "0.4248084", "0.42278832", "0.42261562", "0.42177406", "0.4214987", "0.41899365", "0.41868004", "0.41814697", "0.41726565", "0.41672307", "0.41622245", "0.4160414", "0.41568664", "0.41548002", "0.41479874", "0.41425937", "0.41417468", "0.4140897", "0.41393086", "0.4131876", "0.41284904", "0.41248238", "0.41243568", "0.4115422", "0.4113028", "0.4111865", "0.4111547", "0.4109804", "0.4109708", "0.4102829", "0.41023523", "0.40992108", "0.40965664", "0.40926448", "0.40908468", "0.40859625", "0.40848252", "0.40807766", "0.407753", "0.407257", "0.4071185", "0.40699646", "0.40570882", "0.4056369", "0.40554482", "0.40532225", "0.40497684", "0.40485242", "0.40451515", "0.40430987", "0.40364575" ]
0.7348139
0
use lock with entityId as key to avoid concurrent entity modification
public void modifyEntity(String entityId) { Lock lock = lockMap.computeIfAbsent(entityId, m -> new ReentrantLock()); try { lock.lock(); // simulate long entity modification Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } finally { lock.unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void lock(Object entity, LockModeType lockMode) {\n\t\t\n\t}", "public void lock(int key);", "protected void lockEntry(PersistentEntity persistentEntity, Serializable id, int timeout) {\n // do nothing,\n }", "@Override\n\tpublic void lock(Object entity, LockModeType lockMode, Map<String, Object> properties) {\n\t\t\n\t}", "void acquireActiveEntityWriteLock(LockList locks, DataverseName dataverseName, String entityName)\n throws AlgebricksException;", "@Override\n @SuppressWarnings(\"unchecked\")\n public <T> void putEntity(Key<T> key, T entity)\n {\n // Add to both caches\n session.getCache().put((Class<T>)key.getType(), entity, key.getId());\n queryCache.putEntity(key, entity);\n }", "void acquireWriteLock(E key);", "void lock(Connection con, EnterpriseObject eo, boolean lock)\n throws DataModifiedException {\n try {\n if ((!lock) || (eo == null) || (con.getAutoCommit())) {\n return; // no locking, no revision update\n\n }\n SBR sbr = eo.getSBR();\n String euid = eo.getEUID();\n Integer revisionNumber = sbr.getRevisionNumber();\n lockSBR(con, euid, revisionNumber);\n sbr.setRevisionNumber(sbr.getRevisionNumber().intValue() + 1);\n } catch (ObjectException ex) {\n throw new DataModifiedException(mLocalizer.t(\"OPS523: Could not lock \" +\n \"EnterpriseObject: {0}\", ex));\n } catch (SQLException se) {\n throw new DataModifiedException(mLocalizer.t(\"OPS524: Could not lock \" +\n \"EnterpriseObject: {0}\", se));\n }\n }", "public void lock(final int key, final String entityType, final String userName, final String uuid, final Session session) {\n try {\n\n S_LCK_TBL myLock = new S_LCK_TBL(key, entityType);\n S_LCK_TBL existingLock = (S_LCK_TBL) get(session, S_LCK_TBL.class, myLock);\n\n if (existingLock != null) {\n if (!existingLock.getDbSession().trim().equals(uuid.trim()) && !existingLock.getUserName().trim().equals(userName.trim()))\n throw new RecordInUseException();\n else if (existingLock.getDbSession().trim().equals(uuid.trim()) && existingLock.getUserName().trim().equals(userName.trim()))\n return;\n else if (!existingLock.getDbSession().trim().equals(uuid.trim()) && existingLock.getUserName().trim().equals(userName.trim())) { //sessione appesa/vecchia\n existingLock.markDeleted();\n persistByStatus(existingLock, session);\n }\n }\n\n myLock.setDbSession(uuid);\n myLock.setUserName(userName);\n myLock.markNew();\n persistByStatus(myLock, session);\n\n } catch (HibernateException e) {\n throw new DataAccessException(e);\n }\n }", "@Test\n public void testPessimisticLocking()\n {\n Employee employee = new EmployeeBuilder().withAge(30).withName(\"Hans\").withSurename(\"Mueller\").build();\n\n // saving Employee\n em.getTransaction().begin();\n em.persist(employee);\n em.getTransaction().commit();\n\n // fresh start\n em = emf.createEntityManager();\n EntityManager em2 = emf.createEntityManager();\n\n em.getTransaction().begin();\n Employee reloadedEmployeInstance1 = em.find(Employee.class, employee.getId());\n\n // Enable to get a deadlock\n// em.lock(reloadedEmployeInstance1, LockModeType.READ);\n\n em2.getTransaction().begin();\n Employee reloadedEmployeInstance2 = em2.find(Employee.class, employee.getId());\n reloadedEmployeInstance2.setAge(99);\n em2.persist(reloadedEmployeInstance2);\n em2.getTransaction().commit();\n\n\n em.getTransaction().commit();\n }", "void reattachEntityWithNoLock(IPojoGenEntity entity);", "Lock getLockByKey(String key);", "public CacheKey acquireLock(Vector primaryKey, boolean forMerge) {\n //check if the key is already in the hashtable\n CacheKey key = null;\n\n //cache key should not be changed in other threads during the lock acquire operation\n synchronized (this) {\n // bug 3094912 get must be synchronized as well\n key = getCacheKey(primaryKey);\n if (key == null) {\n //create a chachKey and lock the object\n CacheKey cacheKey = createCacheKey(primaryKey, null, null);\n cacheKey.acquire(forMerge);\n put(cacheKey);\n return cacheKey;\n }\n }\n\n // code removed as key will never be null here, either one will be found or one created\n key.acquire();\n\n return key;\n }", "public CacheKey acquireDeferredLock(Vector primaryKey) {\n //check if the key is already in the hashtable\n CacheKey key = null;\n\n //cache key should not be changed in other threads during the lock acquire operation\n synchronized (this) {\n // bug 3094912 get must be synchronized as well\n key = getCacheKey(primaryKey);\n if (key == null) {\n //create a chachKey and lock the object\n CacheKey cacheKey = createCacheKey(primaryKey, null, null);\n cacheKey.acquireDeferredLock();\n put(cacheKey);\n return cacheKey;\n }\n }\n\n // code removed as key will never be null here, either one will be found or one created\n key.acquireDeferredLock();\n\n return key;\n }", "void lockMetadata(String key);", "void acquireReadLock(E key);", "@Repository\npublic interface PostRepository extends CrudRepository<Post, Long> {\n @Lock(LockModeType.PESSIMISTIC_WRITE)\n Post findByIdAndVisibleIsTrue(Long id);\n}", "public abstract CacheKey put(Vector primaryKey, Object object, Object writeLockValue, long readTime);", "void lock(Connection con, EnterpriseObject eo1, EnterpriseObject eo2)\n throws DataModifiedException {\n try {\n if ((eo1 == null && eo2 == null) || (con.getAutoCommit())) {\n return;\n } else if (eo1 == null) {\n lock(con, eo2, true);\n return;\n } else if (eo2 == null) {\n lock(con, eo1, true);\n return;\n }\n SBR sbr1 = eo1.getSBR();\n String euid1 = eo1.getEUID();\n Integer revisionNumber1 = sbr1.getRevisionNumber();\n SBR sbr2 = eo2.getSBR();\n String euid2 = eo2.getEUID();\n Integer revisionNumber2 = sbr2.getRevisionNumber();\n lockSBR(con, euid1, revisionNumber1, euid2, revisionNumber2);\n sbr1.setRevisionNumber(sbr1.getRevisionNumber().intValue() + 1);\n sbr2.setRevisionNumber(sbr2.getRevisionNumber().intValue() + 1);\n } catch (ObjectException ex) {\n throw new DataModifiedException(mLocalizer.t(\"OPS529: Could not lock \" +\n \"one or more EnterpriseObjects: {0}\", ex));\n } catch (SQLException se) {\n throw new DataModifiedException(mLocalizer.t(\"OPS530: Could not lock \" +\n \"one or more EnterpriseObjects: {0}\", se));\n }\n }", "protected void unlockEntry(PersistentEntity persistentEntity, Serializable id) {\n // do nothing\n }", "public void setLockKey( Long lockKey ) {\n this.lockKey = lockKey;\n }", "void lock(Connection con, EnterpriseObject eo, String revisionNumber,\n boolean lock) throws DataModifiedException {\n try {\n if ((!lock) || (eo == null) || (con.getAutoCommit())) {\n return; // no locking, no revision update\n\n }\n SBR sbr = eo.getSBR();\n String euid = eo.getEUID();\n if (revisionNumber != null) {\n lockSBR(con, euid, revisionNumber);\n } else {\n Integer curRevisionNumber = sbr.getRevisionNumber();\n lockSBR(con, euid, curRevisionNumber);\n }\n sbr.setRevisionNumber(sbr.getRevisionNumber().intValue() + 1);\n } catch (ObjectException ex) {\n throw new DataModifiedException(mLocalizer.t(\"OPS525: Could not lock \" +\n \"EnterpriseObject: {0}\", ex));\n } catch (SQLException se) {\n throw new DataModifiedException(mLocalizer.t(\"OPS526: Could not lock \" +\n \"EnterpriseObject: {0}\", se));\n }\n }", "public CacheKey acquireLockNoWait(Vector primaryKey, boolean forMerge) {\n //check if the key is already in the hashtable\n CacheKey key = null;\n\n //cache key should not be changed in other threads during the lock acquire operation\n synchronized (this) {\n key = getCacheKey(primaryKey);\n if (key == null) {\n //create a chachKey and lock the object\n CacheKey cacheKey = createCacheKey(primaryKey, null, null);\n cacheKey.acquire(forMerge);\n put(cacheKey);\n return cacheKey;\n }\n }\n\n //find the key in the hashtable, lock the object\n if (key != null) {\n //couldn't acquire the key so do not return it\n if (!key.acquireNoWait(forMerge)) {\n key = null;\n }\n }\n\n return key;\n }", "private Locks() {\n\t\tlockId = ObjectId.get().toString();\n\t}", "@Override\n\tpublic void refresh(Object entity, LockModeType lockMode) {\n\t\t\n\t}", "void doLogicalPut(final L lockID, final Object key, final Object value);", "@DefaultMessage(\"Locking record for Update...\")\n @Key(\"gen.lockForUpdate\")\n String gen_lockForUpdate();", "void acquireActiveEntityReadLock(LockList locks, DataverseName dataverseName, String entityName)\n throws AlgebricksException;", "SoftLockID createSoftLockID(TransactionID transactionID, Object key, Element newElement, Element oldElement, boolean pinned);", "protected CacheKey getCacheKeyWithReadLock(Vector primaryKey) {\n CacheKey key = getCacheKey(primaryKey);\n\n if (key != null) {\n key.acquireReadLock();\n key.releaseReadLock();\n }\n\n return key;\n }", "SoftLock findSoftLockById(SoftLockID softLockId);", "private void ensureEntityValue(IEntity entity) {\n entity.setPrimaryKey(entity.getPrimaryKey());\n }", "public LockImpl(long id) {\n\t\tthis.id = id;\n\t}", "void lock();", "public void setEntityId(long entityId);", "public void lock() {\n\n }", "public DResult put(Put put, long startId, boolean locking) throws IOException;", "@Override\n public <T> T getEntity(Key<T> key)\n {\n // Check the session first in case we've loaded the entity in another query or 'get' then fall back to the query cache\n return session.getCache().get(key)\n .map(entity -> {\n if (logger.isTraceEnabled())\n {\n logger.trace(\"Session cache hit {0}[{1}]\", key.getType().getSimpleName(), key.getId());\n }\n\n session.getStats().cacheHit();\n stats().incHits();\n return entity;\n })\n .orElseGet(() -> queryCache.getEntity(key));\n }", "@Override\n public void forceIncrementModificationCounter(SideDishEntity entity) {\n\n }", "public void visitKeylock( DevCat devCat ) {}", "public LockSync() {\n lock = new ReentrantLock();\n }", "protected synchronized void overrideEntityIndex(String entity, int index) { ent_2_i.put(entity,index); }", "@Override\n protected final Void updateKeyAfterInsert(FarmField entity, long rowId) {\n return null;\n }", "public Collection<IgniteTxEntry> optimisticLockEntries();", "@Override\n\tpublic void refresh(Object entity, LockModeType lockMode, Map<String, Object> properties) {\n\t\t\n\t}", "@Test(expected = RollbackException.class)\n public void testOptimisticLocking()\n {\n Employee employee = new EmployeeBuilder().withAge(30).withName(\"Hans\").withSurename(\"Mueller\").build();\n\n // saving Employee\n em.getTransaction().begin();\n em.persist(employee);\n em.getTransaction().commit();\n\n // fresh start\n em = emf.createEntityManager();\n EntityManager em2 = emf.createEntityManager();\n\n\n Employee reloadedEmployeInstance1 = em.find(Employee.class, employee.getId());\n Employee reloadedEmployeInstance2 = em2.find(Employee.class, employee.getId());\n\n // --- client 1 ---\n // saving employee1\n reloadedEmployeInstance1.setAge(100);\n em.getTransaction().begin();\n em.persist(reloadedEmployeInstance1);\n em.getTransaction().commit();\n\n // --- client 2 ---\n // saving employe2\n reloadedEmployeInstance2.setAge(99);\n em2.getTransaction().begin();\n em2.persist(reloadedEmployeInstance2);\n em2.getTransaction().commit();\n }", "public void lock() {\r\n super.lock();\r\n }", "void processBeforeLocking(MutableCachedNode modifiedOrNewNode,\n SaveContext context) throws Exception;", "public void lock() {\n super.lock();\n }", "public void lock() {\n super.lock();\n }", "public void lock() {\n super.lock();\n }", "public CacheKey acquireReadLockOnCacheKey(Vector primaryKey) {\n //check if the key is already in the hashtable\n CacheKey key = null;\n\n //cache key should not be changed in other threads during the lock acquire operation\n synchronized (this) {\n key = getCacheKey(primaryKey);\n if (key == null) {\n //create a chachKey and lock the object\n CacheKey cacheKey = createCacheKey(primaryKey, null, null);\n\n //lets create one but not put it in the cache, as we are only reading\n // should not be writing to the identitymap\n cacheKey.acquireReadLock();\n return cacheKey;\n }\n }\n\n key.acquireReadLock();\n\n return key;\n }", "public abstract String lock(String oid) throws OIDDoesNotExistException, LockNotAvailableException;", "public Lock lock(TYPE key) {\n return lock(key, timeoutMs, TimeUnit.MILLISECONDS);\n }", "@Override\r\n\tpublic Client update(Client entity) {\n\t\treturn clientService.mergeClient(entity);//TODO update should only be based on baseEntityId\r\n\t}", "@PostMapping(\"/distributedLock\")\n public String distributedLock(String key, String uuid, String secondsToLock, String userId) throws Exception{\n Boolean locked = false;\n try {\n locked = lock.distributedLock(key, uuid, secondsToLock);\n if(locked) {\n log.info(\"userId:{} is locked - uuid:{}\", userId, uuid);\n log.info(\"do business logic\");\n// Integer stock=Integer.valueOf(String.valueOf(redisUtil.get(\"stock\",1)));\n// if (stock>0&&stock<=500){\n// redisUtil.set(\"stock\",String.valueOf(stock-1),1);\n// }\n TimeUnit.MICROSECONDS.sleep(500);\n } else {\n log.info(\"userId:{} is not locked - uuid:{}\", userId, uuid);\n }\n } catch (Exception e) {\n log.error(\"error\", e);\n } finally {\n if(locked) {\n lock.distributedUnlock(key, uuid);\n }\n }\n return \"ok\";\n }", "public Lock getLock();", "void processAfterLocking(MutableCachedNode modifiedNode,\n SaveContext context) throws Exception;", "E update(E entity);", "E update(E entity);", "@Override\n protected final Void updateKeyAfterInsert(VaccineInjectTimes entity, long rowId) {\n return null;\n }", "public interface JedisLockSupport {\r\n\t\r\n\t/**\r\n\t * Acquire the lock on passed key and set its owner\r\n\t * It will try once and will return immediately\r\n\t * @param key the key to set lock against\r\n\t * @param owner lock owner\r\n\t * @return true if lock is acquired\r\n\t */\r\n\tpublic boolean acquire(String key, String owner);\r\n\t\r\n\t\r\n\t/**\r\n\t * Acquire the lock on passed key\r\n\t * It will try to get lock for timeout passed\r\n\t * @param key\r\n\t * @param owner\r\n\t * @param timeout\r\n\t * @param timeUnit\r\n\t * @return true if lock is acquired\r\n\t */\r\n\tpublic boolean tryAcquire(String key, String owner, long timeout, TimeUnit timeUnit);\r\n\t\r\n\t/**\r\n\t * Releases the lock\r\n\t * @param key\r\n\t * @param owner\r\n\t */\r\n\tpublic void release(String key, String owner);\r\n\t\r\n\t/**\r\n\t * Interning the string key. Used internally.\r\n\t * String str1 = new String(\"abc\");\r\n\t * String str2 = new String(\"abc\");\r\n\t * str1 and str2 are two different objects \r\n\t * and we synchronized based on the passed key\r\n\t * \r\n\t * @param key to normalize\r\n\t * @return the normalized key\r\n\t */\r\n\tdefault String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}\r\n}", "public Object getGenericEntityByPrimaryKey(Class ent, Serializable key) throws RepositoryException{\n\t\treturn DatanucleusCRUDUtils.getById(ent, key);\n\t}", "public void setLockId(String lockId) {\n this.lockId = lockId;\n }", "public abstract ReentrantLock getLock();", "public CacheKey acquireReadLockOnCacheKeyNoWait(Vector primaryKey) {\n //check if the key is already in the hashtable\n CacheKey key = null;\n\n //cache key should not be changed in other threads during the lock acquire operation\n synchronized (this) {\n key = getCacheKey(primaryKey);\n if (key == null) {\n //create a chachKey and lock the object\n CacheKey cacheKey = createCacheKey(primaryKey, null, null);\n cacheKey.acquireReadLock();\n\n //lets create one but not put it in the cache, as we are only reading\n // should not be writing to the identitymap\n return cacheKey;\n }\n }\n\n //find the key in the hashtable, lock the object\n if (key != null) {\n //couldn't acquire the key so do not return it\n if (!key.acquireReadLockNoWait()) {\n key = null;\n }\n }\n\n return key;\n }", "int updateByPrimaryKeySelective(AccessKeyRecordEntity record);", "public void lock_write() {\n boolean update = false;\n logger.log(Level.FINE,\"lock_write() \"+this.lockState+\".\");\n lock.lock();\n logger.log(Level.FINE,\"lock_write : taking mutex \"+this.lockState+\".\");\n switch(this.lockState){\n case WLC:\n this.lockState=State.WLT;\n logger.log(Level.INFO,\"writing with cache\");\n \t break;\n \t\t default: \t\n update = true;\n break;\n \t }\n lock.unlock();\n logger.log(Level.FINE,\"lock_write : the mutex with :\"+lockState+\".\");\n if(update){\n \tlogger.log(Level.INFO,\"Updating lock to WLT \"+lockState+\".\"); //Avant RLC\n \tthis.lockState=State.WLT; \n if(lockState!=State.WLT){\n logger.log(Level.SEVERE,\"Lock = \"+this.lockState+\" instead of WLT\"); //Bien mmis à WLT.\n }\n logger.log(Level.INFO,\"LockState was updated to \"+lockState+\".\");\n this.obj = client.lock_write(this.id); //BUG : se fait invalider en tant que reader et passe à NL entrant dans la boucle suivante \n // A mon avis : se fait invalider en tant que lecteur (d'ou un lock_incohérent = WLT). A voir \n // Est-ce qu'il s'auto-invalide, auquel cas, il faut vérifier invalidate_reader mais je crois qu'il y un test pour ce cas.\n // Quelqu'un d'autre l'invalide mais dans ce cas, le serveur devrait \"séquencer\" cette autre invalidation et le lock_write.\n if(lockState!=State.WLT){\n logger.log(Level.SEVERE,\"Lock = \"+this.lockState+\" instead of WLT\");\n }\n logger.log(Level.INFO,\"lock_write() : end with \"+lockState+\".\");\n }\n }", "public static boolean updateStuff(Entity entity){\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\tKey key = datastore.put(entity);\n\t\tif (key != null){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public abstract Object update(String oid, Object obj, String lockKey)\n\t\t\tthrows OIDDoesNotExistException, ObjectNotSupportedException, InvalidLockException;", "@Override\n public boolean tryLock() {\n Preconditions.checkState(connection != null);\n checkThread();\n Monitoring.increment(callCounter.name(), (KeyValuePair<String, String>[]) null);\n try {\n return lockLatency.record(() -> {\n if (super.tryLock()) {\n if (locked) return true;\n Transaction tnx = session.beginTransaction();\n try {\n DbLockRecord record = checkExpiry(fetch(session, true, true));\n if (record.isLocked() && instanceId().compareTo(record.getInstanceId()) == 0) {\n session.save(record);\n tnx.commit();\n lockedTime = System.currentTimeMillis();\n locked = true;\n } else if (!record.isLocked()) {\n record.setInstanceId(instanceId());\n record.setLocked(true);\n record.setTimestamp(System.currentTimeMillis());\n session.update(record);\n tnx.commit();\n lockedTime = System.currentTimeMillis();\n locked = true;\n } else\n tnx.rollback();\n } catch (Exception ex) {\n tnx.rollback();\n throw ex;\n }\n }\n return locked;\n });\n } catch (Exception ex) {\n Monitoring.increment(errorCounter.name(), (KeyValuePair<String, String>[]) null);\n throw new LockException(ex);\n }\n }", "ManagementLockObject.Update update();", "ManagementLockObject apply(Context context);", "@Override\n public void forceIncrementModificationCounter(LineEntity entity) {\n\n }", "public String getLockId() {\n return lockId;\n }", "Boolean isConsumeLockEntity();", "void acquireDatasetExclusiveModificationLock(LockList locks, DataverseName dataverseName, String datasetName)\n throws AlgebricksException;", "@Override\n public void lock() {\n Preconditions.checkState(connection != null);\n if (!tryLock(lockGetTimeout(), TimeUnit.MILLISECONDS)) {\n Monitoring.increment(errorCounter.name(), (KeyValuePair<String, String>[]) null);\n throw new LockException(String.format(\"[%s][%s] Timeout getting lock.\", id().getNamespace(), id().getName()));\n }\n }", "@Override\n public boolean hasLockedKey(Object key) {\n return false;\n }", "@Override\r\n\tpublic T update(T entity) throws Exception {\n\t\ttry {\r\n\t\t\tthis.getcurrentSession().update(entity);\r\n\t\t\treturn entity;\r\n\t\t}catch (NonUniqueObjectException e) {\r\n\t\t\tthis.getcurrentSession().merge(entity);\r\n\t\t\treturn entity;\r\n\t\t} catch (DataAccessException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tthrow new Exception(\"更新\" + entity.getClass().getName() + \"实例失败\", e);\r\n\t\t}\r\n\t}", "protected abstract void updateEntry(PersistentEntity persistentEntity, K id, T entry);", "public TEntity save(TEntity entity){\n ContentValues content = toContentValues(entity);\n TEntity oldEntity = getById(entity.getId());\n\n int newKey;\n\n if (oldEntity != null) {\n db.update(tableName, content, String.format(\"Id = %1$s\", oldEntity.getId()), null);\n newKey = oldEntity.getId();\n } else {\n newKey = (int)db.insert(tableName, null, content);\n }\n return getById(newKey);\n }", "public interface CounterRepository extends CrudRepository<Counter,Integer> {\n\n @Query(value = \"SELECT * FROM counter c WHERE c.id = ?1 for UPDATE\",\n nativeQuery = true)\n Counter findByIdWithLock(int id);\n\n\n}", "@Override\n public void lock(int myId) {\n \n while(true) {\n \n flag[myId] = true;\n X = myId;\n \n if (Y!=-1) { //LEFT QUEUE\n flag[myId] = false;\n while (Y!=-1) ; //wait until Y:=-1\n continue; //start all over\n }\n else { \n Y = myId;\n if (X==myId) \n return; // fast path, exit to CS\n \n else { // RIGHT QUEUE\n flag[myId] = false;\n \n for (int j=0; j<numThread; j++) \n while (flag[j]); // wait until flag[j]:=false\n \n if (Y==myId) \n return; // slow path, exit to CS\n else {\n while (Y!=-1) ; //wait until Y:=-1\n continue; //start all over\n }\n }//end right queue else\n }// end not left queue else \n }//end while true\n }", "protected abstract T getEntityById(Long id);", "Update withIdentity(Identity identity);", "public void setEntityId(String entityId) {\n this.entityId = entityId;\n }", "private <T extends EntityBase> void updateParentEntityInCache(Class<T> entityClass, UUID uuid, T entity) {\n for (T childEntity : cache.getEntities(entityClass)) {\n if (uuid.equals(childEntity.getParentEntityId())) {\n childEntity.setParentEntity(entity);\n }\n }\n }", "private void runWrongUpdateTask2(BdbMapDao<BytesValue> dbLock,\n BdbMapDao<Blog.BlogEntry> blogEntryDao,\n ByteString key,\n AtomicInteger conflictCount) throws InterruptedException {\n for (int i = 0; i < execTimes; ++i) {\n\n // Optimistic lock, still causes a lot of contention\n boolean wasSuccessful = false;\n\n for (int retries = 0; retries < MAX_RETRIES; ++retries) {\n // [1] acquire record\n BytesValue lock = dbLock.get(null, key, () -> null);\n if (lock == null) { // does somebody acquired this record before?\n // ok - version is empty, looks like we are the ones who acquired it first\n // NOTE: we need big endian representation of long here!\n final ByteString versionKey = ByteString.copyFrom(Longs.toByteArray(versionId.incrementAndGet()));\n\n // [2] assign update version\n dbLock.put(null, key, BytesValue.newBuilder().setValue(versionKey).build());\n\n // [3] retrieve version once more, duplicates should be disregarded\n lock = dbLock.get(null, key, () -> null);\n if (lock != null && lock.getValue().equals(versionKey)) {\n // [4] same version, proceed with the update\n final Blog.BlogEntry original = blogEntryDao.get(null, key);\n blogEntryDao.put(null, key, Blog.BlogEntry.newBuilder(original)\n .setLikes(original.getLikes() + 1)\n .build());\n\n // [5] clear lock versions\n dbLock.delete(null, key);\n wasSuccessful = true;\n break;\n }\n }\n conflictCount.incrementAndGet(); // CAS failed, do it all over again\n } // optimistic lock retry loop\n\n if (!wasSuccessful) {\n throw new IllegalStateException();\n }\n }\n }", "public Object getLock() {\n return dataLock;\n }", "private int singleStore(GenericEntity entity, Connection connection) throws GenericEntityException {\n GenericPK tempPK = entity.getPrimaryKey();\n ModelEntity modelEntity = entity.getModelEntity();\n\n try {\n // must use same connection for select or it won't be in the same transaction...\n select(tempPK, connection);\n } catch (GenericEntityNotFoundException e) {\n // Debug.logInfo(e);\n // select failed, does not exist, insert\n return singleInsert(entity, modelEntity, modelEntity.getFieldsCopy(), connection);\n }\n // select did not fail, so exists, update\n\n List<ModelField> partialFields = new ArrayList<ModelField>();\n Collection<String> keys = entity.getAllKeys();\n\n for (int fi = 0; fi < modelEntity.getNopksSize(); fi++) {\n ModelField curField = modelEntity.getNopk(fi);\n\n // we don't want to update ALL fields, just the nonpk fields that are in the passed GenericEntity\n if (keys.contains(curField.getName())) {\n //also, only update the fields that have changed, since we have the selected values in tempPK we can compare\n if (entity.get(curField.getName()) == null) {\n if (tempPK.get(curField.getName()) != null) {\n //entity field is null, tempPK is not so are different\n partialFields.add(curField);\n }\n } else if (!entity.get(curField.getName()).equals(tempPK.get(curField.getName()))) {\n //entity field is not null, and compared to tempPK field is different\n partialFields.add(curField);\n }\n }\n }\n\n return singleUpdate(entity, modelEntity, partialFields, connection, null);\n }", "private void reacquireLocks() {\n getCommander().requestLockOn( getPart() );\n for ( Long id : expansions ) {\n try {\n ModelObject expanded = getQueryService().find( ModelObject.class, id );\n if ( !( expanded instanceof Segment || expanded instanceof Plan ) )\n getCommander().requestLockOn( expanded );\n } catch ( NotFoundException e ) {\n LOG.warn( \"Expanded model object not found at: \" + id );\n }\n }\n }", "boolean lockDigitalObject(String uuid, Long id, String description) throws DatabaseException;", "void addRowsLock();", "ManagementLockObject refresh(Context context);", "void lock(Connection con, EnterpriseObject eo1, EnterpriseObject eo2,\n String srcRevisionNumber, String destRevisionNumber)\n throws DataModifiedException {\n try {\n if ((eo1 == null && eo2 == null) || (con.getAutoCommit())) {\n return;\n } else if (eo1 == null) {\n lock(con, eo2, srcRevisionNumber, true);\n return;\n } else if (eo2 == null) {\n lock(con, eo1, destRevisionNumber, true);\n return;\n }\n SBR sbr1 = eo1.getSBR();\n String euid1 = eo1.getEUID();\n SBR sbr2 = eo2.getSBR();\n String euid2 = eo2.getEUID();\n\n if (srcRevisionNumber != null && destRevisionNumber != null) {\n lockSBR(con, euid1, destRevisionNumber, euid2,\n srcRevisionNumber);\n sbr1.setRevisionNumber(Integer.parseInt(destRevisionNumber) + 1);\n sbr2.setRevisionNumber(Integer.parseInt(srcRevisionNumber) + 1);\n } else {\n Integer revisionNumber1 = sbr1.getRevisionNumber();\n sbr2 = eo2.getSBR();\n euid2 = eo2.getEUID();\n Integer revisionNumber2 = sbr2.getRevisionNumber();\n lockSBR(con, euid1, revisionNumber1, euid2, revisionNumber2);\n sbr1.setRevisionNumber(sbr1.getRevisionNumber().intValue() + 1);\n sbr2.setRevisionNumber(sbr2.getRevisionNumber().intValue() + 1);\n }\n } catch (ObjectException ex) {\n throw new DataModifiedException(mLocalizer.t(\"OPS527: Could not lock \" +\n \"one or more EnterpriseObjects: {0}\", ex));\n } catch (SQLException se) {\n throw new DataModifiedException(mLocalizer.t(\"OPS528: Could not lock \" +\n \"one or more EnterpriseObjects: {0}\", se));\n }\n }", "public long getEntityId();", "ManagementLockObject apply();", "public void lock() {\n\t\tlocked = true;\n\t}", "@SuppressWarnings(\"unchecked\") @Override public K getIdByEntity(E entity) {\n K id = (K) session.getIdentifier(entity);\n LOG.info(String.format(\"Found id %d for entity %s.\",id, entity));\n return id;\n }" ]
[ "0.6952761", "0.6877243", "0.683668", "0.68018836", "0.6181282", "0.61163354", "0.6082137", "0.6079825", "0.6075558", "0.6057201", "0.60171336", "0.59491026", "0.59118414", "0.5876734", "0.58499175", "0.5824788", "0.5817028", "0.58116376", "0.58113474", "0.58097094", "0.580756", "0.5743699", "0.573798", "0.57347155", "0.57337064", "0.57318634", "0.57301766", "0.5707311", "0.5682169", "0.56731296", "0.5666141", "0.56336564", "0.563119", "0.5602349", "0.5588725", "0.5568888", "0.5550475", "0.5515004", "0.5476403", "0.54682696", "0.54633635", "0.54578525", "0.54563445", "0.54544234", "0.5450375", "0.54307175", "0.5416443", "0.5410097", "0.53735363", "0.53735363", "0.53735363", "0.53733945", "0.5364659", "0.5364456", "0.5364306", "0.5351735", "0.53502035", "0.533675", "0.5336117", "0.5336117", "0.5333009", "0.5331684", "0.5330837", "0.5325029", "0.53059506", "0.52958804", "0.52930224", "0.5278571", "0.52782243", "0.52635676", "0.5262121", "0.52576524", "0.52535385", "0.5252866", "0.5251745", "0.5242924", "0.5241094", "0.52399266", "0.5235355", "0.52344453", "0.52293414", "0.5226896", "0.52142876", "0.5212204", "0.5211383", "0.5207321", "0.52024126", "0.52006805", "0.520039", "0.51974434", "0.5186907", "0.5174279", "0.51672864", "0.51568764", "0.51567787", "0.5155837", "0.5155094", "0.51510966", "0.5150024", "0.51486766" ]
0.70529634
0
This method set a new status to the phase
void setPhaseStatus(GeneralStatus phaseStatus);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setStatus(Status newStatus){\n status = newStatus;\n }", "public void setPhaseStatus(ProjectPhaseStatus phaseStatus) {\r\n this.phaseStatus = phaseStatus;\r\n }", "public void setStatus(int newStatus) {\n status = newStatus;\n }", "public void setStatus( short newStatus )\r\n {\r\n setStatus( newStatus, -1, null );\r\n }", "public void setStatus(EnumVar status) {\n this.status = status;\n }", "public void setStatus(boolean newstatus){activestatus = newstatus;}", "@Override\n\t\tpublic void setStatus(int status) {\n\t\t\t\n\t\t}", "public void setStatus(JobStatus status);", "public void setStatus(String newStatus){\n\n //assigns the value of newStatus to the status field\n this.status = newStatus;\n }", "void setStatus(STATUS status);", "public void setStatus(boolean newStatus);", "public void setStatus(Status.State state) throws Throwable {\n \t// Don't update terminated transforms. Leave them terminated\n \tif ( _status.state() != Status.State.TERMINATED ) {\n \t\t_status = new Status(state, new Date());\n \t}\n \n }", "public void setStatus(int status);", "public void setStatus(int status);", "public void setStatus(Status status) {\r\n\t this.status = status;\r\n\t }", "public void setStatus(long status) {\r\n this.status = status;\r\n }", "void setStatus(int status);", "@Override\n\tpublic void setStatus(int status);", "public void setStatus(int status){\r\n\t\tthis.status=status;\r\n\t}", "public void setStatus(String status) { this.status = status; }", "public void setPhase(int phase) {\n this.phase = phase;\n }", "public void setStatus(Status status) {\r\n this.status = status;\r\n }", "@Override\n\tpublic void setStatus(boolean status) {\n\t\t_candidate.setStatus(status);\n\t}", "public void setStatus(byte[] status) {\r\n this.status = status;\r\n }", "public void setStatus(int v) \n {\n \n if (this.status != v)\n {\n this.status = v;\n setModified(true);\n }\n \n \n }", "public void setStatus(String status) {\n mBundle.putString(KEY_STATUS, status);\n }", "public void setStatus(Byte status) {\r\n\t\tthis.status = status;\r\n\t}", "public void setStatus(Byte status) {\n\t\tthis.status = status;\n\t}", "public void setStatus(Byte status) {\n\t\tthis.status = status;\n\t}", "public void setStatus(Byte status) {\r\n this.status = status;\r\n }", "public void setStatus(Byte status) {\r\n this.status = status;\r\n }", "public void setStatus(Byte status) {\r\n this.status = status;\r\n }", "public void setStatus(Byte status) {\r\n this.status = status;\r\n }", "public void setStatus(Byte status) {\r\n this.status = status;\r\n }", "public void setStatus(Byte status) {\r\n this.status = status;\r\n }", "public void setStatus(Byte status) {\r\n this.status = status;\r\n }", "public void setStatus(java.lang.Object status) {\n this.status = status;\n }", "public void setStatus(int status) {\n STATUS = status;\n }", "public void setStatus(Status status)\n {\n this.status = status;\n }", "public void setStatus(boolean stat) {\n\t\tstatus = stat;\n\t}", "public void setStatus(Boolean s){ status = s;}", "public void setStatus(STATUS status) {\n this.status = status;\n }", "public void setStatus(int status) {\n this.status = status;\n }", "public void setStatus(int status) {\n this.status = status;\n }", "void setStatus(String status);", "public void setStatus(boolean status) {\n\tthis.status = status;\n }", "public void setPhase(String newPhase,Player newPlayer) {\n\t\tthis.phase = newPhase;\n\t\tthis.p = newPlayer;\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t\tthis.action=\"\";\t//Cleaning up the previous action after it has been displayed\n\t}", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Byte status) {\n this.status = status;\n }", "public void setStatus(Status status) {\n this.status = status;\n }", "public void setStatus(Status status) {\n this.status = status;\n }", "public void setStatus(Status status) {\n this.status = status;\n }", "public void setStatus(Status status) {\n this.status = status;\n }", "void setStatus(java.lang.String status);", "public void setStatus(String status) {\r\n this.status = status;\r\n }", "public void setStatus( short newStatus, int statusSeconds )\r\n {\r\n setStatus( newStatus, statusSeconds, null );\r\n }", "public void setStatus(Short status) {\n\t\tthis.status = status;\n\t}", "public void setStatus(Short status) {\n\t\tthis.status = status;\n\t}", "public void setStatus(String stat)\n {\n status = stat;\n }", "public void setStatus(String status) {\r\n this.status = status;\r\n }", "public void setStatus(String status) {\r\n this.status = status;\r\n }", "private void setStatus() {\n\t\t// adjust the status of the rest\n\t\tif (rest.getState().equals(RestState.INACTIVE)) {\n\t\t\t// set status to heating\n\t\t\trest.setState(RestState.HEATING);\n\t\t\tlog.info(rest.getName() + \" is now in state \" + rest.getState());\n\t\t} else if (rest.getState().equals(RestState.HEATING) && temperatureSensor.getTemperature() >= (rest.getTemperature() - tolerance)) {\n\t\t\t// set status to active\n\t\t\trest.setState(RestState.ACTIVE);\n\t\t\tlog.info(rest.getName() + \" is now in state \" + rest.getState());\n\t\t} else if (rest.getState().equals(RestState.ACTIVE)\n\t\t\t\t&& (new GregorianCalendar().getTimeInMillis() - rest.getActive().getTimeInMillis()) / 1000 / 60 > rest.getDuration()) {\n\t\t\t// time is up :)\n\t\t\tif (rest.isContinueAutomatically()) {\n\t\t\t\trest.setState(RestState.COMPLETED);\n\t\t\t} else {\n\t\t\t\trest.setState(RestState.WAITING_COMPLETE);\n\t\t\t}\n\t\t\tlog.info(rest.getName() + \" is now in state \" + rest.getState());\n\t\t}\n\t}", "public void setStatus(int status) {\n\t\tthis.status = (byte) status;\n\t\trefreshStatus();\n\t}", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\r\n\t\tthis.status = status;\r\n\t}", "public void setStatus(String status) {\r\n\t\tthis.status = status;\r\n\t}", "public void setStatus(String status) {\r\n\t\tthis.status = status;\r\n\t}", "public void setStatus(String status) {\r\n\t\tthis.status = status;\r\n\t}", "public void setStatus(String status) {\r\n\t\tthis.status = status;\r\n\t}", "@Override\n\tpublic void setStatus(int status) {\n\t\t_dictData.setStatus(status);\n\t}", "public void setStateComplete() {state = STATUS_COMPLETE;}", "void setStatus(TaskStatus status);", "public void setStatus(Integer status) {\r\n this.status = status;\r\n }", "public void setStatus(Integer status) {\r\n this.status = status;\r\n }", "public void setStatus( int pStatus )\r\n {\r\n mStatus = pStatus;\r\n }", "public void setStatus(StatusEnum status) {\n this.status = status;\n }", "public void status(boolean b) {\n status = b;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }" ]
[ "0.7117886", "0.6947157", "0.67823863", "0.6765126", "0.67453533", "0.67340356", "0.6721293", "0.66957885", "0.6689429", "0.66727173", "0.66710865", "0.6665544", "0.661769", "0.661769", "0.6613146", "0.6604505", "0.6590093", "0.6568846", "0.65631586", "0.65345263", "0.6530291", "0.65294975", "0.65277255", "0.6513738", "0.65066624", "0.65042853", "0.649629", "0.6486942", "0.6486942", "0.6481979", "0.6481979", "0.6481979", "0.6481979", "0.6481979", "0.6481979", "0.6481979", "0.64680076", "0.646598", "0.6453649", "0.64478225", "0.6441121", "0.6440412", "0.64393234", "0.64393234", "0.6435592", "0.64349145", "0.64324516", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.64313644", "0.6428338", "0.6428338", "0.6428338", "0.6428338", "0.6420244", "0.641887", "0.64167744", "0.6408141", "0.6408141", "0.6406951", "0.6406941", "0.6406941", "0.63997173", "0.63705957", "0.63667715", "0.63667715", "0.63570213", "0.63570213", "0.63570213", "0.63570213", "0.63570213", "0.6352373", "0.63520706", "0.63476485", "0.6346049", "0.6346049", "0.63431513", "0.6335692", "0.6332599", "0.6330657", "0.6330657", "0.6330657", "0.6330657", "0.6330657", "0.6330657", "0.6330657", "0.6330657", "0.6330657", "0.6330657", "0.6330657" ]
0.81373715
0
Suppress default constructor for noninstantiability.
private TedCorrigendumHandler() { throw new AssertionError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "defaultConstructor(){}", "private Instantiation(){}", "void DefaultConstructor(){}", "private Consts(){\n //this prevents even the native class from \n //calling this ctor as well :\n throw new AssertionError();\n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}", "Reproducible newInstance();", "private Log()\n {\n //Hides implicit constructor.\n }", "private SystemInfo() {\r\n // forbid object construction \r\n }", "private InterpreterDependencyChecks() {\r\n\t\t// Hides default constructor\r\n\t}", "private SingleObject()\r\n {\r\n }", "private SerializerFactory() {\n // do nothing\n }", "private NullSafe()\n {\n super();\n }", "private TagCacheManager(){\n //AssertionError不是必须的. 但它可以避免不小心在类的内部调用构造器. 保证该类在任何情况下都不会被实例化.\n //see 《Effective Java》 2nd\n throw new AssertionError(\"No \" + getClass().getName() + \" instances for you!\");\n }", "private SingleObject(){}", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "private LogUtil() {\r\n /* no-op */\r\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "private Validate(){\n //private empty constructor to prevent object initiation\n }", "private QcTestRunner()\n\t{\n\t\t// To prevent external instantiation of this class\n\t}", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "private XmlFactory() {\r\n /* no-op */\r\n }", "private InstanceUtil() {\n }", "private SingletonObject() {\n\n\t}", "private Helper() {\r\n // do nothing\r\n }", "private WebXmlIo()\n {\n // Voluntarily empty constructor as utility classes should not have a public or default\n // constructor\n }", "private Singleton() {\n\t}", "private TetrisMain() {\r\n //prevents instantiation\r\n }", "private Default()\n {}", "@SuppressWarnings(\"unused\")\r\n private Rental() {\r\n }", "private Utility() {\n\t}", "private Rekenhulp()\n\t{\n\t}", "private Singleton()\n\t\t{\n\t\t}", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "private SingleObject(){\n }", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "private Singleton() { }", "private Tuples() {\n // prevent instantiation.\n }", "MyEncodeableWithoutPublicNoArgConstructor() {}", "private DarthSidious(){\n }", "private ContentUtil() {\n // do nothing\n }", "private Ex() {\n }", "private XMLUtil() {\n\t}", "private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }", "private MApi() {}", "private TemplateFactory(){\n //AssertionError不是必须的. 但它可以避免不小心在类的内部调用构造器. 保证该类在任何情况下都不会被实例化.\n //see 《Effective Java》 2nd\n throw new AssertionError(\"No \" + getClass().getName() + \" instances for you!\");\n }", "private NaturePackage() {}", "public Pleasure() {\r\n\t\t}", "@SuppressWarnings(\"unused\")\n private Booking() {\n }", "private SerializationUtils() {\n\t\tthrow new AssertionError();\n\t}", "private ObjectFactory() { }", "private Utils()\n {\n // Private constructor to prevent instantiation\n }", "private Service() {}", "private XMLUtils()\r\n\t{\r\n\t}", "public no() {}", "private ClassUtil() {}", "private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}", "private GeneralServicesImpl() {\r\n\t}", "private Singleton(){}", "private GeoUtil()\n\t{\n\t}", "public Dog() {\n // Default constructor\n }", "private ObjectRepository() {\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate Filter() {\n\n\t}", "private Settings()\n {}", "TypesOfConstructor(){\n System.out.println(\"This is default constructor\");\n }", "private Cat() {\n\t\t\n\t}", "public Person()\n {\n //intentionally left empty\n }", "private Marinator() {\n }", "private Marinator() {\n }", "private UtilityKlasse() {\n\n }", "public Instance() {\n }", "private Supervisor() {\r\n\t}", "private ClassificationSettings() {\n throw new AssertionError();\n }", "private ReportPluginConstant() {\n\t\t// NO_PMD DUMMY CONSTRUCTOR\n\t}", "public static void copyConstructor(){\n\t}", "public Student()\r\n {\r\n //This is intended to be empty\r\n }", "private Security() { }", "private JsonUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "private Foo() {\n\t\tSystem.out.println(\"Private Constructor.\");\n\t}", "private Conf() {\n // empty hidden constructor\n }", "ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}", "private PuzzleConstants() {\n // not called\n }", "public Member() {\n //Empty constructor!\n }", "private AcceleoLibrariesEclipseUtil() {\n \t\t// hides constructor\n \t}", "public ObjectUtils() {\n super();\n }", "private EagerlySinleton()\n\t{\n\t}", "private void __sep__Constructors__() {}", "private A(){\n System.out.println(\"Instance created\");\n }", "public Clade() {}", "private SingletonSample() {}", "public Sad() {\n }", "private AccessorModels() {\n // Private constructor to prevent instantiation\n }", "private MetallicityUtils() {\n\t\t\n\t}", "public D() {}", "private HabitTrackerUtils() {\n // Required empty private constructor (to prevent instantiation).\n }", "private ServiceListingList() {\n //This Exists to defeat instantiation\n super();\n }", "private LazySingleton() {\n if (null != INSTANCE) {\n throw new InstantiationError(\"Instance creation not allowed\");\n }\n }", "private SupplierLoaderUtil() {\n\t}", "private Driver(){\n }", "O() { super(null); }" ]
[ "0.82670325", "0.7635687", "0.7544629", "0.7500964", "0.7452601", "0.7449513", "0.72489494", "0.71992016", "0.7179479", "0.7091578", "0.7035374", "0.70110184", "0.6986614", "0.69856423", "0.6914095", "0.6891218", "0.6879011", "0.68582505", "0.68539506", "0.6841544", "0.6820854", "0.6798008", "0.67911524", "0.6776055", "0.67705584", "0.6765513", "0.6761272", "0.67574507", "0.67533815", "0.67484856", "0.6741407", "0.6724432", "0.67242527", "0.67211616", "0.67185545", "0.67106384", "0.67099535", "0.6699966", "0.6696312", "0.6677413", "0.6676726", "0.66695005", "0.6668766", "0.665835", "0.66542304", "0.66523343", "0.6651032", "0.6645424", "0.6644859", "0.6640535", "0.6627706", "0.6619869", "0.6612621", "0.66106147", "0.66015166", "0.65970504", "0.65959275", "0.6590967", "0.65813655", "0.657536", "0.65750873", "0.65748155", "0.65720004", "0.65627694", "0.6560731", "0.6559363", "0.6554318", "0.6548418", "0.6547602", "0.6547602", "0.6546006", "0.6538001", "0.65248084", "0.6522969", "0.65143806", "0.6510383", "0.6509219", "0.6501689", "0.64986324", "0.64928085", "0.64905584", "0.6484926", "0.64758277", "0.6475415", "0.64636576", "0.6462437", "0.6462145", "0.6458888", "0.6458427", "0.6458339", "0.64521337", "0.6450502", "0.64464736", "0.6439821", "0.64393026", "0.6439033", "0.64384353", "0.64332414", "0.6430866", "0.64296204", "0.6427505" ]
0.0
-1
Parses corrigendum form specific data.
public static ParsedTender parse(final ParsedTender parsedTender, final Document document) { final Element originNode = TedTenderParserUtils.getOriginNode(document); parsedTender .addPublication(TedTenderParserUtils.initMainPublication(document) .setSource(PUBLICATIONS_SOURCE)) .addBuyer(TedTenderParserUtils.parseBody(JsoupUtils.selectFirst("ADDRESS_NOT_STRUCT", originNode)) .setMainActivities(TedTenderParserUtils.getDefaultMainActivities(document)) .setBuyerType(TedTenderParserUtils.getDefaultBuyerType(document))) .setCorrections(parseCorrections(JsoupUtils.select("CONTENTS > CORREC", originNode))); return parsedTender; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void parseTermData()\n {\n for (int i = 0; i < data.length; i++)\n {\n data[i] = Cdata[i];\n }\n }", "private void parseData() {\n\t\t\r\n\t}", "private void parseData() throws IOException {\n // The data section ends with a dashed line...\n //\n while (true) {\n String line = reader.readLine();\n\n if (line == null || isDashedLine(line))\n return;\n else\n parseLine(line);\n }\n }", "private void parseAndPopulate(String in) {\r\n\t\tIParser parser = new AbbyyOCRDataParser(in);\r\n\t\tocrData = parser.parse();\r\n\t\tStore.addData(ocrData);\r\n\t\t\r\n\t\tEditText np = (EditText)findViewById(R.id.patient_et);\r\n\t\tEditText nm = (EditText)findViewById(R.id.medicine_et);\r\n\t\tEditText cd = (EditText)findViewById(R.id.consumption_et);\r\n\t\t\r\n\t\tPatient2Medicine p2m = ocrData.getPatient2Medicine();\r\n\t\tnp.setText(ocrData.getPatient().getName());\r\n\t\tnm.setText(ocrData.getMedicine().getMedicine());\r\n\t\tcd.setText(p2m.getFrequencyOfIntake()\r\n\t\t\t\t+ \" \" + p2m.getQuantityPerIntake() + \" by \" + p2m.getMode());\r\n\t\t\r\n\t}", "protected void processControlSpec(Hashtable attributes)\n throws SAXException\n {\n if (currentControl != null)\n\t throw new SAXException(\n\t \"Trying to create new field when current is not complete.\");\n\tXMLTag typeTag = (XMLTag) attributes.get(XMLTag.TYPE);\n\t// above will throw a class cast exception if we have an\n\t// invalid type value.\n\tString id = (String) attributes.get(XMLTag.ID);\n\tXMLTag dataTypeTag = (XMLTag) attributes.get(XMLTag.DATATYPE);\n\tif (dataTypeTag == null)\n\t dataTypeTag = XMLTag.STRING;\n\tString dataRange = (String) attributes.get(XMLTag.DATARANGE);\n FieldInfo fld = new FieldInfo(id);\n if ((typeTag == XMLTag.FIXEDTEXT) || \n (typeTag == XMLTag.PUSHBUTTON))\n\t {\n\t fld.setDummyControl(true);\n\t }\n\telse if (typeTag == XMLTag.FIELD)\n\t {\n\t fld.setTextControl(true);\n\t if ((dataTypeTag != null) &&\n\t\t((dataTypeTag == XMLTag.READFILE) ||\n\t\t (dataTypeTag == XMLTag.WRITEFILE)||\n (dataTypeTag == XMLTag.PATH)))\n\t {\n\t\tfld.setFileField(true);\n\t\tboolean bMustExist = (dataTypeTag == XMLTag.READFILE)||\n\t\t (dataTypeTag == XMLTag.PATH);\n\t\tfld.setExisting(bMustExist);\n\t\tString range = (String) attributes.get(XMLTag.DATARANGE);\n\t\tif (range != null)\n\t\t {\n\t\t String filePattern;\n\t\t int pos = range.indexOf(\",\");\n\t\t if (pos >= 0)\n\t\t {\n\t\t\t filePattern = range.substring(0,pos);\n\t\t\t String memoryFiles = range.substring(pos+1);\n\t\t\t fld.setAllowedMemoryFiles(\n\t\t\t\t parseMemoryFiles(memoryFiles));\n\t\t\t }\n\t\t else\n\t\t {\n\t\t\t filePattern = range;\n\t\t\t }\n\t\t DFileType type = DFileType.getFileType(filePattern);\n\t\t if (type != null)\n\t\t fld.setFileType(type);\n\t\t }\n\t\t}\n\t else\n\t {\n\t\tValueLimits limits = null;\n\t\tif (dataRange != null)\n\t\t {\n\t\t if (dataTypeTag == XMLTag.INTEGER)\n\t\t {\n\t\t\tlimits = makeIntegerLimits(dataRange);\n\t\t\t}\n\t\t if (dataTypeTag == XMLTag.DOUBLE)\n\t\t {\n\t\t\tlimits = makeLimits(dataRange);\n\t\t\t}\n\t\t fld.setValueLimits(limits);\n\t\t }\n\n\t\t}\n\t }\n\telse if (typeTag == XMLTag.FIXEDCOMBO) \n\t {\n\t if (dataRange == null)\n\t {\n\t\tthrow new SAXException(\n \"Control \" + id + \n\t\t \": DataRange specifying choices is required for fixedCombo controls\");\n\t\t}\n\t int numChoices = dataRange.length();\n\t String[] choices = new String[numChoices];\n\t for (int i = 0; i < numChoices; i++)\n\t {\n\t\tif (i < numChoices - 1)\n \t choices[i] = dataRange.substring(i,i+1);\n\t\telse\n\t\t choices[i] = dataRange.substring(i);\n\t\t}\n fld.setChoiceControl(true);\n\t fld.setChoicesFixed(true);\n\t }\n\telse if (typeTag == XMLTag.VARCOMBO) \n\t {\n fld.setChoiceControl(true);\n\t fld.setChoicesFixed(false);\n\t }\n\telse if (typeTag == XMLTag.CHECKBUTTON)\n\t {\n\t if ((dataRange == null) ||\n\t\t(dataRange.length() != 2))\n\t {\n\t\t // if no data range is specified assume the choices\n\t\t // are \"Y\" and \"N\"\n\t\tdataRange = new String(\"YN\");\n\t\t}\n\t int numChoices = dataRange.length();\n\t String[] choices = new String[numChoices];\n\t for (int i = 0; i < numChoices; i++)\n\t {\n\t\tif (i < numChoices - 1)\n \t choices[i] = dataRange.substring(i,i+1);\n\t\telse\n\t\t choices[i] = dataRange.substring(i);\n\t\t}\n fld.setChoiceControl(true);\n\t fld.setChoicesFixed(true);\n\t fld.setChoiceStrings(choices);\n\n\t }\n\telse if (typeTag == XMLTag.RADIOPANEL)\n\t {\n\t if (dataRange == null)\n\t {\n\t\tthrow new SAXException(\n \"Control \" + id + \n\t\t \": DataRange specifying choices is required for radioPanel controls\");\n\t\t}\n\t int numChoices = dataRange.length();\n\t boolean bHorizontal = true;\n \t XMLTag displayOpt = (XMLTag) attributes.get(XMLTag.DISPLAYOPTS);\n\t if ((displayOpt != null) && (displayOpt == XMLTag.VERTICAL))\n\t\tbHorizontal = false;\n\t String[] choices = new String[numChoices];\n\t for (int i = 0; i < numChoices; i++)\n\t {\n\t\tif (i < numChoices - 1)\n \t choices[i] = dataRange.substring(i,i+1);\n\t\telse\n\t\t choices[i] = dataRange.substring(i);\n\t\t}\n fld.setChoiceControl(true);\n\t fld.setChoicesFixed(true);\n\t }\n\telse if (typeTag == XMLTag.RANGECONTROL)\n\t {\n\t ValueLimits limits = null;\n\t if (dataRange != null)\n\t\t{\n\t\tif (dataTypeTag == XMLTag.INTEGER)\n\t\t {\n\t\t limits = makeIntegerLimits(dataRange);\n\t\t }\n\t if (dataTypeTag == XMLTag.DOUBLE)\n\t\t {\n\t\t limits = makeLimits(dataRange);\n\t\t }\n\t\t}\n\t fld.setValueLimits(limits);\n }\n\telse if (typeTag == XMLTag.LISTBOX)\n\t {\n\t /* No special processing to be done for a list box */\n }\n\telse if (typeTag == XMLTag.TABLECONTROL)\n {\n\t /* No special processing to be done for a list box */\n\t }\n\telse\n\t {\n\t throw new SAXException(\n \"Unimplemented control type: \" + typeTag.toString());\n\t }\n\t// Now set things that are common to all controls\n\tcurrentControl = fld;\n\tString pSpecStr = (String) attributes.get(XMLTag.PSPECSTR);\n\tif (pSpecStr != null)\n\t currentControl.setPSpecifier(pSpecStr);\n\tXMLTag requiredTag = (XMLTag) attributes.get(XMLTag.BREQUIRED);\n\tif ((requiredTag != null) && (requiredTag == XMLTag.TRUE))\n\t currentControl.setRequired(true);\n\tXMLTag defaultTag = (XMLTag) attributes.get(XMLTag.DEFAULTCATEGORY);\n if ((defaultTag == null) &&\n (typeTag == XMLTag.FIXEDCOMBO))\n\t {\n defaultTag = XMLTag.INDEX;\n\t }\n if (defaultTag == XMLTag.STRING)\n\t {\n\t String dflt = (String) attributes.get(XMLTag.DEFAULTSTR);\n\t currentControl.setDefaultValue(dflt);\n\t }\n\telse if (defaultTag == XMLTag.INDEX)\n\t {\n String indexStr = (String) attributes.get(XMLTag.DEFAULTINDEX);\n\t String range = (String) attributes.get(XMLTag.DATARANGE);\n\t if (indexStr == null)\n\t indexStr = \"0\";\n if (range == null)\n\t throw new SAXException(\"Incorrectly specified indexed default - missing data range: control ID is \" + currentControl.getName());\n\t try \n\t {\n\t int index = Integer.parseInt(indexStr);\n\t\tif ((index >= range.length()) || (index < 0))\n\t\t {\n\t\t throw new SAXException(\"Incorrectly specified indexed default - index must match range: control ID is \" + currentControl.getName());\n\t\t }\n\t\tString dflt;\n if (index < range.length()-1)\n\t\t dflt = range.substring(index,index+1);\n\t\telse\n\t\t dflt = range.substring(index);\n\t\tcurrentControl.setDefaultValue(dflt);\n\t\t}\n\t catch (NumberFormatException nfe)\n\t {\n\t throw new SAXException(\"Incorrectly specified indexed default - index must be an integer: control ID is \" + currentControl.getName());\n\t\t}\n\t }\n\t}", "private void parseRawText() {\n\t\t//1-new lines\n\t\t//2-pageObjects\n\t\t//3-sections\n\t\t//Clear any residual data.\n\t\tlinePositions.clear();\n\t\tsections.clear();\n\t\tpageObjects.clear();\n\t\tcategories.clear();\n\t\tinterwikis.clear();\n\t\t\n\t\t//Generate data.\n\t\tparsePageForNewLines();\n\t\tparsePageForPageObjects();\n\t\tparsePageForSections();\n\t}", "public org.jivesoftware.smackx.xdata.packet.DataForm parse(org.xmlpull.v1.XmlPullParser r6, int r7) {\n /*\n r5 = this;\n r0 = \"\";\n r1 = \"type\";\n r0 = r6.getAttributeValue(r0, r1);\n r0 = org.jivesoftware.smackx.xdata.packet.DataForm.Type.fromString(r0);\n r1 = new org.jivesoftware.smackx.xdata.packet.DataForm;\n r1.<init>(r0);\n L_0x0011:\n r0 = r6.next();\n switch(r0) {\n case 2: goto L_0x0021;\n case 3: goto L_0x0019;\n default: goto L_0x0018;\n };\n L_0x0018:\n goto L_0x0011;\n L_0x0019:\n r0 = r6.getDepth();\n if (r0 == r7) goto L_0x0020;\n L_0x001f:\n goto L_0x0011;\n L_0x0020:\n return r1;\n L_0x0021:\n r0 = r6.getName();\n r2 = r6.getNamespace();\n r3 = -1;\n r4 = r0.hashCode();\n switch(r4) {\n case -427039533: goto L_0x006e;\n case 3242771: goto L_0x0064;\n case 3433103: goto L_0x005a;\n case 97427706: goto L_0x0050;\n case 107944136: goto L_0x0046;\n case 110371416: goto L_0x003c;\n case 757376421: goto L_0x0032;\n default: goto L_0x0031;\n };\n L_0x0031:\n goto L_0x0077;\n L_0x0032:\n r4 = \"instructions\";\n r0 = r0.equals(r4);\n if (r0 == 0) goto L_0x0077;\n L_0x003a:\n r3 = 0;\n goto L_0x0077;\n L_0x003c:\n r4 = \"title\";\n r0 = r0.equals(r4);\n if (r0 == 0) goto L_0x0077;\n L_0x0044:\n r3 = 1;\n goto L_0x0077;\n L_0x0046:\n r4 = \"query\";\n r0 = r0.equals(r4);\n if (r0 == 0) goto L_0x0077;\n L_0x004e:\n r3 = 5;\n goto L_0x0077;\n L_0x0050:\n r4 = \"field\";\n r0 = r0.equals(r4);\n if (r0 == 0) goto L_0x0077;\n L_0x0058:\n r3 = 2;\n goto L_0x0077;\n L_0x005a:\n r4 = \"page\";\n r0 = r0.equals(r4);\n if (r0 == 0) goto L_0x0077;\n L_0x0062:\n r3 = 6;\n goto L_0x0077;\n L_0x0064:\n r4 = \"item\";\n r0 = r0.equals(r4);\n if (r0 == 0) goto L_0x0077;\n L_0x006c:\n r3 = 3;\n goto L_0x0077;\n L_0x006e:\n r4 = \"reported\";\n r0 = r0.equals(r4);\n if (r0 == 0) goto L_0x0077;\n L_0x0076:\n r3 = 4;\n L_0x0077:\n switch(r3) {\n case 0: goto L_0x00bf;\n case 1: goto L_0x00b6;\n case 2: goto L_0x00ad;\n case 3: goto L_0x00a4;\n case 4: goto L_0x009b;\n case 5: goto L_0x0088;\n case 6: goto L_0x007b;\n default: goto L_0x007a;\n };\n L_0x007a:\n goto L_0x0011;\n L_0x007b:\n r0 = \"http://jabber.org/protocol/xdata-layout\";\n r0 = r2.equals(r0);\n if (r0 == 0) goto L_0x0011;\n L_0x0083:\n r0 = org.jivesoftware.smackx.xdatalayout.provider.DataLayoutProvider.parse(r6);\n goto L_0x0096;\n L_0x0088:\n r0 = \"jabber:iq:roster\";\n r0 = r2.equals(r0);\n if (r0 == 0) goto L_0x0011;\n L_0x0090:\n r0 = org.jivesoftware.smack.roster.provider.RosterPacketProvider.INSTANCE;\n r0 = r0.parse(r6);\n L_0x0096:\n r1.addExtensionElement(r0);\n goto L_0x0011;\n L_0x009b:\n r0 = parseReported(r6);\n r1.setReportedData(r0);\n goto L_0x0011;\n L_0x00a4:\n r0 = parseItem(r6);\n r1.addItem(r0);\n goto L_0x0011;\n L_0x00ad:\n r0 = parseField(r6);\n r1.addField(r0);\n goto L_0x0011;\n L_0x00b6:\n r0 = r6.nextText();\n r1.setTitle(r0);\n goto L_0x0011;\n L_0x00bf:\n r0 = r6.nextText();\n r1.addInstruction(r0);\n goto L_0x0011;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jivesoftware.smackx.xdata.provider.DataFormProvider.parse(org.xmlpull.v1.XmlPullParser, int):org.jivesoftware.smackx.xdata.packet.DataForm\");\n }", "private void readForm() {\n }", "private void m72698ho() {\n try {\n FileInputStream openFileInput = this.mContext.openFileInput(this.aeq);\n try {\n XmlPullParser newPullParser = Xml.newPullParser();\n newPullParser.setInput(openFileInput, \"UTF-8\");\n int i = 0;\n while (i != 1 && i != 2) {\n i = newPullParser.next();\n }\n if (\"historical-records\".equals(newPullParser.getName())) {\n List list = this.aep;\n list.clear();\n while (true) {\n int next = newPullParser.next();\n if (next != 1) {\n if (!(next == 3 || next == 4)) {\n if (\"historical-record\".equals(newPullParser.getName())) {\n list.add(new C31890c(newPullParser.getAttributeValue(null, \"activity\"), Long.parseLong(newPullParser.getAttributeValue(null, \"time\")), Float.parseFloat(newPullParser.getAttributeValue(null, \"weight\"))));\n } else {\n throw new XmlPullParserException(\"Share records file not well-formed.\");\n }\n }\n } else if (openFileInput != null) {\n try {\n openFileInput.close();\n return;\n } catch (IOException e) {\n return;\n }\n } else {\n return;\n }\n }\n }\n throw new XmlPullParserException(\"Share records file does not start with historical-records tag.\");\n } catch (XmlPullParserException e2) {\n new StringBuilder(\"Error reading historical recrod file: \").append(this.aeq);\n if (openFileInput != null) {\n try {\n openFileInput.close();\n } catch (IOException e3) {\n }\n }\n } catch (IOException e4) {\n new StringBuilder(\"Error reading historical recrod file: \").append(this.aeq);\n if (openFileInput != null) {\n try {\n openFileInput.close();\n } catch (IOException e5) {\n }\n }\n } catch (Throwable th) {\n if (openFileInput != null) {\n try {\n openFileInput.close();\n } catch (IOException e6) {\n }\n }\n }\n } catch (FileNotFoundException e7) {\n }\n }", "public void parsingAdditionalData() {\n\t\tString AdditionalData = billPayBean.getAdditionalData();\n\t\tswitch (Integer.parseInt(billPayBean.getBillerId())) {\n\t\tcase 91901:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(95,120));\n\t\t\tbillPayBean.setMeterNumber(AdditionalData.substring(7,18));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(18,30));\n\t\t\tbreak;\n\t\tcase 91951:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(47,72));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(0,12));\n\t\t\tbreak;\n\t\tcase 91999:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(66,91));\n\t\t\tbillPayBean.setRegNumber(AdditionalData.substring(0,13));\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\t\treturn ;\n\t}", "private void getIncomingData() {\n Bundle bundle = getIntent().getExtras();\n if (bundle.containsKey(\"DOCTOR_ID\")\n && bundle.containsKey(\"DOCTOR_NAME\")\n && bundle.containsKey(\"CLINIC_ID\")\n && bundle.containsKey(\"CLINIC_NAME\")\n && bundle.containsKey(\"CLINIC_LATITUDE\")\n && bundle.containsKey(\"CLINIC_LONGITUDE\")\n && bundle.containsKey(\"CLINIC_ADDRESS\")) {\n DOCTOR_ID = bundle.getString(\"DOCTOR_ID\");\n DOCTOR_NAME = bundle.getString(\"DOCTOR_NAME\");\n CLINIC_ID = bundle.getString(\"CLINIC_ID\");\n CLINIC_NAME = bundle.getString(\"CLINIC_NAME\");\n CLINIC_LATITUDE = bundle.getDouble(\"CLINIC_LATITUDE\");\n CLINIC_LONGITUDE = bundle.getDouble(\"CLINIC_LONGITUDE\");\n CLINIC_ADDRESS = bundle.getString(\"CLINIC_ADDRESS\");\n\n if (DOCTOR_NAME != null) {\n txtDoctorName.setText(DOCTOR_NAME);\n }\n\n if (CLINIC_NAME != null) {\n txtClinicName.setText(CLINIC_NAME);\n }\n\n if (CLINIC_ADDRESS != null) {\n txtClinicAddress.setText(CLINIC_ADDRESS);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Failed to get required info....\", Toast.LENGTH_SHORT).show();\n finish();\n }\n }", "@Override\n\tpublic void readAgence(Agence a) {\n\t\t\n\t}", "private void extractData() {\n String[] info = request.split(\";\");\n actionCode = info[0];\n\n // if the code is 102, 103... then it has data attached\n List listOfCodes = Arrays.asList(\"102\", \"103\", \"104\", \"202\", \"203\");\n\n // extract data attached with the action code\n if (listOfCodes.contains(actionCode)) {\n data = info[1];\n }\n }", "public void testParsing2() throws Exception {\n String data = \"8=FIX.4.2\\0019=76\\001\";\n data += \"35=6\\001\";\n data += \"23=IDENTIFIER\\001\";\n data += \"28=N\\001\";\n data += \"55=MSFT\\001\";\n data += \"54=1\\001\";\n data += \"711=2\\001\";\n data += \"311=DELL\\001\";\n data += \"318=USD\\001\";\n data += \"311=IBM\\001\";\n data += \"318=CAD\\001\";\n data += \"10=037\\001\";\n Message message = new Message(data, DataDictionaryTest.getDictionary());\n \n assertHeaderField(message, \"FIX.4.2\", BeginString.FIELD);\n assertHeaderField(message, \"76\", BodyLength.FIELD);\n assertHeaderField(message, MsgType.INDICATION_OF_INTEREST, MsgType.FIELD);\n assertBodyField(message, \"IDENTIFIER\", IOIid.FIELD);\n assertTrailerField(message, \"037\", CheckSum.FIELD);\n IndicationOfInterest.NoUnderlyings valueMessageType = new IndicationOfInterest.NoUnderlyings();\n message.getGroup(1, valueMessageType);\n assertEquals(\"wrong value\", \"DELL\", valueMessageType.getString(UnderlyingSymbol.FIELD));\n assertEquals(\"wrong value\", \"USD\", valueMessageType.getString(UnderlyingCurrency.FIELD));\n message.getGroup(2, valueMessageType);\n assertEquals(\"wrong value\", \"IBM\", valueMessageType.getString(UnderlyingSymbol.FIELD));\n assertEquals(\"wrong value\", \"CAD\", valueMessageType.getString(UnderlyingCurrency.FIELD));\n }", "public void processLine(String line){\n\t\tString[] splitted = line.split(\"(\\\\s+|\\\\t+)\");\n\t\tif(splitted.length < FIELDS){\n\t\t\tSystem.err.println(\"DataRow: Cannot process line : \" + line);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tindex \t\t= Integer.parseInt(splitted[0]);\n\t\tparentIndex = Integer.parseInt(splitted[1]);\n\t\tword \t\t= splitted[2].trim();\n\t\tpos\t\t\t= splitted[3].trim();\n\t\tpredicateLabel = splitted[4].trim();\n\t\tintervenes = splitted[5];\n\t\t\n\t\tidentificationLabel = splitted[6];\n\t\tclassificationLabel = splitted[7];\n\t\t\n\t\thmmState = Integer.parseInt(splitted[8]);\n\t\tnaiveState = Integer.parseInt(splitted[9]);\n\t\tchunk = splitted[10];\n\t\tne = splitted[11];\n\t\tif(splitted.length > FIELDS){\n\t\t\tSystem.err.println(\"WARNING: data row has more than required columns: \" + line);\n\t\t}\n\t}", "private void separateAttributes() {\n\n String gfuncStr = gridRscData.getGdpfun().replaceAll(\"\\\\s+\", \"\").trim();\n if (gfuncStr != null && gfuncStr.endsWith(\"!\")) {\n gfuncStr = gfuncStr.substring(0, gfuncStr.length() - 1);\n }\n String[] gfuncArray = gfuncStr.split(\"!\", -1);\n\n String[] glevelArray = gridRscData.getGlevel().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] gvcordArray = gridRscData.getGvcord().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] skipArray = gridRscData.getSkip().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] filterArray = gridRscData.getFilter().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] scaleArray = gridRscData.getScale().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] typeArray = gridRscData.getType().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] cintArray = gridRscData.getCint().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] lineArray = gridRscData.getLineAttributes()\n .replaceAll(\"\\\\s+\", \"\").split(\"!\", -1);\n String[] fintArray = gridRscData.getFint().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] flineArray = gridRscData.getFline().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] hiloArray = gridRscData.getHilo().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] hlsymArray = gridRscData.getHlsym().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] windArray = gridRscData.getWind().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] markerArray = gridRscData.getMarker().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] clrbarArray = gridRscData.getClrbar().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] textArray = gridRscData.getText().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] colorArray = gridRscData.getColors().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n /* Clean up cint -- max 5 zoom level */\n if (cintArray != null && cintArray.length > 0) {\n for (int i = 0; i < cintArray.length; i++) {\n String[] tmp = cintArray[i].split(\">\");\n if (tmp.length > 5) {\n cintArray[i] = tmp[0] + \">\" + tmp[1] + \">\" + tmp[2] + \">\"\n + tmp[3] + \">\" + tmp[4];\n }\n }\n }\n\n for (int i = 0; i < gfuncArray.length; i++) {\n if (gfuncArray[i].contains(\"//\")) {\n String[] tmpstr = gfuncArray[i].split(\"//\", 2);\n gfuncArray[i] = tmpstr[0];\n String referencedAlias = tmpstr[1];\n String referencedFunc = tmpstr[0];\n /*\n * Need to substitute all occurrences of referencedAlias with\n * referencedFunc\n */\n for (int j = i + 1; j < gfuncArray.length; j++) {\n /*\n * First need to find out if the gfuncArray[i] is a derived\n * quantity\n */\n gfuncArray[j] = substituteAlias(referencedAlias,\n referencedFunc, gfuncArray[j]);\n }\n } else {\n\n /*\n * Handle blank GDPFUN\n */\n if (gfuncArray[i].isEmpty()) {\n if (i > 0) {\n gfuncArray[i] = gfuncArray[i - 1];\n }\n }\n\n }\n }\n\n contourAttributes = new ContourAttributes[gfuncArray.length];\n\n for (int i = 0; i < gfuncArray.length; i++) {\n contourAttributes[i] = new ContourAttributes();\n contourAttributes[i].setGdpfun(gfuncArray[i]);\n\n if (i == 0) {\n contourAttributes[i].setGlevel(glevelArray[0]);\n contourAttributes[i].setGvcord(gvcordArray[0]);\n contourAttributes[i].setSkip(skipArray[0]);\n contourAttributes[i].setFilter(filterArray[0]);\n contourAttributes[i].setScale(scaleArray[0]);\n contourAttributes[i].setType(typeArray[0]);\n contourAttributes[i].setCint(cintArray[0]);\n contourAttributes[i].setLine(lineArray[0]);\n contourAttributes[i].setFint(fintArray[0]);\n contourAttributes[i].setFline(flineArray[0]);\n contourAttributes[i].setHilo(hiloArray[0]);\n contourAttributes[i].setHlsym(hlsymArray[0]);\n contourAttributes[i].setWind(windArray[0]);\n contourAttributes[i].setMarker(markerArray[0]);\n contourAttributes[i].setClrbar(clrbarArray[0]);\n contourAttributes[i].setText(textArray[0]);\n contourAttributes[i].setColors(colorArray[0]);\n } else {\n int idx = (glevelArray.length > i) ? i\n : (glevelArray.length - 1);\n if (glevelArray[idx].isEmpty() && idx > 0) {\n glevelArray[idx] = glevelArray[idx - 1];\n }\n contourAttributes[i].setGlevel(glevelArray[idx]);\n\n idx = (gvcordArray.length > i) ? i : gvcordArray.length - 1;\n if (gvcordArray[idx].isEmpty() && idx > 0) {\n gvcordArray[idx] = gvcordArray[idx - 1];\n }\n contourAttributes[i].setGvcord(gvcordArray[idx]);\n\n idx = (skipArray.length > i) ? i : skipArray.length - 1;\n if (skipArray[idx].isEmpty() && idx > 0) {\n skipArray[idx] = skipArray[idx - 1];\n }\n contourAttributes[i].setSkip(skipArray[idx]);\n\n idx = (filterArray.length > i) ? i : filterArray.length - 1;\n if (filterArray[idx].isEmpty() && idx > 0) {\n filterArray[idx] = filterArray[idx - 1];\n }\n contourAttributes[i].setFilter(filterArray[idx]);\n\n idx = (scaleArray.length > i) ? i : scaleArray.length - 1;\n if (scaleArray[idx].isEmpty() && idx > 0) {\n scaleArray[idx] = scaleArray[idx - 1];\n }\n contourAttributes[i].setScale(scaleArray[idx]);\n\n idx = (typeArray.length > i) ? i : typeArray.length - 1;\n if (typeArray[idx].isEmpty() && idx > 0) {\n typeArray[idx] = typeArray[idx - 1];\n }\n contourAttributes[i].setType(typeArray[idx]);\n\n idx = (cintArray.length > i) ? i : cintArray.length - 1;\n if (cintArray[idx].isEmpty() && idx > 0) {\n cintArray[idx] = cintArray[idx - 1];\n }\n contourAttributes[i].setCint(cintArray[idx]);\n\n idx = (lineArray.length > i) ? i : lineArray.length - 1;\n if (lineArray[idx].isEmpty() && idx > 0) {\n lineArray[idx] = lineArray[idx - 1];\n }\n contourAttributes[i].setLine(lineArray[idx]);\n\n idx = (fintArray.length > i) ? i : fintArray.length - 1;\n if (fintArray[idx].isEmpty() && idx > 0) {\n fintArray[idx] = fintArray[idx - 1];\n }\n contourAttributes[i].setFint(fintArray[idx]);\n\n idx = (flineArray.length > i) ? i : flineArray.length - 1;\n if (flineArray[idx].isEmpty() && idx > 0) {\n flineArray[idx] = flineArray[idx - 1];\n }\n contourAttributes[i].setFline(flineArray[idx]);\n\n idx = (hiloArray.length > i) ? i : hiloArray.length - 1;\n if (hiloArray[idx].isEmpty() && idx > 0) {\n hiloArray[idx] = hiloArray[idx - 1];\n }\n contourAttributes[i].setHilo(hiloArray[idx]);\n\n idx = (hlsymArray.length > i) ? i : hlsymArray.length - 1;\n if (hlsymArray[idx].isEmpty() && idx > 0) {\n hlsymArray[idx] = hlsymArray[idx - 1];\n }\n contourAttributes[i].setHlsym(hlsymArray[idx]);\n\n idx = (windArray.length > i) ? i : windArray.length - 1;\n if (windArray[idx].isEmpty() && idx > 0) {\n windArray[idx] = windArray[idx - 1];\n }\n contourAttributes[i].setWind(windArray[idx]);\n\n idx = (markerArray.length > i) ? i : markerArray.length - 1;\n if (markerArray[idx].isEmpty() && idx > 0) {\n markerArray[idx] = markerArray[idx - 1];\n }\n contourAttributes[i].setMarker(markerArray[idx]);\n\n idx = (clrbarArray.length > i) ? i : clrbarArray.length - 1;\n if (clrbarArray[idx].isEmpty() && idx > 0) {\n clrbarArray[idx] = clrbarArray[idx - 1];\n }\n contourAttributes[i].setClrbar(clrbarArray[idx]);\n\n idx = (textArray.length > i) ? i : textArray.length - 1;\n if (textArray[idx].isEmpty() && idx > 0) {\n textArray[idx] = textArray[idx - 1];\n }\n contourAttributes[i].setText(textArray[idx]);\n\n idx = (colorArray.length > i) ? i : colorArray.length - 1;\n if (colorArray[idx].isEmpty() && idx > 0) {\n colorArray[idx] = colorArray[idx - 1];\n }\n contourAttributes[i].setColors(colorArray[idx]);\n\n }\n }\n }", "private static Pair<FormRecord, String> reparseRecord(Context context,\r\n FormRecord r)\r\n throws IOException, InvalidStructureException,\r\n XmlPullParserException, UnfullfilledRequirementsException {\r\n final String[] caseIDs = new String[1];\r\n final Date[] modified = new Date[]{new Date(0)};\r\n final String[] uuid = new String[1];\r\n\r\n // NOTE: This does _not_ parse and process the case data. It's only for\r\n // getting meta information about the entry session.\r\n TransactionParserFactory factory = parser -> {\r\n String name = parser.getName();\r\n if (\"case\".equals(name)) {\r\n return buildCaseParser(parser.getNamespace(), parser, caseIDs);\r\n } else if (\"meta\".equalsIgnoreCase(name)) {\r\n return buildMetaParser(uuid, modified, parser);\r\n }\r\n return null;\r\n };\r\n\r\n String path = r.getFilePath();\r\n InputStream is = null;\r\n FileInputStream fis = new FileInputStream(path);\r\n try {\r\n Cipher decrypter = Cipher.getInstance(\"AES\");\r\n decrypter.init(Cipher.DECRYPT_MODE, new SecretKeySpec(r.getAesKey(), \"AES\"));\r\n is = new CipherInputStream(fis, decrypter);\r\n\r\n // Construct parser for this form's internal data.\r\n DataModelPullParser parser = new DataModelPullParser(is, factory);\r\n\r\n // populate uuid, modified, and caseIDs arrays by parsing\r\n parser.parse();\r\n } catch (NoSuchAlgorithmException e) {\r\n e.printStackTrace();\r\n throw new RuntimeException(\"No Algorithm while attempting to decode form submission for processing\");\r\n } catch (NoSuchPaddingException e) {\r\n e.printStackTrace();\r\n throw new RuntimeException(\"Invalid cipher data while attempting to decode form submission for processing\");\r\n } catch (InvalidKeyException e) {\r\n e.printStackTrace();\r\n throw new RuntimeException(\"Invalid Key Data while attempting to decode form submission for processing\");\r\n } finally {\r\n fis.close();\r\n if (is != null) {\r\n is.close();\r\n }\r\n }\r\n\r\n // TODO: We should be committing all changes to form record models via the ASW objects,\r\n // not manually.\r\n FormRecord parsed = new FormRecord(r);\r\n parsed.setUuid(uuid[0]);\r\n parsed.setLastModified(modified[0]);\r\n return new Pair<>(parsed, caseIDs[0]);\r\n }", "private void loadForm() {\n CodingProxy icd9 = problem.getIcd9Code();\n \n if (icd9 != null) {\n txtICD.setText(icd9.getProxiedObject().getCode());\n }\n \n String narr = problem.getProviderNarrative();\n \n if (narr == null) {\n narr = icd9 == null ? \"\" : icd9.getProxiedObject().getDisplay();\n }\n \n String probId = problem.getNumberCode();\n \n if (probId == null || probId.isEmpty()) {\n probId = getBroker().callRPC(\"BGOPROB NEXTID\", PatientContext.getActivePatient().getIdElement().getIdPart());\n }\n \n String pcs[] = probId.split(\"\\\\-\", 2);\n lblPrefix.setValue(pcs[0] + \" - \");\n txtID.setValue(pcs.length < 2 ? \"\" : pcs[1]);\n txtNarrative.setText(narr);\n datOnset.setValue(problem.getOnsetDate());\n \n if (\"P\".equals(problem.getProblemClass())) {\n radPersonal.setSelected(true);\n } else if (\"F\".equals(problem.getProblemClass())) {\n radFamily.setSelected(true);\n } else if (\"I\".equals(problem.getStatus())) {\n radInactive.setSelected(true);\n } else {\n radActive.setSelected(true);\n }\n \n int priority = NumberUtils.toInt(problem.getPriority());\n cboPriority.setSelectedIndex(priority < 0 || priority > 5 ? 0 : priority);\n loadNotes();\n }", "@Override\n\tpublic void readCpteEpargne(CompteEpargne cpt) {\n\t\t\n\t}", "public void extractData(Scanner in) {\n while (in.hasNext()) {\n in.useDelimiter(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\n\n term = (in.next());\n subject = (in.next());\n number = Integer.parseInt(in.next());\n section = (in.next());\n crossList = (in.next());\n title = (in.next());\n\n if (title.startsWith(\"\\\"\")) {\n String newTitle = title.substring(1, title.length() - 1);\n title = \"\";\n title = newTitle;\n }\n\n faculty = (in.next());\n building = (in.next());\n room = (in.next()); // Integer.parseInt(in.next());\n\n if (Character.isLetter(room.charAt(room.length() - 1))) {\n oldRoomLetter = room.substring(room.length() - 1);\n String newRoomString = room.substring(0, room.length() - 1);\n newRoom = Integer.parseInt(newRoomString);\n } else {\n newRoom = Integer.parseInt(room);\n }\n\n startDate = (in.next());\n dayTime = (in.next());\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 }", "private void handleInputData(String relation) throws IOException {\n String fileName = \"clueweb12_parsed.txt\";\n BufferedReader br = new BufferedReader(new FileReader(fileName));\n String line;\n PrintWriter writer = new PrintWriter(\"extracted_pairs/extracted_pairs_\" + argumentType + \".txt\", \"UTF-8\");\n while ((line = br.readLine()) != null) {\n // Saves parsed string in array and continues.\n if (line.contains(\"[Text=\")) {\n parsedWords = line.split(\"] \");\n continue;\n }\n // Following lines takes the relation we're looking for and finds the corresponding lemma.\n if (line.contains(relation + \"(\")) {\n try {\n line = line.substring(relation.length());\n String[] stringPair = line.replaceAll(\"[^0-9-]\", \"\").substring(1).split(\"-\");\n int[] wordIndexPair = new int[2];\n wordIndexPair[0] = Integer.parseInt(stringPair[0]); wordIndexPair[1] = Integer.parseInt(stringPair[1]);\n String headWord = parsedWords[wordIndexPair[0] - 1]; String argumentWord = parsedWords[wordIndexPair[1] - 1];\n String[] splitHead = headWord.split(\" \"); headWord = splitHead[4].substring(6);\n String[] splitArgument = argumentWord.split(\" \"); argumentWord = splitArgument[4].substring(6);\n String headPartOfSpeech = splitHead[3].substring(13); String argumentPartOfSpeech = splitArgument[3].substring(13);\n writer.println(headWord.toLowerCase() + \" \" + argumentWord.toLowerCase() +\n \" \" + headPartOfSpeech.toLowerCase() + \" \" + argumentPartOfSpeech.toLowerCase());\n } catch (Exception e) { continue; }\n }\n }\n // Close buffered input stream.\n br.close();\n }", "private Set<Obs> parseEntryRelationship(EntryRelationship entry) {\n\t\tSet<Obs> res = new HashSet<Obs>();\n\t\t\n\t\tif (entry.getAct()!=null) {\n\t\t\t//we only handle events\n\t\t\tif (entry.getAct().getMoodCode().compareTo(x_DocumentActMood.EVN)==0) {\n\t\t\t\tfor (EntryRelationship er : entry.getAct().getEntryRelationships()) {\n\t\t\t\t\tres.addAll( parseEntryRelationship(er) );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (entry.getObservation()!=null) {\n\t\t\t//we only handle events\n\t\t\tif (entry.getObservation().getMoodCode().compareTo(x_ActMoodDocumentObservation.EVN)==0) {\n\t\t\t\t\n\t\t\t\tif (entry.getObservation().getValues()!=null && !entry.getObservation().getValues().isEmpty()) {\n\t\t\t\t\tObs obs = new Obs();\n\t\t\t\t\tobs.setConcept(\n\t\t\t\t\t\tgetConcept(\n\t\t\t\t\t\t\tentry.getObservation().getCode().getCodeSystem(),\n\t\t\t\t\t\t\tentry.getObservation().getCode().getCode()\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t//TODO multiple values\n\t\t\t\t\tprocessValue(obs, entry.getObservation().getValues().get(0));\n\t\t\t\t\tprocessEffectiveTime(obs, entry.getObservation().getEffectiveTime());\n\t\t\t\t\t\n\t\t\t\t\tres.add(obs);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (EntryRelationship er : entry.getObservation().getEntryRelationships()) {\n\t\t\t\t\tres.addAll( parseEntryRelationship(er) );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (entry.getOrganizer()!=null) {\n\t\t\tfor (Component4 c : entry.getOrganizer().getComponents()) {\n\t\t\t\tres.addAll( parseComponent4(c) );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t}", "private void parseCompleteReqMessage() {\r\n byte result = _partialMessage.get(0);\r\n byte opCode = _partialMessage.get(1);\r\n byte numberOfParams = _partialMessage.get(2);\r\n\r\n /* cursor of bytes within 'message'. Parameters start at position 2 */\r\n int messageIndex = 3;\r\n int availableChars = (int) _partialMessage.size();\r\n\r\n List<String> paramList = new ArrayList<>();\r\n String param;\r\n\r\n for (byte i = 0; (i < numberOfParams) && (messageIndex < availableChars); i++) {\r\n param = \"\";\r\n\r\n /* collect data up to terminator */\r\n while ((messageIndex < availableChars) &&\r\n (_partialMessage.get(messageIndex) != '\\0')) {\r\n param += (char)((byte)(_partialMessage.get(messageIndex)));\r\n ++ messageIndex;\r\n }\r\n\r\n /* skip after terminator */\r\n if (messageIndex < availableChars) {\r\n ++ messageIndex;\r\n }\r\n\r\n paramList.add( param);\r\n }\r\n\r\n _replyDispatcher.onReplyReceivedForRequest(opCode, result, paramList);\r\n }", "private void parse() {\n if (getFields() == null) {\n List<? extends StructField> fieldRefs =\n ((StructObjectInspector)getInspector()).getAllStructFieldRefs();\n setFields(new LazyObject[fieldRefs.size()]);\n for (int i = 0; i < getFields().length; i++) {\n String hbaseColumnFamily = hbaseColumnFamilies.get(i);\n String hbaseColumnQualifier = hbaseColumnQualifiers.get(i);\n\n ObjectInspector fieldObjectInspector = fieldRefs.get(i).getFieldObjectInspector();\n if (hbaseColumnQualifier == null && !HBaseSerDe.isSpecialColumn(hbaseColumnFamily)) {\n // a column family\n getFields()[i] = new LazyHBaseCellMap(\n (LazyMapObjectInspector) fieldObjectInspector);\n continue;\n }\n if(fieldObjectInspector instanceof LazyListObjectInspector) {\n \tgetFields()[i] = new LazyJsonArray((LazyListObjectInspector)fieldObjectInspector);\n \tcontinue;\n }\n\n getFields()[i] = LazyFactory.createLazyObject(fieldRefs.get(i).getFieldObjectInspector());\n }\n setFieldInited(new boolean[getFields().length]);\n }\n Arrays.fill(getFieldInited(), false);\n setParsed(true);\n }", "public void parse(InputStream in) throws IOException {\n InputStreamReader isr = null;\n BufferedReader layoutReader = null;\n try {\n isr = new InputStreamReader(in, \"UTF-8\");\n layoutReader = new BufferedReader(isr);\n List<String> rawQualifiers = new ArrayList<String>();\n List<String> rawSchemas = new ArrayList<String>();\n\n String qualifier;\n String json;\n String line = layoutReader.readLine();\n while (line != null) {\n // Skip empty lines.\n if (line.equals(EMPTY_LINE)) {\n line = layoutReader.readLine();\n continue;\n }\n\n if (SKIP_ENTRY_TOKEN.equals(line)) {\n // null entries indicate this column should be skipped.\n qualifier = null;\n json = null;\n } else {\n qualifier = parseName(line);\n json = parseSchema(layoutReader);\n }\n\n rawQualifiers.add(qualifier);\n rawSchemas.add(json);\n\n line = layoutReader.readLine();\n }\n\n mQualifierInfo = Collections.unmodifiableList(makeQualifierInfo(rawQualifiers, rawSchemas));\n\n LOG.info(\"Parsed input layout of size: \" + getQualifierInfo().size());\n } finally {\n IOUtils.closeQuietly(layoutReader);\n IOUtils.closeQuietly(isr);\n }\n }", "static TreeSet<Noun> parseNouns(Scanner data, int declension){\n\t\tassert(declension != Values.INDEX_ENDINGS_DECLENSION_THIRD && declension != Values.INDEX_ENDINGS_DECLENSION_THIRD_I_N && declension != Values.INDEX_ENDINGS_DECLENSION_THIRD_I_N); //there's a separate function for these guys.\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(NumberFormatException e){ //can happen if a chapter isn't specified. Read the noun from a null chapter.\n\t\t\t\tchapter = Values.CHAPTER_VOID;\n\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}", "final public void parse() throws ParseException {\n\t\tToken x = null;\n\t\tjj_consume_token(20);\n\t\tgetColumns(true);\n\t\tjj_consume_token(REFER);\n\n\t\tx = jj_consume_token(ID);\n\t\tm_refcatalog = x.image;\n\t\tjj_consume_token(21);\n\t\tx = jj_consume_token(ID);\n\t\tm_reftable = x.image;\n\t\tjj_consume_token(20);\n\t\tgetColumns(false);\n\t\tgetActions();\n\t}", "public DocumentData parseData(byte[] data) throws Exception {\n if (data.length < 30) {\n throw new Exception(\"Unsupported barcode encoding\");\n }\n byte complianceIndicator = data[0];\n if (complianceIndicator == 0x40) {\n // May be AAMVA\n byte elementSeparator = data[1];\n byte recordSeparator = data[2];\n byte segmentTerminator = data[3];\n byte[] fileType = Arrays.copyOfRange(data, 4, 9);\n byte[] iin = Arrays.copyOfRange(data, 9, 15);\n int aamvaVersionNumber = dataToInt(Arrays.copyOfRange(data, 15, 17));\n AAMVASubfileParser subfileParser = new AAMVASubfileParser(aamvaVersionNumber, elementSeparator);\n byte[] jurisdictionVersionNumber = Arrays.copyOfRange(data, 17, 19);\n int numberOfEntries = dataToInt(Arrays.copyOfRange(data, 19, 21));\n int index = 21;\n AAMVADocumentData documentData = null;\n for (int i=0; i<numberOfEntries; i++) {\n String subfileType = new String(Arrays.copyOfRange(data, index, index+2), UTF8);\n int offset = dataToInt(Arrays.copyOfRange(data, index+2, index+6));\n int length = dataToInt(Arrays.copyOfRange(data, index+6, index+10));\n int start = Math.min(offset, data.length);\n int end = Math.min(offset+length, data.length);\n if (numberOfEntries == 1 && offset == 0) {\n start = data.length - length;\n end = data.length;\n }\n AAMVADocumentData subData = subfileParser.parseFields(Arrays.copyOfRange(data, start, end));\n if (documentData == null) {\n documentData = subData;\n } else {\n documentData.appendFieldsFrom(subData);\n }\n index += 10;\n }\n if (documentData == null || documentData.isEmpty()) {\n throw new Exception(\"Empty document\");\n }\n return documentData;\n } else if (data[0] == 0x25) {\n MagStripeDocumentData documentData = new MagStripeDocumentData();\n String track = new String(data, StandardCharsets.US_ASCII);\n String jurisdiction = track.substring(1, 3);\n documentData.setValue(new DataField(\"State/Province\", jurisdiction, jurisdiction), \"State/Province\");\n track = track.substring(3);\n String city = getStringToDelimiter(track, \"^\", 13);\n documentData.setValue(new DataField(\"City\", city, city), \"City\");\n track = track.substring(city.length());\n track = leftTrimString(track, \"^\");\n String name = getStringToDelimiter(track, \"^\", 35);\n String[] names = name.split(\"\\\\$\");\n if (names.length > 2) {\n documentData.setValue(new DataField(\"Title\", names[2], names[2].trim()), \"Title\");\n }\n if (names.length > 1) {\n documentData.setValue(new DataField(\"First name\", names[1], StringUtils.strip(names[1], \"/, \")), \"First name\");\n }\n if (names.length > 0) {\n documentData.setValue(new DataField(\"Last name\", names[0], StringUtils.strip(names[0], \"/, \")), \"Last name\");\n }\n track = track.substring(name.length());\n track = leftTrimString(track, \"^\");\n String address = getStringToDelimiter(track, \"^\", 77 - city.length() - name.length());\n address = getStringToDelimiter(address, \"?\", address.length());\n String[] addressFields = address.split(\"\\\\$\");\n address = TextUtils.join(\"\\n\", addressFields);\n documentData.setValue(new DataField(\"Address\", address, address), \"Address\");\n if (track.substring(0, 1).equals(\"?\")) {\n track = track.substring(1);\n }\n int delimiterIndex = track.indexOf(\";\");\n if (delimiterIndex > -1) {\n track = track.substring(delimiterIndex+1);\n String iin = track.substring(0, 6);\n documentData.setValue(new DataField(\"IIN\", iin, iin), \"IIN\");\n track = track.substring(6);\n String dlNo = getStringToDelimiter(track, \"=\", 13);\n track = track.substring(dlNo.length());\n track = leftTrimString(track, \"=\");\n String expiryYear = \"20\"+track.substring(0, 2);\n String expiryMonth = track.substring(2, 4);\n track = track.substring(4);\n String birthYear = track.substring(0, 4);\n String birthMonth = track.substring(4, 6);\n String birthDate = track.substring(6, 8);\n track = track.substring(8);\n String expiryDate = null;\n if (expiryMonth.equals(\"77\")) {\n expiryDate = \"non-expiring\";\n } else if (expiryMonth.equals(\"88\")) {\n Calendar calendar = Calendar.getInstance();\n calendar.set(Integer.parseInt(\"20\" + expiryYear) + 1, Integer.parseInt(birthMonth), 1);\n expiryDate = Integer.toString(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));\n expiryDate = expiryDate + \"/\" + birthMonth + \"/\" + expiryYear;\n } else if (expiryMonth.equals(\"99\")) {\n expiryDate = birthDate + \"/\" + birthMonth + \"/\" + expiryYear;\n } else {\n Calendar calendar = Calendar.getInstance();\n calendar.set(Integer.parseInt(\"20\" + expiryYear), Integer.parseInt(expiryMonth), 1);\n expiryDate = Integer.toString(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));\n expiryDate = expiryDate + \"/\" + expiryMonth + \"/\" + expiryYear;\n }\n documentData.setValue(new DataField(\"Date of expiry\", expiryDate, expiryDate), \"Date of expiry\");\n documentData.setValue(new DataField(\"Date of birth\", birthDate+birthMonth+birthYear, birthDate+\"/\"+birthMonth+\"/\"+birthYear), \"Date of birth\");\n if (track.length() > 0) {\n String dlNoOverflow = getStringToDelimiter(track, \"=\", 5);\n if (!dlNoOverflow.isEmpty()) {\n dlNo += dlNoOverflow;\n }\n }\n documentData.setValue(new DataField(\"DL/ID#\", dlNo, dlNo), \"DL/ID#\");\n delimiterIndex = track.indexOf(\"%\");\n }\n if (delimiterIndex > -1) {\n track = track.substring(delimiterIndex+1);\n String versionNumber = track.substring(0, 1);\n documentData.setValue(new DataField(\"Version #\", versionNumber, versionNumber), \"Version #\");\n track = track.substring(1);\n String securityVersionNumber = track.substring(0, 1);\n documentData.setValue(new DataField(\"Security v. #\", securityVersionNumber, securityVersionNumber), \"Security v. #\");\n track = track.substring(1);\n String postalCode = StringUtils.strip(track.substring(0, 11), \"/, \");\n documentData.setValue(new DataField(\"Postal code\", postalCode, postalCode), \"Postal code\");\n track = track.substring(11);\n String dlClass = track.substring(0, 2).trim();\n if (!dlClass.isEmpty()) {\n documentData.setValue(new DataField(\"Class\", dlClass, dlClass), \"Class\");\n }\n track = track.substring(2);\n String restrictions = track.substring(0, 10).trim();\n if (!restrictions.isEmpty()) {\n documentData.setValue(new DataField(\"Restrictions\", restrictions, restrictions), \"Restrictions\");\n }\n track = track.substring(10);\n String endorsements = track.substring(0, 4).trim();\n if (!endorsements.isEmpty()) {\n documentData.setValue(new DataField(\"Endorsements\", endorsements, endorsements), \"Endorsements\");\n }\n track = track.substring(4);\n String sex = track.substring(0, 1);\n documentData.setValue(new DataField(\"Sex\", sex, sex), \"Sex\");\n track = track.substring(1);\n String height = track.substring(0, 3).trim();\n if (!height.isEmpty()) {\n documentData.setValue(new DataField(\"Height\", height, height), \"Height\");\n }\n track = track.substring(3);\n String weight = track.substring(0, 3).trim();\n if (!weight.isEmpty()) {\n documentData.setValue(new DataField(\"Weight\", weight, weight), \"Weight\");\n }\n track = track.substring(3);\n String hairColour = track.substring(0, 3).trim();\n if (!hairColour.isEmpty()) {\n documentData.setValue(new DataField(\"Hair color\", hairColour, getHairColour(hairColour)), \"Hair color\");\n }\n track = track.substring(3);\n String eyeColour = track.substring(0, 3).trim();\n if (!eyeColour.isEmpty()) {\n documentData.setValue(new DataField(\"Eye color\", eyeColour, getEyeColour(eyeColour)), \"Eye color\");\n }\n }\n return documentData;\n }\n throw new Exception(\"Nothing decoded\");\n }", "public void splitData(String fullData){\n\t\t\n\t\tDictionary<String> strings = new Dictionary<>();\n\t\tDictionary<Float> floats = new Dictionary<>();\n\t\tDictionary<Boolean> booleans = new Dictionary<>();\n\t\t\n\t\tList<String> lines = new ArrayList<>(Arrays.asList(fullData.split(\"\\n\")));\n\t\t\n\t\tString[] labels = lines.get(0).split(\",\");\n\t\tlines.remove(0);\n\t\t\n\t\tfor(String line: lines){\n\t\t\tString[] data = line.split(\",\");\n\t\t\t\n\t\t\tfor(int i=0;i<data.length;i++){\n\t\t\t\t\n\t\t\t\t//placeholder since current data has no actual booleans\n\t\t\t\tif(labels[i].equals(\"autoBaselineGroup\") || labels[i].equals(\"autoGear\") || labels[i].equals(\"Did Climb\") || labels[i].equals(\"died\") || labels[i].equals(\"defense\")){\n\t\t\t\t\tif(data[i].equals(\"1\")){\n\t\t\t\t\t\tbooleans.add(labels[i], true);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tbooleans.add(labels[i], false);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//check what type it is\n\t\t\t\tSystem.out.println(number);\n\t\t\t\ttry{\n\t\t\t\t\tswitch(labels[i]){\n\t\t\t\t\tcase \"Round\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"Date and Time Of Match\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"UUID\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"end\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfloats.add(labels[i], Float.parseFloat(data[i]));\n\t\t\t\t\tcontinue;\n\t\t\t\t} catch(NumberFormatException e){\n\t\t\t\t\t//not an int, check for bool\n\t\t\t\t\t\n\t\t\t\t\tif(data[i].toLowerCase().contains(\"true\")){\n\t\t\t\t\t\tbooleans.add(labels[i], true);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(data[i].toLowerCase().contains(\"false\")){\n\t\t\t\t\t\tbooleans.add(labels[i], false);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//must be string\n\t\t\t\t\tdata[i] = \"\\n\\t\"+data[i];\n\t\t\t\t\tdata[i] = data[i].replace(\"|c\", \",\").replace(\"|n\", \"\\n\\t\").replace(\"||\", \"|\").replace(\"|q\", \"\\\"\").replace(\"|;\", \":\");\n\t\t\t\t\tstrings.add(labels[i], data[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint matchNum = getMatchNum(line, labels);\n\t\t\t\n\t\t\tMatch r = new Match(number, matchNum, \"TIME\");\n\t\t\tr.setData(strings, floats, booleans);\n\t\t\tmatches.add(r);\n\t\t\t\n\t\t\tstrings = new Dictionary<>();\n\t\t\tfloats = new Dictionary<>();\n\t\t\tbooleans = new Dictionary<>();\n\t\t}\n\t}", "private void parseForRecords() {\r\n\t\tApacheAgentExecutionContext c = (ApacheAgentExecutionContext)this.fContext;\r\n\t\tString text = c.getStatusPageContent();\r\n\t\tif(text == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tswitch(c.getApacheVersion()) {\r\n\t\t\tcase VERSION_IBM_6_0_X:\r\n\t\t\t\trecords = ApacheUtils.parseExtendedStatus_ibm_6_0(text);\r\n\t\t\tbreak;\r\n\t\t\tcase VERSION_ORACLE_1_3_X:\r\n\t\t\tcase VERSION_IBM_1_3_X:\r\n\t\t\t\trecords = ApacheUtils.parseExtendedStatus_1_3_x(text);\r\n\t\t\tbreak;\r\n\t\t\tcase VERSION_ORACLE_2_0_X:\r\n\t\t\tcase VERSION_IBM_2_0_X:\r\n\t\t\t\trecords = ApacheUtils.parseExtendedStatus_1_3_x(text);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif(records == null) {\r\n\t\t\tfContext.error(new InvalidDataPattern());\r\n\t\t}\r\n\t}", "@Override\n\tpublic void readCpteCourant(CompteCourant cpt) {\n\t\t\n\t}", "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 next() throws IOException {\r\n if (hasNext()) {\r\n line = next;\r\n next = null;\r\n\r\n int split = line.indexOf('=');\r\n fid = line.substring(0, split);\r\n text = line.substring(split + 1).split(\"\\\\|\", -1);//use -1 as limit to include empty trailing spaces\r\n if (type.getAttributeCount() != text.length)\r\n throw new DataSourceException(\"format error: expected \" + type.getAttributeCount()\r\n + \" attributes, but found \" + text.length + \". [\" + line + \"]\");\r\n } else {\r\n throw new NoSuchElementException();\r\n }\r\n }", "private void parseFormsOfEducation(String block) {\n if (formsOfEducation == null) {\n formsOfEducation = new ArrayList<>();\n }\n\n if (block.contains(\" очной\")) {\n formsOfEducation.add(FormOfEducation.FULL_TIME);\n }\n\n if (block.contains(\" заочной\")) {\n formsOfEducation.add(FormOfEducation.CORRESPONDENCE);\n }\n\n if (block.contains(\"очно-заочной\")) {\n formsOfEducation.add(FormOfEducation.PART_TIME);\n }\n }", "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 }", "@SuppressWarnings(\"unchecked\")\n\tprivate void parseElectronicForRIFCSElement(Electronic electronic) {\n\t\tif (!electronic.getType().isEmpty()) {\n\t\t\tString key = \"location.address.electronic.\" + electronic.getType();\n\t\t\tString csvFieldName = filedsMapping.getString(\"\",key);\n\t\t\tif(!\"\".equals(csvFieldName)) {\n\t\t\t\tthis.data.put(csvFieldName, electronic.getValue());\n\t\t\t}\n\t\t}\n\t}", "protected Object readResolve() {\n\tlabelSet = Label.parse(labelString);\n\treturn this;\n }", "public void parseForm()\n {\n if (mForm.gotoRoot().gotoTag(\"h:head/%1$s:model\", mDefaultPrefix).hasTag(\"%1$s:itext\", mDefaultPrefix)) {\n Log.d(Collect.LOGTAG, t + \"parsing itext form translations...\");\n parseFormTranslations(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model/%1$s:itext\", mDefaultPrefix));\n } else\n Log.d(Collect.LOGTAG, t + \"no form translations to parse\"); \n \n Log.d(Collect.LOGTAG, t + \"parsing form binds...\");\n parseFormBinds(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model\", mDefaultPrefix));\n \n Log.d(Collect.LOGTAG, t + \"parsing form controls...\");\n parseFormControls(mForm.gotoRoot().gotoTag(\"h:body\"));\n \n Log.d(Collect.LOGTAG, t + \"parsing form instance...\");\n parseFormInstance(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model/%1$s:instance\", mDefaultPrefix).gotoChild(), \"/\" + mInstanceRoot);\n Log.d(Collect.LOGTAG, t + \"FINISHED parsing form instance\");\n }", "private void validateExtra() {\n\t\tif (getArguments()!=null)\n\t\t{\n\t\t\tentity = (NoteEntity)getArguments().getSerializable(\"NOTE\");\n\t\t}\n\t}", "public FormulaRecord(int c, int r, String f)\r\n/* 32: */ {\r\n/* 33: 84 */ super(Type.FORMULA2, c, r);\r\n/* 34: 85 */ this.formulaToParse = f;\r\n/* 35: 86 */ this.copiedFrom = null;\r\n/* 36: */ }", "private Association parseAssociation(Record record) {\n return new Association(record.value(CommonTerms.associationIDTerm),\n record.value(DwcTerm.occurrenceID),\n record.value(TermFactory.instance().findTerm(TermURIs.associationType)),\n record.value(TermFactory.instance().findTerm(TermURIs.targetOccurrenceID)),\n record.value(DwcTerm.measurementDeterminedDate), record.value(DwcTerm.measurementDeterminedBy),\n record.value(DwcTerm.measurementMethod), record.value(DwcTerm.measurementRemarks),\n record.value(CommonTerms.sourceTerm), record.value(CommonTerms.bibliographicCitationTerm),\n record.value(CommonTerms.contributorTerm), record.value(CommonTerms.referenceIDTerm));\n }", "public final void lineParsed(LineFormat format, int logicalLinecount,\n int physicalLineCount, String[] values) throws AbortFFPException {\n for (Iterator i = associatedLineFormats.iterator(); i.hasNext();) {\n Association a = (Association) i.next();\n if (format.equals(a.getLineFormat())) {\n a.getListener().lineParsed(format, logicalLinecount,\n physicalLineCount, values);\n return;\n } \n } \n if (!allowLostEvents)\n throw new NoAssociatedListenerException(format, logicalLinecount,\n physicalLineCount, values);\n\n }", "private static void parseRelations(){\n\t\tString[] number = relationReader.nextLine().trim().split(\"\\\\s++\");\n\t\tint numOfCoarse = Integer.parseInt(number[0]);\n\t\tint numOfAccurate = Integer.parseInt(number[1]);\n\t\t\n\t\tfor(int i=0; i<numOfCoarse; i++){\n\t\t\tString[] pair = relationReader.nextLine().trim().split(\"\\\\s++\");\n\t\t\tmap.put(Integer.parseInt(pair[0]), pair[1]);\n\t\t}\n\t\t\n\t\tfor(int i=0; i<numOfAccurate; i++){\n\t\t\tString[] pair = relationReader.nextLine().trim().split(\"\\\\s++\");\n//\t\t\tSystem.err.println(pair[0]);\n\t\t\tif(pair[1].equalsIgnoreCase(\"ROOT\"))\n\t\t\t\ttransform.put(pair[0], pair[1]);\n\t\t\telse\n\t\t\t\ttransform.put(pair[0], map.get(Integer.parseInt(pair[1])));\n\t\t}\n\t\t\n//\t\tSystem.err.println(map.size());\n//\t\tSystem.err.println(transform.size());\n\t\t\n\t\treturn;\n\t}", "void parseCardData(ICardContext context);", "private void collectAttributes (int end) {\n attributeType = 0;\n klass = new StringBuffer();\n id = new StringBuffer();\n style = new StringBuffer();\n language = new StringBuffer();\n int start = textIndex;\n while (textIndex < end\n && ((attributeType > 0) || (textIndex == start))) {\n char c = line.charAt (textIndex);\n switch (attributeType) {\n case 0:\n // No leading character found yet\n if (c == '(') {\n attributeType = 1;\n }\n else\n if (c == '{') {\n attributeType = 3;\n }\n else\n if (c == '[') {\n attributeType = 4;\n }\n break;\n case 1:\n // Left paren indicates class or id\n if (c == '#') {\n attributeType++;\n }\n else\n if (c == ')') {\n attributeType = 0;\n } else {\n klass.append (c);\n }\n break;\n case 2:\n // ID\n if (c == ')') {\n attributeType = 0;\n } else {\n id.append (c);\n }\n break;\n case 3:\n // style\n if (c == '}') {\n attributeType = 0;\n } else {\n style.append (c);\n }\n break;\n case 4:\n // language\n if (c == ']') {\n attributeType = 0;\n } else {\n language.append (c);\n }\n break;\n } // end switch attributeType\n textIndex++;\n } // end while more characters before period\n }", "@Override\n public LispReferralRecord readFrom(ByteBuf byteBuf)\n throws LispParseError, LispReaderException,\n DeserializationException {\n int recordTtl = byteBuf.readInt();\n\n // referral count -> 8 bits\n int referralCount = byteBuf.readUnsignedByte();\n\n // EID mask length -> 8 bits\n byte maskLength = (byte) byteBuf.readUnsignedByte();\n\n byte actionWithFlag = (byte) byteBuf.readUnsignedByte();\n\n // action -> 3 bits\n int actionByte = actionWithFlag >> REPLY_ACTION_SHIFT_BIT;\n LispMapReplyAction action = LispMapReplyAction.valueOf(actionByte);\n if (action == null) {\n action = LispMapReplyAction.NoAction;\n }\n\n // authoritative flag -> 1 bit\n boolean authoritative = ByteOperator.getBit((byte)\n (actionWithFlag >> AUTHORITATIVE_INDEX), 0);\n\n // incomplete flag -> 1 bit\n boolean incomplete = ByteOperator.getBit((byte)\n (actionWithFlag >> INCOMPLETE_INDEX), 0);\n\n // let's skip the reserved field\n byteBuf.skipBytes(RESERVED_SKIP_LENGTH);\n\n // Map version number -> 12 bits, we treat Rsvd field is all zero\n short mapVersionNumber = (short) byteBuf.readUnsignedShort();\n\n LispAfiAddress eidPrefixAfi =\n new LispAfiAddress.AfiAddressReader().readFrom(byteBuf);\n\n List<LispReferral> referrals = Lists.newArrayList();\n for (int i = 0; i < referralCount; i++) {\n referrals.add(new DefaultLispReferral.ReferralReader().readFrom(byteBuf));\n }\n\n return new DefaultReferralRecordBuilder()\n .withRecordTtl(recordTtl)\n .withMaskLength(maskLength)\n .withAction(action)\n .withIsAuthoritative(authoritative)\n .withIsIncomplete(incomplete)\n .withMapVersionNumber(mapVersionNumber)\n .withReferrals(referrals)\n .withEidPrefixAfi(eidPrefixAfi)\n .build();\n }", "public void parseHeader() {\n\t\tthis.release = (Integer) this.headerData.get(0);\n\t\tthis.endian = (ByteOrder) this.headerData.get(1);\n\t\tthis.K = (Short) this.headerData.get(2);\n\t\tthis.datasetLabel = (String) this.headerData.get(4);\n\t\tthis.datasetTimeStamp = (String) this.headerData.get(5);\n\t\tthis.mapOffset = (Integer) this.headerData.get(6);\n\t}", "@SuppressWarnings(\"unchecked\")\n public void init(String f2e_line1, String f2e_line2, String f2e_line3,\n String e2f_line1, String e2f_line2, String e2f_line3) throws IOException {\n String[] comment_f2e = f2e_line1.split(\"\\\\s+\");\n String[] comment_e2f = e2f_line1.split(\"\\\\s+\");\n assert (comment_f2e[0].equals(\"#\"));\n assert (comment_e2f[0].equals(\"#\"));\n p_f2e = Double.parseDouble(comment_f2e[comment_f2e.length - 1]);\n p_e2f = Double.parseDouble(comment_f2e[comment_e2f.length - 1]);\n // Read target strings:\n f = new SimpleSequence<IString>(true,\n IStrings.toSyncIStringArray(escape(f2e_line2.split(\"\\\\s+\"))));\n e = new SimpleSequence<IString>(true,\n IStrings.toSyncIStringArray(escape(e2f_line2.split(\"\\\\s+\"))));\n // Read alignments:\n f2e = new TreeSet[f.size()];\n e2f = new TreeSet[e.size()];\n initAlign(f2e_line3, f2e, e);\n initAlign(e2f_line3, e2f, f);\n }", "@Override\r\n\tpublic void processInputDetails() {\r\n\t\t// Decorate input details.\r\n\t\tString match = \"\";\r\n\t\tList<String> sentences = id.getSentences();\r\n\r\n\t\tfinal int size = sentences.size();\r\n\t\tfor(int i=0; i<size; i++){\r\n\t\t\tfor(String keyword : listOfKeywords) {\r\n\t\t\t\tmatch = \"(?i)(\\\\b\" + keyword + \"\\\\b)\";\r\n\t\t\t\tsentences.set(i, sentences.get(i).replaceAll(match, (KEYWORD_PREFIX + \"$1\" + KEYWORD_SUFFIX)));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Forward to the next decorator, if any.\r\n\t\tif (null != atd) {\r\n\t\t\tatd.processInputDetails();\r\n\t\t}\r\n\t}", "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 static ArrayList readEndnote(String filename){\n \tString ENDOFRECORD=\"__EOREOR__\";\n \tArrayList bibitems = new ArrayList();\n \tFile f = checkAndCreateFile( filename );// will return null if file is not readable\n \tif(f==null) return null;\n \tStringBuffer sb = new StringBuffer();\n \ttry{\n \t BufferedReader in = new BufferedReader(new FileReader( filename));\n \n \t String str;\n \t boolean first = true;\n \t while ((str = in.readLine()) != null) {\n \t\tstr = str.trim();\n \t\t// if(str.equals(\"\")) continue;\n \t\tif(str.indexOf(\"%0\")==0){\n \t\t if (first) {\n \t\t\tfirst = false;\n \t\t }\n \t\t else {\n \t\t\tsb.append(ENDOFRECORD);\n \t\t }\n \t\t sb.append(str);\n \t\t}else\n \t\t sb.append(str);\n \t\tsb.append(\"\\n\");\n \t }\n \t in.close();\n \t}\n \n \tcatch(IOException e){return null;}\n \n \tString [] entries=sb.toString().split(ENDOFRECORD);\n \tHashMap hm=new HashMap();\n \tString Author=\"\",Type=\"\",Editor=\"\";\n \tfor(int i=0; i<entries.length; i++){\n \t hm.clear();\n \t Author=\"\"; Type=\"\";Editor=\"\";\n \t String[] fields = entries[i].substring(1).split(\"\\n%\");\n //String lastPrefix = \"\";\n \t for(int j=0; j <fields.length; j++){\n \t\tif(fields[j].length() < 3)\n \t\t continue;\n \n \t\t/* Details of Refer format for Journal Article and Book:\n \n \t\t Generic Ref Journal Article Book\n \t\t Code\n \t\t Author %A Author Author\n \t\t Year %D Year Year\n \t\t Title %T Title Title\n \t\t Secondary Author %E Series Editor\n \t\t Secondary Title %B Journal Series Title\n \t\t Place Published %C City\n \t\t Publisher %I Publisher\n \t\t Volume %V Volume Volume\n \t\t Number of Volumes %6 Number of Volumes\n \t\t Number %N Issue\n \t\t Pages %P Pages Number of Pages\n \t\t Edition %7 Edition\n \t\t Subsidiary Author %? Translator\n \t\t Alternate Title %J Alternate Journal\n \t\t Label %F Label Label\n \t\t Keywords %K Keywords Keywords\n \t\t Abstract %X Abstract Abstract\n \t\t Notes %O Notes Notes\n \t\t*/\n \n \t\tString prefix=fields[j].substring(0,1);\n \t\tString val = fields[j].substring(2);\n \t\tif( prefix.equals(\"A\")){\n \t\t if( Author.equals(\"\"))\n \t\t\tAuthor=val;\n \t\t else\n \t\t\tAuthor += \" and \" + val;\n \t\t}\n \t\telse if(prefix.equals(\"Y\")){\n \t\t if( Editor.equals(\"\")) Editor=val;\n \t\t else Editor += \" and \" + val;\n \t\t}\n \t\telse if(prefix.equals(\"T\")) hm.put(\"title\", Globals.putBracesAroundCapitals(val));\n \t\telse if(prefix.equals(\"0\")){\n \t\t if(val.indexOf(\"Journal\")==0)\n \t\t\tType=\"article\";\n \t\t else if((val.indexOf(\"Book\")==0)\n \t\t\t || (val.indexOf(\"Edited Book\")==0))\n \t\t\tType=\"book\";\n \t\t else if( val.indexOf(\"Conference\")==0)// Proceedings\n \t\t\tType=\"inproceedings\";\n \t\t else if( val.indexOf(\"Report\")==0) // Techreport\n \t\t\tType=\"techreport\";\n \t\t else\n \t\t\tType = \"misc\"; //\n \t\t}\n \t\telse if(prefix.equals(\"7\")) hm.put(\"edition\",val);\n \t\telse if(prefix.equals(\"C\")) hm.put(\"address\",val);\n \t\telse if(prefix.equals(\"D\")) hm.put(\"year\",val);\n else if(prefix.equals(\"8\")) hm.put(\"date\",val);\n \t\telse if(prefix.equals(\"J\")) {\n \t\t // \"Alternate journal. Let's set it only if no journal\n \t\t // has been set with %B.\n \t\t if (hm.get(\"journal\") == null)\n \t\t\thm.put(\"journal\", val);\n \t\t}\n else if (prefix.equals(\"B\")) {\n \t\t // This prefix stands for \"journal\" in a journal entry, and\n \t\t // \"series\" in a book entry.\n \t\t if (Type.equals(\"article\")) hm.put(\"journal\", val);\n \t\t else if (Type.equals(\"book\") || Type.equals(\"inbook\"))\n \t\t\thm.put(\"series\", val);\n \t\t else /* if (Type.equals(\"inproceedings\"))*/\n \t\t\thm.put(\"booktitle\", val);\n }\n \t\telse if(prefix.equals(\"I\")) hm.put(\"publisher\",val);\n \t\telse if(prefix.equals(\"P\")) hm.put(\"pages\",val);\n \t\telse if(prefix.equals(\"V\")) hm.put(\"volume\",val);\n \t\telse if(prefix.equals(\"N\")) hm.put(\"number\",val);\n \t\telse if(prefix.equals(\"U\")) hm.put(\"url\",val);\n else if(prefix.equals(\"O\")) hm.put(\"note\",val);\n else if(prefix.equals(\"K\")) hm.put(\"keywords\", val);\n \t\telse if(prefix.equals(\"X\")) hm.put(\"abstract\",val);\n \t\telse if(prefix.equals(\"9\")) {\n \t\t //Util.pr(val);\n \t\t if (val.indexOf(\"Ph.D.\")==0)\n \t\t\tType = \"phdthesis\";\n \t\t}\n \t\telse if(prefix.equals(\"F\")) hm.put\n \t\t (Globals.KEY_FIELD,Util.checkLegalKey(val));\n \t }\n \t //fixauthorscomma\n if (!Author.equals(\"\"))\n hm.put(\"author\",fixAuthor_lastnameFirst(Author));\n \t if( !Editor.equals(\"\"))\n \t\thm.put(\"editor\",fixAuthor_lastnameFirst(Editor));\n \t BibtexEntry b=new BibtexEntry(Globals.DEFAULT_BIBTEXENTRY_ID,\n \t\t\t\t\t Globals.getEntryType(Type)); // id assumes an existing database so don't create one here\n \t b.setField( hm);\n //if (hm.isEmpty())\n if (b.getAllFields().length > 0)\n bibitems.add(b);\n \n \t}\n \treturn bibitems;\n }", "@Override\n public void parseFile(String id, Reader reader) throws Exception {\n lineNr = 0;\n BufferedReader fin = null;\n if (reader instanceof BufferedReader) {\n fin = (BufferedReader) reader;\n } else {\n fin = new BufferedReader(reader);\n }\n try {\n while (fin.ready()) {\n String sStr = nextLine(fin);\n if (sStr == null) {\n return;\n }\n if (sStr.toLowerCase().matches(\"^\\\\s*begin\\\\s+data;\\\\s*$\") || sStr.toLowerCase().matches(\"^\\\\s*begin\\\\s+characters;\\\\s*$\")) {\n m_alignment = parseDataBlock(fin);\n m_alignment.setID(id);\n } else if (sStr.toLowerCase().matches(\"^\\\\s*begin\\\\s+calibration;\\\\s*$\")) {\n traitSet = parseCalibrationsBlock(fin);\n } else if (sStr.toLowerCase().matches(\"^\\\\s*begin\\\\s+assumptions;\\\\s*$\") ||\n sStr.toLowerCase().matches(\"^\\\\s*begin\\\\s+sets;\\\\s*$\") ||\n sStr.toLowerCase().matches(\"^\\\\s*begin\\\\s+mrbayes;\\\\s*$\")) {\n parseAssumptionsBlock(fin);\n } else if (sStr.toLowerCase().matches(\"^\\\\s*begin\\\\s+taxa;\\\\s*$\")) {\n parseSATaxaBlock(fin);\n } else if (sStr.toLowerCase().matches(\"^\\\\s*begin\\\\s+trees;\\\\s*$\")) {\n parseSATreesBlock(fin);\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n throw new Exception(\"Around line \" + lineNr + \"\\n\" + e.getMessage());\n }\n }", "@Override\r\n protected void readImpl() {\r\n _recipeId = readD();\r\n }", "public static ExaminationType_type1 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n ExaminationType_type1 object = null;\n // initialize a hash map to keep values\n java.util.Map attributeMap = new java.util.HashMap();\n java.util.List extraAttributeList = new java.util.ArrayList<org.apache.axiom.om.OMAttribute>();\n \n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n while(!reader.isEndElement()) {\n if (reader.isStartElement() || reader.hasText()){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"ExaminationType_type0\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n if (content.indexOf(\":\") > 0) {\n // this seems to be a Qname so find the namespace and send\n prefix = content.substring(0, content.indexOf(\":\"));\n namespaceuri = reader.getNamespaceURI(prefix);\n object = ExaminationType_type1.Factory.fromString(content,namespaceuri);\n } else {\n // this seems to be not a qname send and empty namespace incase of it is\n // check is done in fromString method\n object = ExaminationType_type1.Factory.fromString(content,\"\");\n }\n \n \n } else {\n reader.next();\n } \n } // end of while loop\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "@Override\r\n protected void parseAttributes()\r\n {\n\r\n }", "void format13(String line, int lineCount) {\n\n // is this the first record in the file?\n checkFirstRecord(code, lineCount);\n\n // there can only be one code 13 record per substation\n code13Count++;\n if (code13Count > 1) {\n outputError(lineCount + \" - Fatal - \" +\n \"More than 1 code 13 record in substation\");\n } // if (code13Count > 1)\n\n // get the data off the line\n java.util.StringTokenizer t = new java.util.StringTokenizer(line, \" \");\n String dummy = t.nextToken(); // get 'rid' of the code\n\n if (dataType == SEDIMENT) {\n\n //01 a2 format code always \"13\" n/a\n //02 a12 stnid station id: composed as for format 03 sedphy\n //03 i5 aluminium µgm / gram sedpol2\n //04 f8.3 antimony µgm / gram sedpol2\n //05 f4.1 bismuth µgm / gram sedpol2\n //06 f4.1 molybdenum µgm / gram sedpol2\n //07 f8.3 silver µgm / gram sedpol2\n //08 i4 titanium µgm / gram sedpol2\n //09 f5.2 vanadium µgm / gram sedpol2\n\n if (t.hasMoreTokens()) sedphy.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setAluminium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setAntimony(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setBismuth(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setMolybdenum(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setSilver(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setTitanium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setVanadium(toFloat(t.nextToken(), 1f));\n\n // station Id must match that of previous station record\n checkStationId(lineCount, sedphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format13: sedpol2 = \" + sedpol2);\n\n } else if (dataType == WATER) {\n\n //01 a2 format code always \"13\" n/a\n //02 a12 stnid station id: composed as for format 03 watphy\n //03 i5 aluminium µgm / litre watpol2\n //04 f8.3 antimony µgm / litre watpol2\n //05 f4.1 bismuth µgm / litre watpol2\n //06 f4.1 molybdenum µgm / litre watpol2\n //07 f8.3 silver µgm / litre watpol2\n //08 i4 titanium µgm / litre watpol2\n //08 f5.2 vanadium µgm / litre watpol2\n\n if (t.hasMoreTokens()) watphy.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setAluminium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setAntimony(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setBismuth(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setMolybdenum(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setSilver(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setTitanium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setVanadium(toFloat(t.nextToken(), 1f));\n\n // station Id must match that of previous station record\n checkStationId(lineCount, watphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format13: watpol2 = \" + watpol2);\n\n } // if (dataType == SEDIMENT)\n\n }", "protected void parseCDT(RectData tempVector) throws LoadException {\n\t\t// find eweightLine, ngene, nexpr\n\t\tfindCdtDimensions(tempVector);\n\t\tloadArrayAnnotation(tempVector);\n\t\tloadGeneAnnotation(tempVector);\n\t\tloadCdtData(tempVector);\n\t}", "public static FingerprintInformation parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n FingerprintInformation object =\n new FingerprintInformation();\n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n if (reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"type\")!=null){\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n if (fullTypeName!=null){\n java.lang.String nsPrefix = null;\n if (fullTypeName.indexOf(\":\") > -1){\n nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(\":\"));\n }\n nsPrefix = nsPrefix==null?\"\":nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\":\")+1);\n \n if (!\"FingerprintInformation\".equals(type)){\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);\n return (FingerprintInformation)gov.gsa.hspd12.federated.enrollment.ExtensionMapper.getTypeObject(\n nsUri,type,reader);\n }\n \n\n }\n \n\n }\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n \n reader.next();\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"http://hspd12.gsa.gov/federated/enrollment\",\"FteReasonCode\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (!\"true\".equals(nillableValue) && !\"1\".equals(nillableValue)){\n \n java.lang.String content = reader.getElementText();\n \n object.setFteReasonCode(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n } else {\n \n \n reader.getElementText(); // throw away text nodes if any.\n }\n \n reader.next();\n \n } // End of if for expected property start element\n \n else {\n \n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"http://hspd12.gsa.gov/federated/enrollment\",\"PrimaryPrintIndicator\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (!\"true\".equals(nillableValue) && !\"1\".equals(nillableValue)){\n \n java.lang.String content = reader.getElementText();\n \n object.setPrimaryPrintIndicator(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n } else {\n \n \n reader.getElementText(); // throw away text nodes if any.\n }\n \n reader.next();\n \n } // End of if for expected property start element\n \n else {\n \n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"http://hspd12.gsa.gov/federated/enrollment\",\"SecondaryPrintIndicator\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (!\"true\".equals(nillableValue) && !\"1\".equals(nillableValue)){\n \n java.lang.String content = reader.getElementText();\n \n object.setSecondaryPrintIndicator(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n } else {\n \n \n reader.getElementText(); // throw away text nodes if any.\n }\n \n reader.next();\n \n } // End of if for expected property start element\n \n else {\n \n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"http://hspd12.gsa.gov/federated/enrollment\",\"FingerprintTemplate\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n object.setFingerprintTemplate(null);\n reader.next();\n } else {\n \n object.setFingerprintTemplate(org.apache.axiom.util.stax.XMLStreamReaderUtils.getDataHandlerFromElement(reader));\n \n }\n \n reader.next();\n \n } // End of if for expected property start element\n \n else {\n \n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"http://hspd12.gsa.gov/federated/enrollment\",\"NfiqScores\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n object.setNfiqScores(null);\n reader.next();\n \n reader.next();\n \n }else{\n \n object.setNfiqScores(gov.gsa.hspd12.federated.enrollment.ArrayOfFingerprintScore.Factory.parse(reader));\n \n reader.next();\n }\n } // End of if for expected property start element\n \n else {\n \n }\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n \n if (reader.isStartElement())\n // A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "@Override\n public RecordType parseMetadata() {\n \n this.stationIndex = StationLookup.lookup(getStationId(this.filename));\n \n try {\n reader.mark(READ_AHEAD_LIMIT);\n String line = null;\n boolean headerRead = false;\n List<Variable> vars = null;\n while (null != (line = reader.readLine())) {\n Matcher matcher = headerLinePattern.matcher(line);\n if (matcher.matches()) {\n vars = headerVariables(matcher.group(1));\n reader.mark(READ_AHEAD_LIMIT);\n headerRead = true;\n }\n else if (headerRead) {\n matcher = dataLinePattern.matcher(line);\n if (matcher.matches()) {\n String date = matcher.group(1);\n Instant timestep = Instant.parse(date, getInputDateFormatter());\n this.baseDate = timestep;\n \n RecordType recordType = new RecordType(\"days since \" + baseDate.toString());\n for (Variable var : vars) {\n recordType.addType(var);\n }\n \n reader.reset();\n return recordType;\n }\n }\n }\n \n }\n catch (IOException ex) {\n LOG.debug(\"Error reading metadata\", ex);\n }\n return null;\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 }", "protected boolean parseIrregularXsectsInpData(String unparsedLine) {\r\n\r\n\t\tif (DEBUG)\r\n\t\t\tSystem.out.println(\"unparsedline = \" + unparsedLine);\r\n\r\n\t\t// delimeters: space, tab\r\n\t\tboolean done = false;\r\n\t\tStringTokenizer t = new StringTokenizer(unparsedLine, \" ,\\011\\042\");\r\n\t\tString firstToken = null;\r\n\t\tString nextToken = null;\r\n\r\n\t\tboolean foundChan = false;\r\n\t\tboolean foundDist = false;\r\n\t\tboolean foundFilename = false;\r\n\r\n\t\ttry {\r\n\t\t\tfirstToken = t.nextToken();\r\n\t\t} catch (NoSuchElementException e) {\r\n\t\t\tSystem.out.println(\"error in parseIrregularXsectsInpData. unparsedLine=\" + unparsedLine);\r\n\t\t}\r\n\r\n\t\tif (firstToken.substring(0, 1).equals(\"#\")) {\r\n\t\t\tif (DEBUG)\r\n\t\t\t\tSystem.out.println(\"comment line ignored. line=\" + unparsedLine);\r\n\t\t} else {\r\n\t\t\tif (firstToken.equalsIgnoreCase(END_HEADER)) {\r\n\t\t\t\tdone = true;\r\n\t\t\t\tif (DEBUG)\r\n\t\t\t\t\tSystem.out.println(\"firstToken=\" + firstToken);\r\n\t\t\t} else {\r\n\t\t\t\tif (_chanIndex == 0) {\r\n\t\t\t\t\t_chanNum = firstToken;\r\n\t\t\t\t\tfoundChan = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (_distIndex == 0) {\r\n\t\t\t\t\t// _dist = (new Float(firstToken)).floatValue();\r\n\t\t\t\t\t_dist = Float.parseFloat(firstToken);\r\n\t\t\t\t\tfoundDist = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (_filenameIndex == 0) {\r\n\t\t\t\t\t_pathname = firstToken;\r\n\t\t\t\t\tfoundFilename = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (int i = 1; t.hasMoreTokens(); i++) {\r\n\t\t\t\t\tnextToken = t.nextToken();\r\n\t\t\t\t\tif (DEBUG)\r\n\t\t\t\t\t\tSystem.out.println(\"i, nextToken=\" + i + \",\" + nextToken);\r\n\t\t\t\t\tif (_chanIndex == i) {\r\n\t\t\t\t\t\t_chanNum = nextToken;\r\n\t\t\t\t\t\tfoundChan = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (_distIndex == i) {\r\n\t\t\t\t\t\tif (DEBUG)\r\n\t\t\t\t\t\t\tSystem.out.println(\"distIndex, i=\" + _distIndex + \",\" + i);\r\n\t\t\t\t\t\tif (nextToken.equalsIgnoreCase(\"mid\")) {\r\n\t\t\t\t\t\t\t_dist = _middleNormalizedDist;\r\n\t\t\t\t\t\t} else if (nextToken.equalsIgnoreCase(\"length\")) {\r\n\t\t\t\t\t\t\t_dist = _lengthNormalizedDist;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t_dist = Float.parseFloat(nextToken);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfoundDist = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (_filenameIndex == i) {\r\n\t\t\t\t\t\tif (DEBUG)\r\n\t\t\t\t\t\t\tSystem.out.println(\"distIndex, i=\" + _distIndex + \",\" + i);\r\n\t\t\t\t\t\t_pathname = nextToken;\r\n\t\t\t\t\t\tfoundFilename = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (foundChan == false && foundDist == false && foundFilename == false) {\r\n\t\t\t\t\t\tSystem.out.println(\"Error in IrregularXsectsInpAsciiInput: \");\r\n\t\t\t\t\t\tSystem.out.println(\"foundChan = \" + foundChan);\r\n\t\t\t\t\t\tSystem.out.println(\"foundDist = \" + foundDist);\r\n\t\t\t\t\t\tSystem.out.println(\"foundFilename = \" + foundFilename);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // while has more tokens\r\n\t\t\t} // else\r\n\t\t} // if the line is not commented out\r\n\t\treturn done;\r\n\t}", "private void processAxioms(){\n if(isComplexAxiom()){\n isTerminology = false;\n isTerminologyWithRCIs = false;\n }\n else{\n inspectAxiomLHS();\n\n Predicate<OWLClass> repeatedEquality = e -> equalityNameCount.get(e) > 1;\n Predicate<OWLClass> repeatedInclusion = e -> inclusionNameCount.get(e) > 1;\n\n //No shared names or repeated equalities\n if(containsSharedNames() || equalityNameCount.keySet().stream().anyMatch(repeatedEquality)){\n isTerminology = false;\n isTerminologyWithRCIs = false;\n }\n //Has some repeated inclusions\n else if(inclusionNameCount.keySet().stream().anyMatch(repeatedInclusion)){\n isTerminology = false;\n isTerminologyWithRCIs = true;\n }\n else{\n //Is a terminology hence is a terminology with RCIs\n isTerminology = true;\n isTerminologyWithRCIs = true;\n }\n\n }\n }", "private Set<Obs> parseComponent4(Component4 entry) {\n\t\tSet<Obs> res = new HashSet<Obs>();\n\t\t\n\t\tif (entry.getAct()!=null) {\n\t\t\t//we only handle events\n\t\t\tif (entry.getAct().getMoodCode().compareTo(x_DocumentActMood.EVN)==0) {\n\t\t\t\tfor (EntryRelationship er : entry.getAct().getEntryRelationships()) {\n\t\t\t\t\tres.addAll( parseEntryRelationship(er) );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (entry.getObservation()!=null) {\n\t\t\t//we only handle events\n\t\t\tif (entry.getObservation().getMoodCode().compareTo(x_ActMoodDocumentObservation.EVN)==0) {\n\t\t\t\t\n\t\t\t\tif (entry.getObservation().getValues()!=null && !entry.getObservation().getValues().isEmpty()) {\n\t\t\t\t\tObs obs = new Obs();\n\t\t\t\t\tobs.setConcept(\n\t\t\t\t\t\tgetConcept(\n\t\t\t\t\t\t\tentry.getObservation().getCode().getCodeSystem(),\n\t\t\t\t\t\t\tentry.getObservation().getCode().getCode()\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t//TODO multiple values\n\t\t\t\t\tprocessValue(obs, entry.getObservation().getValues().get(0));\n\t\t\t\t\tprocessEffectiveTime(obs, entry.getObservation().getEffectiveTime());\n\t\t\t\t\t\n\t\t\t\t\tres.add(obs);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (EntryRelationship er : entry.getObservation().getEntryRelationships()) {\n\t\t\t\t\tres.addAll( parseEntryRelationship(er) );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (entry.getOrganizer()!=null) {\n\t\t\tfor (Component4 c : entry.getOrganizer().getComponents()) {\n\t\t\t\tres.addAll( parseComponent4(c) );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t}", "private void IdentifyHeaderAndFooter() {\n receipt_Header = receipt_lines.length > 0 ? receipt_lines[0] : null;\n receipt_Footer = receipt_lines.length > 1 ? receipt_lines[receipt_lines.length - 1].split(\" \")[0] : null;\n }", "private void parseElement(String type, List<Identifier> identifiers,\n\t\t\tList<Name> names, List<Location> locations,\n\t\t\tList<RelatedObject> relatedObjects, List<Subject> subjects,\n\t\t\tList<Description> descriptions, List<Coverage> coverages,\n\t\t\tList<RelatedInfo> relatedInfos, List<Right> rights,\n\t\t\tList<ExistenceDate> existenceDates,\n\t\t\tList<CitationInfo> citationInfos, List<AccessPolicy> accessPolicies) {\n\t\tif (type != null && !type.isEmpty()) {\n\t\t\tthis.data.put(\"type\", type);\n\t\t}\n\n\t\t// get the identifiers for rifcs element\n\t\tif (identifiers != null && !identifiers.isEmpty()) {\n\t\t\tparseIdentifiersForRIFCSElement(identifiers);\n\t\t}\n\n\t\t// get names and nameparts for rifcs element\n\t\tif (names != null && !names.isEmpty()) {\n\t\t\tparseNamesForRIFCSElement(names);\n\t\t}\n\n\t\t// get locations for rifcs element\n\t\tif (locations != null && !locations.isEmpty()) {\n\t\t\tparseLocationsForRIFCSElement(locations);\n\t\t}\n\n\t\t// get the related objects for rifcs element\n\t\tif (relatedObjects != null && !relatedObjects.isEmpty()) {\n\t\t\tparseRelatedObjectsForRIFCSElement(relatedObjects);\n\t\t}\n\n\t\t// get the subjects for rifcs element\n\t\tif (subjects != null && !subjects.isEmpty()) {\n\t\t\tboolean isMultiple = \"person\".equals(type);\n\t\t\tparseSubjectsForRIFCSElement(subjects, isMultiple);\n\t\t}\n\n\t\t// get the descriptions for rifcs element\n\t\tif (descriptions != null && !descriptions.isEmpty()) {\n\t\t\tparseDescriptionsForRIFCSElement(descriptions);\n\t\t}\n\n\t\t// get the related info for rifcs element\n\t\tif (relatedInfos != null && !relatedInfos.isEmpty()) {\n\t\t\tparseRelatedInfosForRIFCSElement(relatedInfos);\n\t\t}\n\n\t\t// get the existance dates for rifcs element\n\t\tif (existenceDates != null && !existenceDates.isEmpty()) {\n\t\t\tparseExistenceDatesForRIFCSElement(existenceDates);\n\t\t}\n\n//\t\t// get the coverages for rifcs element\n//\t\tif (coverages != null && !coverages.isEmpty()) {\n//\t\t\tparseCoveragesForRIFCSElement(coverages);\n//\t\t}\n\n//\t\t// get the right for rifcs element\n//\t\tif (rights != null && !rights.isEmpty()) {\n//\t\t\tparseRightsForRIFCSElement(rights);\n//\t\t}\n\n//\t\t// get the citation info for rifcs element\n//\t\tif (citationInfos != null && !citationInfos.isEmpty()) {\n//\t\t\tparseCitationInfosForRIFCSElement(citationInfos);\n//\t\t}\n\n//\t\t// get the access policy for rifcs element\n//\t\tif (accessPolicies != null && !accessPolicies.isEmpty()) {\n//\t\t\tparseAccessPoliciesForRIFCSElement(accessPolicies);\n//\t\t}\n\t}", "public static RadiologyOrder parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n RadiologyOrder object =\n new RadiologyOrder();\n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n if (reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"type\")!=null){\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n if (fullTypeName!=null){\n java.lang.String nsPrefix = null;\n if (fullTypeName.indexOf(\":\") > -1){\n nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(\":\"));\n }\n nsPrefix = nsPrefix==null?\"\":nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\":\")+1);\n \n if (!\"RadiologyOrder\".equals(type)){\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);\n return (RadiologyOrder)ExtensionMapper.getTypeObject(\n nsUri,type,reader);\n }\n \n\n }\n \n\n }\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n \n reader.next();\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"PatientID\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"PatientID\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n object.setPatientID(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n reader.next();\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"CaseID\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"CaseID\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n object.setCaseID(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n reader.next();\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"ExaminationType\").equals(reader.getName())){\n \n object.setExaminationType(ExaminationType_type1.Factory.parse(reader));\n \n reader.next();\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n \n if (reader.isStartElement())\n // A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "@Override\r\n public String getArtisticForm() {\r\n return artisticForm;\r\n }", "public Project processReconcilliationForm(Project project, ReconciliationForm form) {\r\n\r\n project.setMark(form.getMark());\r\n String originalStatus = project.getStatus();\r\n\r\n if (originalStatus.equals(\"R1A\") || originalStatus.equals(\"SM\")) {\r\n project.setStatus(\"R1M\");\r\n } else if (originalStatus.equals(\"R2C\")) {\r\n project.setStatus(\"R2M\");\r\n } else if (originalStatus.equals(\"R3C\")) {\r\n project.setStatus(\"R3M\");\r\n }\r\n project.addReconComments(\"[Reconciliation \" + project.getStatus() + \" reason]:\\n\" + form.getReason());\r\n return project;\r\n }", "private AtualizarContaPreFaturadaHelper parserRegistroTipo3(String linha) {\r\n\t\tAtualizarContaPreFaturadaHelper retorno = new AtualizarContaPreFaturadaHelper();\r\n\r\n\t\tInteger index = 0;\r\n\r\n\t\t// Tipo de registro\r\n\t\tretorno.tipoRegistro = linha.substring(index, index + REGISTRO_TIPO);\r\n\t\tindex += REGISTRO_TIPO;\r\n\r\n\t\t// Matricula do imovel\r\n\t\tretorno.matriculaImovel = linha.substring(index, index\r\n\t\t\t\t+ MATRICULA_IMOVEL);\r\n\t\tindex += MATRICULA_IMOVEL;\r\n\r\n\t\t// Codigo da Categoria\r\n\t\tretorno.codigoCategoria = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_CODIGO_CATEGORIA);\r\n\t\tindex += REGISTRO_TIPO_3_CODIGO_CATEGORIA;\r\n\r\n\t\t// Codigo da Subcategoria\r\n\t\tretorno.codigoSubCategoria = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_CODIGO_SUBCATEGORIA);\r\n\t\tindex += REGISTRO_TIPO_3_CODIGO_SUBCATEGORIA;\r\n\r\n\t\t// Consumo faturado de agua\r\n\t\tretorno.consumoFaturadoAguaFaixa = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_CONSUMO_FATURADO_AGUA_FAIXA);\r\n\t\tindex += REGISTRO_TIPO_3_CONSUMO_FATURADO_AGUA_FAIXA;\r\n\r\n\t\t// Valor tarifa minima de agua\r\n\t\tretorno.valorFaturadoAguaFaixa = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_VALOR_FATURADO_AGUA_FAIXA);\r\n\t\tindex += REGISTRO_TIPO_3_VALOR_FATURADO_AGUA_FAIXA;\r\n\r\n\t\t// Limite Inicial do Consumo na Faixa\r\n\t\tretorno.limiteInicialConsumoFaixa = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_LIMITE_INICIAL_CONSUMO_FAIXA);\r\n\t\tindex += REGISTRO_TIPO_3_LIMITE_INICIAL_CONSUMO_FAIXA;\r\n\r\n\t\t// Limite Final do consumo na Faixa\r\n\t\tretorno.limiteFinalConsumoFaixa = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_LIMITE_FINAL_CONSUMO_FAIXA);\r\n\t\tindex += REGISTRO_TIPO_3_LIMITE_FINAL_CONSUMO_FAIXA;\r\n\r\n\t\t// Valor da Tarifa Agua na Faixa\r\n\t\tretorno.valorTarifaAguaFaixa = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_VALOR_TARIFA_AGUA_FAIXA);\r\n\t\tindex += REGISTRO_TIPO_3_VALOR_TARIFA_AGUA_FAIXA;\r\n\r\n\t\t// Valor da Tarifa Esgoto na Faixa\r\n\t\tretorno.valorTarifaEsgotoFaixa = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_VALOR_TARIFA_ESGOTO_FAIXA);\r\n\t\tindex += REGISTRO_TIPO_3_VALOR_TARIFA_ESGOTO_FAIXA;\r\n\r\n\t\t// Consumo faturado de esgoto\r\n\t\tretorno.consumoFaturadoEsgotoFaixa = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_CONSUMO_FATURADO_ESGOTO_FAIXA);\r\n\t\tindex += REGISTRO_TIPO_3_CONSUMO_FATURADO_ESGOTO_FAIXA;\r\n\r\n\t\t// Valor tarifa minima de agua\r\n\t\tretorno.valorFaturadoEsgotoFaixa = linha.substring(index, index\r\n\t\t\t\t+ REGISTRO_TIPO_3_VALOR_FATURADO_ESGOTO_FAIXA);\r\n\t\tindex += REGISTRO_TIPO_3_VALOR_FATURADO_ESGOTO_FAIXA;\r\n\r\n\t\treturn retorno;\r\n\t}", "public static ExaminationType_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n ExaminationType_type0 object = null;\n // initialize a hash map to keep values\n java.util.Map attributeMap = new java.util.HashMap();\n java.util.List extraAttributeList = new java.util.ArrayList<org.apache.axiom.om.OMAttribute>();\n \n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n while(!reader.isEndElement()) {\n if (reader.isStartElement() || reader.hasText()){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"ExaminationType_type0\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n if (content.indexOf(\":\") > 0) {\n // this seems to be a Qname so find the namespace and send\n prefix = content.substring(0, content.indexOf(\":\"));\n namespaceuri = reader.getNamespaceURI(prefix);\n object = ExaminationType_type0.Factory.fromString(content,namespaceuri);\n } else {\n // this seems to be not a qname send and empty namespace incase of it is\n // check is done in fromString method\n object = ExaminationType_type0.Factory.fromString(content,\"\");\n }\n \n \n } else {\n reader.next();\n } \n } // end of while loop\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "public void load(VProperty beginProperty, BufferedReader reader) throws Exception {\n\t\tput(\"outlookmessageclass\", \"IPM.Contact\");\n\n\t\tVObject vcard = new VObject(beginProperty, reader);\n\t\tfor (VProperty property : vcard.getProperties()) {\n\t\t\tif (\"UID\".equals(property.getKey())) {\n\t\t\t\tput(\"uid\", property.getValue());\n\t\t\t} else if (\"REV\".equals(property.getKey())) {\n\t\t\t\tput(\"lastmodified\", property.getValue());\n\t\t\t} else if (\"FN\".equals(property.getKey())) {\n\t\t\t\tput(\"cn\", property.getValue());\n\t\t\t\tput(\"subject\", property.getValue());\n\t\t\t\tput(\"fileas\", property.getValue());\n\n\t\t\t} else if (\"N\".equals(property.getKey())) {\n\t\t\t\tconvertContactProperties(this, VCARD_N_PROPERTIES, property.getValues());\n\t\t\t} else if (\"NICKNAME\".equals(property.getKey())) {\n\t\t\t\tput(\"nickname\", property.getValue());\n\t\t\t} else if (\"TEL\".equals(property.getKey())) {\n\t\t\t\tif (property.hasParam(\"TYPE\", \"cell\") || property.hasParam(\"X-GROUP\", \"cell\")) {\n\t\t\t\t\tput(\"mobile\", property.getValue());\n\t\t\t\t} else if (property.hasParam(\"TYPE\", \"work\") || property.hasParam(\"X-GROUP\", \"work\")) {\n\t\t\t\t\tput(\"telephoneNumber\", property.getValue());\n\t\t\t\t} else if (property.hasParam(\"TYPE\", \"home\") || property.hasParam(\"X-GROUP\", \"home\")) {\n\t\t\t\t\tput(\"homePhone\", property.getValue());\n\t\t\t\t} else if (property.hasParam(\"TYPE\", \"fax\")) {\n\t\t\t\t\tif (property.hasParam(\"TYPE\", \"home\")) {\n\t\t\t\t\t\tput(\"homefax\", property.getValue());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tput(\"facsimiletelephonenumber\", property.getValue());\n\t\t\t\t\t}\n\t\t\t\t} else if (property.hasParam(\"TYPE\", \"pager\")) {\n\t\t\t\t\tput(\"pager\", property.getValue());\n\t\t\t\t} else if (property.hasParam(\"TYPE\", \"car\")) {\n\t\t\t\t\tput(\"othermobile\", property.getValue());\n\t\t\t\t} else {\n\t\t\t\t\tput(\"otherTelephone\", property.getValue());\n\t\t\t\t}\n\t\t\t} else if (\"ADR\".equals(property.getKey())) {\n\t\t\t\t// address\n\t\t\t\tif (property.hasParam(\"TYPE\", \"home\")) {\n\t\t\t\t\tconvertContactProperties(this, VCARD_ADR_HOME_PROPERTIES, property.getValues());\n\t\t\t\t} else if (property.hasParam(\"TYPE\", \"work\")) {\n\t\t\t\t\tconvertContactProperties(this, VCARD_ADR_WORK_PROPERTIES, property.getValues());\n\t\t\t\t\t// any other type goes to other address\n\t\t\t\t} else {\n\t\t\t\t\tconvertContactProperties(this, VCARD_ADR_OTHER_PROPERTIES, property.getValues());\n\t\t\t\t}\n\t\t\t} else if (\"EMAIL\".equals(property.getKey())) {\n\t\t\t\tif (property.hasParam(\"TYPE\", \"home\")) {\n\t\t\t\t\tput(\"email2\", property.getValue());\n\t\t\t\t\tput(\"smtpemail2\", property.getValue());\n\t\t\t\t} else if (property.hasParam(\"TYPE\", \"other\")) {\n\t\t\t\t\tput(\"email3\", property.getValue());\n\t\t\t\t\tput(\"smtpemail3\", property.getValue());\n\t\t\t\t} else {\n\t\t\t\t\tput(\"email1\", property.getValue());\n\t\t\t\t\tput(\"smtpemail1\", property.getValue());\n\t\t\t\t}\n\t\t\t} else if (\"ORG\".equals(property.getKey())) {\n\t\t\t\tString o = null;\n\t\t\t\tif (property.getValues() != null && property.getValues().size() > 0) {\n\t\t\t\t\to = property.getValues().get(0);\n\t\t\t\t}\n\t\t\t\tif (property.getValues() != null && property.getValues().size() > 1) {\n\t\t\t\t\to = o + '\\n' + property.getValues().get(1);\n\t\t\t\t}\n\t\t\t\tput(\"o\", o);\n//\t\t\t\tconvertContactProperties(this, VCARD_ORG_PROPERTIES, property.getValues());\n\t\t\t} else if (\"URL\".equals(property.getKey())) {\n\t\t\t\tif (property.hasParam(\"TYPE\", \"work\")) {\n\t\t\t\t\tput(\"businesshomepage\", property.getValue());\n\t\t\t\t} else if (property.hasParam(\"TYPE\", \"home\")) {\n\t\t\t\t\tput(\"personalHomePage\", property.getValue());\n\t\t\t\t} else {\n\t\t\t\t\t// default: set personal home page\n\t\t\t\t\tput(\"personalHomePage\", property.getValue());\n\t\t\t\t}\n\t\t\t} else if (\"TITLE\".equals(property.getKey())) {\n\t\t\t\tput(\"title\", property.getValue());\n\t\t\t} else if (\"NOTE\".equals(property.getKey())) {\n\t\t\t\tput(\"description\", property.getValue());\n\t\t\t} else if (\"CUSTOM1\".equals(property.getKey())) {\n\t\t\t\tput(\"extensionattribute1\", property.getValue());\n\t\t\t} else if (\"CUSTOM2\".equals(property.getKey())) {\n\t\t\t\tput(\"extensionattribute2\", property.getValue());\n\t\t\t} else if (\"CUSTOM3\".equals(property.getKey())) {\n\t\t\t\tput(\"extensionattribute3\", property.getValue());\n\t\t\t} else if (\"CUSTOM4\".equals(property.getKey())) {\n\t\t\t\tput(\"extensionattribute4\", property.getValue());\n\t\t\t} else if (\"ROLE\".equals(property.getKey())) {\n\t\t\t\tput(\"profession\", property.getValue());\n\t\t\t} else if (\"X-AIM\".equals(property.getKey())) {\n\t\t\t\tput(\"im\", property.getValue());\n\t\t\t} else if (\"BDAY\".equals(property.getKey())) {\n\t\t\t\tput(\"bday\", convertBDayToZulu(property.getValue()));\n\t\t\t} else if (\"ANNIVERSARY\".equals(property.getKey()) || \"X-ANNIVERSARY\".equals(property.getKey())) {\n\t\t\t\tput(\"anniversary\", convertBDayToZulu(property.getValue()));\n\t\t\t} else if (\"CATEGORIES\".equals(property.getKey())) {\n\t\t\t\tput(\"keywords\", property.getValue());\n\t\t\t} else if (\"CLASS\".equals(property.getKey())) {\n\t\t\t\tif (\"PUBLIC\".equals(property.getValue())) {\n\t\t\t\t\tput(\"sensitivity\", \"0\");\n\t\t\t\t\tput(\"private\", \"false\");\n\t\t\t\t} else {\n\t\t\t\t\tput(\"sensitivity\", \"2\");\n\t\t\t\t\tput(\"private\", \"true\");\n\t\t\t\t}\n\t\t\t} else if (\"SEX\".equals(property.getKey())) {\n\t\t\t\tString propertyValue = property.getValue();\n\t\t\t\tif (\"1\".equals(propertyValue)) {\n\t\t\t\t\tput(\"gender\", \"2\");\n\t\t\t\t} else if (\"2\".equals(propertyValue)) {\n\t\t\t\t\tput(\"gender\", \"1\");\n\t\t\t\t}\n\t\t\t} else if (\"FBURL\".equals(property.getKey())) {\n\t\t\t\tput(\"fburl\", property.getValue());\n\t\t\t} else if (\"X-ASSISTANT\".equals(property.getKey())) {\n\t\t\t\tput(\"secretarycn\", property.getValue());\n\t\t\t} else if (\"X-MANAGER\".equals(property.getKey())) {\n\t\t\t\tput(\"manager\", property.getValue());\n\t\t\t} else if (\"X-SPOUSE\".equals(property.getKey())) {\n\t\t\t\tString[] spouse = StringUtils.splitPreserveAllTokens(property.getValue(), ',');\n\t\t\t\tif (spouse.length > 0) {\n\t\t\t\t\tput(\"spousecnLastname\", StringUtils.trim(spouse[0]));\n\t\t\t\t}\n\t\t\t\tif (spouse.length > 1) {\n\t\t\t\t\tput(\"spousecnFirstname\", StringUtils.trim(spouse[1]));\n\t\t\t\t}\n\t\t\t} else if (\"PHOTO\".equals(property.getKey())) {\n\t\t\t\tput(\"photo\", property.getValue());\n\t\t\t\tput(\"haspicture\", \"true\");\n\t\t\t}\n\t\t}\n\n\t\t// reset missing properties to null\n\t\tfor (String key : CONTACT_ATTRIBUTES) {\n\t\t\tif (!\"imapUid\".equals(key) && !\"etag\".equals(key) && !\"urlcompname\".equals(key)\n\t\t\t\t\t&& !\"lastmodified\".equals(key) && !\"sensitivity\".equals(key) &&\n\t\t\t\t\t!containsKey(key)) {\n\t\t\t\tput(key, null);\n\t\t\t}\n\t\t}\n\t}", "private void parseSQLDIAGCN() {\n if (readFdocaOneByte() == CodePoint.NULLDATA) {\n return;\n }\n\n // The server should send NULLDATA\n throw new UnsupportedOperationException(\"SQLState.DRDA_COMMAND_NOT_IMPLEMENTED parseSQLDIAGCN\");\n// netAgent_.accumulateChainBreakingReadExceptionAndThrow(\n// new DisconnectException(netAgent_,\n// new ClientMessageId(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED),\n// \"parseSQLDIAGCN\"));\n }", "public Set<ContextualActivity> read() {\n Set<ContextualActivity> defaultActivities = new HashSet<ContextualActivity>();\n try {\n\n Scanner s = new Scanner(input);\n while (s.hasNextLine()) {\n // verb, noun, locations, times, duration\n String infos[] = (s.nextLine()).split(\",\");\n\n Set<String> locations = new HashSet<String>();\n Collections.addAll(locations, infos[2].split(Cons.ENTRY_SEPARATOR_REG));\n\n Set<TimeOfDay> times = new HashSet<TimeOfDay>();\n for (String tm : infos[3].split(Cons.ENTRY_SEPARATOR_REG)) {\n try {\n times.add(TimeOfDay.valueOf(tm.toUpperCase()));\n }\n catch (Exception e){\n }\n }\n\n defaultActivities.add(new DefaultActivity(infos[0], infos[1], locations, times, infos[4]));\n }\n\n return defaultActivities;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return defaultActivities;\n }", "static void readLine(String line) {\n if (line.equals(\"\")) {\n //boş satır varsa birşey yapma\n } else {\n String[] satır = line.split(\", \");\n long id = Long.parseLong(satır[0]);//id\n String a = satır[1]; //eventType\n String b = satır[2]; //EventName\n String c = satır[3]; // date\n String c2 = satır[4];\n boolean c22 = Boolean.parseBoolean(c2); //isAllDay?\n String d = satır[5];//time from\n String e = satır[6];//time to\n String f = satır[7];//color\n String g = satır[8];//location\n String h = satır[9];//description\n String j = satır[10];//reminder\n\n Agenda agenda = new Agenda(id, a, b, c, c22, d, e, f, g, h, j);\n data.add(agenda);\n addtoReminder(j, c);\n }\n }", "public void importFile(String filename) throws IOException, BadEntryException, ImportFileException{\n try{\n BufferedReader reader = new BufferedReader(new FileReader(filename));\n String line;\n line = reader.readLine();\n\n while(line != null){\n String[] fields = line.split(\"\\\\|\");\n int id = Integer.parseInt(fields[1]);\n if(_persons.get(id) != null){\n throw new BadEntryException(fields[0]);\n }\n\n if(fields[0].equals(\"FUNCIONÁRIO\")){\n registerAdministrative(fields);\n line = reader.readLine();\n }else if(fields[0].equals(\"DOCENTE\")){\n Professor _professor = new Professor(id, fields[2], fields[3]);\n _professors.put(id, _professor);\n _persons.put(id, (Person) _professor);\n\n line = reader.readLine();\n if(line != null){\n fields = line.split(\"\\\\|\");\n while((line != null) && (fields[0].charAt(0) == '#')){\n String course = fields[0].substring(2);\n String discipline = fields[1];\n Course _course = _courses.get(course);\n \n if(_course == null){\n _course = new Course(course);\n _disciplineCourse.put(course, new HashMap<String, Discipline>());\n _courses.put(course, _course);\n }\n\n if(_professor.getDisciplineCourses().get(course) == null){\n _professor.getDisciplineCourses().put(course, new HashMap<String, Discipline>());\n }\n\n Discipline _discipline = _disciplines.get(discipline);\n if(_discipline == null){\n _discipline = new Discipline(discipline,_course);\n _disciplines.put(discipline, _discipline);\n _course.getDisciplines().put(discipline, _discipline);\n }\n _discipline.registerObserver(_professor, id);\n _disciplineCourse.get(course).put(discipline, _discipline);\n\n if(_professor.getDisciplines() != null){\n _professor.getDisciplines().put(discipline, _discipline);\n _professor.getDisciplineCourses().get(course).put(discipline, _discipline); \n }\n line = reader.readLine();\n if(line != null){\n fields = line.split(\"\\\\|\");\n\n }\n }\n }\n }else if(fields[0].equals(\"DELEGADO\")){\n Student _student = new Student(id, fields[2], fields[3]);\n _students.put(id, _student);\n _persons.put(id, (Person) _student);\n\n line = reader.readLine();\n fields = line.split(\"\\\\|\");\n while((line != null) && (fields[0].charAt(0) == '#')){\n String course = fields[0].substring(2);\n String discipline = fields[1];\n Course _course = _courses.get(course);\n if(_course == null){\n _course = new Course(course);\n _disciplineCourse.put(course, new HashMap<String, Discipline>());\n _courses.put(course,_course);\n }\n if(_course.getRepresentatives().size() == 8){\n System.out.println(id);\n throw new BadEntryException(course);\n }else{\n _course.getRepresentatives().put(id,_student);\n }\n _student.setCourse(_course);\n Discipline _discipline = _disciplines.get(discipline);\n if(_discipline == null){\n _discipline = new Discipline(discipline, _course);\n _disciplines.put(discipline,_discipline);\n _course.getDisciplines().put(discipline, _discipline);\n }\n if(_student.getDisciplines().size() == 6){\n throw new BadEntryException(discipline);\n }else{\n if(_discipline.getStudents().size() == 100){\n throw new BadEntryException(discipline);\n }else{\n _student.getDisciplines().put(discipline,_discipline);\n _discipline.getStudents().put(id,_student);\n }\n }\n line = reader.readLine();\n if(line != null){\n fields = line.split(\"\\\\|\");\n }\n }\n }else if(fields[0].equals(\"ALUNO\")){\n Student _student = new Student(id, fields[2], fields[3]);\n _students.put(id, _student);\n _persons.put(id, (Person) _student);\n\n line = reader.readLine();\n fields = line.split(\"\\\\|\");\n while((line != null) && (fields[0].charAt(0) == '#')){\n String course = fields[0].substring(2);\n String discipline = fields[1];\n Course _course = _courses.get(course);\n if(_course == null){\n _course = new Course(course);\n _disciplineCourse.put(course, new HashMap<String, Discipline>());\n _courses.put(course, _course);\n }\n _student.setCourse(_course);\n Discipline _discipline = _disciplines.get(discipline);\n if(_discipline == null){\n _discipline = new Discipline(discipline, _course);\n _disciplines.put(discipline, _discipline);\n _course.getDisciplines().put(discipline, _discipline);\n }\n _discipline.registerObserver(_student, id);\n if(_student.getDisciplines().size() == 6){\n throw new BadEntryException(discipline);\n }else{\n _student.getDisciplines().put(discipline,_discipline);\n if(_discipline.getStudents().size() == 100){\n throw new BadEntryException(discipline);\n }else{\n _discipline.getStudents().put(id,_student);\n }\n }\n line = reader.readLine();\n if(line != null){\n fields = line.split(\"\\\\|\");\n }\n }\n\n }else{\n throw new BadEntryException(fields[0]);\n }\n }\n for(Course course: _courses.values()){\n HashMap<Integer,Student> representatives = course.getRepresentatives();\n HashMap<String, Discipline> disciplines = course.getDisciplines();\n for(Discipline discipline: disciplines.values()){\n for(Student representative: representatives.values()){\n discipline.registerObserver(representative, representative.getId());\n }\n }\n \n } \n reader.close();\n }catch(BadEntryException e){\n throw new ImportFileException(e);\n }catch(IOException e){\n throw new ImportFileException(e);\n }\n }", "@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\n\t\t// create an empty Annotation just with the given text\n\t\tAnnotation document = new Annotation(text);\n//\t\tAnnotation document = new Annotation(\"Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.\");\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document); \n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\t HelperDataStructures hds = new HelperDataStructures();\n\n\t\t\n\t\t//SPnew language-specific settings:\n\t\t//SPnew subject tags of the parser\n\t\t HashSet<String> subjTag = new HashSet<String>(); \n\t\t HashSet<String> dirObjTag = new HashSet<String>(); \n\t\t //subordinate conjunction tags\n\t\t HashSet<String> compTag = new HashSet<String>(); \n\t\t //pronoun tags\n\t\t HashSet<String> pronTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> passSubjTag = new HashSet<String>();\n\t\t HashSet<String> apposTag = new HashSet<String>(); \n\t\t HashSet<String> verbComplementTag = new HashSet<String>(); \n\t\t HashSet<String> infVerbTag = new HashSet<String>(); \n\t\t HashSet<String> relclauseTag = new HashSet<String>(); \n\t\t HashSet<String> aclauseTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> compLemma = new HashSet<String>(); \n\t\t HashSet<String> coordLemma = new HashSet<String>(); \n\t\t HashSet<String> directQuoteIntro = new HashSet<String>(); \n\t\t HashSet<String> indirectQuoteIntroChunkValue = new HashSet<String>();\n\t\t \n//\t\t HashSet<String> finiteVerbTag = new HashSet<String>();\n\t\t \n\n\t\t //OPEN ISSUES PROBLEMS:\n\t\t //the subject - verb relation finding does not account for several specific cases: \n\t\t //opinion verbs with passive subjects as opinion holder are not accounted for,\n\t\t //what is needed is a marker in the lex files like PASSSUBJ\n\t\t //ex: Obama is worried/Merkel is concerned\n\t\t //Many of the poorer countries are concerned that the reduction in structural funds and farm subsidies may be detrimental in their attempts to fulfill the Copenhagen Criteria.\n\t\t //Some of the more well off EU states are also worried about the possible effects a sudden influx of cheap labor may have on their economies. Others are afraid that regional aid may be diverted away from those who currently benefit to the new, poorer countries that join in 2004 and beyond. \n\t\t// Does not account for infinitival constructions, here again a marker is needed to specify\n\t\t //subject versus object equi\n\t\t\t//Christian Noyer was reported to have said that it is ok.\n\t\t\t//Reuters has reported Christian Noyer to have said that it is ok.\n\t\t //Obama is likely to have said.. \n\t\t //Several opinion holder- opinion verb pairs in one sentence are not accounted for, right now the first pair is taken.\n\t\t //what is needed is to run through all dependencies. For inderect quotes the xcomp value of the embedded verb points to the \n\t\t //opinion verb. For direct quotes the offsets closest to thwe quote are relevant.\n\t\t //a specific treatment of inverted subjects is necessary then. Right now the\n\t\t //strategy relies on the fact that after the first subj/dirobj - verb pair the\n\t\t //search is interrupted. Thus, if the direct object precedes the subject, it is taken as subject.\n\t\t // this is the case in incorrectly analysed inverted subjeects as: said Zwickel on Monday\n\t\t //coordination of subject not accounted for:employers and many economists\n\t\t //several subject-opinion verbs:\n\t\t //Zwickel has called the hours discrepancy between east and west a \"fairness gap,\" but employers and many economists point out that many eastern operations have a much lower productivity than their western counterparts.\n\t\t if (language.equals(\"en\")){\n \t subjTag.add(\"nsubj\");\n \t subjTag.add(\"xsubj\");\n \t subjTag.add(\"nmod:agent\");\n \t \n \t dirObjTag.add(\"dobj\"); //for inverted subject: \" \" said IG metall boss Klaus Zwickel on Monday morning.\n \t \t\t\t\t\t\t//works only with break DEPENDENCYSEARCH, otherwise \"Monday\" is nsubj \n \t \t\t\t\t\t\t//for infinitival subject of object equi: Reuters reports Obama to have said\n \tpassSubjTag.add(\"nsubjpass\");\n \tapposTag.add(\"appos\");\n \trelclauseTag.add(\"acl:relcl\");\n \taclauseTag.add(\"acl\");\n \t compTag.add(\"mark\");\n \t pronTag.add(\"prp\");\n \thds.pronTag.add(\"prp\");\n \tcompLemma.add(\"that\");\n \tcoordLemma.add(\"and\");\n \tverbComplementTag.add(\"ccomp\");\n \tverbComplementTag.add(\"parataxis\");\n\n \tinfVerbTag.add(\"xcomp\"); //Reuters reported Merkel to have said\n \tinfVerbTag.add(\"advcl\");\n \tdirectQuoteIntro.add(\":\");\n \tindirectQuoteIntroChunkValue.add(\"SBAR\");\n \thds.objectEqui.add(\"report\");\n \thds.objectEqui.add(\"quote\");\n \thds.potentialIndirectQuoteTrigger.add(\"say\");\n// \thds.objectEqui.add(\"confirm\");\n// \thds.subjectEqui.add(\"promise\");\n// \thds.subjectEqui.add(\"quote\");\n// \thds.subjectEqui.add(\"confirm\");\n }\n\t\t \n\t\t boolean containsSubordinateConjunction = false;\n\t\t\n\t\t \n\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tSystem.out.println(\"PREPROCESSING..\");\n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\t//SP Map offsets to NER\n\t\t\t\tList<NamedEntity> ners = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tNamedEntity.class, sentenceAnn);\n\t\t\t\tfor (NamedEntity ne : ners){\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.getCoveredText().toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.casTypeCode);\n\t\t\t\t\t//Person is 71, Location is 213, Organization is 68 geht anders besser siehe unten\n\t\t\t\t\tint nerStart = ne\n\t\t\t\t\t\t\t.getBegin();\n\t\t\t\t\tint nerEnd = ne.getEnd();\n//\t\t\t\t\tSystem.out.println(\"NER: \" + ne.getCoveredText() + \" \" + nerStart + \"-\" + nerEnd ); \n\t\t\t\t\tString offsetNer = \"\" + nerStart + \"-\" + nerEnd;\n\t\t\t\t\thds.offsetToNer.put(offsetNer, ne.getCoveredText());\n//\t\t\t\t\tNer.add(offsetNer);\n\t\t\t\t\thds.Ner.add(offsetNer);\n//\t\t\t\t\tSystem.out.println(\"NER: TYPE \" +ne.getValue().toString());\n\t\t\t\t\tif (ne.getValue().equals(\"PERSON\")){\n\t\t\t\t\t\thds.NerPerson.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t\telse if (ne.getValue().equals(\"ORGANIZATION\")){\n\t\t\t\t\t\thds.NerOrganization.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//DBpediaLink info: map offsets to links\n\t\t\t\tList<DBpediaResource> dbpeds = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tDBpediaResource.class, sentenceAnn);\n\t\t\t\tfor (DBpediaResource dbped : dbpeds){\n//\t\t\t\t\t\n//\t\t\t\t\tint dbStart = dbped\n//\t\t\t\t\t\t\t.getBegin();\n//\t\t\t\t\tint dbEnd = dbped.getEnd();\n\t\t\t\t\t// not found if dbpedia offsets are wrongly outside than sentences\n//\t\t\t\t\tSystem.out.println(\"DBPED SENT: \" + sentenceAnn.getBegin()+ \"-\" + sentenceAnn.getEnd() ); \n//\t\t\t\t\tString offsetDB = \"\" + dbStart + \"-\" + dbEnd;\n//\t\t\t\t\thds.labelToDBpediaLink.put(dbped.getLabel(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getLabel() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t\thds.dbpediaSurfaceFormToDBpediaLink.put(dbped.getCoveredText(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getCoveredText() + \"URI: \" + dbped.getUri() ); \n\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\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//SP Map offsets to lemma of opinion verb/noun; parser does not provide lemma\n\t\t\t\t for (CoreLabel token: sentence.get(TokensAnnotation.class)) {\n//\t\t\t\t\t System.out.println(\"LEMMA \" + token.lemma().toString());\n\t\t\t\t\t int beginTok = token.beginPosition();\n\t\t\t\t\t int endTok = token.endPosition();\n\t\t\t\t\t String offsets = \"\" + beginTok + \"-\" + endTok;\n\t\t\t\t\t hds.offsetToLemma.put(offsets, token.lemma().toString());\n\t\t\t\t\t \n\t\t\t\t\t \t if (opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t \n//\t\t\t \t System.out.println(\"offsetToLemmaOfOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\t\t\t\t\t \t if (passive_opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfPassiveOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n//\t\t\t \t System.out.println(\"offsetToLemmaOfPassiveOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\n\t\t\t\t } \n\n\t\t\t//SPnew parser\n\t\t\tTree tree = sentence.get(TreeAnnotation.class);\n\t\t\tTreebankLanguagePack tlp = new PennTreebankLanguagePack();\n\t\t\tGrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();\n\t\t\tGrammaticalStructure gs = gsf.newGrammaticalStructure(tree);\n\t\t\tCollection<TypedDependency> td = gs.typedDependenciesCollapsed();\n\n\t\t\t \n//\t\t\tSystem.out.println(\"TYPEDdep\" + td);\n\t\t\t\n\t\t\tObject[] list = td.toArray();\n//\t\t\tSystem.out.println(list.length);\n\t\t\tTypedDependency typedDependency;\nDEPENDENCYSEARCH: for (Object object : list) {\n\t\t\ttypedDependency = (TypedDependency) object;\n//\t\t\tSystem.out.println(\"DEP \" + typedDependency.dep().toString()+ \n//\t\t\t\t\t\" GOV \" + typedDependency.gov().toString()+ \n//\t\t\t\" :: \"+ \" RELN \"+typedDependency.reln().toString());\n\t\t\tString pos = null;\n String[] elements;\n String verbCand = null;\n int beginVerbCand = -5;\n\t\t\tint endVerbCand = -5;\n\t\t\tString offsetVerbCand = null;\n\n if (compTag.contains(typedDependency.reln().toString())) {\n \tcontainsSubordinateConjunction = true;\n// \tSystem.out.println(\"subordConj \" + typedDependency.dep().toString().toLowerCase());\n }\n \n else if (subjTag.contains(typedDependency.reln().toString())){\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \t\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tfor (HashMap.Entry<String, String> entry : hds.offsetToLemma.entrySet()) {\n//\t\t\t\t String key = entry.getKey();\n//\t\t\t\t Object value = entry.getValue();\n//\t\t\t\t System.out.println(\"OFFSET \" + key + \" LEMMA \" + value);\n//\t\t\t\t // FOR LOOP\n//\t\t\t\t}\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"SUBJCHAINHEAD1\");\n\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\tSystem.out.println(\"verbCand \" + verbCand);\n\t\t\t\t//hack for subj after obj said Zwickel (obj) on Monday morning (subj)\n\t\t\t\tif (language.equals(\"en\") \n\t\t\t\t\t\t&& hds.predicateToObject.containsKey(offsetVerbCand)\n\t\t\t\t\t\t){\n// \t\tSystem.out.println(\"CONTINUE DEP\");\n \t\tcontinue DEPENDENCYSEARCH;\n \t}\n\t\t\t\telse {\n\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n\t\t\t\t}\n }\n //Merkel is concerned\n else if (passSubjTag.contains(typedDependency.reln().toString())){\n \t//Merkel was reported\n \t//Merkel was concerned\n \t//Merkel was quoted\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n////\t\t\t\t\tSystem.out.println(\"LEMMA verbCand \" + verbCandLemma);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n \t\n \tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n// \tSystem.out.println(\"SUBJCHAINHEAD2\");\n \t//Merkel is concerned\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfPassiveOpinionVerb,\n \t\t\thds);\n }\n //Meanwhile, the ECB's vice-president, Christian Noyer, was reported at the start of the week to have said that the bank's future interest-rate moves\n// would depend on the behavior of wage negotiators as well as the pace of the economic recovery.\n\n else if (apposTag.contains(typedDependency.reln().toString())){\n \t\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tString appo = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tint beginAppo = typedDependency.dep().beginPosition();\n\t\t\t\tint endAppo = typedDependency.dep().endPosition();\n\t\t\t\tString offsetAppo = \"\" + beginAppo + \"-\" + endAppo;\n\t\t\t\t\n// \tSystem.out.println(\"APPOSITION1 \" + subjCand + \"::\"+ appo + \":\" + offsetSubjCand + \" \" + offsetAppo);\n \thds.subjectToApposition.put(offsetSubjCand, offsetAppo);\n }\n else if (relclauseTag.contains(typedDependency.reln().toString())){\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tverbCand = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.dep().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.dep().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\tString subjCandPos = null;\n\t\t\t\tif (hds.predicateToSubject.containsKey(offsetVerbCand)){\n\t\t\t\t\t\n\t\t\t\t\tif (subjCand.matches(\".+?/.+?\")) { \n\t\t\t\t\t\telements = subjCand.split(\"/\");\n\t\t\t\t\t\tsubjCand = elements[0];\n\t\t\t\t\t\tsubjCandPos = elements[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tString del = hds.predicateToSubject.get(offsetVerbCand);\n\t\t\t\t\thds.predicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToPredicate.remove(del);\n\t\t\t\t\thds.normalPredicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToNormalPredicate.remove(del);\n//\t\t\t\t\tSystem.out.println(\"REMOVE RELPRO \" + verbCand + \"/\" + hds.offsetToLemma.get(del));\n\t\t\t\t\thds.predicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToPredicate.put( offsetSubjCand, offsetVerbCand);\n\t\t\t\t\thds.normalPredicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToNormalPredicate.put( offsetSubjCand, offsetVerbCand);\n//\t\t\t\t\tSystem.out.println(\"RELCLAUSE \" + subjCand + \"::\" + \":\" + verbCand);\n\t\t\t\t\thds.offsetToSubjectHead.put(offsetSubjCand,subjCand);\n\t\t\t\t\thds.SubjectHead.add(offsetSubjCand);\n\t\t\t\t\t\n\t\t\t\t\tif (subjCandPos != null && hds.pronTag.contains(subjCandPos)){\n\t\t\t\t\t\thds.PronominalSubject.add(offsetSubjCand);\n\t\t\t\t\t}\n\t\t\t\t}\n \t\n \t\n }\n \n else if (dirObjTag.contains(typedDependency.reln().toString())\n \t\t){\n \tstoreRelations(typedDependency, hds.predicateToObject, hds.ObjectToPredicate, hds);\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\t\n\t\t\t\tString objCand = typedDependency.dep().toString().toLowerCase();\n \tint beginObjCand = typedDependency.dep().beginPosition();\n \tint endObjCand = typedDependency.dep().endPosition();\n \tString offsetObjCand = \"\" + beginObjCand + \"-\" + endObjCand;\n \tString objCandPos;\n \tif (objCand.matches(\".+?/.+?\")) { \n\t\t\t\t\telements = objCand.split(\"/\");\n\t\t\t\t\tobjCand = elements[0];\n\t\t\t\t\tobjCandPos = elements[1];\n//\t\t\t\t\tSystem.out.println(\"PRON OBJ \" + objCandPos);\n\t\t\t\t\tif (pronTag.contains(objCandPos)){\n\t\t\t\t\thds.PronominalSubject.add(offsetObjCand);\n\t\t\t\t\t}\n\t\t\t\t\t}\n// \tSystem.out.println(\"DIROBJ STORE ONLY\");\n \t//told Obama\n \t//said IG metall boss Klaus Zwickel\n \t// problem: pointing DO\n \t//explains David Gems, pointing out the genetically manipulated species.\n \t if (language.equals(\"en\") \n \t\t\t\t\t\t&& !hds.normalPredicateToSubject.containsKey(offsetVerbCand)\n \t\t\t\t\t\t){\n// \t\t System.out.println(\"INVERSE SUBJ HACK ENGLISH PREDTOOBJ\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t }\n }\n //was reported to have said\n else if (infVerbTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.mainToInfinitiveVerb, hds.infinitiveToMainVerb, hds);\n// \tSystem.out.println(\"MAIN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n else if (aclauseTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.nounToInfinitiveVerb, hds.infinitiveVerbToNoun, hds);\n// \tSystem.out.println(\"NOUN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n \n \n\n\t\t\t}\n\t\t\t\n//\t\t\tSemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);\n//\t\t\tSystem.out.println(\"SEM-DEP \" + dependencies);\t\n\t\t}\n\t\t\n\n\t\tMap<Integer, edu.stanford.nlp.dcoref.CorefChain> corefChains = document.get(CorefChainAnnotation.class);\n\t\t \n\t\t if (corefChains == null) { return; }\n\t\t //SPCOPY\n\t\t for (Entry<Integer, edu.stanford.nlp.dcoref.CorefChain> entry: corefChains.entrySet()) {\n//\t\t System.out.println(\"Chain \" + entry.getKey() + \" \");\n\t\t \tint chain = entry.getKey();\n\t\t String repMenNer = null;\n\t\t String repMen = null;\n\t\t String offsetRepMenNer = null;\n\n\t\t List<IaiCorefAnnotation> listCorefAnnotation = new ArrayList<IaiCorefAnnotation>();\n\t\t \n\t\t for (CorefMention m : entry.getValue().getMentionsInTextualOrder()) {\n\t\t \tboolean corefMentionContainsNer = false;\n\t\t \tboolean repMenContainsNer = false;\n\n//\t\t \n\n\t\t\t\t// We need to subtract one since the indices count from 1 but the Lists start from 0\n\t\t \tList<CoreLabel> tokens = sentences.get(m.sentNum - 1).get(TokensAnnotation.class);\n\t\t // We subtract two for end: one for 0-based indexing, and one because we want last token of mention not one following.\n//\t\t System.out.println(\" \" + m + \", i.e., 0-based character offsets [\" + tokens.get(m.startIndex - 1).beginPosition() +\n//\t\t \", \" + tokens.get(m.endIndex - 2).endPosition() + \")\");\n\t\t \n\t\t int beginCoref = tokens.get(m.startIndex - 1).beginPosition();\n\t\t\t\t int endCoref = tokens.get(m.endIndex - 2).endPosition();\n\t\t\t\t String offsetCorefMention = \"\" + beginCoref + \"-\" + endCoref;\n\t\t\t\t String corefMention = m.mentionSpan;\n\n\t\t\t\t CorefMention RepresentativeMention = entry.getValue().getRepresentativeMention();\n\t\t\t\t repMen = RepresentativeMention.mentionSpan;\n\t\t\t\t List<CoreLabel> repMenTokens = sentences.get(RepresentativeMention.sentNum - 1).get(TokensAnnotation.class);\n//\t\t\t\t System.out.println(\"REPMEN ANNO \" + \"\\\"\" + repMen + \"\\\"\" + \" is representative mention\" +\n// \", i.e., 0-based character offsets [\" + repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition() +\n//\t\t \", \" + repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition() + \")\");\n\t\t\t\t int beginRepMen = repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition();\n\t\t\t\t int endRepMen = repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition();\n\t\t\t\t String offsetRepMen = \"\" + beginRepMen + \"-\" + endRepMen;\n\t\t \t \n\t\t\t\t//Determine repMenNer that consists of largest NER (Merkel) to (Angela Merkel)\n\t\t\t\t //and \"Chancellor \"Angela Merkel\" to \"Angela Merkel\"\n\t\t \t //Further reduction to NER as in \"Chancellor Angela Merkel\" to \"Angela Merkel\" is\n\t\t\t\t //done in determineBestSubject. There, Chunk information and subjectHead info is available.\n\t\t\t\t //Chunk info and subjectHead info is used to distinguish \"Chancellor Angela Merkel\" to \"Angela Merkel\"\n\t\t\t\t //from \"The enemies of Angela Merkel\" which is not reduced to \"Angela Merkel\"\n\t\t\t\t //Problem solved: The corefMentions of a particular chain do not necessarily have the same RepMenNer (RepMen) \n\t\t\t\t // any more: Chancellor Angela Merkel repMenNer Chancellor Angela Merkel , then Angela Merkel has RepMenNer Angela Merkel\n\t\t\t\t if (offsetRepMenNer != null && hds.Ner.contains(offsetRepMenNer)){\n//\t\t\t\t\t System.out.println(\"NEWNer.contains(offsetRepMenNer)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetRepMen != null && hds.Ner.contains(offsetRepMen)){\n\t\t\t\t\t repMenNer = repMen;\n\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\tSystem.out.println(\"NEWNer.contains(offsetRepMen)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetCorefMention != null && hds.Ner.contains(offsetCorefMention)){\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"Ner.contains(offsetCorefMention)\");\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t corefMentionContainsNer = offsetsContainAnnotation(offsetCorefMention,hds.Ner);\n\t\t\t\t\t repMenContainsNer = offsetsContainAnnotation(offsetRepMen,hds.Ner);\n//\t\t\t\t\t System.out.println(\"ELSE Ner.contains(offsetCorefMention)\");\n\t\t\t\t }\n\t\t\t\t //Determine repMenNer that contains NER\n\t\t\t\t\tif (repMenNer == null){\n\t\t\t\t\t\tif (corefMentionContainsNer){\n\t\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT1\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (repMenContainsNer){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//no NER:\n\t\t\t\t\t\t//Pronoun -> repMen is repMenNer\n\t\t\t\t\t\telse if (hds.PronominalSubject.contains(offsetCorefMention) && repMen != null){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT3\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//other no NER: corefMention is repMenNer because it is closer to original\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"DEFAULT4\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t \n \t IaiCorefAnnotation corefAnnotation = new IaiCorefAnnotation(aJCas);\n\t\t\t\n\t\t\t\t\t\n\n\n\t\t\t\t\tcorefAnnotation.setBegin(beginCoref);\n\t\t\t\t\tcorefAnnotation.setEnd(endCoref);\n\t\t\t\t\tcorefAnnotation.setCorefMention(corefMention);\n\t\t\t\t\tcorefAnnotation.setCorefChain(chain);\n\t\t\t\t\t//done below\n//\t\t\t\t\tcorefAnnotation.setRepresentativeMention(repMenNer);\n//\t\t\t\t\tcorefAnnotation.addToIndexes(); \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlistCorefAnnotation.add(corefAnnotation);\n\t\t\t\t\t\n//\t\t\t\t\tdone below:\n//\t\t\t\t\t offsetToRepMen.put(offsetCorefMention, repMenNer);\n//\t\t\t\t\t RepMen.add(offsetCorefMention);\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t }//end coref mention\n//\t\t System.out.println(\"END Chain \" + chain );\n//\t\t System.out.println(listCorefAnnotation.size());\n\t\t String offsetCorefMention = null;\n\t\t for (int i = 0; i < listCorefAnnotation.size(); i++) {\n\t\t \tIaiCorefAnnotation corefAnnotation = listCorefAnnotation.get(i);\n\t\t \tcorefAnnotation.setRepresentativeMention(repMenNer);\n\t\t \tcorefAnnotation.addToIndexes();\n\t\t \toffsetCorefMention = \"\" + corefAnnotation.getBegin() + \"-\" + corefAnnotation.getEnd();\n\t\t\t\t\thds.offsetToRepMen.put(offsetCorefMention, repMenNer);\n\t\t\t\t\thds.RepMen.add(offsetCorefMention);\n\t\t\t\t\t//COREF\n//\t\t\t\t\tSystem.out.println(\"Chain \" + corefAnnotation.getCorefChain());\n//\t\t\t\t\tSystem.out.println(\"corefMention \" + corefAnnotation.getCorefMention() + offsetCorefMention);\n//\t\t\t\t\tSystem.out.println(\"repMenNer \" + repMenNer);\n\t\t }\n\t\t } //end chains\n\n\n//\t\t System.out.println(\"NOW quote finder\");\n\n\n\t\t\n\t\t///* quote finder: begin find quote relation and quotee\n\t\t// direct quotes\n\t\t\n\t\t\n\t\tString quotee_left = null;\n\t\tString quotee_right = null; \n\t\t\n\t\tString representative_quotee_left = null;\n\t\tString representative_quotee_right = null; \n\t\t\n\t\tString quote_relation_left = null;\n\t\tString quote_relation_right = null;\n\t\t\n\t\tString quoteType = null;\n\t\tint quoteeReliability = 5;\n\t\tint quoteeReliability_left = 5;\n\t\tint quoteeReliability_right = 5;\n\t\tint quotee_end = -5;\n\t\tint quotee_begin = -5;\n\t\t\n\t\tboolean quoteeBeforeQuote = false;\n\n\n\t\n\t\t\n\t\t// these are all the quotes in this document\n\t\tList<CoreMap> quotes = document.get(QuotationsAnnotation.class);\n\t\tfor (CoreMap quote : quotes) {\n\t\t\tif (quote.get(TokensAnnotation.class).size() > 5) {\n\t\t\t\tQuoteAnnotation annotation = new QuoteAnnotation(aJCas);\n\n\t\t\t\tint beginQuote = quote.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endQuote = quote.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(quote.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tannotation.setBegin(beginQuote);\n\t\t\t\tannotation.setEnd(endQuote);\n\t\t\t\tannotation.addToIndexes();\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\tList<Q> newQuotes = document.get(QuotationsAnnotation.class);\t\t\n//\t\tfor (CoreMap annotation : newQuotes) {\n//\t\t\t\tif (1==1){\n//\t\t\t\tRe-initialize markup variables since they are also used for indirect quotes\n\t\t\t\tquotee_left = null;\n\t\t\t\tquotee_right = null; \n\t\t\t\t\n\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\n\t\t\t\tquote_relation_left = null;\n\t\t\t\tquote_relation_right = null;\n\t\t\t\tquoteeReliability = 5;\n\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\tquotee_end = -5;\n\t\t\t\tquotee_begin = -5;\n\t\t\t\tquoteType = \"direct\";\n\t\t\t\tquoteeBeforeQuote = false;\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> directQuoteTokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tToken.class, annotation);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n\t\t\t\t\n \n//\t\t\t\tfor (Token aFollowToken: followTokens){\n//\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\tChunk.class, aFollowToken);\n \n//direct quote quotee right:\n\t\t\t\t\n\t for (Token aFollow2Token: followTokens){\n\t\t\t\t\t List<SentenceAnnotation> sentencesFollowQuote = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t SentenceAnnotation.class, aFollow2Token);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t for (SentenceAnnotation sentenceFollowsQuote: sentencesFollowQuote){\n\t\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tChunk.class, sentenceFollowsQuote);\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT\");\n\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"RIGHT\", \n\t\t\t\t\tchunks, hds, annotation);\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_right = quote_annotation_result[0];\n\t\t\t representative_quotee_right = quote_annotation_result[1];\n\t\t\t quote_relation_right = quote_annotation_result[2];\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_right = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t //Will Throw exception!\n\t\t\t //do something! anything to handle the exception.\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_right = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT RESULT quotee \" + quotee_right + \" representative_quotee \" + representative_quotee_right\n//\t\t\t\t\t+ \" quote_relation \" + quote_relation_right);\n\t\t \n\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> precedingTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n for (Token aPrecedingToken: precedingTokens){ \n \t\n \tif (directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString()) \n \t\t\t|| compLemma.contains(aPrecedingToken.getLemma().getValue().toString())) {\n// \t\tSystem.out.println(\"Hello, World lemma found\" + aPrecedingToken.getLemma().getValue());\n \t\tquoteeBeforeQuote = true;\n \t}\n \t\tList <NamedEntity> namedEntities = null;\n \t\tList <Token> tokens = null;\n \t\tList<Chunk> chunks = null;\n \t\t\n\t\t\t\t List<Sentence> precedingSentences = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken, 1);\n\t\t\t\t \n\t\t\t\t\t\tif (precedingSentences.isEmpty()){\n\t\t\t\t\t\t\tList<Sentence> firstSentence;\n\t\t\t\t \tfirstSentence = JCasUtil.selectCovering(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken);\n\n\t\t\t\t \tfor (Sentence aSentence: firstSentence){\n\t\t\t\t \t\t\n\n\t\t\t\t\t\t\t\tchunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\tChunk.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t \t\tnamedEntities = JCasUtil.selectCovered(aJCas,\n\t \t \t\tNamedEntity.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\ttokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\n\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t else {\t\n\t\t\t\t \tfor (Sentence aSentence: precedingSentences){\n//\t\t\t\t \t\tSystem.out.println(\"Hello, World sentence\" + aSentence);\n\t\t\t\t \t\tchunks = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tChunk.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\tnamedEntities = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tNamedEntity.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\ttokens = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence, aPrecedingToken);\n\t\t\t\t \t}\n\t\t\t\t }\n \t\n//\t\t\t\t \n//\t\t\t\t\t\tSystem.out.println(\"DIRECT QUOTE LEFT\");\n\t\t\t\t\t\tString[] quote_annotation_direct_left = determine_quotee_and_quote_relation(\"LEFT\", chunks,\n\t\t\t\t\t\t\t\t hds, annotation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t );\n//\t\t\t\t\t\tSystem.out.println(\"QUOTE ANNOTATION \" + quote_annotation_direct_left.length);\t\t\n\t\tif (quote_annotation_direct_left.length>=4){\n//\t\t\tSystem.out.println(\"QUOTE ANNOTATION UPDATE \" + quote_annotation_direct_left[0] +\n//\t\t\t\t\t\" \" + quote_annotation_direct_left[1] + \" \" +\n//\t\t\t\t\tquote_annotation_direct_left[2]);\n\t\t quotee_left = quote_annotation_direct_left[0];\n\t\t representative_quotee_left = quote_annotation_direct_left[1];\n\t\t quote_relation_left = quote_annotation_direct_left[2];\n\t\t try {\n\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t} catch (NumberFormatException e) {\n\t\t //Will Throw exception!\n\t\t //do something! anything to handle the exception.\n\t\t\tquoteeReliability = -5;\n\t\t\tquoteeReliability_left = -5;\n\t\t\t}\t\t\t\t\t \n\t\t }\n//\t\tSystem.out.println(\"DIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t+ \" quote_relation \" + quote_relation_left);\n\t\t//no subject - predicate quotee quote_relation, quote introduced with colon: \n\t\tif (quotee_left == null && quote_relation_left == null && representative_quotee_left == null \n\t\t&& directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString())){\n//\t\t\tSystem.out.println(\"NER DIRECT QUOTE LEFT COLON\");\n\t\t\tString quoteeCandOffset = null; \n\t\t\tString quoteeCandText = null;\n\t\t if (namedEntities.size() == 1){\n \t \tfor (NamedEntity ne : namedEntities){\n// \t \t\tSystem.out.println(\"ONE NER \" + ne.getCoveredText());\n \t \t\tquoteeCandText = ne.getCoveredText();\n\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\tquotee_end = ne.getEnd();\n\t\t\t\t\tquotee_begin = ne.getBegin();\n\t\t\t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n\t\t\t\t\tquoteeReliability = 1;\n\t\t\t\t\tquoteeReliability_left = 1;\n \t }\n \t }\n \t else if (namedEntities.size() > 1) {\n \t \tint count = 0;\n \t \tString quotee_cand = null;\n// \t \tSystem.out.println(\"Hello, World ELSE SEVERAL NER\");\n \t \tfor (NamedEntity ner : namedEntities){\n// \t \t\tSystem.out.println(\"Hello, World NER TYPE\" + ner.getValue());\n \t \t\tif (ner.getValue().equals(\"PERSON\")){\n \t \t\t\tcount = count + 1;\n \t \t\t\tquotee_cand = ner.getCoveredText();\n \t \t\t\tquotee_end = ner.getEnd();\n \t \t\t\tquotee_begin = ner.getBegin();\n \t \t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n \t \t\t\t\n// \t \t\t\tSystem.out.println(\"Hello, World FOUND PERSON\" + quotee_cand);\n \t \t\t}\n \t \t}\n \t \tif (count == 1){ // there is exactly one NER.PERSON\n// \t \t\tSystem.out.println(\"ONE PERSON, SEVERAL NER \" + quotee_cand);\n \t \t\t\tquoteeCandText = quotee_cand;\n\t\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\t\tquoteeReliability = 3;\n\t\t\t\t\t\tquoteeReliability_left = 3;\n \t \t}\n \t }\n\t\t if(quoteeCandOffset != null && quoteeCandText != null ){\n//\t\t \t quotee_left = quoteeCandText;\n\t\t \t String result [] = determineBestRepMenSubject(\n\t\t \t\t\t quoteeCandOffset,quoteeCandOffset, quoteeCandText, hds);\n\t\t \t if (result.length>=2){\n\t\t \t\t quotee_left = result [0];\n\t\t \t\t representative_quotee_left = result [1];\n//\t\t \t System.out.println(\"RESULT2 NER quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left);\n\t\t \t }\n\t\t }\n\t\t}\n }\n\t\t\n \n\n\t\t\t\t\n\t\t\t\tif (quotee_left != null && quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"TWO QUOTEES\");\n\t\t\t\t\t\n\t\t\t\t\tif (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\") \n\t\t\t\t\t\t|| \tdirectQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t|| directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"PUNCT \" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\",\")){\n//\t\t\t\t\t\tSystem.out.println(\"COMMA \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse if (!directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\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\tSystem.out.println(\"NO PUNCT \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n//\t\t\t\t\t\tSystem.out.println(\"UNCLEAR LEFT RIGHT \" + quotee_left + quote_relation_left + quote + quotee_right + quote_relation_right);\n\t\t\t\t\tannotation.setQuotee(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteRelation(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (quoteeBeforeQuote == true){\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_left != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE LEFT\" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE RIGHT FOUND\" + quotee_right + \" QUOTE RELATION \" + quote_relation_right + \":\" + quoteeReliability_right);\n\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_left != null ){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"NO QUOTEE FOUND\" + quote + quote_relation_left + quote_relation_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_right != null){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t}\n\t\t\t\telse if (quoteType != null){\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"Hello, World NO QUOTEE and NO QUOTE RELATION FOUND\" + quote);\n\t\t\t\t}\n\t\t\t\tif (annotation.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\tSystem.out.println(\"NOW!!\" + annotation.getRepresentativeQuoteeMention());\n\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(annotation.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\tannotation.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(annotation.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\tSystem.out.println(\"DBPRED FOUND\" + annotation.getRepresentativeQuoteeMention() + \" URI: \" + annotation.getQuoteeDBpediaUri());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} //for direct quote\n\t\t\n\t\t// annotate indirect quotes: opinion verb + 'that' ... until end of sentence: said that ...\n\n//\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class); //already instantiated above\nINDIRECTQUOTE:\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tif (sentence.get(TokensAnnotation.class).size() > 5) { \n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n//\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t \tint indirectQuoteBegin = -5;\n\t\t\t\tint indirectQuoteEnd = -5;\n\t\t\t\tboolean subsequentDirectQuoteInstance = false;\n\t\t\t\t\n\t\t\t\tList<Chunk> chunksIQ = JCasUtil.selectCovered(aJCas,\n\t\t\t\tChunk.class, sentenceAnn);\n\t\t\t\tList<Chunk> chunksBeforeIndirectQuote = null;\n\t\t\t\t\n\t\t\t\tint index = 0;\nINDIRECTCHUNK:\tfor (Chunk aChunk : chunksIQ) {\n\t\t\t\t\tindex++;\n\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE CHUNK VALUE \" + aChunk.getChunkValue().toString());\n//\t\t\t\t\tif (aChunk.getChunkValue().equals(\"SBAR\")) {\n\t\t\t\t\tif(indirectQuoteIntroChunkValue.contains(aChunk.getChunkValue())){\n//\t\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE INDEX \" + \"\" + index);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Token> tokensSbar = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tToken.class, aChunk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (Token aTokenSbar : tokensSbar){\n//\t\t\t\t\t\t\tString that = \"that\";\n\t\t\t\t\t\t\tif (compLemma.contains(aTokenSbar.getLemma().getCoveredText())){\n\t\t\t\t\t\t// VP test: does that clause contain VP?\n//\t\t\t\t\t\t\t\tSystem.out.println(\"TOK1\" + aTokenSbar.getLemma().getCoveredText());\n//\t\t\t \tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\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\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\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\t//NEW\n//\t\t\t\t\t\t\t\tif (LANGUAGE == \"en\")\n\t\t\t\t\t\t\t\tList<Token> precedingSbarTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\t\t\t\t\tToken.class, aChunk, 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Token aPrecedingSbarToken: precedingSbarTokens){ \n//\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOK2\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \tif (coordLemma.contains(aPrecedingSbarToken.getLemma().getValue().toString())){\n//\t\t\t\t \t\tSystem.out.println(\"TOKK\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t \t\tint k = 0;\n\t\t\t\t \tSAY:\tfor (Chunk chunkBeforeAndThat : chunksBeforeIndirectQuote){\n//\t\t\t\t \t\t\txxxx\n\t\t\t\t \t\tk++;\n\t\t\t\t \t\t\tif (chunkBeforeAndThat.getChunkValue().equals(\"VP\")){\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\tList<Token> tokensInVp = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tToken.class, chunkBeforeAndThat);\n\t\t\t\t\t\t\t\t\t\t\t\tfor (Token aTokenInVp : tokensInVp){\n//\t\t\t\t\t\t\t\t\t\t\t\t\tString and;\n//\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOKK\" + aTokenInVp.getLemma().getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (aTokenInVp.getLemma().getValue().equals(\"say\")){\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY OLD\" + indirectQuoteBegin + \":\" + sentenceAnn.getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, k);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindirectQuoteBegin = chunksBeforeIndirectQuote.get(chunksBeforeIndirectQuote.size()-1).getEnd()+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY NEW\" + indirectQuoteBegin + \":\" );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak SAY;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\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\t\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\t}\n\t\t\t\t \t\t\n\t\t\t\t \t}\n\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\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\t\t\n//\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\t\n\t\t\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuoteChunk = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class, aChunk);\n\t\t\t\t\t\t\t\tif (coveringDirectQuoteChunk.isEmpty()){\n//\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t indirectQuote.setBegin(indirectQuoteBegin);\n//\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t indirectQuoteEnd = sentenceAnn.getEnd();\n\t\t\t\t\t\t\t\t indirectQuote.setEnd(indirectQuoteEnd);\n\t\t\t\t\t\t\t\t indirectQuote.addToIndexes();\n\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = false;\n//\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FALSE\");\n\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\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t List<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tToken.class, indirectQuote, 1);\n\t\t\t\t\t\t\t\t for (Token aFollow3Token: followTokens){\n\t\t\t\t\t\t\t\t\t List<QuoteAnnotation> subsequentDirectQuotes = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class,aFollow3Token);\n\t\t\t\t\t\t\t\t\t if (!subsequentDirectQuotes.isEmpty()){\n\t\t\t\t\t\t\t\t\t\t for (QuoteAnnotation subsequentDirectQuote: subsequentDirectQuotes){\n\t\t\t\t\t\t\t\t\t\t\t if (subsequentDirectQuote.getRepresentativeQuoteeMention() != null\n\t\t\t\t\t\t\t\t\t\t\t\t && subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")){\n//\t\t\t\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FOUND\"); \n\t\t\t\t\t\t\t\t\t\t\t hds.subsequentDirectQuote = subsequentDirectQuote;\n\t\t\t\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = true;\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }\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\t \n\t\t\t\t\t\t\t\t break INDIRECTCHUNK;\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}\n\t\t\t\t\tif (indirectQuoteBegin >= 0 && indirectQuoteEnd >= 0){\n//\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuote = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n//\t\t\t\t\t\tif (coveringDirectQuote.isEmpty()){\n////\t\t\t\t\t\t\t\n//\t\t\t\t\t\tindirectQuote.addToIndexes();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//indirect quote is covered by direct quote and therefore discarded\n//\t\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n//\t\t\t\t\t\t}\n\t\t\t\t\tList<QuoteAnnotation> coveredDirectQuotes = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n\t\t\t\t\tfor (QuoteAnnotation coveredDirectQuote : coveredDirectQuotes){\n//\t\t\t\t\t\tSystem.out.println(\"Hello, World covered direct quote\" + coveredDirectQuote.getCoveredText());\n\t\t\t\t\t\t//delete coveredDirectQuoteIndex\n\t\t\t\t\t\tcoveredDirectQuote.removeFromIndexes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//no indirect quote in sentence\n\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n\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\tRe-initialize markup variables since they are also used for direct quotes\n\t\t\t\t\t\tquotee_left = null;\n\t\t\t\t\t\tquotee_right = null; \n\t\t\t\t\t\t\n\t\t\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquote_relation_left = null;\n\t\t\t\t\t\tquote_relation_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquoteType = \"indirect\";\n\t\t\t\t\t\tquoteeReliability = 5;\n\t\t\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\t\t\tquotee_end = -5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\tif (chunksBeforeIndirectQuote != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"chunksBeforeIndirectQuote FOUND!! \");\n\t\t\t\t\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"LEFT\", chunksBeforeIndirectQuote,\n\t\t\t\t\t\t\t\t\t hds, indirectQuote\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_left = quote_annotation_result[0];\n\t\t\t representative_quotee_left = quote_annotation_result[1];\n\t\t\t quote_relation_left = quote_annotation_result[2];\n//\t\t\t System.out.println(\"INDIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t\t + \" QUOTE RELATION \" + quote_relation_left);\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_left = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n\t\t\t\n\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\tif (quotee_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t\tindirectQuote.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\t\tindirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//indirect quote followed by direct quote:\n\t\t\t\t\t\t\t//the quotee and quote relation of the indirect quote are copied to the direct quote \n\t\t\t\t\t\t\t//Genetic researcher Otmar Wiestler hopes that the government's strict controls on genetic research \n\t\t\t\t\t\t\t//will be relaxed with the advent of the new ethics commission. \n\t\t\t\t\t\t\t//\"For one thing the government urgently needs advice, because of course it's such an extremely \n\t\t\t\t\t\t\t//complex field. And one of the reasons Chancellor Schröder formed this new commission was without \n\t\t\t\t\t\t\t//a doubt to create his own group of advisors.\"\n\n\t\t\t\t\t\t\tif (subsequentDirectQuoteInstance == true\n\t\t\t\t\t\t\t\t&&\thds.subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuotee().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuoteRelation().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t\t){\n//\t\t\t\t\t\t\t\tSystem.out.println(\"SUBSEQUENT UNCLEAR DIR QUOTE FOUND!!\"); \n\t\t\t\t\t\t\t\tint begin = hds.subsequentDirectQuote.getBegin();\n\t\t\t\t\t\t\t\tint end = hds.subsequentDirectQuote.getEnd();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteType(\"direct\");\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteeReliability(quoteeReliability_left + 2);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.addToIndexes();\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\t\t\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE \" + quotee_left + quote_relation_left + quoteeReliability);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (quote_relation_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if (quoteType != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE NOT FOUND\" + quote_relation_left);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (indirectQuote.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"NOW!!\" + indirectQuote.getRepresentativeQuoteeMention());\n\t\t\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(indirectQuote.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\t\t\tindirectQuote.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\t\t\tSystem.out.println(\"DBPEDIA \" + indirectQuote.getRepresentativeQuoteeMention() + \" URI: \" + hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\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\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t }\n//\t\t\t} //for chunk\n//\t\t\t\tsay without that\n//\t\t\t}\t\t\n\t\t} //Core map sentences indirect quotes\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public int parseAdditionalConfig(List<String> lines, int line_i) {\n RTGraphComponent mycomp = (RTGraphComponent) getRTComponent();\n // Parse the extents\n if (lines.get(line_i).startsWith(\"#AC extents|\")) {\n StringTokenizer st = new StringTokenizer(lines.get(line_i++),\"|\");\n st.nextToken();\n extents = new Rectangle2D.Double(Double.parseDouble(st.nextToken()),\n Double.parseDouble(st.nextToken()),\n\t\t\t\t Double.parseDouble(st.nextToken()),\n\t\t\t\t Double.parseDouble(st.nextToken()));\n }\n // Parse the retained nodes\n if (lines.get(line_i).startsWith(\"#AC retain|\")) {\n StringTokenizer st = new StringTokenizer(lines.get(line_i++),\"|\"); st.nextToken();\n Set<String> new_retained_nodes = new HashSet<String>();\n while (st.hasMoreTokens()) new_retained_nodes.add(Utils.decFmURL(st.nextToken()));\n if (retained_nodes != null) {\n retained_nodes.clear();\n retained_nodes.addAll(new_retained_nodes);\n } else retained_nodes = new_retained_nodes;\n }\n // Parse the sticky labels\n if (lines.get(line_i).startsWith(\"#AC sticky|\")) {\n StringTokenizer st = new StringTokenizer(lines.get(line_i++),\"|\"); st.nextToken();\n Set<String> new_sticky_labels = new HashSet<String>();\n while (st.hasMoreTokens()) new_sticky_labels.add(Utils.decFmURL(st.nextToken()));\n if (mycomp.sticky_labels != null) {\n mycomp.sticky_labels.clear();\n mycomp.sticky_labels.addAll(new_sticky_labels);\n } else mycomp.sticky_labels = new_sticky_labels;\n }\n // Parse the coordinates\n while (lines.get(line_i).startsWith(\"#AC wxy|\")) {\n StringTokenizer st = new StringTokenizer(lines.get(line_i++),\"|\"); st.nextToken();\n String entity = Utils.decFmURL(st.nextToken());\n double x = Double.parseDouble(st.nextToken()),\n y = Double.parseDouble(st.nextToken());\n entity_to_wxy.put(entity, new Point2D.Double(x,y));\n }\n if (lines.get(line_i).equals(\"#AC graphend\")) line_i++;\n else throw new RuntimeException(\"Incorrect Ending For LinkNode Parser \\\"\" + lines.get(line_i) + \"\\\"\");\n\n // Apply the settings\n newBundlesRoot(getRTParent().getRootBundles());\n transform();\n return line_i;\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 readRecord() {\n\t\ttry {\n\t\t\tScanner scan = new Scanner(recordFile);\n\t\t\tString temp = \"\";\n\t\t\tboolean foundAddress = false;\n\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\tString member = scan.nextLine();\n\t\t\t\tScanner sc = new Scanner(member);\n\t\t\t\tString keyword, param;\n\t\t\t\tif(sc.hasNext()) {\n\t\t\t\t\tkeyword = sc.next();\n\t\t\t\t\t\n\t\t\t\t\tif(keyword.equalsIgnoreCase(\"address\")) {\n\t\t\t\t\t\tfoundAddress = true;\n\t\t\t\t\t\tif(sc.hasNextLine()) {\n\t\t\t\t\t\t\tparam = sc.nextLine();\n\t\t\t\t\t\t\ttemp = temp + \"; \" + keyword.toLowerCase() + \" \" + param;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if(keyword.equalsIgnoreCase(\"name\")\n\t\t\t\t\t\t\t|| keyword.equalsIgnoreCase(\"birthday\")\n\t\t\t\t\t\t\t|| keyword.equalsIgnoreCase(\"postcode\")\n\t\t\t\t\t\t\t|| keyword.equalsIgnoreCase(\"phone\")\n\t\t\t\t\t\t\t|| keyword.equalsIgnoreCase(\"recipient\")\n\t\t\t\t\t\t\t|| keyword.equalsIgnoreCase(\"donation\")) {\n\t\t\t\t\t\tfoundAddress = false;\n\t\t\t\t\t\tif(sc.hasNextLine()) {\n\t\t\t\t\t\t\tparam = sc.nextLine();\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttemp = temp + \"; \" + keyword.toLowerCase() + \" \" + param;\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// if found extended address in a new line\n\t\t\t\t\tif(!keyword.equalsIgnoreCase(\"address\") \n\t\t\t\t\t\t\t&& !keyword.equalsIgnoreCase(\"name\")\n\t\t\t\t\t\t\t&& !keyword.equalsIgnoreCase(\"birthday\")\n\t\t\t\t\t\t\t&& !keyword.equalsIgnoreCase(\"postcode\")\n\t\t\t\t\t\t\t&& !keyword.equalsIgnoreCase(\"phone\")\n\t\t\t\t\t\t\t&& !keyword.equalsIgnoreCase(\"recipient\")\n\t\t\t\t\t\t\t&& !keyword.equalsIgnoreCase(\"donation\")\n\t\t\t\t\t\t\t&& foundAddress) {\n\t\t\t\t\t\ttemp = temp + \" \" + keyword;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(member.equals(\"\") || !scan.hasNextLine()) {\n\t\t\t\t\trecord.addDonator(temp);\n\t\t\t\t\ttemp = \"\";\n\t\t\t\t}\n\t\t\t\tsc.close();\n\t\t\t} \n\t\t\tscan.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Transactional\r\n\tprotected void processFormdetails(FormDescriptor form, String xmlPathName, int currFormIdx) {\r\n\t\tlogger.debug(\"Processing protocols, designations, refdocs and definitions for form\");\r\n\t\t\r\n\t\tList<ProtocolTransferObjectExt> protos = form.getProtocols();\r\n\t\tprocessProtocols(form, protos);\r\n\t\t\r\n\t\tList<DesignationTransferObjectExt> designations = form.getDesignations();\r\n\t\tprocessDesignations(form, designations);\r\n\t\t\r\n\t\tList<RefdocTransferObjectExt> refdocs = form.getRefdocs();\r\n\t\tprocessRefdocs(form, refdocs);\r\n\t\t\r\n\t\tList<DefinitionTransferObjectExt> definitions = form.getDefinitions();\r\n\t\tprocessDefinitions(form, definitions);\r\n\t\t\r\n\t\tprocessContactCommnunications(form);\r\n\t\t\r\n\t\tprocessClassifications(form);\r\n\t\t\r\n\t\tlogger.debug(\"Done processing protocols, designations, refdocs and definitions for form\");\r\n\t}", "public static ParsedData arffFileReader(File file) throws Exception {\n\n ParsedData data;\n String line = null;\n BufferedReader br = new BufferedReader(new FileReader(file));\n\n ArrayList<Attribute> attributes = new ArrayList<>();\n boolean attributeTest = true;\n int attributeNumber = 0;\n ArrayList<String> datasetList = new ArrayList<>();\n String relName = \"\";\n\n int rows = 0;\n int columns = 0;\n\n while ((line = br.readLine()) != null) {\n\n line = line.trim();\n\n if (attributeTest) {\n if(line.startsWith(\"@relation\")){\n relName = line.split(\" \")[1];\n }\n\n if (line.startsWith(\"@attribute\")) {\n attributes.add(parseAttribute(line, attributeNumber));\n attributeNumber++;\n }\n } else {\n String[] instance = parseInstance(line);\n if(instance.length != attributes.size()) {\n System.out.println(\"Skip illegal line: \" + Utils.concatStringArray(instance));\n continue;\n }\n for (int i = 0; i < instance.length; i++) {\n datasetList.add(instance[i]);\n }\n rows++;\n }\n if (line.startsWith(\"@data\")) {\n attributeTest = false;\n }\n\n }\n columns = attributes.size();\n\n String[] datasetArray = new String[datasetList.size()];\n for (int i = 0; i < datasetList.size(); i++) {\n datasetArray[i] = datasetList.get(i);\n }\n\n DataSet dataset = new DataSet(datasetArray, rows, columns);\n data = new ParsedData(dataset, attributes, relName);\n return data;\n\n }", "private static List<AggregatedBodyPart> parse(String boundary, byte[] data) {\n return parse(boundary, ImmutableList.of(data));\n }", "protected void parseLine(String dataLine) {\n String[] line = dataLine.split(\",\");\n if (validater(line)) {\n try {\n Route route =\n new Route(\n line[airline],\n Integer.parseInt(line[airlineID]),\n line[sourceAirport],\n Integer.parseInt(line[sourceAirportID]),\n line[destinationAirport],\n Integer.parseInt(line[destinationAirportID]),\n line[codeshare],\n Integer.parseInt(line[stops]),\n line[equipment].split(\" \"));\n addRoute(route);\n } catch (Exception e) {\n errorCounter(11);\n }\n }\n }", "protected abstract DataTypes[] processLine(MutableCharArrayString line);", "public void parse(){\r\n\t\t//StringTokenizer st = new StringTokenizer(nmeaSentence,\",\");\r\n\t\tst = new StringTokenizer(nmeaSentence,\",\");\r\n\t\tString sv = \"\";\r\n\r\n\t\ttry{\r\n\t\t\tnmeaHeader = st.nextToken();//Global Positioning System Fix Data\r\n\t\t\tmode = st.nextToken();\r\n\t\t\tmodeValue = Integer.parseInt(st.nextToken());\r\n\r\n\t\t\tfor(int i=0;i<=11;i++){\r\n\t\t\t\tsv = st.nextToken();\r\n\t\t\t\tif(sv.length() > 0){\r\n\t\t\t\t\tSV[i] = Integer.parseInt(sv);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSV[i] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tPDOP = Float.parseFloat(st.nextToken());\r\n\t\t\tHDOP = Float.parseFloat(st.nextToken());\r\n\t\t\tVDOP = Float.parseFloat(st.nextToken());\r\n\r\n\t\t}catch(NoSuchElementException e){\r\n\t\t\t//Empty\r\n\t\t}catch(NumberFormatException e2){\r\n\t\t\t//Empty\r\n\t\t}\r\n\r\n\t}", "private void parseQuestions()\n\t{\n\t\tlog.info(\"Parsing questions\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Element> questions_list = doc.selectNodes(\"//document/questions/rows/row\");\n\t\tq_l10ns_node = doc.selectSingleNode(\"//document/question_l10ns/rows\");\n\t\tsq_node = doc.selectSingleNode(\"//document/subquestions/rows\");\n\t\tq_node = doc.selectSingleNode(\"//document/questions/rows\");\n\t\ta_node = doc.selectSingleNode(\"//document/answers/rows\");\n\n\t\tfor (Element question : questions_list) {\n\t\t\tString qid = question.element(\"qid\").getText();\n\t\t\tlog.debug(\"Working on question: \" + qid);\n\t\t\tQuestion q = new Question(qid,\n\t\t\t\t\t\t\t\t\t Integer.parseInt(question.element(\"gid\").getText()),\n\t\t\t\t\t\t\t\t\t question.element(\"type\").getText(),\n\t\t\t\t\t\t\t\t\t q_l10ns_node.selectSingleNode(\"row[qid=\" + qid + \"]/question\").getText(),\n\t\t\t\t\t\t\t\t\t question.element(\"title\").getText(),\n\t\t\t\t\t\t\t\t\t question.element(\"mandatory\").getText().equals(\"N\") ? \"No\" : \"Yes\",\n\t\t\t\t\t\t\t\t\t q_l10ns_node.selectSingleNode(\"row[qid=\" + qid + \"]/language\").getText());\n\n\t\t\t// Add a description, if there is one\n\t\t\tNode desc = q_l10ns_node.selectSingleNode(\"row[qid=\" + q.getQid() + \"]/help\");\n\t\t\tif (desc != null) {\n\t\t\t\tq.setDescription(desc.getText());\n\t\t\t}\n\n\t\t\taddCondition(q);\n\n\t\t\tswitch (q.type) {\n\t\t\t\t// Normal Text Fields\n\t\t\t\tcase \"S\":\n\t\t\t\tcase \"T\":\n\t\t\t\tcase \"U\":\n\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Date/Time\n\t\t\t\tcase \"D\":\n\t\t\t\t\tdate_time_qids.add(q.getQid());\n\t\t\t\t\tbreak;\n\t\t\t\t// Numeric Input\n\t\t\t\tcase \"N\":\n\t\t\t\t\tif (check_int_only(q)) {\n\t\t\t\t\t\tq.setType(\"I\");\n\t\t\t\t\t}\n\t\t\t\t\tadd_range(q);\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Single 5-Point Choice\n\t\t\t\tcase \"5\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"5pt.cl\", ClGenerator.getIntCl(5), \"string\", true));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Yes/No\n\t\t\t\tcase \"Y\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"YN.cl\", ClGenerator.getYNCl(), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Gender\n\t\t\t\tcase \"G\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"Gender.cl\", ClGenerator.getGenderCl(), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// List with comment\n\t\t\t\tcase \"O\":\n\t\t\t\t\taddComment(q);\n\t\t\t\t// Radio List\n\t\t\t\tcase \"L\":\n\t\t\t\t// Dropdown List\n\t\t\t\tcase \"!\":\n\t\t\t\t\tboolean oth = question.elementText(\"other\").equals(\"Y\");\n\t\t\t\t\tif(oth) {\n\t\t\t\t\t\taddOtherQuestion(q);\n\t\t\t\t\t}\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(q.getQid() + \".cl\", getAnswerCodesByID(q.getQid(), oth), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Texts\n\t\t\t\t// Input On Demand\n\t\t\t\tcase \"Q\":\n\t\t\t\t\taddSubquestions(q, \"T\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Numeric Inputs\n\t\t\t\tcase \"K\":\n\t\t\t\t\tadd_range(q);\n\t\t\t\t\tif (check_int_only(q)){\n\t\t\t\t\t\taddSubquestions(q, \"I\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddSubquestions(q, \"N\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Dual scale array\n\t\t\t\tcase \"1\":\n\t\t\t\t\tHashMap<String, String>[] code_lists = ClGenerator.getDualScaleCls(q.getQid(), getAnswerIdsByID(q.getQid()), a_node);\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid() + \".0\", code_lists[0], \"string\", false, \"-0\");\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid() + \".1\", code_lists[1], \"string\", false, \"-1\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Array by column\n\t\t\t\tcase \"H\":\n\t\t\t\t// Flexible Array\n\t\t\t\tcase \"F\":\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid().concat(\".cl\"), getAnswerCodesByID(q.getQid(), false), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 5pt Array\n\t\t\t\tcase \"A\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"5pt.cl\", ClGenerator.getIntCl(5), \"integer\", true, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 10pt Array\n\t\t\t\tcase \"B\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"10pt.cl\", ClGenerator.getIntCl(10), \"integer\", true, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Increase/Same/Decrease Array\n\t\t\t\tcase \"E\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"ISD.cl\", ClGenerator.getISDCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 10pt Array\n\t\t\t\tcase \"C\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"YNU.cl\", ClGenerator.getYNUCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Matrix with numerical input\n\t\t\t\tcase \":\":\n\t\t\t\t\tq.setType(\"N\");\n\t\t\t\t\taddQuestionMatrix(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Matrix with text input\n\t\t\t\tcase \";\":\n\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\taddQuestionMatrix(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Choice (Normal, Bootstrap, Image select)\n\t\t\t\tcase \"M\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"MC.cl\", ClGenerator.getMCCL(), \"string\", false, \"\");\n\t\t\t\t\tif (question.elementTextTrim(\"other\").equals(\"Y\")) {\n\t\t\t\t\t\tq.setQid(q.getQid().concat(\"other\"));\n\t\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// MC with comments\n\t\t\t\tcase \"P\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"MC.cl\", ClGenerator.getMCCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tlog.error(\"Question type not supported: \" + q.type);\n\t\t\t}\n\t\t}\n\t}", "public Association createAssociation(SnpAssociationStandardMultiForm form) {\n Association association = setCommonAssociationElements(form);\n association.setSnpInteraction(false);\n\n // Add loci to association, for multi-snp and standard snps we assume their is only one locus\n Collection<Locus> loci = new ArrayList<>();\n Locus locus = new Locus();\n\n // Set locus description and haplotype count\n // Set this number to the number of rows entered by curator\n Integer numberOfRows = form.getSnpFormRows().size();\n if (numberOfRows > 1) {\n locus.setHaplotypeSnpCount(numberOfRows);\n association.setMultiSnpHaplotype(true);\n }\n\n if (form.getMultiSnpHaplotypeDescr() != null && !form.getMultiSnpHaplotypeDescr().isEmpty()) {\n locus.setDescription(form.getMultiSnpHaplotypeDescr());\n }\n else {\n if (numberOfRows > 1) {\n locus.setDescription(numberOfRows + \"-SNP haplotype\");\n }\n else {\n locus.setDescription(\"Single variant\");\n }\n }\n\n // Create gene from each string entered, may sure to check pre-existence\n Collection<String> authorReportedGenes = form.getAuthorReportedGenes();\n Collection<Gene> locusGenes = lociAttributesService.createGene(authorReportedGenes);\n\n // Set locus genes\n locus.setAuthorReportedGenes(locusGenes);\n\n // Handle rows entered for haplotype by curator\n Collection<SnpFormRow> rows = form.getSnpFormRows();\n Collection<RiskAllele> locusRiskAlleles = new ArrayList<>();\n\n for (SnpFormRow row : rows) {\n\n // Create snps from row information\n String curatorEnteredSNP = row.getSnp();\n SingleNucleotidePolymorphism snp = lociAttributesService.createSnp(curatorEnteredSNP);\n\n // Get the curator entered risk allele\n String curatorEnteredRiskAllele = row.getStrongestRiskAllele();\n\n // Create a new risk allele and assign newly created snp\n RiskAllele riskAllele = lociAttributesService.createRiskAllele(curatorEnteredRiskAllele, snp);\n\n // If association is not a multi-snp haplotype save frequency to risk allele\n if (!form.getMultiSnpHaplotype()) {\n riskAllele.setRiskFrequency(form.getRiskFrequency());\n }\n\n // Check for proxies and if we have one create a proxy snps\n if (row.getProxySnps() != null && !row.getProxySnps().isEmpty()) {\n Collection<SingleNucleotidePolymorphism> riskAlleleProxySnps = new ArrayList<>();\n\n for (String curatorEnteredProxySnp : row.getProxySnps()) {\n SingleNucleotidePolymorphism proxySnp = lociAttributesService.createSnp(curatorEnteredProxySnp);\n riskAlleleProxySnps.add(proxySnp);\n }\n\n riskAllele.setProxySnps(riskAlleleProxySnps);\n }\n\n locusRiskAlleles.add(riskAllele);\n }\n\n // Assign all created risk alleles to locus\n locus.setStrongestRiskAlleles(locusRiskAlleles);\n\n // Add locus to collection and link to our association\n loci.add(locus);\n association.setLoci(loci);\n return association;\n }", "public static GetDirectAreaInfo parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n GetDirectAreaInfo object =\n new GetDirectAreaInfo();\n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n if (reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"type\")!=null){\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n if (fullTypeName!=null){\n java.lang.String nsPrefix = null;\n if (fullTypeName.indexOf(\":\") > -1){\n nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(\":\"));\n }\n nsPrefix = nsPrefix==null?\"\":nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\":\")+1);\n \n if (!\"getDirectAreaInfo\".equals(type)){\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);\n return (GetDirectAreaInfo)ExtensionMapper.getTypeObject(\n nsUri,type,reader);\n }\n \n\n }\n \n\n }\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n \n reader.next();\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"requestXml\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n object.setRequestXml(null);\n reader.next();\n \n reader.next();\n \n }else{\n \n object.setRequestXml(org.apache.axis2.databinding.types.soapencoding.String.Factory.parse(reader));\n \n reader.next();\n }\n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n \n if (reader.isStartElement())\n // A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "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 }", "public String[] processData(String raw_data, int type){\n String[] values;\n Pattern pattern = null;\n raw_data = raw_data.trim();\n // Use \"|\" to separate data\n if (type == 1){\n pattern = Pattern.compile(\"\\\\|\");\n }else if (type == 0){\n // Use whitespace to separate data\n pattern = Pattern.compile(\"\\\\s+\");\n }else {\n System.out.println(\"Please use correct type\");\n System.exit(1);\n }\n values = pattern.split(raw_data);\n // Delete whitespace\n if (values != null) {\n for (int i = 0 ; i < values.length ; i++){\n values[i] = values[i].trim();\n if (values[i].equals(\"\")){\n System.out.println(\"File is missing data\");\n System.exit(1);\n }\n }\n }\n return values;\n }", "public String relationshipFromHeader(String rel_str) {\n StringTokenizer st = new StringTokenizer(rel_str, BundlesDT.DELIM);\n String fm_hdr = Utils.decFmURL(st.nextToken()), fm_ico = Utils.decFmURL(st.nextToken()); boolean fm_typed = st.nextToken().toLowerCase().equals(\"true\");\n String to_hdr = Utils.decFmURL(st.nextToken()), to_ico = Utils.decFmURL(st.nextToken()); boolean to_typed = st.nextToken().toLowerCase().equals(\"true\");\n String style = Utils.decFmURL(st.nextToken()); return fm_hdr; }", "public static EditInfo parse(\r\n javax.xml.stream.XMLStreamReader reader)\r\n throws java.lang.Exception {\r\n EditInfo object = new EditInfo();\r\n\r\n int event;\r\n javax.xml.namespace.QName currentQName = null;\r\n java.lang.String nillableValue = null;\r\n java.lang.String prefix = \"\";\r\n java.lang.String namespaceuri = \"\";\r\n\r\n try {\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n currentQName = reader.getName();\r\n\r\n if (reader.getAttributeValue(\r\n \"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\") != null) {\r\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\");\r\n\r\n if (fullTypeName != null) {\r\n java.lang.String nsPrefix = null;\r\n\r\n if (fullTypeName.indexOf(\":\") > -1) {\r\n nsPrefix = fullTypeName.substring(0,\r\n fullTypeName.indexOf(\":\"));\r\n }\r\n\r\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\r\n\r\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\r\n \":\") + 1);\r\n\r\n if (!\"EditInfo\".equals(type)) {\r\n //find namespace for the prefix\r\n java.lang.String nsUri = reader.getNamespaceContext()\r\n .getNamespaceURI(nsPrefix);\r\n\r\n return (EditInfo) ExtensionMapper.getTypeObject(nsUri,\r\n type, reader);\r\n }\r\n }\r\n }\r\n\r\n // Note all attributes that were handled. Used to differ normal attributes\r\n // from anyAttributes.\r\n java.util.Vector handledAttributes = new java.util.Vector();\r\n\r\n reader.next();\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if ((reader.isStartElement() &&\r\n new javax.xml.namespace.QName(\r\n \"http://tempuri.org/\", \"request\").equals(\r\n reader.getName())) ||\r\n new javax.xml.namespace.QName(\"\", \"request\").equals(\r\n reader.getName())) {\r\n object.setRequest(Request.Factory.parse(reader));\r\n\r\n reader.next();\r\n } // End of if for expected property start element\r\n\r\n else {\r\n }\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if (reader.isStartElement()) {\r\n // 2 - A start element we are not expecting indicates a trailing invalid property\r\n throw new org.apache.axis2.databinding.ADBException(\r\n \"Unexpected subelement \" + reader.getName());\r\n }\r\n } catch (javax.xml.stream.XMLStreamException e) {\r\n throw new java.lang.Exception(e);\r\n }\r\n\r\n return object;\r\n }", "static TreeSet<Noun> parse3rdNouns(Scanner data){\n\n\t\tint declension = 3;\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\t\t\ttry{\n\t\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD;\n\t\t\t\t\t//System.out.println(\"No i-stem\");\n\t\t\t\t} catch(NumberFormatException e){ //I-Stem.\n\t\t\t\t\tchapter = Integer.parseInt(current[0].substring(0, 2));\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD_I;\n\t\t\t\t\t//System.out.println(\"i-stem\");\n\t\t\t\t}\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}", "private void readHeader(){ \n Set<Object> tmpAttr = headerFile.keySet();\n Object[] attributes = tmpAttr.toArray(new Object[tmpAttr.size()]);\n \n Object[][] dataArray = new Object[attributes.length][2];\n for (int ndx = 0; ndx < attributes.length; ndx++) {\n dataArray[ndx][0] = attributes[ndx];\n dataArray[ndx][1] = headerFile.get(attributes[ndx]);\n if (attributes[ndx].toString().equals(\"Description\"))\n Description = headerFile.get(attributes[ndx]);\n }\n data = dataArray;\n }", "public Event createModelFromMultpleTSVline(HashSet<String[]> gatheredValues,\n String provenanceInfo,\n char separator,\n DateTimeFormatter dateTimeFormatter,\n boolean filterFrom,\n LocalDate fromDate,\n boolean filterTo,\n LocalDate toDate,\n boolean filterByKeyword,\n String keyword) {\n\n Event event = null;\n boolean firstLine = true;\n for (String[] values : gatheredValues) {\n if (firstLine) {\n event = new Event(values[0], provenanceInfo);\n firstLine = false;\n }\n //fill the attributes\n //add uri\n event.addURI(values[0]);\n\n //add label after removing the language tag\n if (values[1].contains(\"@\"))\n event.addLabel(values[1].substring(0, values[1].indexOf(\"@\")));\n else\n event.addLabel(values[1]);\n\n\n // 1214-07-27^^http://www.w3.org/2001/XMLSchema#date\n //incomplete date 1863-##-##^^http://www.w3.org/2001/XMLSchema#date\n String date = values[2].replace(\"##\", \"01\");\n if (values[2].contains(\"^\"))\n date = date.substring(0, date.indexOf(\"^\"));\n\n try {\n LocalDate localDate = LocalDate.parse(date, dateTimeFormatter);\n //check date against user input parameters\n if (filterFrom) { //&& filterTo) {\n //if (localDate.isAfter(toDate) || localDate.isBefore(fromDate)) {\n if (localDate.isBefore(fromDate)) {\n return null;\n }\n }\n if (filterTo) {\n if (localDate.isAfter(toDate)) {\n return null;\n }\n }\n event.addDate(localDate);\n } catch (DateTimeParseException e) {\n //System.out.println(values[0] + \" \" + date);\n return null;\n }\n\n\n\n //50.5833^^http://www.w3.org/2001/XMLSchema#float\t3.225^^http://www.w3.org/2001/XMLSchema#float\n //event.setLat(Double.valueOf(values[3].substring(0, values[3].indexOf(\"^\"))));\n //event.setLon(Double.valueOf(values[4].substring(0, values[4].indexOf(\"^\"))));\n if (values.length>4) {\n String latString = values[3];\n if (latString.contains(\"^\"))\n latString = latString.substring(0, latString.indexOf(\"^\"));\n String longString = values[4];\n if (longString.contains(\"^\"))\n longString = longString.substring(0, longString.indexOf(\"^\"));\n\n Pair<Double, Double> p = new Pair<>(\n Double.valueOf(latString),\n Double.valueOf(longString)\n );\n event.addCoordinates(p);\n }\n if (values.length>5) {\n event.addSame(values[5]);\n }\n if (values.length>6) {\n Location location = new Location(values[6], provenanceInfo);\n event.addLocation(location);\n }\n }\n\n //filter labels by keyword\n if(filterByKeyword) {\n if (!event.getLabels().stream().anyMatch(label -> label.trim().toLowerCase().contains(keyword.toLowerCase()))) {\n return null;\n } /*else {\n System.out.println(keyword + \" found for \" + event.getLabels());\n }*/\n }\n\n return event;\n }", "public static GetDirectAreaInfoResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n GetDirectAreaInfoResponse object =\n new GetDirectAreaInfoResponse();\n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n if (reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"type\")!=null){\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n if (fullTypeName!=null){\n java.lang.String nsPrefix = null;\n if (fullTypeName.indexOf(\":\") > -1){\n nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(\":\"));\n }\n nsPrefix = nsPrefix==null?\"\":nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\":\")+1);\n \n if (!\"getDirectAreaInfoResponse\".equals(type)){\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);\n return (GetDirectAreaInfoResponse)ExtensionMapper.getTypeObject(\n nsUri,type,reader);\n }\n \n\n }\n \n\n }\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n \n reader.next();\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"getDirectAreaInfoReturn\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n object.setGetDirectAreaInfoReturn(null);\n reader.next();\n \n reader.next();\n \n }else{\n \n object.setGetDirectAreaInfoReturn(org.apache.axis2.databinding.types.soapencoding.String.Factory.parse(reader));\n \n reader.next();\n }\n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n \n if (reader.isStartElement())\n // A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "@Override\r\n\tpublic DocumentData read(File in) throws Exception {\r\n\t\tDocumentData doc = new DocumentData(in);\r\n\t\tBufferedReader reader = FileHandler.getBufferedReader(in);\r\n\t\tBufferedReader nested = null;\r\n\t\tString inpath = in.getAbsolutePath();\r\n\t\tFile nestin = new File (inpath.substring(0,inpath.length()-5)+SUBSUFFIX);\r\n\t\tif(nestin.exists())\r\n\t\t\tnested = FileHandler.getBufferedReader(nestin);\r\n\t\tint lcnt=0;\r\n\t\tint scnt=0;\r\n\t\tint start=-1;\r\n\t\tint nstart = -1;\r\n\t\tSentenceData sent = null;\r\n\t\twhile(true){\r\n\t\t\tString line = reader.readLine();\r\n\t\t\tString nline = null;\r\n\t\t\tif(nested!=null)\r\n\t\t\t\tnline = nested.readLine();\r\n\t\t\tif(line==null) {\r\n\t\t\t\tif(sent!=null){\r\n\t\t\t\t\tdoc.addSentenceData(sent);\r\n\t\t\t\t\tsent=null;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tline = line.trim();\r\n\t\t\tlcnt++;\r\n\t\t\tif(line.length()==0){\r\n\t\t\t\tif(sent!=null){\r\n\t\t\t\t\tdoc.addSentenceData(sent);\r\n\t\t\t\t\tsent=null;\r\n\t\t\t\t\tscnt=0;\r\n\t\t\t\t}else\r\n\t\t\t\t\tSystem.out.println(\"Skip empty line in line:\"+lcnt);\r\n\t\t\t}else if(line.startsWith(\"#\")){\r\n\t\t\t\tSystem.out.println(\"Skip comments in line:\"+lcnt+\"; \"+line);\r\n\t\t\t}else{\r\n\t\t\t\tif(sent==null)\r\n\t\t\t\t\tsent = new SentenceData();\r\n\t\t\t\tscnt++;\r\n\t\t\t\t\r\n\t\t\t\tString tmp[] = line.split(\"\\t\");\r\n\t\t\t\tsent.addTokens(tmp[0]);\r\n\t\t\t\tString mark = tmp[tmp.length-1];// last column is the markables;\r\n\t\t\t\tif(mark.equals(\"O\")){\r\n\t\t\t\t\tif(start>=0)\r\n\t\t\t\t\t\tsent.addMarkables(start, scnt-1);\r\n\t\t\t\t\tstart=-1;\r\n\t\t\t\t}else if(mark.startsWith(\"I-\")||mark.startsWith(\"B-\")){\r\n\t\t\t\t\tif(start<0)\r\n\t\t\t\t\t\tstart = scnt;//support both IOB1 and IOB2\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Exception(\"Please input only IOB or IOB2 scheme (main): \"+lcnt+\": \"+line);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nline!=null){\r\n\t\t\t\t\tString ntmp[] = nline.split(\"\\t\");\r\n\t\t\t\t\tString nmark = ntmp[ntmp.length-1];\r\n\t\t\t\t\tif(nmark.equals(\"O\")){\r\n\t\t\t\t\t\tif(nstart>=0)\r\n\t\t\t\t\t\t\tsent.addMarkables(start, scnt-1);\r\n\t\t\t\t\t\tnstart=-1;\r\n\t\t\t\t\t}else if(nmark.startsWith(\"I-\")||nmark.startsWith(\"B-\")){\r\n\t\t\t\t\t\tif(nstart<0)\r\n\t\t\t\t\t\t\tnstart = scnt;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthrow new Exception(\"Please input only IOB or IOB2 scheme (nested): \"+lcnt+\": \"+nline);\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\t\r\n\t\t}\r\n\t\t\r\n\t\treturn doc;\r\n\t}", "public static FactIdentifier parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception {\r\n FactIdentifier object =\r\n new FactIdentifier();\r\n\r\n int event;\r\n java.lang.String nillableValue = null;\r\n java.lang.String prefix = \"\";\r\n java.lang.String namespaceuri = \"\";\r\n try {\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n\r\n if (reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\", \"type\") != null) {\r\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\r\n \"type\");\r\n if (fullTypeName != null) {\r\n java.lang.String nsPrefix = null;\r\n if (fullTypeName.indexOf(\":\") > -1) {\r\n nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(\":\"));\r\n }\r\n nsPrefix = nsPrefix == null ? \"\" : nsPrefix;\r\n\r\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\":\") + 1);\r\n\r\n if (!\"FactIdentifier\".equals(type)) {\r\n //find namespace for the prefix\r\n java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);\r\n return (FactIdentifier) ExtensionMapper.getTypeObject(\r\n nsUri, type, reader);\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n // Note all attributes that were handled. Used to differ normal attributes\r\n // from anyAttributes.\r\n java.util.List handledAttributes = new java.util.ArrayList();\r\n\r\n\r\n reader.next();\r\n\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\r\n\r\n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\", \"identifierKey\").equals(reader.getName())) {\r\n\r\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\", \"nil\");\r\n if (!\"true\".equals(nillableValue) && !\"1\".equals(nillableValue)) {\r\n\r\n java.lang.String content = reader.getElementText();\r\n\r\n object.setIdentifierKey(\r\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\r\n\r\n } else {\r\n\r\n\r\n reader.getElementText(); // throw away text nodes if any.\r\n }\r\n\r\n reader.next();\r\n\r\n } // End of if for expected property start element\r\n\r\n else {\r\n\r\n }\r\n\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\r\n\r\n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\", \"identifierValue\").equals(reader.getName())) {\r\n\r\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\", \"nil\");\r\n if (!\"true\".equals(nillableValue) && !\"1\".equals(nillableValue)) {\r\n\r\n java.lang.String content = reader.getElementText();\r\n\r\n object.setIdentifierValue(\r\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\r\n\r\n } else {\r\n\r\n\r\n reader.getElementText(); // throw away text nodes if any.\r\n }\r\n\r\n reader.next();\r\n\r\n } // End of if for expected property start element\r\n\r\n else {\r\n\r\n }\r\n\r\n while (!reader.isStartElement() && !reader.isEndElement())\r\n reader.next();\r\n\r\n if (reader.isStartElement())\r\n // A start element we are not expecting indicates a trailing invalid property\r\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\r\n\r\n\r\n } catch (javax.xml.stream.XMLStreamException e) {\r\n throw new java.lang.Exception(e);\r\n }\r\n\r\n return object;\r\n }", "protected abstract MS_LineBuilder prepareContent(MS_LineBuilder lb);", "public CompoundInfo getCompoundInfo() {\r\n\treturn formalCompound.getCompoundInfo();\r\n}" ]
[ "0.5325338", "0.5164326", "0.50570256", "0.49713483", "0.47745126", "0.47485703", "0.47307613", "0.47185844", "0.47084117", "0.47051454", "0.46722803", "0.46589637", "0.46473923", "0.4618903", "0.4587504", "0.4577613", "0.45687318", "0.4558048", "0.4554017", "0.45534134", "0.45519203", "0.45472422", "0.4539019", "0.45303315", "0.45121178", "0.45049533", "0.4493828", "0.44918227", "0.44904503", "0.44757056", "0.44729143", "0.44632828", "0.4461178", "0.4459664", "0.445788", "0.44558382", "0.444693", "0.44452628", "0.4438166", "0.44228265", "0.44211692", "0.44089112", "0.43972144", "0.43897945", "0.4388746", "0.43870905", "0.43770248", "0.43768996", "0.4374698", "0.43733397", "0.43684292", "0.43655005", "0.43615606", "0.43549508", "0.43532443", "0.43501806", "0.43492213", "0.43480223", "0.43451834", "0.43436924", "0.43421435", "0.43405223", "0.43354034", "0.43351892", "0.43336183", "0.43250617", "0.43246672", "0.4321976", "0.43179026", "0.43174243", "0.4316108", "0.4315301", "0.43145785", "0.4312583", "0.4310221", "0.4307481", "0.42966136", "0.42963782", "0.4290293", "0.42859447", "0.42840415", "0.42832324", "0.42797312", "0.4275208", "0.42734954", "0.42699736", "0.4269028", "0.42679575", "0.42615426", "0.4251407", "0.42473644", "0.42431277", "0.42407843", "0.42405277", "0.42383018", "0.42372027", "0.42370424", "0.42352715", "0.42316714", "0.42310616", "0.42310414" ]
0.0
-1
/mBundle.putString("key", etCreate.getText().toString()); openService(MyIntentService.class,mBundle); openActivityForResult(PayActivity.class,REQUEST_PAY_CODE,mBundle); NotificationUtil.getNotificationUtils(MainActivity.this).showNotification(null,null);
@SuppressLint("RestrictedApi") @Override public void call(Void aVoid) { initRemoteViews(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n \t public void onClick(View v) {\n \t\tRegno=(EditText) findViewById(R.id.regno);\n \t\tRouteno=(EditText) findViewById(R.id.routeno);\n \t\tDriver =(EditText) findViewById(R.id.name);\n \t\tPhone = (EditText) findViewById(R.id.phone);\n \t\t\n \t\tmrg = Regno.getText().toString();\n \t\tmrn = Routeno.getText().toString();\n \t\tmd = Driver.getText().toString();\n \t\tmp = Phone.getText().toString();\n \t\t\n \t\tIntent intentVibrate =new Intent(getApplicationContext(),VibrateService.class);\n \t\tstartService(intentVibrate);\n \t\t \t\t\n \t\t sendData();\n \t\t }", "public void onCreate(Bundle bundle) {\n TraceMachine.startTracing(\"PayResultActivity\");\n try {\n TraceMachine.enterMethod(this._nr_trace, \"PayResultActivity#onCreate\", null);\n } catch (NoSuchFieldError e) {\n while (true) {\n TraceMachine.enterMethod(null, \"PayResultActivity#onCreate\", null);\n }\n }\n super.onCreate(bundle);\n Intent intent = getIntent();\n if ((!TextUtils.isEmpty(intent.getStringExtra(\"orderSuffix\")) ? 1 : 0) != 0) {\n C0575a.f463a = intent.getStringExtra(\"phonecashier.pay.hash\");\n m751a(this, C0575a.f463a, intent.getStringExtra(\"orderSuffix\"), intent.getStringExtra(\"externalPkgName\"));\n m750a((Activity) this, 300);\n TraceMachine.exitMethod();\n return;\n }\n String stringExtra = intent.getStringExtra(\"phonecashier.pay.result\");\n int intExtra = intent.getIntExtra(\"phonecashier.pay.resultOrderHash\", 0);\n if (intExtra == 0 || !TextUtils.equals(C0575a.f463a, String.valueOf(intExtra))) {\n C0590a.m801a(\"biz\", \"SchemePayWrongHashEx\", \"Expected \" + C0575a.f463a + \", got \" + intExtra);\n m752a(C0575a.f463a);\n m750a((Activity) this, 300);\n TraceMachine.exitMethod();\n return;\n }\n if (TextUtils.isEmpty(stringExtra)) {\n m752a(C0575a.f463a);\n } else {\n m753a(stringExtra, C0575a.f463a);\n }\n C0575a.f463a = \"\";\n m750a((Activity) this, 300);\n TraceMachine.exitMethod();\n }", "@Override\n public void onClick(DialogInterface dialog,\n int which) {\n showDialog(getResources()\n .getString(\n R.string.smssdk_get_verification_code_content));\n new MessageVerify(phone, new MessageVerify.SuccessCallBack() {\n @Override\n public void onSuccess(JSONObject obj) {\n try {\n String message = obj.getString(Config.KEY_RETURN_MESSAGE);\n sessionId = obj.getString(Config.KEY_SESSIONID);\n //token = obj.getString(Config.KEY_TOKEN);\n\n\n Config.cacheSessionId(RegisterActivity.this, sessionId);\n // Config.cacheToken(RegisterActivity.this, token);\n Log.i(\"info\",\"从服务器获取的sessionId:\" + sessionId);\n Log.i(\"info\",\"从缓存中取出的sessionId:\" + Config.getCacheSessionId(RegisterActivity.this));\n\n Toast.makeText(RegisterActivity.this, message, Toast.LENGTH_SHORT).show();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new MessageVerify.FailCallBack() {\n @Override\n public void onFail(String message) {\n Toast.makeText(RegisterActivity.this, message, Toast.LENGTH_SHORT).show();\n }\n });\n\n closeDialog();\n\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(getApplicationContext(),AudioService.class);\n intent.putExtra(\"code\",1);\n startService(intent);\n }", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if(resultCode==RESULT_OK&&requestCode==ACTIVITY_DOS){\n\n String nom=data.getExtras().getString(\"nombreIntent\");\n String loc=data.getExtras().getString(\"localidadIntent\");\n String pro=data.getExtras().getString(\"provinciaIntent\");\n boolean bueno = data.getExtras().getBoolean(\"eleccionIntent\");\n if(bueno==true) {\n notificationExtendida(nom, \"De \" + loc + \", (\"+pro+\")\",nom,loc,pro,1);\n }else{\n msg1.setText(nom);\n msg2.setText(loc);\n msg3.setText(pro);\n }\n }\n else{\n Toast.makeText(getApplicationContext(),\"ERROR EN LA APLICACION\", Toast.LENGTH_SHORT).show();\n }\n }", "private void pay(){\n //Calculating the new balance\n Integer value = Integer.parseInt(this.txtAmount.getText().toString());\n int result = this.balance - value;\n //The intent to be passed back.\n Intent data = new Intent(TransferActivity.this, MainActivity.class);\n //The bundle to be put into the intent.\n Bundle bundle = new Bundle();\n //Gets time of transaction\n Calendar cal = Calendar.getInstance();\n Date date = cal.getTime();\n DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n String formattedDate = dateFormat.format(date);\n //Fills bundle the needed data\n bundle.putInt(MainActivity.PARAM_INT_NAME, result);\n bundle.putString(MainActivity.PARAM_STRING_NAME, this.chosenName);\n bundle.putString(MainActivity.PARAM_DATE_NAME, formattedDate);\n data.replaceExtras(bundle);\n //Sets result and ends activity\n setResult(Activity.RESULT_OK, data);\n finish();\n }", "@Override\n public void onClick(View v) {\n startService(new Intent(MainActivity.this, MyService.class));\n }", "public void onReceive(Context context, Intent intent) {\n\n\n RespondPackage respondPackage = (RespondPackage) intent.getParcelableExtra(HttpService.MY_SERVICE_PAYLOAD);\n if (respondPackage.getParams().containsKey(RespondPackage.SUCCESS)) {\n Log.d(\"JsonResponseData\", \"onReceive: \"\n + respondPackage.getParams().get(RespondPackage.SUCCESS));\n //progress.setVisibility(View.GONE);\n String success = respondPackage.getParams().get(\"success\");\n try {\n JSONObject jsonObject = new JSONArray(success).getJSONObject(0);\n int pId = jsonObject.getInt(\"PId\");\n String pAmt = jsonObject.getString(\"PAmt\");\n PaymentSucessDialog paymentSucessDialog = new PaymentSucessDialog();\n paymentSucessDialog.setValues(pId, pAmt);\n paymentSucessDialog.show(getFragmentManager(), \"Payment\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n\n } else {\n Log.d(\"JsonResponseData\", \"onReceive: \"\n + respondPackage.getParams().get(RespondPackage.FAILED));\n Toast.makeText(context, \"Please Select Image\", Toast.LENGTH_SHORT).show();\n }\n\n }", "@SuppressLint(\"NewApi\")\n @Override\n public void onClick(View v) {\n sPhone = etPhone.getText().toString();\n sSms = etSms.getText().toString();\n\n //if (sPhone.length() > 0 && sSms.length() > 0)\n // sendSMS(sPhone, sSms);\n\n\n etSms.getText().clear();\n\n Intent i = new Intent(SMSActivity.this, AlarmService.class);\n i.putExtra(\"exPhone\", sPhone);\n i.putExtra(\"exSmS\", sSms);\n\n smsData.put(\"Phone\", sPhone);\n smsData.put(\"Message\", sSms);\n\n\n pIntent = PendingIntent.getService(getApplicationContext(), 0, i, PendingIntent.FLAG_UPDATE_CURRENT);\n\n aManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n c.setTimeInMillis(System.currentTimeMillis());\n c.set(Calendar.HOUR_OF_DAY, hour);\n c.set(Calendar.MINUTE, minute);\n aManager.set(AlarmManager.RTC_WAKEUP, c.getTimeInMillis(), pIntent);\n Toast.makeText(getApplicationContext(), \"Sms scheduled! \", Toast.LENGTH_SHORT).show();\n\n\n onSaveClickedSP(v);\n send15minNotification(hour, minute);\n sendsentNotification(hour, minute);\n\n Intent intent = new Intent(SMSActivity.this, SucessSMSActivity.class);\n startActivity(intent);\n\n }", "public void submitOrder(View view) {\n\n displayQuantity(myQuantity);\n int total = calculatePrice(myPrice,myQuantity);\n String orderMessage = displayOrder(total);\n Context context = getApplicationContext();\n Toast myToast = Toast.makeText(context,\"Thanks:\" + myName,Toast.LENGTH_SHORT);\n myToast.show();\n // intent to maps\n //Intent myIntent = new Intent(Intent.ACTION_VIEW);\n //myIntent.setData(Uri.parse(\"geo:47.6, -122.3\"));\n Intent myIntent = new Intent(Intent.ACTION_SENDTO);\n myIntent.setData(Uri.parse(\"mailto:\"));\n myIntent.putExtra(Intent.EXTRA_EMAIL, \"korolvlondone@gmail.com\");\n myIntent.putExtra(Intent.EXTRA_SUBJECT,\"Java Order\");\n myIntent.putExtra(Intent.EXTRA_TEXT,orderMessage);\n if(myIntent.resolveActivity(getPackageManager())!= null) {startActivity(myIntent);}\n\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n\t Log.i(TAG,\"Alarm Service has started.\");\n Context context = this.getApplicationContext();\n notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);\n Intent mIntent = new Intent(this, MainActivity.class);\n Bundle bundle = new Bundle(); \n bundle.putString(\"test\", \"test\");\n mIntent.putExtras(bundle);\n\t\tpendingIntent = PendingIntent.getActivity(context, 0, mIntent, PendingIntent.FLAG_UPDATE_CURRENT); \n\t\t\n\t\tResources res = this.getResources();\n\t\tNotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\n\t\tbuilder.setContentIntent(pendingIntent)\n\t\t .setSmallIcon(R.drawable.ic_launcher)\n\t\t .setLargeIcon(BitmapFactory.decodeResource(res, R.drawable.ic_launcher))\n\t\t .setTicker(res.getString(R.string.notification_title))\n\t\t .setAutoCancel(true)\n\t\t .setContentTitle(res.getString(R.string.notification_title))\n\t\t .setContentText(res.getString(R.string.notification_subject));\n\n\t\tnotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);\n\t\tnotificationManager.notify(NOTIFICATION_ID, builder.build());\n\t\tLog.i(TAG,\"Notifications sent.\");\n\t\tMyAlarm app = (MyAlarm)getApplicationContext();\n\t\tapp.incrementCount();\n\n }", "public void startPayment() {\n double ruppes = Double.parseDouble(price);\n final Activity activity = this;\n final Checkout co = new Checkout();\n try {\n JSONObject options = new JSONObject();\n options.put(\"name\", getResources().getString(R.string.application_name));\n options.put(\"description\", \"\");\n //You can omit the image option to fetch the image from dashboard\n options.put(\"image\", getResources().getDrawable(R.mipmap.ic_app_logo));\n options.put(\"currency\", \"INR\");\n options.put(\"amount\", ruppes * 100);\n JSONObject preFill = new JSONObject();\n preFill.put(\"email\", \"multipz.paresh@gmail.com\");\n preFill.put(\"contact\", \"8758689113\");\n options.put(\"prefill\", preFill);\n co.open(activity, options);\n } catch (Exception e) {\n Toast.makeText(activity, \"Error in payment: \" + e.getMessage(), Toast.LENGTH_SHORT)\n .show();\n e.printStackTrace();\n }\n }", "private void alertBox_service(final String title, final String msg) {\r\n\t\tAlertDialog.Builder service_alert = new AlertDialog.Builder(this);\r\n\t\tservice_alert.setTitle(title);\r\n\t\tif (msg.equalsIgnoreCase(\"Successfully Pre Authorized\")) {\r\n\t\t\tservice_alert\r\n\t\t\t.setMessage(\"The credit card information is securely saved\");\r\n\t\t} else {\r\n\t\t\tservice_alert.setMessage(msg);\r\n\t\t}\r\n\t\tservice_alert.setNeutralButton(\"OK\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\tif (msg.equals(\"Successfully Pre Authorized\")) {\r\n\t\t\t\t\tif (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"ZouponsLogin\")|| getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"Registration\")) {\r\n\t\t\t\t\t\tstartActivity(new Intent(AddCreditCard.this,ShopperHomePage.class));\r\n\t\t\t\t\t} else if (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"ManageWallets\")) {\r\n\t\t\t\t\t\tstartActivity(new Intent(AddCreditCard.this,ManageWallets.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK));\r\n\t\t\t\t\t} else if (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"StoreOwner_Billing\")) {\r\n\t\t\t\t\t\tIntent intent_rightmenuBilling = new Intent(AddCreditCard.this,ManageWallets.class);\r\n\t\t\t\t\t\tintent_rightmenuBilling.putExtra(\"FromStoreOwnerBilling\", true);\r\n\t\t\t\t\t\tintent_rightmenuBilling.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\t\t\tstartActivity(intent_rightmenuBilling);\r\n\t\t\t\t\t} else if (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"MobilePay\")) {\r\n\t\t\t\t\t\tsetResult(RESULT_OK); // to move control to step2 managecards on activity result\r\n\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t} else if (getIntent().getExtras().getString(\"class_name\").equalsIgnoreCase(\"StoreOwner_PointOfSale\")) {\r\n\t\t\t\t\t\tif (WebServiceStaticArrays.mFirstDataGlobalPaymentList.size() > 0) {\r\n\t\t\t\t\t\t\tFirstDataGlobalpayment_ClassVariables mFirstData_details = (FirstDataGlobalpayment_ClassVariables) WebServiceStaticArrays.mFirstDataGlobalPaymentList.get(0);\r\n\t\t\t\t\t\t\tIntent card_intent = new Intent();\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"user_id\", getIntent().getExtras().getString(\"user_id\"));\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_id\",\tmFirstData_details.mCardId);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_name\",mNonZouponsMemberCardName);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_masknumber\",\tmNonZouponsMemberCardMask);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_expirymonth\", mNonZouponsMemberCardexpiryMonth);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_expiryyear\",\tmNonZouponsMemberCardexpiryYear);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"card_cvv\", mNonZouponsMemberCardCVV);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"address\", \"\");\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"zipcode\",\tmNonZouponsMemberZipcode);\r\n\t\t\t\t\t\t\tcard_intent.putExtra(\"streetnumber\",mNonZouponsMemberStreetNumber);\r\n\t\t\t\t\t\t\tManageCardAddPin_ClassVariables.mEditCardFlag = \"false\";\r\n\t\t\t\t\t\t\tManageCardAddPin_ClassVariables.mAddPinFlag = \"true\";\r\n\t\t\t\t\t\t\tsetResult(RESULT_OK, card_intent); // to move control to step2 managecards on activity result or POS part2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdialog.dismiss();\r\n\t\t\t}\r\n\t\t});\r\n\t\tservice_alert.show();\r\n\t}", "private void BundleData(Intent intent) {\n bundle=new Bundle();\n bundle.putString(\"FNAME\",fname);\n bundle.putString(\"LNAME\",lname);\n bundle.putString(\"LOCALITY\",locality);\n bundle.putString(\"CITY\",city);\n bundle.putInt(\"PINCODE\",pincode);\n bundle.putString(\"TIME_TO_CALL\",timers);\n bundle.putString(\"PHONE\",phone);\n bundle.putString(\"ALTPHONE\",altphone);\n bundle.putString(\"EMAIL\",emailid);\n intent.putExtras(bundle);\n }", "public void pindah_ke_log(View v)\n {\n Intent dashboard = new Intent(DashboardUser.this,BuyerTransactionActivity.class) ;\n dashboard.putExtra(\"param1\",value1);\n dashboard.putExtra(\"param2\",value2);\n dashboard.putExtra(\"param3\",value3);\n dashboard.putExtra(\"param4\",value4);\n dashboard.putExtra(\"param5\",value5);\n// SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n// SharedPreferences.Editor editor = sharedPreferences.edit();\n// editor.putString(TEXT, value1);\n// editor.putString(SWITCH, value2);\n// editor.apply();\n startActivityForResult(dashboard, 100);\n }", "public void showNotification(String title,String message)\n {\n\n Bitmap icon = BitmapFactory.decodeResource(this.getResources(),\n R.drawable.girl);\n// NotificationCompat.Builder builder = new NotificationCompat.Builder(this,\"Notify\")\n// .setContentTitle(title).setSmallIcon(R.drawable.common_google_signin_btn_icon_dark)\n\n// // .addAction(R.drawable.user,\"Pay\",payInent)\n// //.addAction(R.drawable.user,\"Pay Later\",payLaterInent)\n// .setDefaults(Notification.DEFAULT_ALL)\n// .setPriority(NotificationManager.IMPORTANCE_HIGH)\n// .setAutoCancel(true).setContentText(message).setLargeIcon(icon)\n// .setStyle(new NotificationCompat.BigPictureStyle()\n// .bigPicture(icon).bigLargeIcon(null));\n\n// NotificationCompat.Builder builder;\n// builder = new NotificationCompat.Builder(this, \"Notify\");\n// builder.setContentTitle(title) // required\n// .setSmallIcon(R.drawable.user) // required\n// .setContentText(message) // required\n// .setStyle(new NotificationCompat.BigPictureStyle()\n// .bigPicture(icon).setSummaryText(\"\"))\n// .setAutoCancel(true)\n// .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400})\n// .setSound(Settings.System.DEFAULT_NOTIFICATION_URI)\n// .setPriority(NotificationCompat.PRIORITY_HIGH)\n// ;\n\n Notification notification = null;\n if( message.charAt(0) == 'C' )\n {\n// Intent intent = new Intent(this, PayLater.class);\n Intent intent = new Intent(this, PayLaterTest.class);\n PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setVibrate(new long[0])// heads-up\n .addAction(R.drawable.user,\"Pay\",payInent)\n .setAutoCancel(true)\n .build();\n }\n else if( message.charAt(0) == 'G' )\n {\n //start activity go in\n Intent intent = new Intent(this, PayActivity.class);\n PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setVibrate(new long[0])// heads-up\n .addAction(R.drawable.user,\"Verify\",payInent)\n .setAutoCancel(true)\n .build();\n }\n else if( message.charAt(0) == 'I' )\n {\n //start activity invalid slot\n// Intent intent = new Intent(this, PayActivity.class);\n\n// PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setAutoCancel(true)\n .setVibrate(new long[0])// heads-up\n // .addAction(R.drawable.user,\"Verify\",payInent)\n .build();\n }\n\n m = (NotificationManager) getSystemService(getApplicationContext().NOTIFICATION_SERVICE);;\n m.notify(999,notification);\n // m.cancel(999);\n }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data)\n\t{\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif(requestCode==5844&&resultCode==RESULT_OK){\n\t\t\tstartService(new Intent(this,LocalVpnService.class));\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n Log.i(\"ServiceExam\",\"start\");\n Intent i = new Intent(\n getApplicationContext(),\n Example17Sub_LifeCycleService.class\n );\n\n i.putExtra(\"MSG\",\"HELLO\");\n // Start Service\n // 만약 서비스 객체가 메모리에 없으면 생성하고 수행\n // onCreate() -> onStartCommand()\n // 만약 서비스 객체가 이미 존재하고 있으면\n // onStartCommand()\n startService(i);\n }", "@Override\n public void onClick(View arg0) {\n\n String messageToSend = \"Thank you for shopping. Your order will be delivered soon.\";\n String number = \"6476710881\";\n SmsManager.getDefault().sendTextMessage(number, null, messageToSend, null,null);\n Toast.makeText(getApplicationContext(), \"Your Payment is done\", Toast.LENGTH_LONG).show();\n\n Intent myIntent = new Intent(getApplicationContext(),LoginActivity.class);\n startActivity(myIntent);\n\n }", "@Override\n public void onClick(View view) {\n Intent myIntent = new Intent(DriverPrefrActivity.this, SearchParkActivity.class);\n //Creating a bundle\n Bundle bundle = new Bundle();\n //Adding values to bundle\n bundle.putString(\"driverlargecar\", String.valueOf(largecar));\n bundle.putString(\"drivertype\", String.valueOf(type));\n bundle.putString(\"driverprice\", String.valueOf(price));\n bundle.putString(\"driverdistancepklot\", String.valueOf(distpklot));\n\n myIntent.putExtra(\"mybundle\", bundle);\n startActivity(myIntent);\n }", "@Override\n public void onClick(View v) {\n Bundle emptyBundle = new Bundle();\n emptyBundle.putBoolean(\"isEmpty\",true);\n emptyBundle.putInt(\"ReminderCode\",returnNewReminderCode());\n Intent resultIntent=new Intent(MainActivity.this,NewReminder.class);\n resultIntent.putExtras(emptyBundle);\n startActivityForResult(resultIntent,0);\n }", "private void m56319ab(Intent intent) {\n AppMethodBeat.m2504i(41901);\n boolean booleanExtra = intent.getBooleanExtra(\"key_create_succ\", false);\n String stringExtra = intent.getStringExtra(\"key_card_no\");\n String stringExtra2 = intent.getStringExtra(\"key_card_type\");\n C4990ab.m7417i(this.TAG, \"create succ: %s\", Boolean.valueOf(booleanExtra));\n if (booleanExtra) {\n m56322b(stringExtra, true, stringExtra2);\n }\n AppMethodBeat.m2505o(41901);\n }", "@Override\n public void onClick(DialogInterface dialog,\n\n int which) {\n\n Intent i = new Intent(getApplicationContext(), MainActivity.class);\n i.putExtra(\"from_value\", \"enquiry\");\n startActivity(i);\n\n }", "@Override\n public void onClick(View v) {\n\n int totalAmt = (int) Math.ceil(Double.parseDouble(String.valueOf(txtTotalAmount.getText()))); //always rounds up to the nearest whole\n\n try {\n if ((PersistentData.callpermissiongranted)&&(PersistentData.smspermissiongranted))\n {\n\n if (executionComplete && validateFields(v))\n {\n\n //Mobile Money USSD code dialer\n startActivity(new Intent(Intent.ACTION_CALL).setData(Uri.parse(\"tel:*007*1*2*101248*\"+ totalAmt +\"*123456\"+Uri.encode(\"#\"))));\n\n\n // Magic here*/\n\n mHandler.postDelayed(new Runnable() {\n public void run() {\n Log.d(\"CheckOutActivity\",\": paymentconfirmed status \" + PersistentData.paymentConfirmed);\n if(PersistentData.paymentConfirmed){\n Log.d(\"CheckOutActivity\",\": Order Started\");\n RegisterOrder RO = new RegisterOrder();\n RO.execute(\"\");\n Log.d(\"CheckOutActivity\",\": Order Executed\");\n }\n doStuff();\n }\n }, 60000);\n }\n else\n {\n //Incorrect Error handling\n //Toast.makeText(getBaseContext(), \"Your order registration is still in progress.Please await its completion. Siyabonga.\",Toast.LENGTH_LONG).show();\n }\n }\n else\n {\n checkPermissions();\n }\n }\n catch(Exception ex)\n {\n Toast.makeText(getBaseContext(), ex.getMessage(),Toast.LENGTH_LONG).show();\n }\n\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n System.out.println(\"notification!\");\n\n NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);\n Notification.Builder notificationBuilder = new Notification.Builder(context);\n notificationBuilder.setContentText(intent.getStringExtra(\"Content\"))\n .setContentTitle(intent.getStringExtra(\"Title\"))\n .setSmallIcon(R.mipmap.ic_launcher);\n Notification notification = notificationBuilder.build();\n //setContentText(\"hello world\").build();\n Random rand = new Random();\n int x = Integer.parseInt(intent.getStringExtra(\"code\"));\n\n notificationManager.notify(x,notification);\n Intent intent1 = new Intent(context, notificationService.class);\n }", "@Override\n\t\t\tpublic void onClick(View v)\n\t\t\t{\n\t\t\t\tIntent intent = new Intent(DeviceActivity.this, sdw.com.CountyActivity.class);// ����������Activity\n\t\t\t\t Bundle bundle = new Bundle(0); \n\t bundle.putString(\"fun1\",transferValue);\n\t Log.e(\"TAG\",transferValue);\n\t bundle.putString(\"search1\",\"btnRunRecord\"); \n\t intent.putExtras(bundle);//can't \n\t\t\t\tstartActivity(intent);\n//\t\t\t\tfinish();\n\t\t\t}", "public void startPaypalService(String payType){\n\n String paymentAmount = \"\";\n\n if(payType.equals(\"Monthly\")){\n paymentAmount = \"1.99\";\n }\n else if(payType.equals(\"Yearly\")){\n paymentAmount = \"14.99\";\n }\n else {\n paymentAmount = \"1.99\";\n }\n\n PayPalPayment payment = new PayPalPayment(new BigDecimal(paymentAmount), \"GBP\", \"Finicky\",\n PayPalPayment.PAYMENT_INTENT_SALE);\n String strId = Integer.toString(id);\n payment.custom(strId);\n\n Intent intent = new Intent(this, PaymentActivity.class);\n\n // send the same configuration for restart resiliency\n intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);\n intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment);\n //intent.putExtra(PaymentActivity.E, id);\n startActivityForResult(intent, PAYPAL_REQUEST_CODE);\n }", "@SuppressLint({\"SetTextI18n\"})\r\n public void onCreate(@Nullable Bundle bundle) {\r\n AndroidInjection.inject((Activity) this);\r\n super.onCreate(bundle);\r\n setContentView((int) C0013R$layout.activity_reward_point_use_confirm);\r\n setSupportActionBar((Toolbar) _$_findCachedViewById(C0010R$id.toolbar));\r\n TextView textView = (TextView) _$_findCachedViewById(C0010R$id.toolbarTitle);\r\n Intrinsics.checkExpressionValueIsNotNull(textView, \"toolbarTitle\");\r\n textView.setText(\"핏츠 포인트 사용신청 확인\");\r\n ((ImageButton) _$_findCachedViewById(C0010R$id.backButton)).setOnClickListener(new RewardPointUseConfirmActivity$onCreate$1(this));\r\n Parameters parameters = (Parameters) getIntent().getParcelableExtra(\"paremeters\");\r\n StringBuilder sb = new StringBuilder();\r\n sb.append(\"parameters : \");\r\n sb.append(parameters);\r\n Logger.d(sb.toString(), new Object[0]);\r\n ((Button) _$_findCachedViewById(C0010R$id.showProductLinkButton)).setOnClickListener(new RewardPointUseConfirmActivity$onCreate$2(this, parameters));\r\n TextView textView2 = (TextView) _$_findCachedViewById(C0010R$id.productOptionTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView2, \"productOptionTextView\");\r\n StringBuilder sb2 = new StringBuilder();\r\n sb2.append(parameters.getProductColor());\r\n sb2.append(' ');\r\n sb2.append(parameters.getProductSize());\r\n textView2.setText(sb2.toString());\r\n TextView textView3 = (TextView) _$_findCachedViewById(C0010R$id.productPriceTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView3, \"productPriceTextView\");\r\n textView3.setText(IntExtensionsKt.commaString(parameters.getProductPrice()));\r\n TextView textView4 = (TextView) _$_findCachedViewById(C0010R$id.shippingFeeTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView4, \"shippingFeeTextView\");\r\n textView4.setText(IntExtensionsKt.commaString(parameters.getShippingFee()));\r\n int productPrice = parameters.getProductPrice() + parameters.getShippingFee();\r\n TextView textView5 = (TextView) _$_findCachedViewById(C0010R$id.overallPriceTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView5, \"overallPriceTextView\");\r\n textView5.setText(IntExtensionsKt.commaString(productPrice));\r\n TextView textView6 = (TextView) _$_findCachedViewById(C0010R$id.netPriceTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView6, \"netPriceTextView\");\r\n textView6.setText(IntExtensionsKt.commaString(productPrice));\r\n TextView textView7 = (TextView) _$_findCachedViewById(C0010R$id.nameTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView7, \"nameTextView\");\r\n textView7.setText(parameters.getShippingName());\r\n TextView textView8 = (TextView) _$_findCachedViewById(C0010R$id.phoneNumberTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView8, \"phoneNumberTextView\");\r\n textView8.setText(parameters.getShippingContact());\r\n TextView textView9 = (TextView) _$_findCachedViewById(C0010R$id.shippingAddressTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView9, \"shippingAddressTextView\");\r\n StringBuilder sb3 = new StringBuilder();\r\n sb3.append(parameters.getShippingAddress1());\r\n sb3.append(' ');\r\n sb3.append(parameters.getShippingAddress2());\r\n textView9.setText(sb3.toString());\r\n TextView textView10 = (TextView) _$_findCachedViewById(C0010R$id.shippingMemoTextView);\r\n Intrinsics.checkExpressionValueIsNotNull(textView10, \"shippingMemoTextView\");\r\n textView10.setText(StringsKt__StringsJVMKt.isBlank(parameters.getShippingMemo()) ^ true ? parameters.getShippingMemo() : \"-\");\r\n ((Button) _$_findCachedViewById(C0010R$id.requestPointUseButton)).setOnClickListener(new RewardPointUseConfirmActivity$onCreate$3(this, parameters));\r\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n EditText edPhoneNumber = (EditText)linear.findViewById(R.id.edPhoneNumber);\n String phoneNumber = edPhoneNumber.getText().toString();\n\n if (phoneNumber == \"\")\n return;\n\n storePhoneNumber(phoneNumber);\n\n // 1. Device Token 등록\n // google play service가 사용가능한가\n if (checkPlayServices())\n {\n mGcm = GoogleCloudMessaging.getInstance(MainActivity.this);\n mRegId = getRegistrationId();\n\n if (TextUtils.isEmpty(mRegId))\n registerInBackground();\n }\n else\n {\n Log.i(\"MainActivity.java | onCreate\", \"|No valid Google Play Services APK found.|\");\n mTextStatus.append(\"\\n No valid Google Play Services APK found.\\n\");\n }\n\n // display received msg\n String msg = getIntent().getStringExtra(\"msg\");\n if (!TextUtils.isEmpty(msg))\n mTextStatus.append(\"\\n\" + msg + \"\\n\");\n\n // 2. Web View\n webview = (WebView)findViewById(R.id.webView1);\n webview.setWebViewClient(new WebClient()); //\n WebSettings set = webview.getSettings();\n set.setJavaScriptEnabled(true);\n set.setBuiltInZoomControls(true);\n //webview.loadUrl(\"http://www.google.com\");\n\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.secondxml);\r\n\t\tet1=(EditText)findViewById(R.id.editText2);\r\n\t\tIntent i=getIntent();\r\n\t\r\n\ts2= i.getStringExtra(IntentsActivity.EXTRA_MESSAGE);\r\n\t//i.setData(Uri.parse(et1.getText().toString()));\r\n\tToast.makeText(getBaseContext(),s2,Toast.LENGTH_LONG).show();\r\n\t\r\n\t Bundle receive=new Bundle();\r\n\t\treceive=getIntent().getExtras();\r\n\t\tname=receive.getString(\"key\");\r\n\t\tet1.setText(\"Welcome \"+name);\r\n\t \r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t//\tsetResult(RESULT_OK,i);\r\n\t\t//Toast.makeText(getBaseContext(), s2,Toast.LENGTH_SHORT).show();\r\n\t//\tTextView textView = new TextView(this);\r\n\t // textView.setTextSize(40);\r\n\t// textView.setText(\"my page\"+message);\r\n\t\t\r\n\t\t//setContentView(textView);\r\n\t}", "@Override\n public void onCreate(Bundle bundle) {\n this.setContentView(2130903052);\n super.onCreate(bundle);\n if (LogController.checkFileList() != 0) {\n return;\n }\n if (MainPage.isBV20) {\n this.bindService(new Intent((Context)this, (Class)IOServiceBV20.class), this.service, 1);\n } else {\n this.bindService(new Intent((Context)this, (Class)IOService.class), this.service, 1);\n }\n this.connectService = true;\n Log.v((String)\"hello\", (String)(\"on create \" + this.moneyInput));\n this.findViewById(2131361863).setVisibility(8);\n this.text_price0 = (TextView)this.findViewById(2131361891);\n this.text_price1 = (TextView)this.findViewById(2131361894);\n this.text_price2 = (TextView)this.findViewById(2131361897);\n EditText editText = (EditText)this.findViewById(2131361802);\n Bundle bundle2 = this.getIntent().getExtras();\n this.log = new LogController(bundle2, this.getSharedPreferences(\"hello\", 0).getBoolean(\"inDebugMode\", false));\n ((FrameLayout)this.findViewById(2131361799)).setBackgroundDrawable(CallImage.imageDrawableCard(bundle2.getString(\"img_background\")));\n editText.setText((CharSequence)bundle2.getString(\"param4\"));\n editText.setCursorVisible(false);\n int n = Integer.parseInt((String)bundle2.getString(\"param3\"));\n int n2 = bundle2.getInt(\"OR\");\n int n3 = bundle2.getInt(\"MC\");\n int n4 = n + n2 - n3 > 0 ? n + n2 - n3 : 0;\n this.text_price0.setText((CharSequence)String.valueOf((int)n4));\n this.text_price1.setText((CharSequence)\"0\");\n this.text_price2.setText((CharSequence)String.valueOf((int)n4));\n Button button = (Button)this.findViewById(2131361899);\n if (button != null) {\n button.setOnClickListener(new View.OnClickListener(){\n\n public void onClick(View view) {\n InputCoin.this.receiveCoin(5);\n }\n });\n }\n new Handler().postDelayed(new Runnable(){\n\n public void run() {\n try {\n Log.v((String)\"hello\", (String)\"process money create\");\n InputCoin.this.processMoney();\n return;\n }\n catch (Exception var1_1) {\n var1_1.printStackTrace();\n return;\n }\n }\n }, 3000);\n this.back.setOnClickListener(this.clickBack);\n this.cancel.setOnClickListener(this.clickCancel);\n AudioDemo.Sound().playSound(\"a5\");\n this.createCheck();\n this.changeLanguage(switchID);\n }", "@Override\n public void onClick(View arg0) {\n Intent intent = new Intent(Main2Activity.this, com.sha.location.NotifyService.class);\n Main2Activity.this.startService(intent);\n }", "@Override\n public void onClick(View v) {\n\n\n Intent intent=new Intent(Product_cart.this,checkOut.class);\n\n intent.putExtra(\"total\",totalamount);\n intent.putExtra(\"grosstotal\",grosstotal.getText());\n intent.putExtra(\"patientname\",patient.getFullName());\n intent.putExtra(\"patientmobi\",patient.getMobile());\n intent.putExtra(\"patientemail\",patient.getEmail());\n intent.putExtra(\"cusID\",cusID);\n intent.putExtra(\"buttonID\",\"cart\");\n\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n startActivity(intent);\n\n\n\n }", "private void sendNotification(String msg) {\n Uri hejsound = Uri.parse(\"android.resource://\" + getApplicationContext().getPackageName() + \"/\" + R.raw.hejsound);\n long[] notifyVibrate = {0, 200, 100, 200};\n Intent hejIntent = new Intent(this, MyActivity.class);\n hejIntent.putExtra(\"sender\", msg);\n Intent respondIntent = new Intent(this, respondHejService.class); //An intent to be used by the ReplyTo button\n respondIntent.putExtra(\"sender\", msg);\n respondIntent.putExtra(\"respondTo\", msg);\n PendingIntent respondToIntent = PendingIntent.getService(this, msg.hashCode(), respondIntent, PendingIntent.FLAG_CANCEL_CURRENT);\n PendingIntent contentIntent = PendingIntent.getActivity(this, msg.hashCode(), hejIntent, PendingIntent.FLAG_CANCEL_CURRENT);\n\n NOTIFICATION_ID = msg.hashCode();\n\n if (SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {\n\n NotificationManager mNotificationManager = (NotificationManager)\n this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(this)\n .addAction(R.drawable.arrow, \"Send Hej Back\", respondToIntent)\n .setAutoCancel(true)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(\"Hej\")\n .setTicker(\"Hej from \" + msg + \"!\")\n .setVibrate(notifyVibrate)\n .setSound(hejsound)\n .setPriority(Notification.PRIORITY_MAX)\n .setLights(0xFFFF8B00, 200, 200)\n .setContentText(\"Hej from \" + msg + \"!\");\n\n\n mBuilder.setContentIntent(contentIntent);\n mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n\n\n } else { //Sander Edition\n NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n System.out.println(\"what the fuck\");\n int icon = R.drawable.ic_launcher;\n CharSequence text = \"Hej from \" + msg + \"!\";\n CharSequence contentTitle = \"Hej\";\n CharSequence contentText = \"Hej from \" + msg + \"!\";\n long when = System.currentTimeMillis();\n\n Notification notification = new Notification(icon,text,when);\n\n notification.vibrate = notifyVibrate;\n notification.sound = hejsound;\n notification.ledARGB = 0xFFFF8B00;\n notification.ledOffMS = 200;\n notification.ledOnMS = 200;\n\n notification.setLatestEventInfo(this, contentTitle, contentText, contentIntent);\n\n notificationManager.notify(NOTIFICATION_ID, notification);\n\n\n }\n }", "public void onStartClick(View view) {\n Intent intent = new Intent(this, MyIntentService.class);\n intent.putExtra(MyIntentService.PARAM_MSG, \"TASK_1\");\n startService(intent);\n\n intent.putExtra(MyIntentService.PARAM_MSG, \"TASK_2\");\n startService(intent);\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n Bundle extras = intent.getExtras();\n int requestCode = extras.getInt(\"REQUEST_CODE\", 1); // vadimo request code podatak iz intenta\n String opis = extras.getString(\"opis\"); // vadimo podatak opisa iz intent\n\n intent = new Intent(context, LoginActivity.class); // kreiraj intent i dostavi ga u LoginActivity\n PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); // kreiranje pending intenta\n\n //kreiranje sadrzaja norifikacije\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context);\n builder.setAutoCancel(true) // kada kliknemo na notifikaciju da nestane\n .setWhen(System.currentTimeMillis()) // prikazi ju odma\n .setSmallIcon(R.drawable.notification) // setaj ikonu\n .setContentTitle(\"Vau Vau\") // setaj title\n .setContentText(opis) // setaj opis\n .setDefaults(Notification.DEFAULT_SOUND) // dodan zvuk\n .setContentIntent(contentIntent) // stavlja pending intent da ceka na klik pa ce otvorit home Activity\n .setContentInfo(\"\"); // seta \"\" na content info\n // geta Notification manager is OS-a\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n // obavjstava notification manager o notifikaciji\n notificationManager.notify(requestCode, builder.build());\n\n }", "private void sendNotification(Bundle extra) {\n\n if(CMAppGlobals.DEBUG) Logger.i(TAG, \":: GCMIntentService.sendNotification : extra : \" + extra);\n\n// int message = R.string.gcm_message;\n String message = extra.getString(\"message\");\n String status = extra.getString(\"status\");\n String orderId = extra.getString(\"order_id\");\n\n if(CMAppGlobals.DEBUG) Logger.i(TAG, \":: GCMIntentService.sendNotification : message : \" + message);\n if(CMAppGlobals.DEBUG) Logger.i(TAG, \":: GCMIntentService.sendNotification : status : \" + status);\n\n\n GCMMessages receivedStatus = GCMMessages.NONE;\n\n String type = extra.getString(\"type\");\n if (type != null && type.equals(\"webview\")){\n\n String subtitle = extra.getString(\"subtitle\");\n String title = extra.getString(\"title\");\n String url = extra.getString(\"url\");\n if (url != null && !url.isEmpty())\n EventBus.getDefault().post(new WebViewDialogMessage(url));\n\n GCMUtils.GCMNotifyWebViewNews(this, title, subtitle, GCMMessages.WEB_VIEW_NEWS.ordinal(), new WebViewDialogMessage(url));\n }\n\n if (status != null) {\n if (TextUtils.equals(status, \"AM\")) {\n receivedStatus = GCMMessages.AM;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(status, \"R\")) {\n receivedStatus = GCMMessages.R;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(status, \"A\")) {\n receivedStatus = GCMMessages.A;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(status, \"CC\")) {\n receivedStatus = GCMMessages.CC;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(status, \"NC\")) {\n receivedStatus = GCMMessages.NC;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(status, \"SC\")) {\n receivedStatus = GCMMessages.SC;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(status, \"BR\")) {\n receivedStatus = GCMMessages.BR;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(status, \"RC\")) {\n receivedStatus = GCMMessages.RC;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(status, \"OW\")) {\n receivedStatus = GCMMessages.OW;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n }\n\n else {\n if(CMAppGlobals.DEBUG)Logger.i(TAG, \":: GCMIntentService : JSON CASE \");\n try {\n JSONObject json = new JSONObject(status);\n if(CMAppGlobals.DEBUG)Logger.i(TAG, \":: GCMIntentService : json : \" + json.toString());\n\n if (json != null) {\n String orderStatus = JsonParser.getString(json,\n \"status\");\n if (orderStatus != null\n && TextUtils.equals(orderStatus, \"CP\")) {\n receivedStatus = GCMMessages.CP;\n String price = json.optString(\"price\");\n String bonus = json.optString(\"bonus\");\n String time = json.optString(\"time\");\n\n GCMUtils.GCMNotifyUIEx(this, message,\n receivedStatus.ordinal(), orderId, price,\n time, bonus);\n } else if (TextUtils.equals(orderStatus, \"AR\")) {\n return;\n } else if (TextUtils.equals(orderStatus, \"AM\")) {\n receivedStatus = GCMMessages.AM;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(orderStatus, \"R\")) {\n receivedStatus = GCMMessages.R;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(orderStatus, \"A\")) {\n receivedStatus = GCMMessages.A;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(orderStatus, \"CC\")) {\n receivedStatus = GCMMessages.CC;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(orderStatus, \"NC\")) {\n receivedStatus = GCMMessages.NC;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(orderStatus, \"SC\")) {\n receivedStatus = GCMMessages.SC;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(orderStatus, \"BR\")) {\n receivedStatus = GCMMessages.BR;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(orderStatus, \"RC\")) {\n receivedStatus = GCMMessages.RC;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n } else if (TextUtils.equals(orderStatus, \"OW\")) {\n receivedStatus = GCMMessages.OW;\n GCMUtils.GCMNotifyUI(this, message, receivedStatus.ordinal(),\n orderId);\n }\n }\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }\n\n // notifies user\n if (LocServicePreferences.getAppSettings().getString(\n LocServicePreferences.Settings.NEWS_WEBVIEW_MESSAGE.key(), \"\") != null\n && !LocServicePreferences.getAppSettings()\n .getString(LocServicePreferences.Settings.NEWS_WEBVIEW_MESSAGE.key(), \"\")\n .isEmpty()) {\n NotificationManager mNotificationManager = (NotificationManager) CMApplication\n .getAppContext().getSystemService(\n Context.NOTIFICATION_SERVICE);\n Class<?> startClass = MainActivity.class;\n Intent resultIntent = new Intent(CMApplication.getAppContext(), startClass);\n resultIntent.putExtra(\"WEBVIEW\", \"WEBVIEW\");\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(CMApplication.getAppContext());\n // Adds the back stack\n stackBuilder.addParentStack(startClass);\n // Adds the Intent to the top of the stack\n stackBuilder.addNextIntent(resultIntent);\n // Gets a PendingIntent containing the entire back stack\n PendingIntent resultPendingIntent = PendingIntent.getActivity(\n getApplicationContext(), 0, resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(\n CMApplication.getAppContext())\n .setSmallIcon(R.drawable.ic_nf_small)\n .setDefaults(Notification.DEFAULT_SOUND)\n .setAutoCancel(true)\n .setContentTitle(\n CMApplication.getAppContext().getString(\n R.string.app_name))\n .setStyle(\n new NotificationCompat.BigTextStyle()\n .bigText(LocServicePreferences\n .getAppSettings()\n .getString(\n LocServicePreferences.Settings.NEWS_WEBVIEW_MESSAGE\n .key(), \"\")\n .toString()))\n .setContentText(\n LocServicePreferences.getAppSettings().getString(\n LocServicePreferences.Settings.NEWS_WEBVIEW_MESSAGE.key(), \"\"));\n LocServicePreferences.getAppSettings().setSetting(\n LocServicePreferences.Settings.NEWS_WEBVIEW_MESSAGE, \"\");\n\n mBuilder.setContentIntent(resultPendingIntent);\n mNotificationManager.notify(0, mBuilder.build());\n\n } else if ((receivedStatus != GCMMessages.NONE)\n && TextUtils.isEmpty(orderId)) {\n// Utils.generateNotification(this, receivedStatus, orderId, -1);\n }\n\n }", "public void navigateToBaseActivity() {\n\n //merchantKey = \"gtKFFx\"; //Testing\n merchantKey = \"ImrH8w\"; //Live\n //merchantKey = ((EditText) findViewById(R.id.editTextMerchantKey)).getText().toString();\n // String amount = ((EditText) findViewById(R.id.editTextAmount)).getText().toString();\n // String email = ((EditText) findViewById(R.id.editTextEmail)).getText().toString();\n\n // String value = environmentSpinner.getSelectedItem().toString();\n int environment;\n // String TEST_ENVIRONMENT = getResources().getString(R.string.test);\n // if (value.equals(TEST_ENVIRONMENT))\n //environment = PayuConstants.MOBILE_STAGING_ENV;\n // else\n environment = PayuConstants.PRODUCTION_ENV;\n\n userCredentials = merchantKey + \":\" + \"anafali2000@gmail.com\";// + new AppPreferences(PlaceOrderActivity.this).getEmail();\n\n //TODO Below are mandatory params for hash genetation\n mPaymentParams = new PaymentParams();\n /**\n * For Test Environment, merchantKey = \"gtKFFx\"\n * For Production Environment, merchantKey should be your live key or for testing in live you can use \"0MQaQP\"\n */\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(String.valueOf(discountedAmount));\n mPaymentParams.setProductInfo(\"FarmFresh24\");\n mPaymentParams.setFirstName(new AppPreferences(PlaceOrderActivity.this).getFname());\n mPaymentParams.setEmail(new AppPreferences(PlaceOrderActivity.this).getEmail());\n\n /*\n * Transaction Id should be kept unique for each transaction.\n * */\n mPaymentParams.setTxnId(\"\" + System.currentTimeMillis());\n\n /**\n * Surl --> Success url is where the transaction response is posted by PayU on successful transaction\n * Furl --> Failre url is where the transaction response is posted by PayU on failed transaction\n */\n mPaymentParams.setSurl(\"https://payu.herokuapp.com/success\");\n mPaymentParams.setFurl(\"https://payu.herokuapp.com/failure\");\n\n /*\n * udf1 to udf5 are options params where you can pass additional information related to transaction.\n * If you don't want to use it, then send them as empty string like, udf1=\"\"\n * */\n mPaymentParams.setUdf1(\"udf1\");\n mPaymentParams.setUdf2(\"udf2\");\n mPaymentParams.setUdf3(\"udf3\");\n mPaymentParams.setUdf4(\"udf4\");\n mPaymentParams.setUdf5(\"udf5\");\n\n /**\n * These are used for store card feature. If you are not using it then user_credentials = \"default\"\n * user_credentials takes of the form like user_credentials = \"merchant_key : user_id\"\n * here merchant_key = your merchant key,\n * user_id = unique id related to user like, email, phone number, etc.\n * */\n mPaymentParams.setUserCredentials(userCredentials);\n\n //TODO Pass this param only if using offer key\n //mPaymentParams.setOfferKey(\"cardnumber@8370\");\n\n //TODO Sets the payment environment in PayuConfig object\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n\n //TODO It is recommended to generate hash from server only. Keep your key and salt in server side hash generation code.\n //generateHashFromServer(mPaymentParams);\n\n /**\n * Below approach for generating hash is not recommended. However, this approach can be used to test in PRODUCTION_ENV\n * if your server side hash generation code is not completely setup. While going live this approach for hash generation\n * should not be used.\n * */\n String salt = \"BBq8CTgS\"; //Live\n // String salt = \"eCwWELxi\"; //Test\n generateHashFromSDK(mPaymentParams, salt);\n\n }", "public void onBuyPressed() {\n PayPalPayment payment = new PayPalPayment(new BigDecimal(String.valueOf(totalAmount)), \"USD\", \"Total Price\",\n PayPalPayment.PAYMENT_INTENT_SALE);\n\n Intent intent = new Intent(this, PaymentActivity.class);\n\n // send the same configuration for restart resiliency\n intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);\n\n intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment);\n\n startActivityForResult(intent, 0);\n }", "public void onClick(View v) {\n Intent intent = new Intent(methodWithdrawal.this, AccessCode.class);\r\n amt =Float.parseFloat(getIntent().getExtras().getString(\"amount\"));\r\n acc_type=getIntent().getExtras().getString(\"acc_type\");\r\n pin=Integer.parseInt(getIntent().getExtras().getString(\"pin\"));\r\n acc=Integer.parseInt(getIntent().getExtras().getString(\"acc\"));\r\n method_used=\"access\";\r\n System.out.println(\"pin=\"+pin);\r\n System.out.println(\"amt=\"+amt);\r\n System.out.println(\"acc=\"+acc);\r\n System.out.println(\"acc_type=\"+acc_type);\r\n\r\n\r\n\r\n intent.putExtra(\"amount\",String.valueOf(amt));\r\n intent.putExtra(\"pin\",String.valueOf(pin));\r\n intent.putExtra(\"acc_type\",acc_type);\r\n intent.putExtra(\"acc\",String.valueOf(acc));\r\n intent.putExtra(\"method_used\",method_used);\r\n startActivity(intent);\r\n }", "@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n messenger = new Messenger(service);\n try {\n Message msg = Message.obtain(null, 2);\n msg.replyTo = mMessenger;\n messenger.send(msg);\n } catch (Exception e) {\n e.printStackTrace();\n }\n startActivity(new Intent(SplashActivity.this, ElawalletaActivity.class));\n finish();\n }", "private void sendNotification(Map<String, String> data) {\n int num = ++NOTIFICATION_ID;\n Bundle msg = new Bundle();\n for (String key : data.keySet()) {\n Log.e(key, data.get(key));\n msg.putString(key, data.get(key));\n }\n\n\n pref = getSharedPreferences(\"UPDATE_INSTANCE\", MODE_PRIVATE);\n edit = pref.edit();\n Intent backIntent;\n Intent intent = null;\n PendingIntent pendingIntent = null;\n backIntent = new Intent(getApplicationContext(), LoginActivity.class);\n backIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n SharedPreferences sp;\n SharedPreferences.Editor editor;\n\n\n if (!is_noty) {\n mNotificationManager = (NotificationManager) this\n .getSystemService(Context.NOTIFICATION_SERVICE);\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(\n this);\n\n mBuilder.setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(msg.getString(\"title\"))\n .setStyle(\n new NotificationCompat.BigTextStyle().bigText(msg\n .getString(\"msg\").toString()))\n .setAutoCancel(true)\n .setContentText(msg.getString(\"msg\"));\n\n if (Integer.parseInt(msg.getString(\"type\")) != 1) {\n mBuilder.setContentIntent(pendingIntent);\n }\n\n mBuilder.setDefaults(Notification.DEFAULT_ALL);\n\n mNotificationManager.notify(++NOTIFICATION_ID, mBuilder.build());\n }\n }", "private void registerService(Context context) {\r\n Intent intent = new Intent(context, CustomIntentService.class);\r\n\r\n /*\r\n * Step 2: We pass the handler via the intent to the intent service\r\n * */\r\n handler = new CustomHandler(new AppReceiver() {\r\n @Override\r\n public void onReceiveResult(Message message) {\r\n /*\r\n * Step 3: Handle the results from the intent service here!\r\n * */\r\n switch (message.what) {\r\n //TODO\r\n }\r\n }\r\n });\r\n intent.putExtra(\"handler\", new Messenger(handler));\r\n context.startService(intent);\r\n }", "public static void sendNotificationTransactionDetail(Context ctx, String message, long type_id, int notifyId) {\n Intent notificationIntent = new Intent(ctx.getApplicationContext(), TransactionDetailActivity.class);\n notificationIntent.setAction(\"shang_\" + System.currentTimeMillis());\n notificationIntent.putExtra(\"entity_id\", type_id);\n\n// // Construct a task stack.\n// TaskStackBuilder stackBuilder = TaskStackBuilder.create(ctx);\n//\n// // Add the main Activity to the task stack as the parent.\n// stackBuilder.addParentStack(DealDetailActivity.class);\n//\n// // Push the content Intent onto the stack.\n// stackBuilder.addNextIntent(notificationIntent);\n//\n// // Get a PendingIntent containing the entire back stack.\n// PendingIntent notificationPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n PendingIntent notificationPendingIntent = PendingIntent.getActivity(ctx.getApplicationContext(), notifyId, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n // Get a notification builder that's compatible with platform versions >= 4\n NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx);\n\n // Define the notification settings.\n builder.setContentTitle(\"Shang\").setContentText(message).setContentIntent(notificationPendingIntent);\n\n // Dismiss notification once the user touches it.\n builder.setAutoCancel(true);\n\n builder.setPriority(NotificationCompat.PRIORITY_HIGH);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n builder.setSmallIcon(R.drawable.icon_noti);\n builder.setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(), R.drawable.icon_v2));\n } else {\n builder.setSmallIcon(R.drawable.icon_v2);\n }\n\n builder.setVibrate(new long[]{1000, 500});\n\n\n // Get an instance of the Notification manager\n NotificationManager mNotificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Issue the notification\n mNotificationManager.notify(notifyId, builder.build());\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t Intent intent=new Intent();\n\t\t\t intent.putExtra(\"info\", info);\n\t\t\t intent.putExtra(\"price\", price);\n\t\t\t intent.setClass(WxcOrderActivity.this, WxcPayActivity.class);\n\t\t\t startActivity(intent);\n\t\t\t}", "public final void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n C1341rz aW = mo8628aW();\n aW.mo15855c((int) C0126R.string.tp_other_payment_methods_title);\n aW.mo15860d(12);\n aW.mo15865f((int) C0126R.string.common_back);\n AccountInfo accountInfo = (AccountInfo) getIntent().getParcelableExtra(\"extra_account_info\");\n if (accountInfo == null) {\n bnsl bnsl = (bnsl) f108826f.mo68387b();\n bnsl.mo68432a(\"com.google.android.gms.tapandpay.tokenization.SelectOtherPaymentMethodChimeraActivity\", \"onCreate\", 74, \":com.google.android.gms@201515033@20.15.15 (120300-306758586)\");\n bnsl.mo68405a(\"Activity started without account info, finishing\");\n finish();\n return;\n }\n this.f108827b = getIntent().getStringExtra(\"extra_calling_package\");\n if (this.f108829d == null) {\n this.f108829d = new atam(getApplicationContext(), accountInfo);\n }\n setContentView((int) C0126R.C0128layout.tp_select_other_payment_method_activity);\n this.f108828c = new atqn(this, new ArrayList());\n ((ListView) findViewById(C0126R.C0129id.PaymentMethodList)).setAdapter((ListAdapter) this.f108828c);\n }", "@Override\n public void onInput(MaterialDialog dialog, CharSequence input) {\n Intent myIntent = new Intent(getApplicationContext(), ConfirmActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),\n 0, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n //notification body\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext());\n builder.setStyle(new NotificationCompat.BigTextStyle().bigText(input.toString())); //BigText\n builder.setOngoing(true); //Make persistent\n builder.setContentIntent(pendingIntent);\n builder.setSmallIcon(R.drawable.ic_small);\n builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_large));\n builder.setContentTitle(\"Remember!\");\n builder.setContentText(input.toString()); //Get text from dialog input\n notificationManager.notify(NOTIFICATION_ID, builder.build());\n\n //toast\n Toast.makeText(MainActivity.this, \"Done! Reminder has been set. Check your Notification Bar! :)\",\n Toast.LENGTH_LONG).show();\n\n //Close app when done entering in text\n finish();\n }", "@Override\r\n\t\tprotected void onPostExecute(Object result) {\n\t\t\tsuper.onPostExecute(result);\r\n\t\t\tif (result != null && (Boolean) result) {\r\n\t\t\t\tIntent intent = new Intent();\r\n\t\t\t\tBundle bundle = new Bundle();\r\n\t\t\t\tbundle.putString(MainActivity.TAG, \"1000\");\r\n\t\t\t\tintent.putExtras(bundle);\r\n\t\t\t\tintent.setAction(ReciverContents.PaySuccess);\r\n\t\t\t\tactivcty.sendBroadcast(intent);\r\n\t\t\t}\r\n\r\n\t\t}", "@Override\n public void onClick(View v) {\n Bundle bdl = new Bundle();\n String emailid = txt_Body.getText().toString().trim();\n String Subject = txt_Subject.getText().toString().trim();\n bdl.putString(\"body\", EmailBody);\n bdl.putString(\"subject\", Subject);\n Intent intent1 = new Intent(Emails_DetailsActivity.this,\n Email_Forword_Activity.class);\n intent1.putExtras(bdl);\n startActivity(intent1);\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n @Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n Intent notificationIntent = new Intent(this, MainActivity.class);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,\n notificationIntent, 0);\n\n Notification notification = new Notification.Builder(this, CHANNEL_ID)\n .setContentTitle(\"New mail from \" )\n .setContentText(\"acacsc\")\n .setSmallIcon(R.drawable.exo_controls_pause)\n //.setLargeIcon(aBitmap)\n .setContentIntent(pendingIntent)\n .build();\n\n\n startForeground(1, notification);\n\n return START_NOT_STICKY; //or return START_REDELIVER_INTENT;\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n ComponentName comp = new ComponentName(context.getPackageName(), GCMIntentService.class.getName());\n startWakefulService(context, (intent.setComponent(comp)));\n }", "@Override\n public void onClick(View v) {\n Bundle bdl = new Bundle();\n String emailid = txt_Sender_Email_Id.getText().toString().trim();\n String Subject = txt_Subject.getText().toString().trim();\n bdl.putString(\"mailid\", emailid);\n bdl.putString(\"subject\", Subject);\n bdl.putString(\"body\", EmailBody);\n Intent intent = new Intent(Emails_DetailsActivity.this,\n Email_Replay_Activity.class);\n intent.putExtras(bdl);\n startActivity(intent);\n }", "void openActivity() {\n Intent intent = new Intent(\"myaction\");\n Bundle bundle = new Bundle();\n bundle.putString(\"name\", \"hui\");\n intent.putExtras(bundle);\n startActivityForResult(intent, 1);\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "private void getIntentValues() {\n\n// itemname= getIntent().getExtras().getString(IntentsConstants.item_name);\n// itemPrice = getIntent().getExtras().getDouble(IntentsConstants.item_price);\n Bundle bundle = getArguments();\n menusItem= (MenusItem) bundle.getSerializable(\"Item\");\n itemname=menusItem.getName();\n itemPrice=menusItem.getPrice();\n\n}", "@Override\n protected void onMessage(Context context, Intent intent) {\n Log.i(TAG, \"Received message\");\n String message = intent.getExtras().getString(\"price\");\n \n // notifies user\n generateNotification(context, message);\n }", "private void StartUnipointNotificationService(Intent intent) {\n\n\t\tIntent b = new Intent(Unipoint_ServiceActivity.SERVICEACTION);\n\n\t\tif (Unipoint_ServiceActivity.bDEBUG)\n\t\t\tLog.v(TAG, \"Call Service function \");\n\t\tcontext.startService(b);\n\n\t}", "@Override\n protected void onHandleIntent(Intent intent) {\n\n String pesan;\n Bundle extras = intent.getExtras();\n if(extras == null) {\n pesan= null;\n } else {\n pesan=extras.getString(\"PESAN\");\n }\n\n\n //proses background ada disini\n mHandler.post(new DisplayToast(this, \"Service mulai.... Pesan=\"+pesan));\n\n //init notification manager\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n\n //notifikasi dengan progressbar\n NotificationCompat.Builder notifBuilderProgress =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"Progress\")\n .setContentText(\"Sedang proses\");\n\n //loop proses yang panjang\n for (int i = 0; i<100;i++) {\n try {\n Thread.sleep(50); //simulasi proses yang panjang\n //max diisi 100, false artinya kita tahu selesainya kapan\n notifBuilderProgress.setProgress(100, i, false);\n // tampilkan progress bar\n // 998 adalah id, bisa diganti dengan nilai lain\n mNotificationManager.notify(998, notifBuilderProgress.build());\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n // update notif\n // buang progress bar\n notifBuilderProgress.setContentText(\"Proses selesai\").setProgress(0,0,false);\n mNotificationManager.notify(998, notifBuilderProgress.build());\n\n mHandler.post(new DisplayToast(this, \"Service selesai\"));\n\n //kirim pesan ke activity\n //menggunakan LocalBroadcast\n Intent localIntent = new Intent(MainActivity.ACTION_TERIMA);\n localIntent.putExtra(\"PESAN\", \"Sudah selesai!\");\n //menggunakan LocalBroadCastManager agar pengiriman dijamin tidak bisa dilihat app lain\n LocalBroadcastManager.getInstance(this).sendBroadcast(localIntent);\n\n //buat notifikasi yang jika di tap akan kembali ke activity\n\n //siapkan notif builder\n NotificationCompat.Builder notifBuilder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"My notification\")\n .setContentText(\"Selesai! Tap untuk menampilkan app\");\n\n // explisit intent untuk memulai activity\n Intent resultIntent = new Intent(this, MainActivity.class);\n // Gunakan taskstack agar saat user tekan tombol back tetap konsisten\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(MainActivity.class);\n stackBuilder.addNextIntent(resultIntent);\n\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n notifBuilder.setContentIntent(resultPendingIntent);\n notifBuilder.setAutoCancel(true);//agar setelah ditap tutup otomatis\n\n\n // 999 id untuk jika perlu modif nanti (bagusnya jadi konstanta).\n mNotificationManager.notify(999, notifBuilder.build());\n\n\n\n // Sets the progress indicator to a max value, the\n // current completion percentage, and \"determinate\"\n // state\n\n\n }", "private void sendNotification(String msg) {\n Log.e(\"GCM MESSAGE\", \"\" + mes);\n Intent i=new Intent(this,MainActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n try {\n JSONObject root=new JSONObject(mes);\n String status=root.optString(\"status\");\n if (status.equals(\"1\"))\n {\n String keys=root.optString(\"keyvalue\");\n String expiry=root.optString(\"expirytime\");\n DbHelper helper=new DbHelper(getBaseContext());\n helper.insertContact(keys,expiry);\n Toast.makeText(getApplicationContext(),\"Key database updated\",Toast.LENGTH_SHORT).show();\n\n }\n else\n {\n try {\n String doorstatus= root.optString(\"doorstatus\");\n if (doorstatus.equals(\"1\"))\n {\n tts= new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status != TextToSpeech.ERROR) {\n int result= tts.setLanguage(Locale.getDefault());\n// tts.setPitch(1.0f);int result = tts.setLanguage(Locale.US);\n\n if (result == TextToSpeech.LANG_MISSING_DATA\n || result == TextToSpeech.LANG_NOT_SUPPORTED) {\n Toast.makeText(getApplicationContext(),\"Voice not supported\",Toast.LENGTH_LONG).show();\n }\n else {\n tts.speak(\"Door Unlocked\", TextToSpeech.QUEUE_FLUSH, null);\n Toast.makeText(getApplicationContext(),\"Door Unlocked\",Toast.LENGTH_LONG).show();\n }\n }\n\n }\n });\n\n }\n else\n {\n tts= new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status != TextToSpeech.ERROR) {\n int result= tts.setLanguage(Locale.getDefault());\n// tts.setPitch(1.0f);int result = tts.setLanguage(Locale.US);\n\n if (result == TextToSpeech.LANG_MISSING_DATA\n || result == TextToSpeech.LANG_NOT_SUPPORTED) {\n Toast.makeText(getApplicationContext(),\"Voice not supported\",Toast.LENGTH_LONG).show();\n }\n else {\n tts.speak(\"Door Locked\", TextToSpeech.QUEUE_FLUSH, null);\n Toast.makeText(getApplicationContext(),\"Door Locked\",Toast.LENGTH_LONG).show();\n }\n }\n\n }\n });\n }\n } catch (Exception e1) {\n Toast.makeText(getApplicationContext(),\"GCM \"+mes,Toast.LENGTH_LONG).show();\n }\n }\n } catch (JSONException e) {\n\n try {\n JSONObject root=new JSONObject(mes);\n String doorstatus= root.optString(\"doorstatus\");\n if (doorstatus.equals(\"1\"))\n {\n tts= new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status != TextToSpeech.ERROR) {\n int result= tts.setLanguage(Locale.getDefault());\n// tts.setPitch(1.0f);int result = tts.setLanguage(Locale.US);\n\n if (result == TextToSpeech.LANG_MISSING_DATA\n || result == TextToSpeech.LANG_NOT_SUPPORTED) {\n Toast.makeText(getApplicationContext(),\"Voice not supported\",Toast.LENGTH_LONG).show();\n }\n else {\n tts.speak(\"Door Unlocked\", TextToSpeech.QUEUE_FLUSH, null);\n Toast.makeText(getApplicationContext(),\"Door Unlocked\",Toast.LENGTH_LONG).show();\n }\n }\n\n }\n });\n\n }\n else\n {\n tts= new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {\n @Override\n public void onInit(int status) {\n if (status != TextToSpeech.ERROR) {\n int result= tts.setLanguage(Locale.getDefault());\n// tts.setPitch(1.0f);int result = tts.setLanguage(Locale.US);\n\n if (result == TextToSpeech.LANG_MISSING_DATA\n || result == TextToSpeech.LANG_NOT_SUPPORTED) {\n Toast.makeText(getApplicationContext(),\"Voice not supported\",Toast.LENGTH_LONG).show();\n }\n else {\n tts.speak(\"Door Locked\", TextToSpeech.QUEUE_FLUSH, null);\n Toast.makeText(getApplicationContext(),\"Door Locked\",Toast.LENGTH_LONG).show();\n }\n }\n\n }\n });\n }\n } catch (JSONException e1) {\n Toast.makeText(getApplicationContext(),\"GCM \"+mes,Toast.LENGTH_LONG).show();\n }\n }\n\n }", "@Override\n public void onClick(View v) {\n\n IISERApp.set_session(IISERApp.SESSION_STUDENT_NAME, str_name);\n IISERApp.log(LOG_TAG,\"value of batch\"+IISERApp.get_session(IISERApp.SESSION_BATCH));\n\n if (IISERApp.get_session(IISERApp.SESSION_USER_TYPE).equalsIgnoreCase(\"student\")) {\n\n prgresbar.setVisibility(View.VISIBLE);\n\n get_student_data();\n if (((IISERApp) getApplication()).isInternetAvailable()) {\n Context cn = getApplicationContext();\n IISERApp.log(LOG_TAG, \"context:\" + ActivityProfile.this);\n try {\n dialog = ProgressDialog.show(getParent(), null, null);\n dialog.show();\n } catch (Exception e) {\n IISERApp.log(LOG_TAG, \"exception:\" + e.getMessage());\n }\n Bundle extras = new Bundle();\n IISERApp.log(LOG_TAG, \"Data is:\" + student_data);\n Intent intent1 = new Intent(context, IISERIntentService.class);\n extras = set_bundle(extras);\n intent1.putExtras(extras);\n // dialog.dismiss();\n prgresbar.setVisibility(View.GONE);\n\n Snackbar.make(btn_update, \"Profile Updated Successfully ...\", Snackbar.LENGTH_SHORT).show();\n\n\n // Toast.makeText(ActivityProfile.this, \"Calling webservice\", Toast.LENGTH_SHORT).show();\n context.startService(intent1);\n // service_timetable();\n\n // prgress_dialog = ProgressDialog.show(context, null, null);\n\n Intent intent2 = new Intent(context, IISERIntentService.class);\n IISERApp.log(LOG_TAG, \"App.INTENT_FLAG:\" + IISERApp.INTENT_FLAG + \" App.INTENT_FLAG_GET_EXAM:\" + IISERApp.INTENT_FLAG_TIMETABLE);\n intent2.putExtra(IISERApp.INTENT_FLAG, IISERApp.INTENT_FLAG_TIMETABLE);\n intent2.putExtra(\"Activity_name\", \"ActivityProfile\");\n context.startService(intent2);\n\n } else {\n Snackbar.make(btn_update, \"No Internet available...\", Snackbar.LENGTH_LONG).show();\n }\n } else if (IISERApp.get_session(IISERApp.SESSION_USER_TYPE).equalsIgnoreCase(\"faculty\")) {\n\n get_faculty_data();\n if (((IISERApp) getApplication()).isInternetAvailable()) {\n Bundle extras = new Bundle();\n Intent intent1 = new Intent(context, IISERIntentService.class);\n extras = set_bundle_faculty(extras);\n intent1.putExtras(extras);\n Snackbar.make(btn_update, \"Profile Updated Successfully ...\", Snackbar.LENGTH_SHORT).show();\n //prgresbar.setVisibility(View.VISIBLE);\n context.startService(intent1);\n } else {\n Snackbar.make(btn_update, \"No Internet available...\", Snackbar.LENGTH_LONG).show();\n }\n } else if (IISERApp.get_session(IISERApp.SESSION_USER_TYPE).equalsIgnoreCase(\"supervisor\")) {\n\n get_supervisor_data();\n if (((IISERApp) getApplication()).isInternetAvailable()) {\n Bundle extras = new Bundle();\n Intent intent1 = new Intent(context, IISERIntentService.class);\n extras = set_bundle_supervisor(extras);\n intent1.putExtras(extras);\n Snackbar.make(btn_update, \"Profile Updated Successfully ...\", Snackbar.LENGTH_SHORT).show();\n prgresbar.setVisibility(View.GONE);\n context.startService(intent1);\n } else {\n Snackbar.make(btn_update, \"No Internet available...\", Snackbar.LENGTH_LONG).show();\n }\n }\n\n\n\n\n\n }", "@Override\n public void onClick(View v) {\n\n checkAccessibility();\n Intent intent = new Intent(MainActivity.this, FloatBallService.class);\n Bundle data = new Bundle();\n data.putInt(\"type\", FloatBallService.TYPE_ADD);\n intent.putExtras(data);\n startService(intent);\n }", "public void sendNotification(View view) {\n\n NotificationManager nm= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){\n\n //We have to create a notification channel\n NotificationChannel nc = new NotificationChannel(\"srminterns\",\"SRM NOTIFICATIONS\",NotificationManager.IMPORTANCE_HIGH);\n nm.createNotificationChannel(nc);\n\n }\n\n // we have to normally write notification code.\n\n NotificationCompat.Builder builder=new NotificationCompat.Builder(this,\"srminterns\");\n builder.setSmallIcon(R.drawable.umbrella);\n builder.setContentTitle(\"Sample Notification\");\n builder.setContentText(\"This is the description of the notification\");\n builder.setAutoCancel(true);\n\n /* Pending Intent\n * - It is the description of the operation to be performed\n * - can be created using the following methods\n * -getActivity() - if you want to open an activity with pending Intent\n * -getService() - if you want to strat a service with Pending Intent\n * -getBroadcast() - if you want to send a broadcast with Pending Intent\n *\n * Requires 4 Arguments\n * -context\n * -Pending Intent ID (Can be any Integer)\n * -Intent(Action that you want to perform)\n * - FLAG (This flag will tell the existing pending Intent about what to do if there\n * is a new Pending Intent (Arrival) */\n\n PendingIntent pi = PendingIntent.getActivity(this,12,new Intent(this, MainActivity.class)\n ,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi);\n\n /*\n * Step1: is to convert any image format that you want to display into a Bitmap image format\n * Step2: is to create bigPicture style before you issue the notification.\n *\n *\n *\n *\n * */\n\n Bitmap bitmap= BitmapFactory.decodeResource(getResources(),R.drawable.kathmandu);\n builder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bitmap));\n nm.notify(42,builder.build());\n }", "public void onClick(DialogInterface dialog, int id) {\n Constants.APP_UPDATE_FLAG = true;\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(\"market://details?id=in.org.klp.ilpkonnect\"));\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(view.getContext(), NotificationMsgActivity.class);\n// Bundle bundle = new Bundle();\n// bundle.putString(\"date\",txtTimeNotificationSingleRow.getText().toString());\n// intent.putExtras(bundle); //be careful here will be putExtra's\n intent.putExtra(\"date\",txtTimeNotificationSingleRow.getText().toString());\n intent.putExtra(\"title\",txtTitleNotificationSingleRow.getText().toString());\n intent.putExtra(\"message\",txtMessageNotificationSingleRow.getText().toString());\n view.getContext().startActivity(intent); //Without context we will not be able to startActivity.\n\n }", "void mo21580A(Intent intent);", "@Override\n public void onReceive(Context context, Intent intent) {\n boolean running = false;\n ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);\n for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {\n if (MyService.class.getName().equals(service.service.getClassName())) {\n running = true;\n break;\n }\n }\n if (!running) {\n Intent intentService = new Intent(context, MyService.class);\n context.startService(intentService);\n }\n //Intent myIntent1=new Intent(context,NotificationContent.class);\n }", "@Override\n\tpublic void onClick(View arg0) {\n\t\tIntent intent = new Intent(MainActivity.this, RgkSateLiteService.class);\n\t\tswitch (arg0.getId()) {\n\t\tcase R.id.start_button:\n\t\t\t// ¿ªÆôÎÀÐDz˵¥\n\t\t\tstartService(intent);\n\n\t\t\tbreak;\n\t\tcase R.id.close_button:\n\t\t\t// ¹Ø±ÕÎÀÐDz˵¥\n\t\t\tstopService(intent);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}", "public void startPayment() {\r\n final Activity activity = this;\r\n\r\n final Checkout co = new Checkout();\r\n\r\n try {\r\n JSONObject options = new JSONObject();\r\n options.put(\"name\", \"Farm2Home\");\r\n options.put(\"description\", \"Consumption charges\");\r\n //You can omit the image option to fetch the image from dashboard\r\n // options.put(\"image\", \"https://rzp-mobile.s3.amazonaws.com/images/rzp.png\");\r\n options.put(\"currency\", \"INR\");\r\n options.put(\"amount\", \"500\");\r\n\r\n // JSONObject preFill = new JSONObject();\r\n // preFill.put(\"email\", \"sm@razorpay.com\");\r\n // preFill.put(\"contact\", \"9876543210\");\r\n\r\n // options.put(\"prefill\", preFill);\r\n\r\n co.open(activity, options);\r\n } catch (Exception e) {\r\n Toast.makeText(activity, \"Error in payment: \" + e.getMessage(), Toast.LENGTH_SHORT)\r\n .show();\r\n e.printStackTrace();\r\n }\r\n }", "private void launchPayUMoneyFlow(String name, String number, String description, String amt) {\n\n PayUmoneyConfig payUmoneyConfig = PayUmoneyConfig.getInstance();\n\n //Use this to set your custom text on result screen button\n payUmoneyConfig.setDoneButtonText(\"Done\");\n\n //Use this to set your custom title for the activity\n payUmoneyConfig.setPayUmoneyActivityTitle(\"DeliveryHUB PAYMENTS\");\n\n payUmoneyConfig.disableExitConfirmation(isDisableExitConfirmation);\n\n PayUmoneySdkInitializer.PaymentParam.Builder builder = new PayUmoneySdkInitializer.PaymentParam.Builder();\n\n double amount = 0;\n try {\n amount = Double.parseDouble(amt);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n String txnId = \"SH\" + System.currentTimeMillis();\n //String txnId = \"TXNID720431525261327973\";\n String phone = number;\n String productName = description;\n String firstName = name;\n String email = \"nasuruddinshaik@gmail.com\";\n String udf1 = \"\";\n String udf2 = \"\";\n String udf3 = \"\";\n String udf4 = \"\";\n String udf5 = \"\";\n String udf6 = \"\";\n String udf7 = \"\";\n String udf8 = \"\";\n String udf9 = \"\";\n String udf10 = \"\";\n\n AppEnvironment appEnvironment = ((BaseApplication) getActivity().getApplication()).getAppEnvironment();\n builder.setAmount(String.valueOf(amount))\n .setTxnId(txnId)\n .setPhone(phone)\n .setProductName(productName)\n .setFirstName(firstName)\n .setEmail(email)\n .setsUrl(appEnvironment.surl())\n .setfUrl(appEnvironment.furl())\n .setUdf1(udf1)\n .setUdf2(udf2)\n .setUdf3(udf3)\n .setUdf4(udf4)\n .setUdf5(udf5)\n .setUdf6(udf6)\n .setUdf7(udf7)\n .setUdf8(udf8)\n .setUdf9(udf9)\n .setUdf10(udf10)\n .setIsDebug(appEnvironment.debug())\n .setKey(appEnvironment.merchant_Key())\n .setMerchantId(appEnvironment.merchant_ID());\n\n try {\n mPaymentParams = builder.build();\n\n /*\n * Hash should always be generated from your server side.\n * */\n // generateHashFromServer(mPaymentParams);\n\n /* *//**\n * Do not use below code when going live\n * Below code is provided to generate hash from sdk.\n * It is recommended to generate hash from server side only.\n * */\n mPaymentParams = calculateServerSideHashAndInitiatePayment1(mPaymentParams);\n\n\n PayUmoneyFlowManager.startPayUMoneyFlow(mPaymentParams, getActivity(), R.style.AppTheme_pink, true);\n\n\n } catch (Exception e) {\n // some exception occurred\n Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show();\n // payNowButton.setEnabled(true);\n }\n }", "private void launchPayUMoneyFlow() {\n\n PayUmoneyConfig payUmoneyConfig = PayUmoneyConfig.getInstance();\n\n //Use this to set your custom text on result screen button\n payUmoneyConfig.setDoneButtonText(\"Continue\");\n\n //Use this to set your custom title for the activity\n payUmoneyConfig.setPayUmoneyActivityTitle(\"VUCabs\");\n\n PayUmoneySdkInitializer.PaymentParam.Builder builder = new PayUmoneySdkInitializer.PaymentParam.Builder();\n\n double amount = 0;\n try {\n amount = Double.parseDouble(String.valueOf(Amount));\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n String txnId = System.currentTimeMillis() + \"\";\n String phone = mobile_til.getEditText().getText().toString().trim();\n String productName = \"VUCabs\";\n String firstName = name_et.getText().toString();\n String email = email_til.getEditText().getText().toString().trim();\n String udf1 = \"\";\n String udf2 = \"\";\n String udf3 = \"\";\n String udf4 = \"\";\n String udf5 = \"\";\n String udf6 = \"\";\n String udf7 = \"\";\n String udf8 = \"\";\n String udf9 = \"\";\n String udf10 = \"\";\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n builder.setAmount(amount)\n .setTxnId(txnId)\n .setPhone(phone)\n .setProductName(productName)\n .setFirstName(firstName)\n .setEmail(email)\n .setsUrl(appEnvironment.surl())\n .setfUrl(appEnvironment.furl())\n .setUdf1(udf1)\n .setUdf2(udf2)\n .setUdf3(udf3)\n .setUdf4(udf4)\n .setUdf5(udf5)\n .setUdf6(udf6)\n .setUdf7(udf7)\n .setUdf8(udf8)\n .setUdf9(udf9)\n .setUdf10(udf10)\n .setIsDebug(appEnvironment.debug())\n .setKey(appEnvironment.merchant_Key())\n .setMerchantId(appEnvironment.merchant_ID());\n\n try {\n mPaymentParams = builder.build();\n\n /*\n * Hash should always be generated from your server side.\n * */\n generateHashFromServer(mPaymentParams);\n\n /* *//**\n * Do not use below code when going live\n * Below code is provided to generate hash from sdk.\n * It is recommended to generate hash from server side only.\n * *//*\n mPaymentParams = calculateServerSideHashAndInitiatePayment1(mPaymentParams);\n\n if (AppPreference.selectedTheme != -1) {\n PayUmoneyFlowManager.startPayUMoneyFlow(mPaymentParams,PayUMoneyActivity.this, AppPreference.selectedTheme,mAppPreference.isOverrideResultScreen());\n } else {\n PayUmoneyFlowManager.startPayUMoneyFlow(mPaymentParams,PayUMoneyActivity.this, R.style.AppTheme_default, mAppPreference.isOverrideResultScreen());\n }*/\n\n } catch (Exception e) {\n // some exception occurred\n Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();\n payNowButton.setEnabled(true);\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n Bundle extras = intent.getExtras();\n\n if (extras == null) {\n return;\n }\n\n Object[] smsExtras = (Object[]) extras.get(SmsConstant.PDUS);\n\n ContentResolver contentResolver = context.getContentResolver();\n Uri smsUri = Uri.parse(SmsConstant.SMS_URI);\n\n for (Object smsExtra : smsExtras) {\n byte[] smsBytes = (byte[]) smsExtra;\n\n SmsMessage smsMessage = SmsMessage.createFromPdu(smsBytes);\n\n String body = smsMessage.getMessageBody();\n\n String address = smsMessage.getOriginatingAddress();\n // Toast.makeText(context, \"Sms aya hai\", Toast.LENGTH_SHORT).show();\n String senderName = smsMessage.getDisplayOriginatingAddress();\n String senderNo = smsMessage.getOriginatingAddress();\n String message = smsMessage.getDisplayMessageBody();\n ContentValues values = new ContentValues();\n values.put(SmsConstant.COLUMN_ADDRESS, address);\n values.put(SmsConstant.COLUMN_BODY, body);\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n startForeground2(context,senderName, senderNo, message);\n }\n else {\n\n\n issueNotification(context,senderName, senderNo, message);\n }\n\n Uri uri = contentResolver.insert(smsUri, values);\n\n // TODO: implement notification\n }\n }", "static /* synthetic */ void m56314a(HoneyPayMainUI honeyPayMainUI, long j, long j2, String str, String str2, String str3) {\n AppMethodBeat.m2504i(41911);\n C4990ab.m7416i(honeyPayMainUI.TAG, \"go to give card\");\n Intent intent = new Intent(honeyPayMainUI, HoneyPayGiveCardUI.class);\n intent.putExtra(\"key_max_credit_line\", j);\n intent.putExtra(\"key_min_credit_line\", j2);\n intent.putExtra(\"key_true_name\", str);\n intent.putExtra(\"key_take_message\", str2);\n intent.putExtra(\"key_username\", str3);\n honeyPayMainUI.startActivityForResult(intent, 2);\n AppMethodBeat.m2505o(41911);\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void runCode(View view) {\n\n // Create an Intent to the IntentService\n Intent intent = new Intent(this, MyIntentService.class);\n\n // Start the Service passing the Intent object\n startService(intent);\n }", "public void sendMessage(View view) {\n\n //Intent to invoke the second activity from the first activity\n Intent intent = new Intent(MainActivity.this, SumActivity.class);\n\n //get values for two numbers\n num1 = Integer.parseInt(editTextNum1.getText().toString());\n num2 = Integer.parseInt(editTextNum2.getText().toString());\n\n\n intent.putExtra(\"num1\", num1);\n intent.putExtra(\"num2\", num2);\n startActivity(intent);\n }", "private void TransferDataToMainActivity(){\n Intent intent = new Intent(ChooseService.this, MainActivity.class);\n intent.putExtra(\"Professional\", professionalName);\n intent.putExtra(\"Service\", serviceName);\n intent.putExtra(\"Price\", servicePrice);\n startActivity(intent);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n mOneSignal = OneSignel.getInstance();\n\n// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n// WindowManager.LayoutParams.FLAG_FULLSCREEN);\n// getSupportActionBar().hide();\n\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (checkAndRequestPermissions()) {\n // carry on the normal flow, as the case of permissions granted.\n }\n } else {\n\n finish();\n\n }\n\n\n sharedPreferences = getSharedPreferences(\"save\", Context.MODE_PRIVATE);\n _name = sharedPreferences.getString(\"name\", null); // getting String\n _pId = sharedPreferences.getString(\"id\", null); // getting String\n _email = sharedPreferences.getString(\"email\", null); // getting String\n _phone = sharedPreferences.getString(\"phone\", null); // getting String\n\n\n\n\n // Toast.makeText(this, _phone, Toast.LENGTH_LONG).show();\n\n\n//\n// SharedPreferences sharedPreferences1 = getSharedPreferences(\"notifyID\", Context.MODE_PRIVATE);\n// _CchatId = sharedPreferences1.getString(\"reportid\", null); // getting String\n// _Cuid = sharedPreferences1.getString(\"uid\", null); // getting String\n// _Cuname = sharedPreferences1.getString(\"uname\", null); // getting String\n// _Cpid = sharedPreferences1.getString(\"pid\", null); // getting String\n// _Cpname = sharedPreferences1.getString(\"pname\", null); // getting String\n// minSecns = sharedPreferences1.getString(\"uMins\", null); // getting String\n// usedSec = sharedPreferences1.getString(\"usedSec\", null); // getting String\n//\n//\n// if(_CchatId!=null){\n//\n// getChatAPI();\n//\n// }\n//\n\n\n Bundle extras = getIntent().getExtras();\n\n\n if (extras != null) {\n\n _pId = extras.getString(\"id\");\n _name = extras.getString(\"name\");\n _phone = extras.getString(\"phone\");\n _email = extras.getString(\"email\");\n\n }\n\n // Toast.makeText(this, _pId, Toast.LENGTH_SHORT).show();\n\n\n requestQueue = Volley.newRequestQueue(this);\n requestQueue1 = Volley.newRequestQueue(this);\n\n\n _dateTime = (TextView) findViewById(R.id.date_time);\n _dateChat = (TextView) findViewById(R.id.date_timeChat);\n _dateCall = (TextView) findViewById(R.id.date_timeCall);\n _nameAppbar = (TextView) findViewById(R.id.Name_appbar);\n _mail_appbar = (TextView) findViewById(R.id.Mail_appbar);\n _viewBalance = (TextView) findViewById(R.id.viewBalance);\n _report = (LinearLayout) findViewById(R.id.report);\n _support = (LinearLayout) findViewById(R.id.support);\n _reportPrice = (TextView) findViewById(R.id.reportPrice);\n _chatPrice = (TextView) findViewById(R.id.chatPrice);\n _callPrice = (TextView) findViewById(R.id.callPrice);\n _lockedTEXT = (TextView) findViewById(R.id.lockedTEXT);\n _lockedTEXTCHAT = (TextView) findViewById(R.id.lockedTEXTCHAT);\n _lockedTEXTCALL = (TextView) findViewById(R.id.lockedTEXTCALL);\n\n _callHistory = (LinearLayout) findViewById(R.id.callHistory);\n _chating = (LinearLayout) findViewById(R.id.chating);\n _profile = (CircleImageView) findViewById(R.id.profile);\n\n\n\n\n _nameAppbar.setText(_name);\n _mail_appbar.setText(_email);\n\n\n switchButton = (Switch) findViewById(R.id.switchButton);\n switchButtonChat = (Switch) findViewById(R.id.switchButtonChat);\n switchButtonCall = (Switch) findViewById(R.id.switchButtonCall);\n progressBar = new ProgressDialog(this);\n\n progressBar.setMessage(\"Loading\");\n progressBar.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressBar.setCancelable(false);\n\n CallstatusAPI();\n\n priceAPI();\n\n\n// final Handler ha=new Handler();\n//\n// ha.postDelayed(new Runnable() {\n//\n// @Override\n// public void run() {\n//\n// if(alertD!=null) {\n//\n// alertD.dismiss();\n// }\n//\n// getChatRequestAPI();\n//\n//\n// ha.postDelayed(this, 20000);\n// }\n//\n// }, 20000);\n//\n// getChatRequestAPI();\n\n\n\n _profile.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent intent = new Intent(MainActivity.this, ProfileActivity.class);\n startActivity(intent);\n }\n });\n\n\n _viewBalance.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent intent = new Intent(MainActivity.this, WalletActivity.class);\n startActivity(intent);\n }\n });\n\n _report.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent intent = new Intent(MainActivity.this, ReportsActivity.class);\n startActivity(intent);\n }\n });\n\n\n _callHistory.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n Intent intent = new Intent(MainActivity.this, CallLogActivity.class);\n startActivity(intent);\n\n\n// Intent intent = new Intent(MainActivity.this, CallingActivity.class);\n// startActivity(intent);\n\n }\n });\n _chating.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n// AlertDialog.Builder dialog=new AlertDialog.Builder(MainActivity.this);\n// dialog.setMessage(\"Coming soon\");\n// dialog.setTitle(\"Alert\");\n// dialog.setPositiveButton(\"Okay\",\n// new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog,\n// int which) {\n//\n//\n//\n// }\n// });\n//\n// AlertDialog alertDialog=dialog.create();\n// alertDialog.show();\n\n Intent intent = new Intent(MainActivity.this, ChatLogActivity.class);\n\n intent.putExtra(\"pid\", _pId);\n intent.putExtra(\"pname\", _name);\n startActivity(intent);\n\n\n// Intent intent = new Intent(MainActivity.this, ChatActivity.class);\n//\n// intent.putExtra(\"pid\", _pId);\n// intent.putExtra(\"pname\", _name);\n// startActivity(intent);\n\n }\n });\n\n\n switchButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n if(switchButton.isChecked()){\n\n switchButton.setText(\"ON\");\n _satus=\"1\";\n date_time = \"0000-00-00\";\n _time = \"00:00\";\n getStatusAPI();\n _dateTime.setText(\"ONLINE\");\n\n } else {\n\n switchButton.setChecked(true);\n datePicker();\n\n }\n }\n });\n\n\n switchButtonChat.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n if(switchButtonChat.isChecked()){\n\n switchButtonChat.setText(\"ON\");\n ChatSatus=\"1\";\n date_time_chat = \"0000-00-00\";\n _time_chat = \"00:00\";\n\n getChatStatusAPI();\n\n _dateChat.setText(\"ONLINE\");\n\n\n }else {\n\n switchButtonChat.setChecked(true);\n\n datePickerChat();\n\n }\n }\n });\n\n\n switchButtonCall.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n if(switchButtonCall.isChecked()){\n\n switchButtonCall.setText(\"ON\");\n CallSatus=\"1\";\n date_time_call = \"0000-00-00\";\n _time_call = \"00:00\";\n\n getCallStatusAPI();\n\n _dateCall.setText(\"ONLINE\");\n\n\n }else {\n\n switchButtonCall.setChecked(true);\n\n datePickerCall();\n\n }\n }\n });\n\n\n\n ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.FOREGROUND_SERVICE}, PackageManager.PERMISSION_GRANTED);\n\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (Settings.canDrawOverlays(this)) {\n\n // startService(new Intent(MainActivity.this, ChatService.class));\n\n } else {\n\n RuntimePermissionForUser();\n\n Toast.makeText(MainActivity.this, \"System Alert Window Permission Is Required For Floating Widget.\", Toast.LENGTH_LONG).show();\n\n }\n }\n\n\n // Toast.makeText(mOneSignal, _pId, Toast.LENGTH_SHORT).show();\n\n if(isServiceRunning()){\n\n // Toast.makeText(MainActivity.this, \"Service Running\", Toast.LENGTH_SHORT).show();\n\n\n } else {\n\n final Intent intent = new Intent(this, ChatNotifyService.class);\n ServiceCaller(intent);\n\n }\n\n if(isSupportChatRunning()){\n\n stopService(new Intent(this, NotificationService.class));\n\n } else {\n\n Intent intent = new Intent(this, NotificationService.class);\n\n ServiceCaller(intent);\n }\n\n// if(isServiceRunningC()){\n//\n// startService(new Intent(this, ChatReqPopService.class));\n//\n// }\n\n }", "@Override\n\t\t public void launchApp(Context context, UMessage msg) {\n\t\t\t\t Toast.makeText(context, \"launchApp:\"+msg.custom, Toast.LENGTH_LONG).show();\n\t\t \t Intent it=new Intent(getApplicationContext(),MainActivity.class);//MenuActivity_VC\n\t\t \t\t it.putExtra(\"notify\", msg.custom);\n\t\t \t\t startActivity(it);\n\t\t\t }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);\n\n\t\tString title, msg;\n\t\tBundle bun = getIntent().getExtras();\n\t\ttitle = bun.getString(\"title\");\n\t\tmsg = bun.getString(\"msg\");\n\t\tgetURL = bun.getString(\"url\");\n\n\t\tAlertDialog.Builder alertDialog = new AlertDialog.Builder(PushNotification.this);\n\n\t\talertDialog.setPositiveButton(\"닫기\", new AlertDialog.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t//PushWakeLock.releaseCpuLock();\n\t\t\t\tPushNotification.this.finish();\n\t\t\t}\n\t\t});\n\n\t\talertDialog.setNegativeButton(\"보기\", new AlertDialog.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t//KeyguardManager km = (KeyguardManager)getSystemService(KEYGUARD_SERVICE);\n\t\t\t\t//KeyguardManager.KeyguardLock keyLock = km.newKeyguardLock(KEYGUARD_SERVICE);\n\t\t\t\t//keyLock.disableKeyguard(); //순정 락스크린 해제\n\n\t\t\t\t//Intent loadintent = new Intent(PushNotification.this.getApplicationContext(), RuntimeStandAlone.class);\n\t\t\t\tIntent loadintent = new Intent(\"skt.cornerstone.runtime.push\");\n\t\t\t\tif(getURL != null) loadintent.putExtra(UriReceiver.FLAG_DATA, parseUriArgs(getURL));\n\t\t\t\t//loadintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n\t\t\t\tstartActivity(loadintent);\n\t\t\t\tPushNotification.this.finish();\n\t\t\t}\n\t\t});\n\n\t\talertDialog.setIcon(R.drawable.pushicon);\n\t\talertDialog.setTitle(title);\n\t\talertDialog.setMessage(msg);\n\t\t//alertDialog.setView(getLayoutInflater().inflate(R.layout.customdialoglayout, null));\n\t\talertDialog.show();\n\n\t\t//chisu test \n\t\t//\t\tAlertDialog dialog = alertDialog.create();\n\t\t//\t\tdialog.getWindow().getAttributes().windowAnimations = R.style.dialog_animation;\n\t\t//\t\tdialog.getWindow().setGravity(Gravity.BOTTOM);\n\t\t//\t\tdialog.show();\n\n\n\n\t\t//\t\tDialog dialog = new Dialog(this);\n\t\t//\t\tdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\t//\t\tdialog.setContentView(R.layout.customdialoglayout);\n\t\t//\t\tdialog.getWindow().setGravity(Gravity.TOP);\n\t\t//\t\tdialog.getWindow().getAttributes().windowAnimations = R.style.dialog_animation;\n\t\t//\t\t//dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n\t\t//\t\tdialog.getWindow().setBackgroundDrawable(getResources().getDrawable(R.drawable.filled_box));\n\t\t//\t\tdialog.setOnDismissListener(new OnDismissListener() {\n\t\t//\t\t\tpublic void onDismiss(DialogInterface dialog) {\n\t\t//\t\t\t\t// TODO Auto-generated method stub\n\t\t//\t\t\t\tPushNotification.this.finish();\n\t\t//\t\t\t}\n\t\t//\t\t});\n\t\t//\t\tdialog.getWindow().findViewById(R.id.cmd_submit).setOnClickListener(this);\n\t\t//\t\tdialog.show();\n\t\t//\n\t\t//\t\timageAnim = (ImageView) dialog.getWindow().findViewById(R.id.image);\n\n\t\t//\t\tanimation = new AnimationDrawable();\n\t\t//\t\tanimation.addFrame(getResources().getDrawable(R.drawable.pushicon), 500);\n\t\t//\t\tanimation.addFrame(getResources().getDrawable(R.drawable.map), 500);\n\t\t//\t\tanimation.addFrame(getResources().getDrawable(R.drawable.default_video_poster), 500);\n\t\t//\t\tanimation.setOneShot(false);\n\t\t//\t\timageAnim.setBackgroundDrawable(animation);\n\t\t//\t\tanimation.start();\n\n\n\n\n\t\t//\t\tAnimationSet rootSet= new AnimationSet(true);\n\t\t//\t\trootSet.setInterpolator(new AccelerateInterpolator(10.0f));\n\t\t//\t\t\n\t\t//\t\tTranslateAnimation trans = new TranslateAnimation(300.0f, 0.0f, 0.0f, 0.0f);\n\t\t//\t\ttrans.setDuration(1500L);\n\t\t//\t\ttrans.setStartOffset(0L);\n\t\t//\t\t\n\t\t//\t\tRotateAnimation rotate = new RotateAnimation(0f, 360f, 0.5f, 0.5f);\n\t\t//\t\trotate.setStartOffset(0L);\n\t\t//\t\trotate.setDuration(2000L);\n\t\t//\t\trotate.setRepeatCount(1);\n\t\t//\t\t\n\t\t//\t\tScaleAnimation scale = new ScaleAnimation(0f, 1f, 0f, 1f, 0.5f, 0.5f);\n\t\t//\t\tscale.setStartOffset(0L);\n\t\t//\t\tscale.setDuration(2000L);\n\t\t//\t\tscale.setFillBefore(true);\n\t\t//\t\t\n\t\t//\t\tAlphaAnimation alpha = new AlphaAnimation(0f, 1f);\n\t\t//\t\talpha.setDuration(1500L);\n\t\t//\t\t\n\t\t//\t\trootSet.addAnimation(trans);\n\t\t//\t\t//rootSet.addAnimation(rotate);\n\t\t//\t\t//rootSet.addAnimation(scale);\n\t\t//\t\trootSet.addAnimation(alpha);\n\t\t//\t\t\n\t\t//\t\trootSet.setStartOffset(1000);\n\t\t//\t\t\n\t\t//\t\timageAnim.startAnimation(rootSet);\n\t\t//\n\n\n\n\t\t//vibration operate\n\t\tVibrator vibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);\n\t\tvibrator.vibrate(500);\n\n\t\t//\n\t\tUri ringtoneUri = RingtoneManager.getActualDefaultRingtoneUri(getApplicationContext(),RingtoneManager.TYPE_NOTIFICATION);\n\t\tRingtone ringtone = RingtoneManager.getRingtone(getApplicationContext(), ringtoneUri);\n\t\tringtone.play();\n\n\t\t// 폰 설정의 조명시간을 가져와서 해당 시간만큼만 화면을 켠다.\n\t\tint defTimeOut = Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, 15000);\n\t\tTimerTask task = new TimerTask() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\treleaseCpuLock();\n\t\t\t}\n\t\t};\n\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(task, defTimeOut);\n\n\t}", "@Override\n public void onClick(View v) {\n\n\n\n\n Intent intent = getIntent();\n intent.setClass(ConfirmPayActivity.this,FinishedPayActivity.class);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.SAVE_USER_CARD);\n merchantWebService.setHash(mPayuHashes.getSaveCardHash());\n merchantWebService.setVar1(mPaymentParams.getUserCredentials());\n merchantWebService.setVar2(\"\" + cardHolderNameEditText.getText().toString());\n merchantWebService.setVar3(PayuConstants.CC);\n merchantWebService.setVar4(PayuConstants.CC);\n merchantWebService.setVar5(\"\" + cardNameEditText.getText().toString());\n merchantWebService.setVar6(\"\" + cardNumberEditText.getText().toString());\n merchantWebService.setVar7(\"\" + cardExpiryMonthEditText.getText().toString());\n merchantWebService.setVar8(\"\" + cardExpiryYearEditText.getText().toString());\n\n postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams();\n\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n SaveCardTask saveCardTask = new SaveCardTask(PayUVerifyApiActivity.this);\n saveCardTask.execute(payuConfig);\n\n // lets cancel the dialog.\n saveUserCardDialog.dismiss();\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void onReceive(Context context, Intent intent) {\n\t\t\tSystem.out.println(\"接收到信息了=======act===============\");\n\t\t\tString extra = intent.getExtras().getString(Constant.PUSHTYPE);\n\t\t\tSystem.out.println(\"接收到信息了=======act===============\" + extra);\n\t\t\ttry {\n\t\t\t\tJSONObject extraJson = new JSONObject(extra);\n//\t\t\t\tJSONObject android = extraJson.getJSONObject(\"android\");\n\t\t\t\tint msgtype = Integer.parseInt(extraJson.getString(\"msgtype\"));\n\t\t\t\tswitch (msgtype) {\n\t\t\t\t\tcase 0: //来新抢单了\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 31: //来新消息了\n\t\t\t\t\t\tConstant.PUSH_MSG_NUM += 1;\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}\n\t\t\t\t//{\"android\":{\"msgtype\":\"0\",\"sound\":\"happy\",\"badge\":1}}\n\n// if (msgtype.equals(Constant.ENTRUSTDISABLED)) {\n// ToastUtils.getInstance(MyApplication.getIntence().getApplicationContext()).show(\"您的账号已经被禁用,请联系客服!\");\n// UserInfoUtil.quiteAccount(MyApplication.getIntence().getApplicationContext());\n// UserInfoUtil.setExitAccount(MyApplication.getIntence().getApplicationContext(), true);\n// SharePreferenceUtil.getInstance(MyApplication.getIntence().getApplicationContext())\n// .setString(SharePreferenceConstant.ENTRUST_MOBLIEPHONE, \"\");\n// MyApplication.getIntence().isBackToMain = true;\n// Intent intentLogin = new Intent(getActivity(), LoginActivity.class);\n// startActivity(intentLogin);\n// new ActivityAnimation(getActivity(), Constant.RIGHT_ENTER);\n// JPushInterface.stopPush(MyApplication.getIntence().getApplicationContext());\n// }\n\t\t\t\t /*\n * msgtype 类型\n * 0 您有一条新的抢单\n * 1 抢单成功\n * 2 抢单失败\n * 3 结算成功\n * 4 承运商禁用\n * 14 委托方禁用\n * 11 您有一条新的委托已成立\n * 12 您有一条订单已送达\n * 31 新的公告\n */\n//\t\t\t\tif(msgtype.equals(\"0\")){\n//\n//\t\t\t\t}else if(msgtype.equals(\"31\")){\n//\n//\t\t\t\t}\n\t\t\t} catch (JSONException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\n\t\t}", "@Override\n\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\tfinal String appview = app_view.getText()\n\t\t\t\t\t\t\t\t\t.toString();\n\t\t\t\t\t\t\tLinearLayout shenpi = (LinearLayout) LayoutInflater\n\t\t\t\t\t\t\t\t\t.from(context).inflate(\n\t\t\t\t\t\t\t\t\t\t\tR.layout.submit_dialog, null);\n\t\t\t\t\t\t\tTextView heads = (TextView) shenpi\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.heads);\n\t\t\t\t\t\t\tButton button_t = (Button) shenpi\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.button_t);\n\t\t\t\t\t\t\tButton button_f = (Button) shenpi\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.button_f);\n\t\t\t\t\t\t\theads.setText(\"您确定要提交审核吗?\");\n\t\t\t\t\t\t\tdialog_app.show();\n\t\t\t\t\t\t\tdialog_app.getWindow().setContentView(shenpi);\n\t\t\t\t\t\t\tbutton_t.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tToastManager.getInstance(context).showToastcenter(\"此功能暂不能使用\");\n\n\n//{taskId=405574, applyId=1201, proc_inst_id=405515, descId=usertask5, verifyOtDetail=verifyOtDetail, state=57, duTime=, userids=228, id=1515, mainCause=和你一\n//\n//起碎,沉睡的人们毫无知觉, applyNameState=9, end_time=2016-07-08 23:23, start_time=2016-07-08 18:23, app_view=核实刘宇庭加班时长:}\n\n//\t\t\t\t\t\t\t\t\tRequestParams param = new RequestParams();\n//\t\t\t\t\t\t\t\t\tparam.put(\"taskId\", TaskId);\n//\t\t\t\t\t\t\t\t\tparam.put(\"applyId\", applyId);\n//\t\t\t\t\t\t\t\t\tparam.put(\"key\", key);\n//\t\t\t\t\t\t\t\t\tparam.put(\"applyNameState\", applyNameState);\n////\t\t\t\t\t\t\t\t\tparam.put(\"id\", );\n//\t\t\t\t\t\t\t\t\tparam.put(\"proc_inst_id\", procInstId);\n//\t\t\t\t\t\t\t\t\tparam.put(\"verifyOtDetail\", \"verifyOtDetail\");\n////\t\t\t\t\t\t\t\t\tparam.put(\"userids\", \"\");\n//\t\t\t\t\t\t\t\t\tparam.put(\"state\", mstate);\n//\t\t\t\t\t\t\t\t\tparam.put(\"duTime\", \"\");\n//\t\t\t\t\t\t\t\t\tparam.put(\"authApp\", app_atate);\n//\t\t\t\t\t\t\t\t\tparam.put(\"descId\", descId);\n//\t\t\t\t\t\t\t\t\tparam.put(\"mainCause\", appview);\n//\t\t\t\t\t\t\t\t\tparam.put(\"start_time\", \"2016-07-08 18:23\");\n//\t\t\t\t\t\t\t\t\tparam.put(\"end_time\", \"2016-07-08 23:23\");\n//\t\t\t\t\t\t\t\t\tparam.put(\"app_view\", \"核实刘宇庭加班时长:\");\n//\t\t\t\t\t\t\t\t\tDialog progressDialog = dialog_util\n//\t\t\t\t\t\t\t\t\t\t\t.showWaitingDialog(\n//\t\t\t\t\t\t\t\t\t\t\t\t\tOverTimeTaskDetailsActivity.this,\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\"正在审批\", false);\n//\t\t\t\t\t\t\t\t\tasync.post(\n//\t\t\t\t\t\t\t\t\t\t\tAPIURL.CHECK.ADDDETAILS,\n//\t\t\t\t\t\t\t\t\t\t\tcontext,\n//\t\t\t\t\t\t\t\t\t\t\tparam,\n//\t\t\t\t\t\t\t\t\t\t\tnew JsonHandlerApproval(\n//\t\t\t\t\t\t\t\t\t\t\t\t\tOverTimeTaskDetailsActivity.this,\n//\t\t\t\t\t\t\t\t\t\t\t\t\tprogressDialog));\n\t\t\t\t\t\t\t\t\tdialog_app.dismiss();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tbutton_f.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\tdialog_app.dismiss();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}", "@Override\n protected void onHandleIntent(Intent intent) {\n\n }", "private void sendNotificationSample() {\n Intent notificationIntent = new Intent(GCMIntentService.this, AlertActivity.class);\n\n // Get a PendingIntent containing the entire back stack.\n int i = new Random().nextInt(100);\n PendingIntent notificationPendingIntent = PendingIntent.getActivity(GCMIntentService.this, i, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Get a notification builder that's compatible with platform versions >= 4\n NotificationCompat.Builder builder = new NotificationCompat.Builder(GCMIntentService.this);\n\n // Define the notification settings.\n builder.setSmallIcon(R.drawable.icon_v2)\n // In a real app, you may want to use a library like Volley\n // to decode the Bitmap.\n //.setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_launcher)).\n .setContentTitle(\"Shang\").setContentText(i + \". This is test mesage from notification\").setContentIntent(notificationPendingIntent);\n\n // Dismiss notification once the user touches it.\n builder.setAutoCancel(true);\n\n Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n builder.setSound(alarmSound);\n\n builder.setVibrate(new long[]{0, 2000});\n\n builder.setContentIntent(notificationPendingIntent);\n\n // Get an instance of the Notification manager\n NotificationManager mNotificationManager = (NotificationManager) GCMIntentService.this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Issue the notification\n mNotificationManager.notify(i, builder.build());\n }", "@Override\n\tpublic void onReceive(Context context, Intent intent) {\n if(intent != null && \"com.mmi.helper.request\".equals(intent.getAction())){\n\t\t\t\tandroid.util.Log.i(\"zuozhuang\",\"come here !!\");\n\t\tString type = intent.getExtras().getString(\"type\");\n\t\tString value = intent.getExtras().getString(\"value\");\n\t\tString pac_flag = intent.getExtras().getString(\"pac_flag\");\n\t\tLog.i(\"dongxiaotang\", \"type: \" + type + \" value: \" + value);\n\t\t\n\t\tIntent fmIntent = new Intent(\"com.wind.factoryautotest.action.FmService\");\n\t\tfmIntent.setPackage(\"com.wind.factoryautotest\");\n\t\t\n\t\tIntent reIntent = new Intent();\n\t\treIntent.setAction(\"com.mmi.helper.response\");\n\t\t\n\t\tswitch(type){\n\t\t\tcase \"led_open\": \n\t\t\t\tnew LEDTest().test(\"11\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"led_shutdown\":\n\t\t\t\tnew LEDTest().test(\"10\");\t\t\t\n\t\t\t\tbreak;\n\n\t\t\tcase \"vibrator_play\":\n\t\t\t\tnew VibratorTest().test(context, true);\n\t\t\t\tbreak;\n\t\t\tcase \"vibrator_stop\":\n\t\t\t\tnew VibratorTest().test(context, false);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t case \"set_pacmmi_result\":\n\t\t\t\tboolean i = false;\n\t\t\t if(value.equals(\"pass\")){\n\t\t\t\t i = PartitionUtils.writeFile(true);\n\t\t\t\t}else if( value.equals(\"fail\")){\n\t\t\t\t\ti = PartitionUtils.writeFile(false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!i) reIntent.putExtra(\"result\",\"fail\");\n\t\t\t\tif (i) reIntent.putExtra(\"result\",\"success\");\n\t\t\t\tcontext.sendBroadcast(reIntent);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"set_pacflag_result\":\n\n try{\n android.provider.Settings.System.putInt(context.getApplicationContext().getContentResolver(), pac_flag, Integer.parseInt(value));\n\t\t\t\t\treIntent.putExtra(\"result\",\"success\");\n\t\t\t\t\tcontext.sendBroadcast(reIntent);\n }catch(NumberFormatException e){\n\t\t\t\t\treIntent.putExtra(\"result\",\"fail\");\n\t\t\t\t\tcontext.sendBroadcast(reIntent);\n }\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"get_pacflag_result\":\n try{\n String result = android.provider.Settings.System.getInt(context.getApplicationContext().getContentResolver(), pac_flag, 0)==1?\"success\":\"fail\";\n\t\t\t\t\treIntent.putExtra(\"result\",result);\n\t\t\t\t\tcontext.sendBroadcast(reIntent);\n }catch(NumberFormatException e){\n\t\t\t\t\treIntent.putExtra(\"result\",\"fail\");\n\t\t\t\t\tcontext.sendBroadcast(reIntent);\n }\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"get_all_pacflag\":\n String[] items = getRemoteStringArray(\"emode_pac_flag_keys\",context);\n ContentResolver cr = context.getApplicationContext().getContentResolver();\n int ilen = items.length;\n StringBuffer content = new StringBuffer();\n String msn = android.os.SystemProperties.get(\"gsm.serial\", \"\");\n if(msn.indexOf(' ') >= 0){\n msn = msn.substring(0, msn.indexOf(' '));\n }else{\n msn = \"unknown\";\n }\n String version = android.os.SystemProperties.get(\"ro.build.version.incremental\", \"unknown\");\n content.append(\"sn:\" + msn + \",version:\" + version + \",\");\n for(int j = 0; j < ilen; j ++){\n content.append(items[j].substring(15) + \":\" + android.provider.Settings.System.getInt(cr, items[j], 0) + \",\");\n }\n\t\t\t\tString result = content.substring(0, content.length()-1);\n\t\t\t\treIntent.putExtra(\"result\",result);\n\t\t\t context.sendBroadcast(reIntent);\n\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n break;\n\t\t}\n\t }\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n Log.i(\"TAG\", \"someone called me 3\");\n\n // Explicitly specify that GcmIntentService will handle the intent.\n ComponentName comp = new ComponentName(context.getPackageName(), GcmIntentService.class.getName());\n // Start the service, keeping the device awake while it is launching.\n Log.i(\"TAG\", \"someone called me 4\");\n startWakefulService(context, (intent.setComponent(comp)));\n setResultCode(Activity.RESULT_OK);\n Log.i(\"TAG\", \"someone called me 5\");\n\n }", "private void handleActionNotification() {\n String result = getQuote(stringsArray);\n// Notification myNotification = new Notification.Builder(this)\n// .setAutoCancel(true)\n// .setDefaults(Notification.DEFAULT_ALL)\n// .setWhen(System.currentTimeMillis())\n// .setSmallIcon(R.mipmap.ic_launcher)\n// .setContentText(result)\n// .build();\n//\n// NotificationManagerCompat manager = NotificationManagerCompat.from(this);\n// manager.notify(0, myNotification);\n\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"My notification\")\n .setContentText(result);\n\n NotificationManager notificationManager = (NotificationManager)this\n .getSystemService(Context.NOTIFICATION_SERVICE);\n int id = 1;\n notificationManager.notify(id, builder.build());\n }", "public void onClick(View V){\n onTunePushDefines.sTempCount++;\n\n\n\n final LinearLayout linear = (LinearLayout)View.inflate(MainActivity.this, R.layout.phonenum, null);\n\n EditText edPhoneNumber = (EditText)linear.findViewById(R.id.edPhoneNumber);\n edPhoneNumber.setText(getPhoneNumber());\n\n new AlertDialog.Builder(MainActivity.this)\n .setTitle(\"전화번호를 입력해 주십시요\")\n .setView(linear)\n .setCancelable(false)\n .setPositiveButton(\"확인\", new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n // TODO Auto-generated method stub\n EditText edPhoneNumber = (EditText)linear.findViewById(R.id.edPhoneNumber);\n String phoneNumber = edPhoneNumber.getText().toString();\n\n if (phoneNumber == \"\")\n return;\n\n storePhoneNumber(phoneNumber);\n\n // 1. Device Token 등록\n // google play service가 사용가능한가\n if (checkPlayServices())\n {\n mGcm = GoogleCloudMessaging.getInstance(MainActivity.this);\n mRegId = getRegistrationId();\n\n if (TextUtils.isEmpty(mRegId))\n registerInBackground();\n }\n else\n {\n Log.i(\"MainActivity.java | onCreate\", \"|No valid Google Play Services APK found.|\");\n mTextStatus.append(\"\\n No valid Google Play Services APK found.\\n\");\n }\n\n // display received msg\n String msg = getIntent().getStringExtra(\"msg\");\n if (!TextUtils.isEmpty(msg))\n mTextStatus.append(\"\\n\" + msg + \"\\n\");\n\n // 2. Web View\n webview = (WebView)findViewById(R.id.webView1);\n webview.setWebViewClient(new WebClient()); //\n WebSettings set = webview.getSettings();\n set.setJavaScriptEnabled(true);\n set.setBuiltInZoomControls(true);\n //webview.loadUrl(\"http://www.google.com\");\n\n }\n })\n\n .setNegativeButton(\"취소\", new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n // TODO Auto-generated method stub\n //mtvPhoneNumber.setText(\"bbb\");\n }\n })\n .show();\n\n }", "public void crearNotificacion(){\n Intent dismissIntent = new Intent(this, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n dismissIntent.setAction(\"Sincronizar\");\n PendingIntent piDismiss = PendingIntent.getActivity(this, 0, dismissIntent, 0);\n\n//set intents and pending intents to call service on click of \"snooze\" action button of notification\n /*Intent snoozeIntent = new Intent(this, MyService.class);\n snoozeIntent.setAction(ACTION_SNOOZE);\n PendingIntent piSnooze = PendingIntent.getService(this, 0, snoozeIntent, 0);*/\n\n //build notification\n android.support.v4.app.NotificationCompat.Builder builder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_app)\n .setContentTitle(\"Sincronización pendiente\")\n .setContentText(\"Sincronice la aplicación para recuperar nuevos eventos\")\n .setDefaults(Notification.DEFAULT_ALL) // must requires VIBRATE permission\n .setPriority(NotificationCompat.PRIORITY_HIGH) //must give priority to High, Max which will considered as heads-up notification\n /*.addAction(R.drawable.snooze,\n getString(R.string.snooze), piSnooze)*/;\n builder.setContentIntent(piDismiss);\n builder.setAutoCancel(true);\n\n// Gets an instance of the NotificationManager service\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n//to post your notification to the notification bar with a id. If a notification with same id already exists, it will get replaced with updated information.\n notificationManager.notify(10000, builder.build());\n }", "@Override\n public void onReceive(Context context, final Intent intent) {\n if (KeyPairGeneratorService.ACTION_GENERATE.equals(intent.getAction())) {\n // we can stop the service now\n context.stopService(new Intent(context, KeyPairGeneratorService.class));\n\n handler.post(new Runnable() {\n public void run() {\n PersonalKey key = intent.getParcelableExtra(KeyPairGeneratorService.EXTRA_KEY);\n action.run(key);\n }\n });\n }\n\n // key generation has started\n else if (KeyPairGeneratorService.ACTION_STARTED.equals(intent.getAction())) {\n // simply run the action with null key\n handler.post(new Runnable() {\n public void run() {\n action.run(null);\n }\n });\n }\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tServiceAdditionActivity.setclass(\"rebuy\");\r\n\t\t\t\tstartActivity(new Intent(ServiceActivity.this,ServiceAdditionActivity.class));\r\n\t\t\t}", "public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n setContentView(R.layout.activity_razorpay);\n Intent intent = getIntent();\n Checkout.preload(getApplicationContext());\n startPayment(intent);\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n DateArray.clear();\n myorderfrequency.clear();\n Intent intentfetc=getIntent();\n product_id=intentfetc.getStringExtra(\"product_id\");\n p_img=intentfetc.getStringExtra(\"p_img\");\n p_details=String.valueOf(getIntent().getStringExtra(\"p_details\"));\n p_type=String.valueOf(getIntent().getStringExtra(\"p_type\"));\n Intent intent=new Intent(getApplicationContext(), ProductDetail.class);\n intent.putExtra(\"pincodeChek\",pin);\n intent.putExtra(\"p_id\",product_id);\n intent.putExtra(\"image_url\",img);\n intent.putExtra(\"p_details\",p_details);\n intent.putExtra(\"p_type\",p_type);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK |Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n finish();\n }", "private void setUpNotification() {\n if (getIntent().getExtras() != null) {\n for (String key : getIntent().getExtras().keySet()) {\n Object value = getIntent().getExtras().get(key);\n Logger.e(\"Key: \" + key + \" Value: \" + value);\n\n if(key.equals(\"Key\")) {\n try {\n String idStr = String.valueOf(value);\n int id = Integer.parseInt(idStr);\n onOpenJobItem(id);\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }\n\n }\n }\n // [END handle_data_extras]\n }", "@Override\n public void onClick(View v) {\n Intent i = new Intent(getApplicationContext(), Prescription.class);\n Bundle bundle = new Bundle();\n bundle.putString(\"Chatroomcode\", chatCode);\n i.putExtras(bundle);\n startActivity(i);\n CustomIntent.customType(Chat.this, \"fadein-to-fadeout\");\n }", "@SuppressLint(\"WrongConstant\")\n private Notification prepareNotification() {\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O &&\n mNotificationManager.getNotificationChannel(FOREGROUND_CHANNEL_ID) == null) {\n CharSequence name = getString(R.string.text_name_notification);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(FOREGROUND_CHANNEL_ID, name, importance);\n channel.enableVibration(false);\n mNotificationManager.createNotificationChannel(channel);\n }\n\n Intent notificationIntent = new Intent(this, Principal.class);\n notificationIntent.setAction(Constants.ACTION.MAIN_ACTION);\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\n // if min sdk goes below honeycomb\n /*if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n } else {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n }*/\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // make a stop intent\n Intent stopIntent = new Intent(this, Servicio_cargar_punto_google.class);\n stopIntent.setAction(Constants.ACTION.STOP_ACTION);\n PendingIntent pendingStopIntent = PendingIntent.getService(this, 0, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.notification);\n //remoteViews.setOnClickPendingIntent(R.id.btn_stop, pendingStopIntent);\n remoteViews.setTextViewText(R.id.tv_fecha, fecha);\n\n // if it is connected\n switch (stateService) {\n case Constants.STATE_SERVICE.NOT_CONNECTED:\n remoteViews.setTextViewText(R.id.tv_estado, \"Sin conexión a internet . . .\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n case Constants.STATE_SERVICE.CONNECTED:\n remoteViews.setTextViewText(R.id.tv_estado, \"Traigo en camino\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_carrito_verde);\n break;\n case Constants.STATE_SERVICE.GPS_INACTIVO:\n remoteViews.setTextViewText(R.id.tv_estado, \"GPS inactivo\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n case Constants.STATE_SERVICE.SIN_INTERNET:\n remoteViews.setTextViewText(R.id.tv_estado, \"Sin conexión a internet . .\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n }\n\n // notification builder\n NotificationCompat.Builder notificationBuilder;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n notificationBuilder = new NotificationCompat.Builder(this, FOREGROUND_CHANNEL_ID);\n } else {\n notificationBuilder = new NotificationCompat.Builder(this);\n }\n notificationBuilder\n .setContent(remoteViews)\n .setSmallIcon(R.drawable.ic_carrito_verde)\n .setCategory(NotificationCompat.CATEGORY_SERVICE)\n .setOnlyAlertOnce(true)\n .setOngoing(true)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setVisibility(Notification.VISIBILITY_PUBLIC);\n }\n\n return notificationBuilder.build();\n }", "@Override\n public void onClick(View v) {\n String s1=e1.getText().toString();\n String s2=e2.getText().toString();\n Intent i=new Intent(MainActivity.this,Secondactivity.class);\n //use method of intent class this is putExtra(through putextra method)send data in form of key n valu\n i.putExtra(\"name_key\",s1);\n i.putExtra(\"phone_name\",s2);\n startActivity(i);\n\n\n\n }", "private void finishInputMoney(boolean bl) {\n if (this.ToLoading) {\n return;\n }\n this.ToLoading = true;\n Log.w((String)\"hello\", (String)\"finish\");\n this.moneyInput = this.coin + this.bank;\n Bundle bundle = this.getIntent().getExtras();\n bundle.putString(\"TotalPrice\", \"\" + this.moneyInput);\n bundle.putString(\"TotalCoin1\", \"\" + this.coin);\n bundle.putString(\"TotalCoin2\", \"0\");\n bundle.putString(\"TotalCoin3\", \"0\");\n bundle.putString(\"TotalCoin4\", \"0\");\n bundle.putString(\"TotalBank1\", \"\" + this.bank);\n bundle.putString(\"TotalBank2\", \"0\");\n bundle.putString(\"OperationRate\", String.valueOf((int)bundle.getInt(\"OR\")));\n if (this.endInput) {\n bundle.putInt(\"Service\", 2);\n AudioDemo.Sound().playSound(\"a6\");\n } else {\n Log.v((String)\"hello\", (String)\"come finish else\");\n bundle.putInt(\"Service\", 4);\n if (bl) {\n this.finish();\n } else {\n Intent intent = new Intent(this.getBaseContext(), (Class)MainPage.class);\n intent.setFlags(67108864);\n this.startActivity(intent);\n }\n }\n if (!this.getSharedPreferences(\"hello\", 0).getBoolean(\"inDebugMode\", false)) {\n Log.w((String)\"hello\", (String)\"to loading\");\n Intent intent = new Intent(this.getBaseContext(), (Class)Loading.class);\n intent.putExtras(bundle);\n this.startActivity(intent);\n return;\n }\n Intent intent = new Intent(this.getBaseContext(), (Class)MainPage.class);\n intent.setFlags(67108864);\n this.startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n\n\n Intent i = new Intent(BackUpSignActivity.this, SignInUpActivity.class);\n i.putExtra(\"SIGN\", \"UP_GOOGLE_PLUS\");\n i.putExtra(\"email\",\"ehgma0821@gmail.com\");\n startActivity(i);\n }", "@Override\n public void onLaunchActivity(final Intent intent, final String s) throws RemoteException {\n final PoyntError error = new PoyntError(PoyntError.CHECK_CARD_FAILURE);\n listener.onResponse(transaction, requestId, error);\n }" ]
[ "0.661432", "0.6425577", "0.635154", "0.6349238", "0.6270685", "0.6251447", "0.624086", "0.62367785", "0.6232767", "0.622005", "0.6202881", "0.6180342", "0.61631393", "0.6156657", "0.6155747", "0.6138749", "0.6137114", "0.61206377", "0.60934985", "0.60930496", "0.6090637", "0.60834897", "0.6082967", "0.607796", "0.6072531", "0.6061704", "0.60562664", "0.605202", "0.6042313", "0.60316753", "0.60245544", "0.60132736", "0.6001723", "0.59839594", "0.5982046", "0.59783405", "0.5943335", "0.59412414", "0.5934476", "0.5920616", "0.5919756", "0.59016293", "0.58958066", "0.5885389", "0.588426", "0.58805937", "0.5875469", "0.58718675", "0.5856044", "0.58513755", "0.58424973", "0.5834218", "0.5833128", "0.5831375", "0.5831278", "0.5830717", "0.5828453", "0.5820469", "0.58184123", "0.58110744", "0.58097845", "0.5808805", "0.5799924", "0.5798384", "0.57927704", "0.57903236", "0.57751805", "0.5761401", "0.5761043", "0.57606167", "0.5758999", "0.57571095", "0.5755497", "0.57480794", "0.57471555", "0.57454735", "0.57422525", "0.5740814", "0.5734855", "0.5726632", "0.57261676", "0.57258517", "0.57253104", "0.5717088", "0.5715614", "0.5709584", "0.57063204", "0.5704841", "0.5701025", "0.57007074", "0.5684956", "0.5676933", "0.5674399", "0.5671583", "0.5670978", "0.5670805", "0.5670448", "0.56672823", "0.56654227", "0.5664316", "0.566397" ]
0.0
-1
openActivity(FirstActivity.class); /String a = RSAUtil.getRSAUtil().myEncrypt(etCreate.getText().toString()); String b = RSAUtil.getRSAUtil().myDecryption(a); LogUtils.i(a); LogUtils.i(b);
@Override public void call(Void aVoid) { NotificationUtil.getNotificationUtils(MainActivity.this).closeNotification(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void test() {\n\t\t// super.onCreate(savedInstanceState);\n\t\t// setContentView(R.layout.main);\n\t\tString masterPassword = \"abcdefghijklmn\";\n\t\tString originalText = \"i see qinhubao eat milk!\";\n\t\tbyte[] text = new byte[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };\n\t\tbyte[] password = new byte[] { 'a' };\n\t\ttry {\n\t\t\tString encryptingCode = encrypt(masterPassword, originalText);\n\t\t\t// System.out.println(\"加密结果为 \" + encryptingCode);\n\t\t\tLog.i(\"加密结果为 \", encryptingCode);\n\t\t\tString decryptingCode = decrypt(masterPassword, encryptingCode);\n\t\t\tSystem.out.println(\"解密结果为 \" + decryptingCode);\n\t\t\tLog.i(\"解密结果\", decryptingCode);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void onClick(final View arg0) {\n if (key != null) {\n if (encrypt != null) {\n decrypt = key.decrypt(encrypt);\n messageTxt.setText(new String(decrypt.toByteArray()));\n } else if (messageTxt.getText().length() > 0\n && !messageTxt.getText().equals(\"\")) {\n String encryptedMessage = messageTxt.getText().toString();\n encryptedMessage = encryptedMessage.replace(\" \", \"\");\n encryptedMessage = encryptedMessage.trim();\n Log.i(\"encryptedMessage\", encryptedMessage);\n try {\n decrypt = (BigInteger) key.decrypt(new BigInteger(\n encryptedMessage));\n messageTxt.setText(new String(decrypt.toByteArray()));\n } catch (Exception e) {\n e.printStackTrace();\n Toast.makeText(ShhActivity.this, \"Your text cannot be decrypted\",\n Toast.LENGTH_SHORT).show();\n }\n } else {\n Toast.makeText(ShhActivity.this, \"Your text cannot be decrypted\",\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n // kontrole\n final Button btnDecipher = findViewById(R.id.btnDecipher);\n final Button btnGen = findViewById(R.id.genKeys);\n final TextView txt = findViewById(R.id.editText);\n final Button btnSend = findViewById(R.id.btnSend);\n final TextView labelGAB = findViewById(R.id.labelGAB);\n final Button btnUcitaj = findViewById(R.id.btnUcitaj);\n\n gab = null;\n\n // ne dozvoljamo sifrovanje/desifrovanje pre razmene kljuceva\n btnDecipher.setEnabled(false);\n btnSend.setEnabled(false);\n\n // handler za slanje sifrovanje poruke\n btnSend.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n try {\n String text = txt.getText().toString();\n txt.setText(\"\");\n share(\"Пошаљи шифровано користећи\", AES.encrypt(text, gab.toString()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n\n // handler za generisanje p, g, a, g^a\n btnGen.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n Pair<BigInteger, BigInteger> pair = findPrimeAndPrimeRoot();\n rand = new Random();\n\n a = BigInteger.valueOf(rand.nextInt() & Integer.MAX_VALUE);\n _public = new PublicInfo(pair.p, pair.g, pair.g.modPow(a, pair.p));\n\n String text = _public.p.toString(16)\n + \"\\n\" + _public.g.toString(16)\n + \"\\n\" + _public.ga.toString(16);\n\n share(\"Пошаљи p, g, g^a користећи\", text);\n }\n });\n\n // handler za ucitavanje kljuca (ili p, g, g^a, ili g^b, zavisno od toga do kojeg smo koraka)\n btnUcitaj.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n String data = getClipboard(\"Нисте копирали кључ.\");\n\n if (data == null)\n return;\n\n String[] d = data.split(\"\\n\");\n\n // primili smo p, g, g^a\n if (d.length == 3)\n {\n _public = new PublicInfo(new BigInteger(d[0], 16), new BigInteger(d[1], 16), new BigInteger(d[2], 16));\n\n rand = new Random();\n b = BigInteger.valueOf(rand.nextInt() & Integer.MAX_VALUE);\n\n _public.gb = _public.g.modPow(b, _public.p);\n gab = _public.ga.modPow(b, _public.p);\n\n labelGAB.setText(gab.toString());\n\n btnDecipher.setEnabled(true);\n btnSend.setEnabled(true);\n\n share(\"Пошаљи g^b користећи\", _public.gb.toString(16));\n return;\n }\n // primili smo g^b\n else if (d.length == 1)\n {\n gab = (new BigInteger(d[0], 16)).modPow(a, _public.p);\n\n labelGAB.setText(gab.toString());\n\n btnDecipher.setEnabled(true);\n btnSend.setEnabled(true);\n\n toastr(\"Кључеви учитани!\");\n }\n else\n {\n toastr(\"Ти не знаш шта радиш!\");\n }\n }\n });\n\n // handler za desifrovanje\n btnDecipher.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n String data = getClipboard(\"Нисте копирали поруку.\");\n\n if (data != null) {\n try {\n String dec = AES.decrypt(data, gab.toString());\n toastr(dec);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n });\n }", "public void continueOne(View view){\n EditText firstName= (EditText) findViewById(R.id.firstName);\n String firstNameString = firstName.getText().toString();\n EditText lastName= (EditText) findViewById(R.id.lastName);\n String lastNameString= lastName.getText().toString();\n EditText studentID= (EditText) findViewById(R.id.studentId);\n String studentIDString= studentID.getText().toString();\n\n /**Toasts are the things that are like mini notifications that you'll see at the bottom of the screen.*/\n Context context = getApplicationContext();\n CharSequence text = \"Let's do this, \" + firstNameString + \"!\";\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n /**The following is an intent to start the next activity (mainCodeOne), and carry the key user data with it. MainActivityOne*/\n Intent intentOne = new Intent(this, AndroidBarcodeActivityOne.class);\n intentOne.putExtra(\"firstNameString\", firstNameString);\n intentOne.putExtra(\"lastNameString\", lastNameString);\n intentOne.putExtra(\"studentIDString\", studentIDString);\n startActivity(intentOne);\n\n\n }", "public void onClickPKCS15(View view) {\n Intent i = new Intent(this, TestActivity.class);\n i.putExtra(\"providerType\", ProviderType.PKCS15);\n startActivity(i);\n }", "public void onClick(View planes) {\n \tString editText1=edit1.getText().toString();\n \tString decrypting = StringTranslater.decryptString(editText1);\n \tresult.setText(decrypting);\n }", "public void onClick(View planes) {\n \tString editText1=edit1.getText().toString();\n \tString encrypting = StringTranslater.encrpytingString(editText1);\n \tresult.setText(encrypting);\n// \tInputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\n// \timm.hideSoftInputFromWindow(edit1.getWindowToken(), 0);\n }", "public void sendMessage(View view) {\n\n //Intent to invoke the second activity from the first activity\n Intent intent = new Intent(MainActivity.this, SumActivity.class);\n\n //get values for two numbers\n num1 = Integer.parseInt(editTextNum1.getText().toString());\n num2 = Integer.parseInt(editTextNum2.getText().toString());\n\n\n intent.putExtra(\"num1\", num1);\n intent.putExtra(\"num2\", num2);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n String s1=e1.getText().toString();\n String s2=e2.getText().toString();\n Intent i=new Intent(MainActivity.this,Secondactivity.class);\n //use method of intent class this is putExtra(through putextra method)send data in form of key n valu\n i.putExtra(\"name_key\",s1);\n i.putExtra(\"phone_name\",s2);\n startActivity(i);\n\n\n\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.secondxml);\r\n\t\tet1=(EditText)findViewById(R.id.editText2);\r\n\t\tIntent i=getIntent();\r\n\t\r\n\ts2= i.getStringExtra(IntentsActivity.EXTRA_MESSAGE);\r\n\t//i.setData(Uri.parse(et1.getText().toString()));\r\n\tToast.makeText(getBaseContext(),s2,Toast.LENGTH_LONG).show();\r\n\t\r\n\t Bundle receive=new Bundle();\r\n\t\treceive=getIntent().getExtras();\r\n\t\tname=receive.getString(\"key\");\r\n\t\tet1.setText(\"Welcome \"+name);\r\n\t \r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t//\tsetResult(RESULT_OK,i);\r\n\t\t//Toast.makeText(getBaseContext(), s2,Toast.LENGTH_SHORT).show();\r\n\t//\tTextView textView = new TextView(this);\r\n\t // textView.setTextSize(40);\r\n\t// textView.setText(\"my page\"+message);\r\n\t\t\r\n\t\t//setContentView(textView);\r\n\t}", "@Override public void onClick(View arg0) {\n\n try\n {\n EditText ed1=(EditText)findViewById(R.id.editText1);\n EditText ed2=(EditText)findViewById(R.id.editText2);\n EditText ed3=(EditText)findViewById(R.id.editText3);\n int a=Integer.parseInt(ed1.getText().toString());\n String b=ed2.getText().toString();\n int ce=Integer.parseInt(ed3.getText().toString());\n rslt=\"START\";\n Caller c=new Caller(); c.a=a;\n c.b=b;c.c=ce;\n c.join(); c.start();\n startActivity(new Intent(\"android.intent.action.FIRST\"));\n while(rslt==\"START\") {\n try {\n Thread.sleep(10);\n }catch(Exception ex) {\n }\n }\n //ad.setTitle(\"RESULT \");\n //ad.setMessage(rslt);\n rslt=rslt.replace(\"[\", \" \").replace(\"\\n]\", \" \").replace(\".\",\"-\").replace(\", \",\"\");\n part=rslt.split(\"\\n\");\n }catch(Exception ex) {\n //ad.setTitle(\"Error!\"); ad.setMessage(ex.toString());\n }\n // ad.show();\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t str1=editText1.getText().toString();\n\t\t\t\t\tSharedPreferences preferences=getSharedPreferences(\"user\",Context.MODE_PRIVATE);\n\t\t\t Editor editor=preferences.edit();\n\t\t\t editor.putString(\"str1\", str1);\n\t\t\t editor.commit();\n\t\t\t \n\t\t\t}", "public String encrypt(String input) throws Throwable {\n\n byte[] inputByteArray = input.getBytes();\n String keyString = \"\";\n\n // reading the public key\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(\n new InputStreamReader(context.getAssets().open(\"Put your public key in assets and Enter its name here\"), \"UTF-8\"));\n String line;\n while ((line = reader.readLine()) != null) {\n keyString += line;\n }\n reader.close();\n }catch (IOException e){\n Toast.makeText(context, \"Couldn't create file reader\", Toast.LENGTH_SHORT).show();\n }\n\n // fetching the key from public key\n keyString = keyString.replaceAll(NEW_LINE_CHARACTER, EMPTY_STRING)\n .replaceAll(PUBLIC_KEY_START_KEY_STRING, EMPTY_STRING)\n .replaceAll(PUBLIC_KEY_END_KEY_STRING, EMPTY_STRING);\n\n byte[] publicKey = keyString.getBytes();\n\n Key generatePublic = KeyFactory.getInstance(\"RSA\").\n generatePublic(new X509EncodedKeySpec(Base64.getDecoder().decode(publicKey)));\n\n // create RSA Cipher instance\n Cipher cipherInstance = Cipher.getInstance(\"RSA/None/PKCS1Padding\");\n cipherInstance.init(Cipher.ENCRYPT_MODE, generatePublic);\n\n // encrypt string\n byte[] encryptedByteArray = cipherInstance.doFinal(inputByteArray);\n return Base64.getEncoder().encodeToString(encryptedByteArray);\n }", "public void pindah_ke_log(View v)\n {\n Intent dashboard = new Intent(DashboardUser.this,BuyerTransactionActivity.class) ;\n dashboard.putExtra(\"param1\",value1);\n dashboard.putExtra(\"param2\",value2);\n dashboard.putExtra(\"param3\",value3);\n dashboard.putExtra(\"param4\",value4);\n dashboard.putExtra(\"param5\",value5);\n// SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n// SharedPreferences.Editor editor = sharedPreferences.edit();\n// editor.putString(TEXT, value1);\n// editor.putString(SWITCH, value2);\n// editor.apply();\n startActivityForResult(dashboard, 100);\n }", "@Override\n public void onClick(View arg0)\n {\n if (enc.isRunning())\n {\n enc.rLogin(); // async\n }\n }", "@Override\n public void run() {\n Intent intent=new Intent(getApplicationContext(),OTPPage.class);\n\n //passing the data\n intent.putExtra(\"auth\",s);\n\n //start the intent\n startActivity(intent);\n\n }", "public void onClick(View v) {\n Intent intent = new Intent(methodWithdrawal.this, AccessCode.class);\r\n amt =Float.parseFloat(getIntent().getExtras().getString(\"amount\"));\r\n acc_type=getIntent().getExtras().getString(\"acc_type\");\r\n pin=Integer.parseInt(getIntent().getExtras().getString(\"pin\"));\r\n acc=Integer.parseInt(getIntent().getExtras().getString(\"acc\"));\r\n method_used=\"access\";\r\n System.out.println(\"pin=\"+pin);\r\n System.out.println(\"amt=\"+amt);\r\n System.out.println(\"acc=\"+acc);\r\n System.out.println(\"acc_type=\"+acc_type);\r\n\r\n\r\n\r\n intent.putExtra(\"amount\",String.valueOf(amt));\r\n intent.putExtra(\"pin\",String.valueOf(pin));\r\n intent.putExtra(\"acc_type\",acc_type);\r\n intent.putExtra(\"acc\",String.valueOf(acc));\r\n intent.putExtra(\"method_used\",method_used);\r\n startActivity(intent);\r\n }", "@Override\n public void onClick(View v) {\n String secretPass2 = edt.getText().toString().trim();\n String msg = message;\n // originalMessage = msg.replace(User.CHAT_WITH_NAME + \":-\", \"\").trim();\n\n String decryptMessage = AES.decrypt(msg, secretPass2);\n textView.setText(Html.fromHtml(title));\n textView.append(\"\\n\");\n if (decryptMessage != null && !decryptMessage.isEmpty()) {\n\n try {\n textView.append(\" \" + decryptMessage + \" \\n\");\n\n // delay 10 second\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n public void run() {\n // Actions to do after 10 seconds\n textView.setText(Html.fromHtml(title));\n textView.append(\"\\n\");\n textView.append(\" \" + message + \" \\n\");\n }\n }, 10000);\n\n // end of delay\n } catch (Exception e) {\n textView.append(\" \" + message + \" \\n\");\n }\n } else {\n textView.append(\" \" + message + \" \\n\");\n Toast.makeText(ChatActivity.this, \"Wrong Key\", Toast.LENGTH_SHORT).show();\n }\n\n b.dismiss();\n }", "public void onClickAuthentication(View view) {\n Intent i = new Intent(this, TestActivity.class);\n i.putExtra(\"providerType\", ProviderType.AUTHENTICATION);\n startActivity(i);\n }", "@Override\n public void onClick(View ve) {\n Intent intent = new Intent(MainActivity.this, MainActivity2.class);\n\n // añadimos un valor extra al intent, en este caso el texto que haya en el text view\n intent.putExtra(Values.CLAVE_INTENT, input.getText().toString());\n\n // intent.putExtra(Values.CLAVE_INTENT, getText(R.string.helloWorld));\n\n // cambiamos de activity esperando un resultado\n // deja la activity en pausa hasta que devuelva un resultCode esperado (un numero definido en la clase values)\n startActivityForResult(intent, Values.REQ_ACT_2);\n\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t super.onCreate(savedInstanceState);\n\t setContentView(R.layout.second2);\n\t Button bt1 = (Button)findViewById(R.id.btnClose1);\n\t\tfinal TextView txt = findViewById(R.id.secondTxt);\n\t\tfinal Intent secondintent = getIntent();\n\t\tcode = secondintent.getStringExtra(\"code\");\n\t bt1.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tswitch (code){\n\t\t\t\t\tcase \"call2\" :\n\t\t\t\t\t\tString data = secondintent.getStringExtra(\"data\");\n\t\t\t\t\t\t//이너클래스에서 intent객체를 쓰기 위해서,\n\t\t\t\t\t\t// 선언된 intent객체를 final로 만들어준다.\n\t\t\t\t\t\ttxt.setText(data);\n\n\t\t\t\t\t\tsecondintent.putExtra(\"second\",\"두번째 액티비티에서 실행완료\");\n\t\t\t\t\t\t//실행 후에 값을 가지고 호출한 액티비티로 되돌아가기\n\t\t\t\t\t\t//되돌아갈때 값을 공유하기 위해 intent객체를 넘긴다.\n\t\t\t\t\t\tsetResult(RESULT_OK,secondintent);\n\t\t\t\t\t\t//되돌아가므로, 액티비티를 종료해줘야 한다.(메모리에서 없애기)\n\t\t\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void onClick(View arg0) {\n Intent nextScreen = new Intent(getApplicationContext(), ActivityTwo.class);\n\n //Sending data to another Activity\n nextScreen.putExtra(\"name_input\", inputName.getText().toString());\n nextScreen.putExtra(\"email_input\", inputEmail.getText().toString());\n\n Log.e(\"n\", inputName.getText() + \".\" + inputEmail.getText());\n\n startActivity(nextScreen);\n\n }", "@Override\n public void onClick(View v) {\n if(e.getText().toString().equals(\"admin\") && e2.getText().toString().equals(\"admin\"))\n {\n Intent i=new Intent(MainActivity.this,SecondActivity.class);\n\n i.putExtra(\"x\",e.getText().toString());\n\n startActivity(i);\n }\n else\n {\n Toast.makeText(MainActivity.this,\"Authentification échouée\",Toast.LENGTH_LONG).show();\n }\n /* Exercice 2 */\n\n\n\n\n }", "static /* synthetic */ void m56314a(HoneyPayMainUI honeyPayMainUI, long j, long j2, String str, String str2, String str3) {\n AppMethodBeat.m2504i(41911);\n C4990ab.m7416i(honeyPayMainUI.TAG, \"go to give card\");\n Intent intent = new Intent(honeyPayMainUI, HoneyPayGiveCardUI.class);\n intent.putExtra(\"key_max_credit_line\", j);\n intent.putExtra(\"key_min_credit_line\", j2);\n intent.putExtra(\"key_true_name\", str);\n intent.putExtra(\"key_take_message\", str2);\n intent.putExtra(\"key_username\", str3);\n honeyPayMainUI.startActivityForResult(intent, 2);\n AppMethodBeat.m2505o(41911);\n }", "public void loginUserMainActivity(View view) \n {\n // Initialize the intent to user's main activity\n Intent userMainIntent = new Intent(this, UserMainActivity.class);\n\n // Get the user name.\n String uname = unameEt.getText().toString();\n\n // Get the password.\n String pwd = pwdEt.getText().toString();\n\n if(!User.UserExists(uname, pwd, getApplicationContext())) \n { // The user credentials were invalid, do nothing\n Toast.makeText(getApplicationContext(), \"Invalid credentials.\", Toast.LENGTH_SHORT).show();\n } \n else \n { // The credentials were valid, open main menu, build the intent with the user id.\n \t//TODO encrypt the data first?\n userMainIntent.putExtra(\"un\", uname);\n userMainIntent.putExtra(\"pwd\", pwd);\n // Start the user's main activity.\n startActivity(userMainIntent);\n }\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t final EditText uname;\n\t\t\t\t\tEditText pwd;\n\t\t\t\t TextView title=(TextView) findViewById(R.id.textView1);\n\t\t\t \n\t\t\t\t String s;\n\t\t\t\t \n\t\t\t\t uname=(EditText) findViewById(R.id.name);\n\t\t\t\t pwd=(EditText) findViewById(R.id.password);\n\t\t\t\t\n\t\t\t\ts=uname.getText().toString(); //text will get into\n\t\t\t\n\t\t\t\tToast.makeText(getApplicationContext(), \"hi\", Toast.LENGTH_LONG).show();//pop msg\n\t\t\t\tToast.makeText(getApplicationContext(), \"WELCOME\", Toast.LENGTH_LONG).show();//msg to display with or without time\n\t\t\t\t\n\t\t\t\tIntent i=new Intent(MainActivity.this,success.class); //validation first :-current java file to second:-success file to open\n\t\t\t\ti.putExtra(\"name\", s); //user will enter text stored in s send back to the main activity for verification\n\t\t\t\tstartActivity(i);\n\t\t\t\tToast.makeText(getApplicationContext(), \"hello\", Toast.LENGTH_LONG).show();\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.main_login);\r\n\r\n\t\t// 获取附加码\r\n\t\tloaderData();\r\n\r\n\t\t// 显示附加码\r\n\t\tshowec = (TextView) findViewById(R.id.loginbox).findViewById(R.id.extraCode);\r\n\t\tshowec.setText(extraCode);\r\n\t\t\r\n\t\t//刷新附加码\r\n\t\tshowec.setOnClickListener(new OnClickListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t\t// 获取附加码\r\n\t\t\t\tloaderData();\r\n\t\t\t\t\r\n\t\t\t\t// 显示附加码\r\n\t\t\t\tshowec.setText(extraCode);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tuserid = (EditText) findViewById(R.id.login_box).findViewById(R.id.nameEdit);\r\n\t\tpassword = (EditText) findViewById(R.id.login_box).findViewById(R.id.passwdEdit);\r\n\t\textracode = (EditText) findViewById(R.id.login_box).findViewById(R.id.pyramidEdit);\r\n\r\n\t\t// 登录按钮\r\n\t\tbtn_login = (Button) findViewById(R.id.login_box).findViewById(R.id.btn_userlogin);\r\n\t\tbtn_login.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tuserId = userid.getText().toString();\r\n\t\t\t\tpassWord = password.getText().toString();\r\n\t\t\t\tInputCode = extracode.getText().toString();\r\n\t\t\t\tif (InputCode.equals(extraCode)) {\r\n\r\n\t\t\t\t\tif (!userId.equals(\"\")) {\r\n\r\n\t\t\t\t\t\tif (!passWord.equals(\"\")) {\r\n\r\n\t\t\t\t\t\t\tif (EHelper.hasInternet(Login.this)) {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t// 将用户名和密码发送到服务端进行验证\r\n\t\t\t\t\t\t\t\t\tJSONObject json = ConnectWs.connect(Login.this, EAccType.NULL,\r\n\t\t\t\t\t\t\t\t\t\t\tEOperation.LOGIN, userId, passWord, InputCode);\r\n\t\t\t\t\t\t\t\t\t// 将JSON数据转换为boolean型\r\n\t\t\t\t\t\t\t\t\tloginflag = EHelper.toBoolean(json);\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\tif (loginflag) {\r\n\t\t\t\t\t\t\t\t\t\t// 登录成功\r\n\t\t\t\t\t\t\t\t\t\tFinanceAss.loginstatus = true;\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (EHelper.hasInternet(Login.this)) {\r\n\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 获取用户详细信息\r\n\t\t\t\t\t\t\t\t\t\t\t\tJSONObject json2 = ConnectWs.connect(Login.this, EAccType.NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tEOperation.GET_USER_INFO, userId);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 将JSON数据转换为MAP型\r\n\t\t\t\t\t\t\t\t\t\t\t\tMap<String, String> userinfo = EHelper.toMap(json2);\r\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(json2.toString());\r\n\t\t\t\t\t\t\t\t\t\t\t\tuserName = userinfo.get(\"userName\").toString();\r\n\t\t\t\t\t\t\t\t\t\t\t\tlogintimes = userinfo.get(\"loginTimes\").toString();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tToast.makeText(Login.this, \"对不起,服务器未连接\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tToast.makeText(Login.this, \"没有连接网络\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tintent.putExtra(\"logintimes\", logintimes);\r\n\t\t\t\t\t\t\t\t\t\tintent.setClass(Login.this, BankMain.class);\r\n\t\t\t\t\t\t\t\t\t\tLogin.this.startActivity(intent);\r\n\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t// 登录失败\r\n\t\t\t\t\t\t\t\t\t\tMyDialogOne dialog = new MyDialogOne(Login.this, R.style.dialog);\r\n\t\t\t\t\t\t\t\t\t\tdialog.setTitleAndInfo(\"登录手机银行\", \"\\n登录失败!\\n用户名或密码输入错误!\");\r\n\t\t\t\t\t\t\t\t\t\tdialog.show();\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t\t\tToast.makeText(Login.this, \"对不起,服务器未连接\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tToast.makeText(Login.this, \"没有连接网络\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t// 用Dialog提示密码为空\r\n\t\t\t\t\t\t\tMyDialogOne dialog = new MyDialogOne(Login.this, R.style.dialog);\r\n\t\t\t\t\t\t\tdialog.setTitleAndInfo(\"登录手机银行\", \"\\n\\n密码不能为空!\");\r\n\t\t\t\t\t\t\tdialog.show();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t// 用Dialog提示用户名为空\r\n\t\t\t\t\t\tMyDialogOne dialog = new MyDialogOne(Login.this, R.style.dialog);\r\n\t\t\t\t\t\tdialog.setTitleAndInfo(\"登录手机银行\", \"\\n\\n用户号不能为空!\");\r\n\t\t\t\t\t\tdialog.show();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// 用Dialog提示附加码不正确\r\n\t\t\t\t\tMyDialogOne dialog = new MyDialogOne(Login.this, R.style.dialog);\r\n\t\t\t\t\tdialog.setTitleAndInfo(\"登录手机银行\", \"\\n\\n附加码不正确!\");\r\n\t\t\t\t\tdialog.show();\r\n\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// 设置底部选项卡\r\n\t\tbankmain = (ImageView) findViewById(R.id.mainbelow).findViewById(R.id.btnMain);\r\n\t\tbankmain.setImageResource(R.drawable.main_sjyh);\r\n//\t\tbankmain.setImageResource(R.drawable.main_sjyh2);\r\n\t\tbankmain.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tbankhelp = (ImageView) findViewById(R.id.mainbelow).findViewById(R.id.btnHelper);\r\n\t\tbankhelp.setImageResource(R.drawable.main_jrzs);\r\n//\t\tbankhelp.setImageResource(R.drawable.main_jrzs2);\r\n\t\tbankhelp.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t\tintent = new Intent(Login.this, FinanceAss.class);\r\n\t\t\t\tintent.addFlags(intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\r\n\t\t\t\tLogin.this.startActivity(intent);\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@SuppressLint(\"ShowToast\") @Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tStaticDB.setSilent( new String(silent.getText().toString()));\n\t\t\t\t\tStaticDB.setRing(new String(ring.getText().toString()));\n\t\t\t\t\tStaticDB.setVibrate(new String(vibrate.getText().toString()));\n\t\t\t\t\t\n\t\t\t\t\tToast.makeText(getApplicationContext(), StaticDB.getSilent(), 100).show();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tIntent it=new Intent(SecondActivity.this,ThirdActivity.class);\n\t\t\t\tstartActivity(it);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}", "public String decrypt(String input) throws Throwable {\n byte[] inputByteArray = Base64.getDecoder().decode(input);\n String keyString = \"\";\n\n // read the private key\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(\n new InputStreamReader(context.getAssets().open(\"Put your private key in assets and Enter its name here\"), \"UTF-8\"));\n String line;\n while ((line = reader.readLine()) != null) {\n keyString += line;\n }\n reader.close();\n }catch (IOException e){\n Toast.makeText(context, \"Couldn't create file reader\", Toast.LENGTH_SHORT).show();\n }\n\n // fetching the key from public key\n keyString = keyString.replaceAll(NEW_LINE_CHARACTER, EMPTY_STRING)\n .replaceAll(PRIVATE_KEY_START_KEY_STRING, EMPTY_STRING)\n .replaceAll(PRIVATE_KEY_END_KEY_STRING, EMPTY_STRING);\n\n byte[] privateKey = keyString.getBytes();\n\n Key generatePrivate = KeyFactory.getInstance(\"RSA\").\n generatePrivate(new PKCS8EncodedKeySpec(Base64.getDecoder().decode(privateKey)));\n\n // create RSA Cipher instance\n Cipher cipherInstance = Cipher.getInstance(\"RSA/None/PKCS1Padding\");\n cipherInstance.init(Cipher.DECRYPT_MODE, generatePrivate);\n\n // encrypt string\n byte[] decryptedByteArray = cipherInstance.doFinal(inputByteArray);\n return new String(decryptedByteArray);\n }", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t\tString ac=account.getText().toString();\r\n\t\t\tString ppString=pwd.getText().toString();\r\n\t\t\tif (ac.equals(\"admin\") && ppString.equals(\"123456\")) {\r\n\t\t\t\teditor=preferences.edit();\r\n\t\t\t\tif (reBox.isChecked()) {\r\n\t\t\t\t\teditor.putBoolean(\"remeber\", true);\r\n\t\t\t\t\teditor.putString(\"account\", ac);\r\n\t\t\t\t\teditor.putString(\"pwd\", ppString);\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\teditor.clear();\r\n\t\t\t\t}\r\n\t\t\t\teditor.commit();\r\n\t\t\t\tIntent intent=new Intent(LoginActivity.this,MainActivity.class);\r\n\t\t\t\tstartActivity(intent);\r\n\t\t\t\tfinish();\r\n\t\t\t}else {\r\n\t\t\t\tToast.makeText(LoginActivity.this, \"²»ÕýÈ·\", 1).show();\r\n\t\t\t}\r\n\t\t}", "public void navigateToCryptoGraphyActivity(View view) {\n startActivity(new Intent(this,CryptographyActivity.class));\n }", "@Override\n public void onClick(View v) {\n GREETER=edit.getText().toString();\n\n //Acceder al segundo Activity y mandarle un string\n Intent intent=new Intent(MainActivity.this,SecondActivity.class);\n intent.putExtra(\"greeter\",GREETER); //ID + dato a enviar a Second Acitivty\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n String txt_display = txtDisplay.getText().toString();\n Intent myIntent = new Intent(MainActivity.this,\n SecondActivity.class);\n myIntent.putExtra(Intent.EXTRA_TEXT, txt_display);\n startActivity(myIntent);\n }", "@Override\n public void onCheckButtonClick() {\n\n String result;\n try {\n int a = Integer.parseInt(view.getFirstNumberTextViewValue());\n int b = Integer.parseInt(view.getSecondNumberTextViewValue());\n result = model.checkNumbers(a,b);\n } catch (NumberFormatException e) {\n view.showToast(\"You gave wrong input!!!\");\n return;\n } catch (WrongParametersException e) {\n view.showToast(e.getMessage());\n return;\n }\n Intent intent = view.createNewIntent(SecondActivity.class);\n intent.putExtra(\"result\", result);\n view.startNewActivity(intent);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main2);\n\n Bundle parametros = getIntent().getExtras(); \t\t\t// accede a todos los extras utilizados y declarados en el Intent\n String usuario = parametros.getString(\"sesion_usuario\"); //obtengo el usuario, queda guardado en session_usuario\n\n TextView saludo_usuario = (TextView) findViewById(R.id.saludo_usuario); //obteng el control del textview para poder editarlo por codigo\n String formaSaludo = \"Bievenido \"+usuario; //creo un string porque no puedo concatenar directamente en TextView\n saludo_usuario.setText(formaSaludo); // Muestro por pantalla\n\n Button btnMarcar = (Button) findViewById(R.id.btnMarcar); //instancion btnMarcar declarado en el xml para poder utilizarlo por codigo\n ncelular = (EditText) findViewById(R.id.ncelular);\n\n btnMarcar.setOnClickListener(new View.OnClickListener(){ //Si btnMarcar es precionado\n @Override\n public void onClick(View v) {\n marcarLlamada(v); //llama al metodo marcarLlamada\n }\n });\n\n Button btnFinalizar = (Button) findViewById(R.id.btnFinalizar);\n btnFinalizar.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v) {\n finalizaractividad(v);\n }\n });\n\n }", "private void m56319ab(Intent intent) {\n AppMethodBeat.m2504i(41901);\n boolean booleanExtra = intent.getBooleanExtra(\"key_create_succ\", false);\n String stringExtra = intent.getStringExtra(\"key_card_no\");\n String stringExtra2 = intent.getStringExtra(\"key_card_type\");\n C4990ab.m7417i(this.TAG, \"create succ: %s\", Boolean.valueOf(booleanExtra));\n if (booleanExtra) {\n m56322b(stringExtra, true, stringExtra2);\n }\n AppMethodBeat.m2505o(41901);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);\n final View view = View.inflate(this, R.layout.activity_welcome, null);\n setContentView(view);\n reqPermission();\n //由于没有服务端,验证码的生成采用android机器编码的偏移量\n hardwareNumber = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);\n String newString = hardwareNumber.substring(2,hardwareNumber.length()-2);\n int hardLength = newString.length();\n char[] chars = new char[hardLength];\n for (int i = 0;i<hardLength;i++){\n char ha = newString.charAt(i);\n char after ;\n if (ha+3 >= 57 && ha+3<65||ha+3>122){\n after ='1';\n }else {\n after = (char) (ha+3);\n }\n chars[i] = after;\n verify = new String(chars).trim();\n }\n String NewPath = Environment.getExternalStorageDirectory()+ File.separator+\"mycwpath\";\n\n File file = new File(NewPath);\n if (file.exists()){\n Log.d(TAG, \"算法库已存在\" );\n }else{\n CopyAssets(this,\"cwlib\",NewPath);\n }\n faceApplication = (FaceApplication) getApplication();\n okHttpClient = faceApplication.getOkHttpClient();\n //setContentView(R.layout.activity_welcome);\n AlphaAnimation alphaAnimation = new AlphaAnimation(0.3f,1.0f);//设置透明度的动画\n alphaAnimation.setDuration(3000);//维持时间\n view.startAnimation(alphaAnimation);\n\n alphaAnimation.setAnimationListener(new Animation.AnimationListener()\n {\n @Override\n public void onAnimationEnd(Animation arg0) {\n firstGetLicence = sharedPreferences.getBoolean(\"firstGet\",true);\n // firstGetLicence = false;//临时用的\n if (firstGetLicence){\n //showSetip();\n showVerification();\n\n }else {\n redirectTo();//跳转到主界面\n }\n }\n @Override\n public void onAnimationRepeat(Animation animation) {\n //设置重复次数\n }\n @Override\n public void onAnimationStart(Animation animation) {\n sharedPreferences = faceApplication.getShare();\n }\n\n });\n\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\tcardNumStr = cardNumAuto.getText().toString();\n\t\t\t\tpasswordStr = passwordET.getText().toString();\n\n\t\t\t\tif (!((cardNumStr.equals(\"test\")) && (passwordStr\n\t\t\t\t\t\t.equals(\"test\")))) {\n\t\t\t\t\tToast.makeText(Login.this, \"密码错误,请重新输入\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tif (savePasswordCB.isChecked()) {// 登陆成功才保存密码\n\t\t\t\t\t\tsp.edit().putString(cardNumStr, passwordStr).commit();\n\t\t\t\t\t}\n\t\t\t\t\tToast.makeText(Login.this, \"登陆成功!\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t// 跳转到另一个Activity\n\t\t\t\t\t// do something\n\t\t\t\t\tIntent temptIntent=new Intent();\n\t\t\t\t\ttemptIntent.setClass(Login.this, ECGmain.class);\n\t\t\t\t\ttemptIntent.putExtra(USER, cardNumStr);\n\t\t\t\t\tstartActivity(temptIntent);\n\t\t\t\t\tLogin.this.finish();\n\n\t\t\t\t}\n\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\tif(null == jobject8 || \"\".equals(jobject8) || \"{}\".equals(jobject8) || \"[]\".equals(jobject8)){ \n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\tif(sp.getBoolean(\"islogin\", false)){\n\t\t\t\t\t\t\tif(isconect){\n\t\t\t\t\t\t\t\tIntent intent=new Intent(getActivity(),Buyactivity1.class);\n\t\t\t\t\t\t\t\tintent.putExtra(\"productname\", productname);\n\t\t\t\t\t\t\t\tintent.putExtra(\"beginmoney\", beginmoney);\n\t\t\t\t\t\t\t\tintent.putExtra(\"shouxufei\", shouxufei);\n\t\t\t\t\t\t\t\tintent.putExtra(\"yuqishouyi\", yuqishouyi+\"%\");\n\t\t\t\t\t\t\t\tintent.putExtra(\"licaiqixian\", licaiqixian);\n\t\t\t\t\t\t\t\tintent.putExtra(\"yuqishouyichanshengshijian\", yuqishouyichanshengshijian);\n\t\t\t\t\t\t\t\tintent.putExtra(\"productid\", productid);\n\t\t\t\t\t\t\t\tintent.putExtra(\"fengxiandengji\", fengxiandengji);\n\t\t\t\t\t\t\t\tintent.putExtra(\"iscouldbuy\", iscouldbuy);\n\t\t\t\t\t\t\t\tintent.putExtra(\"explan\", explan);\n\t\t\t\t\t\t\t\tintent.putExtra(\"iscouldedit\", iscouldedit);\n\t\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t\t}else{}\n\n\n\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\tstartActivity(new Intent(getActivity(),Loginactivity.class));\n\t\t\t\t\t\t}\n\n\n\n\n\t\t\t\t\t}", "public void startActivity() {\n\n Intent intent = new Intent(this, ActivityB.class);\n EditText editText = (EditText) findViewById(R.id.edtWriteSomething);\n String message = editText.getText().toString();\n intent.putExtra(\"EXTRA_MESSAGE\", message);\n startActivity(intent);\n }", "@Test\r\n public void testEncryptDecryptPlaintext() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n String message = instance.decryptPlaintext(result, add, keys);\r\n assertEquals(message, \"Hola caracola\");\r\n }", "@Override\n public void onClick(View v) {\n\n Intent intent = new Intent(ResultActivity.this, SecondActivity.class);\n intent.putExtra(\"data1\", Edata2.getText().toString());\n startActivity(intent);\n }", "private static void m751a(Activity activity, String str, String str2, String str3) {\n if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {\n Intent intent = new Intent();\n try {\n intent.setPackage(\"hk.alipay.wallet\");\n intent.setData(Uri.parse(\"alipayhk://platformapi/startApp?appId=20000125&schemePaySession=\" + URLEncoder.encode(str, Utf8Charset.NAME) + \"&orderSuffix=\" + URLEncoder.encode(str2, Utf8Charset.NAME) + \"&packageName=\" + URLEncoder.encode(str3, Utf8Charset.NAME) + \"&externalPkgName=\" + URLEncoder.encode(str3, Utf8Charset.NAME)));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n C0646c.m1017b(\"msp\", \"PayTask:payReuslt: UnsupportedEncodingException:\" + e);\n }\n if (activity != null) {\n activity.startActivity(intent);\n }\n }\n }", "public static String _activity_create(boolean _firsttime) throws Exception{\nmostCurrent._activity.LoadLayout(\"lay_mosquito_Main\",mostCurrent.activityBA);\n //BA.debugLineNum = 61;BA.debugLine=\"utilidades.ResetUserFontScale(Activity)\";\nmostCurrent._vvvvvvvvvvvvvvvvvvvvv7._vvvvvvvvv0 /*String*/ (mostCurrent.activityBA,(anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(mostCurrent._activity.getObject())));\n //BA.debugLineNum = 62;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tnew Thread(){\n\t\t\t\t\tpublic void run(){\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmAuth.fetchSessionkey();\n\t\t\t\t\t\t} catch (IOException 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}\n\t\t\t\t}.start();\n\n\t\t\t}", "@SuppressLint(\"HandlerLeak\")\r\n\t@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t\tsharedPreferences = this.getSharedPreferences(\"userinfo\", MODE_PRIVATE);\r\n\t\tif ((sharedPreferences.getInt(\"UID\", 00000000) != 00000000)) {\r\n\t\t\tLog.d(\"uid\",\r\n\t\t\t\t\tString.valueOf(sharedPreferences.getInt(\"UID\", 00000000)));\r\n\t\t\tIntent intent = new Intent(this, MainActivity.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t\toverridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);\r\n\t\t\tLoginActivity.this.finish();\r\n\r\n\t\t}\r\n\r\n\t\tsetContentView(R.layout.login);\r\n\t\thttpUtils = new HttpUtils(this);\r\n\t\thttpUtils.registerToolsListener(this);\r\n\r\n\t\tuserName = (EditText) findViewById(R.id.editText1);\r\n\t\tpwd = (EditText) findViewById(R.id.editText2);\r\n\t\tlogin = (Button) findViewById(R.id.button1);\r\n\t\tregist = (Button) findViewById(R.id.button2);\r\n\r\n\t\tString text1 = \"忘记密码?\";\r\n\t\ttv4 = (TextView) findViewById(R.id.textView4);\r\n\t\ttv5 = (TextView) findViewById(R.id.textView5);\r\n\r\n\t\tSpannableString spannableString1 = new SpannableString(text1);\r\n\t\tspannableString1.setSpan(new ClickableSpan() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View widget) {\r\n\t\t\t\tIntent intent = new Intent(LoginActivity.this,\r\n\t\t\t\t\t\tLosspwdActivity.class);\r\n\t\t\t\tstartActivity(intent);\r\n\t\t\t\toverridePendingTransition(R.anim.in_from_right,\r\n\t\t\t\t\t\tR.anim.out_to_left);\r\n\r\n\t\t\t}\r\n\t\t}, 0, text1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\r\n\t\ttv5.setText(spannableString1);\r\n\t\ttv5.setMovementMethod(LinkMovementMethod.getInstance());\r\n\t\tlogin.setOnClickListener(this);\r\n\t\tregist.setOnClickListener(this);\r\n\r\n\t\thandler = new Handler() {\r\n\t\t\tpublic void handleMessage(android.os.Message msg) {\r\n\t\t\t\tswitch (msg.what) {\r\n\r\n\t\t\t\tcase SET_TV8:\r\n\t\t\t\t\tpd.dismiss();\r\n\t\t\t\t\tif(timer!=null){\r\n\t\t\t\t\t\ttimer.cancel();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttv4.setText(msg.obj.toString());\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase TO_EXAMPLEACTIVITY:\r\n\t\t\t\t\tpd.dismiss();\r\n\t\t\t\t\tif(timer!=null){\r\n\t\t\t\t\t\ttimer.cancel();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tEditor editor = sharedPreferences.edit();\r\n\t\t\t\t\teditor.putString(\"username\", userName.getText().toString());\r\n\r\n\t\t\t\t\teditor.putString(\"password\", pwd.getText().toString());\r\n\t\t\t\t\tint uid = Integer.parseInt(msg.obj.toString());\r\n\t\t\t\t\tLog.d(\"TAG\", msg.obj.toString());\r\n\t\t\t\t\teditor.putInt(\"UID\", uid);\r\n\t\t\t\t\tLog.d(\"uid\", String.valueOf(uid));\r\n\t\t\t\t\teditor.commit();\r\n\t\t\t\t\tIntent intent = new Intent(LoginActivity.this,\r\n\t\t\t\t\t\t\tMainActivity.class);\r\n\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\toverridePendingTransition(R.anim.in_from_right,\r\n\t\t\t\t\t\t\tR.anim.out_to_left);\r\n\t\t\t\t\tLoginActivity.this.finish();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t};\r\n\r\n\t}", "public static boolean _activity_keypress(int _keycode) throws Exception{\nif (_keycode==anywheresoftware.b4a.keywords.Common.KeyCodes.KEYCODE_BACK) { \n //BA.debugLineNum = 75;BA.debugLine=\"If Msgbox2(\\\"آيا مايل به خروج هستيد؟\\\",\\\"خروج\\\",\\\"آري\\\",\\\"خير\\\",\\\"\\\",Null) = DialogResponse.POSITIVE Then\";\nif (anywheresoftware.b4a.keywords.Common.Msgbox2(\"آيا مايل به خروج هستيد؟\",\"خروج\",\"آري\",\"خير\",\"\",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null),mostCurrent.activityBA)==anywheresoftware.b4a.keywords.Common.DialogResponse.POSITIVE) { \n //BA.debugLineNum = 76;BA.debugLine=\"Activity.Finish\";\nmostCurrent._activity.Finish();\n };\n //BA.debugLineNum = 78;BA.debugLine=\"Return True\";\nif (true) return anywheresoftware.b4a.keywords.Common.True;\n }else if(_keycode==anywheresoftware.b4a.keywords.Common.KeyCodes.KEYCODE_HOME) { \n //BA.debugLineNum = 80;BA.debugLine=\"Return True\";\nif (true) return anywheresoftware.b4a.keywords.Common.True;\n };\n //BA.debugLineNum = 83;BA.debugLine=\"End Sub\";\nreturn false;\n}", "public void loginToMain(View v){\n SharedPreferences.Editor editor = login.edit();\n editor.putString(\"LOGIN\", m_loginText.getText().toString());\n editor.commit();\n \n \n \tIntent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n finish();\n }", "@Override\n public void onClick(View view) {\n int clicked_value = -2;\n switch(view.getId()){\n case R.id.keypad0 :\n clicked_value = 0;\n break;\n case R.id.keypad1:\n clicked_value = 1;\n break;\n case R.id.keypad2 :\n clicked_value = 2;\n break;\n case R.id.keypad3 :\n clicked_value = 3;\n break;\n case R.id.keypad4 :\n clicked_value = 4;\n break;\n case R.id.keypad5:\n clicked_value = 5;\n break;\n case R.id.keypad6 :\n clicked_value = 6;\n break;\n case R.id.keypad7:\n clicked_value = 7;\n break;\n case R.id.keypad8:\n clicked_value = 8;\n break;\n case R.id.keypad9:\n clicked_value = 9;\n break;\n case R.id.keypadback:\n clicked_value = -1;\n break;\n }\n\n Log.d(\"Clicked Value\",String.valueOf(clicked_value));\n if(clicked_value == -1)\n {\n int passLength = passNum.length();\n if(passLength != 0)\n passNum = passNum.substring(0,passLength-1); // 그 이전까지 잘라낸다. 하나 지워짐.\n Log.d(\"mypass2\",passNum);\n }\n else if(clicked_value >=0 && clicked_value <=9)\n {\n passNum = passNum + clicked_value; // 글자 하나 추가.\n Log.d(\"mypass\",passNum);\n\n\n if(passNum.length() >= 4) // 길이가 다 차면\n {\n if(lockerType == 2)\n {\n // 비밀번호를 새로 설정한다.\n if(this.isFirst == 0)\n {\n myPass = passNum; // 일단 임시로 저장.\n passNum = \"\";\n this.isFirst++;\n this.tPassText.setText(\"비밀번호를 한번 더 입력하세요.\");\n }\n else if(this.isFirst == 1)\n {\n if(myPass.equals(passNum))\n {\n // 비밀번호가 설정되었다.\n SharedPreferences sharedPreferences = getSharedPreferences(\"mind_key\",MODE_PRIVATE);\n //저장을 하기위해 editor를 이용하여 값을 저장시켜준다.\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putBoolean(\"lockmode\",true);\n editor.putString(\"locker_pass\",passNum); // key, value를 이용하여 저장하는 형\n editor.commit();\n\n Toast toast = Toast.makeText(getApplicationContext(),\"비밀번호가 설정되었습니다.\",Toast.LENGTH_SHORT);\n toast.show();\n setResult(Activity.RESULT_OK);\n finish();\n }\n else\n {\n // 같지않다면,\n Toast toast = Toast.makeText(getApplicationContext(),\"비밀번호가 다릅니다.\",Toast.LENGTH_SHORT);\n toast.show();\n this.isFirst = 0;\n this.tPassText.setText(\"새로운 비밀번호를 입력하세요.\");\n passNum = \"\";\n }\n }\n }\n else {\n SharedPreferences sharedPreferences = getSharedPreferences(\"mind_key\", MODE_PRIVATE);\n\n //저장을 하기위해 editor를 이용하여 값을 저장시켜준다.\n //SharedPreferences.Editor editor = sharedPreferences.edit();\n //String text = editText.getText().toString(); // 사용자가 입력한 저장할 데이터\n myPass = sharedPreferences.getString(\"locker_pass\", \"0000\");\n\n if (passNum.equals(myPass)) {\n if (lockerType == 0) {\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(intent);//액티비티를 메인으로 넘긴다.\n finish();\n } else if (lockerType == 1) {\n // 비밀번호 해제.\n\n // 비밀번호가 설정되었다.\n sharedPreferences = getSharedPreferences(\"mind_key\",MODE_PRIVATE);\n //저장을 하기위해 editor를 이용하여 값을 저장시켜준다.\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putBoolean(\"lockmode\",false);\n //editor.putString(\"locker_pass\",passNum); // key, value를 이용하여 저장하는 형\n editor.commit();\n\n setResult(Activity.RESULT_OK);\n finish();\n }\n } else {\n Toast failLogin = Toast.makeText(this.getApplicationContext(), \"비밀번호가 틀렸습니다\", Toast.LENGTH_SHORT);\n failLogin.show();\n passNum = \"\";\n }\n //editor.putString(\"lokcer_pass\",\"1234\"); // key, value를 이용하여 저장하는 형태\n }\n\n }\n }\n\n resetPassView();\n\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(MainActivity.this, ActivityB.class);\n\t\t\t\ti.putExtra(\"name\", textBox.getText().toString());\n\t\t\t\ti.putExtra(\"job\", textBox1.getText().toString()); \n\t\t\t\ti.putExtra(\"boolean\", textBox2.getText().toString());\n\t\t\t\ti.putExtra(\"amount\", textBox3.getText().toString());\n\t\t\t\t\n\t\t\t startActivity(i);\n\t\t\t}", "public void startSecondActivity(){\n\n Bundle b = new Bundle();\n b.putString(\"LM\", \"There are \" + count + \" faces in the photo\");\n if (tts.handler != null){\n Message msg = tts.handler.obtainMessage(0);\n msg.setData(b);\n tts.handler.sendMessage(msg);\n }\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_login1);\n EditText pass1et=findViewById(R.id.pass1);\n EditText email=findViewById(R.id.name1);\n Button btn=findViewById(R.id.btn1);\n TextView t=findViewById(R.id.login1);\n t.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent intent = new Intent(Login1.this,\n MainActivity.class);\n startActivity(intent);\n\n }\n });\n btn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n loginCheck(email,pass1et);\n }\n\n\n });\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view= inflater.inflate(R.layout.fragment_cha_cha_fragment, container, false);\n initview();\n chachakey.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n @Override\n public void onFocusChange(View v, boolean hasFocus) {\n if(!hasFocus){\n String tkey=chachakey.getText().toString();\n if(tkey.getBytes().length==0)\n Snackbar.make(v,\"密钥格式错误\",Snackbar.LENGTH_INDEFINITE)\n .setAction(\"确认\", new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n chachakey.setFocusable(true);\n }\n })\n .addCallback(callback).show();\n key=tkey.getBytes();\n }\n }\n });\n button.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if(!check()){\n Snackbar.make(getActivity().findViewById(android.R.id.content), \"密钥为空\", Snackbar.LENGTH_INDEFINITE)\n .setAction(\"确定\", new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n chachakey.setFocusable(true);\n }\n })\n .show();\n return;\n }\n// Log.i(\"teSt\",GetChachaKeyandIV.sha(chachakey.getText().toString()));\n// Log.i(\"teSt\",String.valueOf(GetChachaKeyandIV.sha(chachakey.getText().toString()).length()));\n key=GetChachaKeyandIV.sha(chachakey.getText().toString()).substring(0, 32).getBytes();\n iv=GetChachaKeyandIV.sha(chachakey.getText().toString()).substring(32, 40).getBytes();\n// Log.i(\"teSt\",new String(key));\n// Log.i(\"teSt\",String.valueOf(key.length));\n// Log.i(\"teSt\",new String(iv));\n// Log.i(\"teSt\",String.valueOf(iv.length));\n ChachaThread chachaThread=new ChachaThread();\n output.setText(\"结果:\");\n Toast.makeText(getContext(),\"正在加密解密测试,请稍等....\",Toast.LENGTH_SHORT).show();\n chachaThread.execute();\n button.setEnabled(false);\n }\n });\n return view;\n }", "Encryption encryption();", "@Override\r\n public void onClick(View view) {\n String message = enterMessage.getText().toString().trim();\r\n\r\n //create the SharedPrefference instantiations, so that we are able to save the data:\r\n //primul arg e key, apoi mode (we can limit the accesibility from other apps with mode):\r\n// MODE_PRIVATE = ONLY THIS APP IS ABLE TO ACCESS THIS...(xml file)\r\n SharedPreferences sharedPreferences = getSharedPreferences(MESSAGE_ID, MODE_PRIVATE );\r\n\r\n\r\n //invoke the SharedPreferences editor:\r\n //ony \"editor\" will be able to access..\r\n SharedPreferences.Editor editor = sharedPreferences.edit();\r\n editor.putString(\"key_message\", message);\r\n\r\n editor.apply(); //this saves to disk;\r\n\r\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tRandom ra=new Random();\r\n\t\t\t\tint val=ra.nextInt(999);\r\n\t\t\t\tSmsManager sms=SmsManager.getDefault();\r\n\t\t\t\tsms.sendTextMessage(txt_phone.getText().toString(), null, val+\"\", null, null);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tIntent i=new Intent(getApplicationContext(), OTP_Reg.class);\r\n\t\t\t\ti.putExtra(\"name\", txt_name.getText().toString());\r\n\t\t\t\ti.putExtra(\"phone\", txt_phone.getText().toString());\r\n\t\t\t\ti.putExtra(\"otp\", val+\"\");\r\n\t\t\t\t\r\n\t\t\t\tstartActivity(i);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t}", "public void onCreate(Bundle bundle) {\n TraceMachine.startTracing(\"PayResultActivity\");\n try {\n TraceMachine.enterMethod(this._nr_trace, \"PayResultActivity#onCreate\", null);\n } catch (NoSuchFieldError e) {\n while (true) {\n TraceMachine.enterMethod(null, \"PayResultActivity#onCreate\", null);\n }\n }\n super.onCreate(bundle);\n Intent intent = getIntent();\n if ((!TextUtils.isEmpty(intent.getStringExtra(\"orderSuffix\")) ? 1 : 0) != 0) {\n C0575a.f463a = intent.getStringExtra(\"phonecashier.pay.hash\");\n m751a(this, C0575a.f463a, intent.getStringExtra(\"orderSuffix\"), intent.getStringExtra(\"externalPkgName\"));\n m750a((Activity) this, 300);\n TraceMachine.exitMethod();\n return;\n }\n String stringExtra = intent.getStringExtra(\"phonecashier.pay.result\");\n int intExtra = intent.getIntExtra(\"phonecashier.pay.resultOrderHash\", 0);\n if (intExtra == 0 || !TextUtils.equals(C0575a.f463a, String.valueOf(intExtra))) {\n C0590a.m801a(\"biz\", \"SchemePayWrongHashEx\", \"Expected \" + C0575a.f463a + \", got \" + intExtra);\n m752a(C0575a.f463a);\n m750a((Activity) this, 300);\n TraceMachine.exitMethod();\n return;\n }\n if (TextUtils.isEmpty(stringExtra)) {\n m752a(C0575a.f463a);\n } else {\n m753a(stringExtra, C0575a.f463a);\n }\n C0575a.f463a = \"\";\n m750a((Activity) this, 300);\n TraceMachine.exitMethod();\n }", "@Override\n public void onGenerateButtonClicked() {\n\n String result;\n try {\n int c = Integer.parseInt(view.getEndpointTextViewValue());\n result = model.generate(c);\n } catch (NumberFormatException e) {\n view.showToast(\"Wrong input!\");\n return;\n } catch (WrongParametersException e) {\n view.showToast(e.getMessage());\n return;\n }\n Intent intent = view.createNewIntent(SecondActivity.class);\n intent.putExtra(\"result\", result);\n view.startNewActivity(intent);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n txtCor = (EditText)findViewById(R.id.txtCor);\n txtPas = (EditText)findViewById(R.id.txtPas);\n\n btnIngresar = (Button)findViewById(R.id.btnIngresar);\n\n //SharedPreferences sharedPreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);\n\n btnIngresar.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n Thread tr = new Thread(){\n @Override\n public void run() {\n final String res = enviarPost(txtCor.getText().toString(), txtPas.getText().toString());\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n\n int r = objJSON(res);\n\n String u = getResultData(res);\n\n if (r > 0){\n\n Intent i = new Intent(getApplicationContext(), Principal.class);\n i.putExtra(\"data\", res);\n startActivity(i);\n }else{\n Toast.makeText(getApplicationContext(),\"Usuario o Password Incorrectos\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n };\n\n tr.start();\n\n }\n });\n\n\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t realCode = GenerateCodeActivity.getInstance().getCode();\n\t\t\t\t\t\t\tString phoneCode = et_phoneCode.getText().toString();\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\tif(phoneCode.equals(realCode))\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tIntent intent=new Intent(pre_registerActivity.this, RegisterActivity.class);\n\t\t\t\t\t\t\t\tintent.putExtra(\"phone\",et_phoneNum.getText().toString());//传到跳转页面\n\t\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tToast.makeText(pre_registerActivity.this, \"验证码错误\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t}", "@Override\r\n public void onClick(View v) {\n String un = user_name.getText().toString();\r\n String pwd = pass_wrd.getText().toString();\r\n\r\n System.out.println(un + \" \" + pwd);\r\n if(db.validCredentials(un, pwd)){\r\n Intent secondActivity = new Intent(getApplicationContext(), UserAreaActivity.class);\r\n startActivity(secondActivity);\r\n } else{\r\n invalid.setVisibility(View.VISIBLE);\r\n }\r\n }", "protected void onStart() {\n\t\tsuper.onStart();\n flag =false;\n\t\ttry {\n\t\t\tString key = \"__@#$%%$^&^targ!!!@#$#%$%^$%etteam123$%^&^mem$%$^$^$$%6^$%^$%^$^$^$%^$%^$^4^%$^$ber^&^*^&*^crypt*%$^$^$%^$^$logic@#$@!$!@!$@!$!$1\"; // needs to be at least 8 characters for DES\n\n\n\t\t\t//tmp output the file to guest sd/internal memory.\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tFile file_out_config = new File(extStorageDirectory,\"config.xml\");\n\t\t\tFile file_out_html = new File(extStorageDirectory,\"index.html\");\n \n //input the encrypted password file to decrypter \n\t\t\tInputStream is_config =getApplicationContext().getAssets().open(\"target_config.tgt\");\n\t\t\tInputStream is_html =getApplicationContext().getAssets().open(\"target_html.tgt\");\n\n\t\t\t\n\t\t\t//donot encrypt the file back becoz write is not allowed on assest folder.but we can encrypt in the sd card!!!\n\n decrypt(key, is_config, new FileOutputStream(file_out_config));\n decrypt(key, is_html, new FileOutputStream(file_out_html));\n\t\t} catch (Throwable e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t \n\t\tToast.makeText(LaunchActivity.this, \"Saving Decrypted File On Internal Storage\", Toast.LENGTH_LONG).show(); \n\n\t}", "@Override\n public void onClick(View v) {\n Bundle bdl = new Bundle();\n String emailid = txt_Sender_Email_Id.getText().toString().trim();\n String Subject = txt_Subject.getText().toString().trim();\n bdl.putString(\"mailid\", emailid);\n bdl.putString(\"subject\", Subject);\n bdl.putString(\"body\", EmailBody);\n Intent intent = new Intent(Emails_DetailsActivity.this,\n Email_Replay_Activity.class);\n intent.putExtras(bdl);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n\n Intent intent = new Intent(context, NewsDetails.class);\n intent.putExtra(\"desc\", desc.getText().toString()); // here key is = desc\n intent.putExtra(\"pubdate\", pub.getText().toString()); //key is = pubdate ,, nd in next activity key must be same\n intent.putExtra(\"title\", txtTitle.getText().toString());\n intent.putExtra(\"shdesc\", shdesc.getText().toString());\n intent.putExtra(\"postedby\", uname.getText().toString());\n context.startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Referinta.Verset = v.getId();\n\n Intent intent = new Intent(getContext(), TextActivity.class);\n // 2. put key/value data\n\n // intent.putExtra(\"referinta\", referinta );\n // intent.putExtra(\"message\", capitole[1]);\n\n // 3. or you can add data to a bundle\n\n\n // 5. start the activity\n startActivity(intent);\n // finish();\n\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setClass(getApplicationContext(), Atividade2.class);\n //envio do parametro chamado parametro1\n intent.putExtra(\"parametro1\", \"este é um parametro\");\n startActivity(intent);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(edittext_phone.length()!=11)\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(getBaseContext(), \"手机号码有误!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(edittext_pas.length()<1)\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(getBaseContext(), \"请输入密码!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tverfy_button.setEnabled(false);\n\t\t\t\ttime=30;\n\t\t\t\trelativeLayoutregist.setVisibility(View.INVISIBLE);\n\t\t\t\trelativeLayouttijiao.setVisibility(View.VISIBLE);\n\t\t\t\t//传电话号码\n\t\t\t\ttextview_phone.setText(edittext_phone.getText().toString());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Todo 发送短信,获取验证码\n\t\t\t\tinitSDK();\n\t\t\t\tSMSSDK.getVerificationCode(\"86\",textview_phone.getText().toString());\n\t\t\t\t\t\n\t\t\t\thandler.postDelayed(runnable, 1000); \n\t\t\t\t \n\t\t\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tuserId = userid.getText().toString();\r\n\t\t\t\tpassWord = password.getText().toString();\r\n\t\t\t\tInputCode = extracode.getText().toString();\r\n\t\t\t\tif (InputCode.equals(extraCode)) {\r\n\r\n\t\t\t\t\tif (!userId.equals(\"\")) {\r\n\r\n\t\t\t\t\t\tif (!passWord.equals(\"\")) {\r\n\r\n\t\t\t\t\t\t\tif (EHelper.hasInternet(Login.this)) {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t// 将用户名和密码发送到服务端进行验证\r\n\t\t\t\t\t\t\t\t\tJSONObject json = ConnectWs.connect(Login.this, EAccType.NULL,\r\n\t\t\t\t\t\t\t\t\t\t\tEOperation.LOGIN, userId, passWord, InputCode);\r\n\t\t\t\t\t\t\t\t\t// 将JSON数据转换为boolean型\r\n\t\t\t\t\t\t\t\t\tloginflag = EHelper.toBoolean(json);\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\tif (loginflag) {\r\n\t\t\t\t\t\t\t\t\t\t// 登录成功\r\n\t\t\t\t\t\t\t\t\t\tFinanceAss.loginstatus = true;\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (EHelper.hasInternet(Login.this)) {\r\n\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 获取用户详细信息\r\n\t\t\t\t\t\t\t\t\t\t\t\tJSONObject json2 = ConnectWs.connect(Login.this, EAccType.NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tEOperation.GET_USER_INFO, userId);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 将JSON数据转换为MAP型\r\n\t\t\t\t\t\t\t\t\t\t\t\tMap<String, String> userinfo = EHelper.toMap(json2);\r\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(json2.toString());\r\n\t\t\t\t\t\t\t\t\t\t\t\tuserName = userinfo.get(\"userName\").toString();\r\n\t\t\t\t\t\t\t\t\t\t\t\tlogintimes = userinfo.get(\"loginTimes\").toString();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tToast.makeText(Login.this, \"对不起,服务器未连接\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tToast.makeText(Login.this, \"没有连接网络\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tintent.putExtra(\"logintimes\", logintimes);\r\n\t\t\t\t\t\t\t\t\t\tintent.setClass(Login.this, BankMain.class);\r\n\t\t\t\t\t\t\t\t\t\tLogin.this.startActivity(intent);\r\n\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t// 登录失败\r\n\t\t\t\t\t\t\t\t\t\tMyDialogOne dialog = new MyDialogOne(Login.this, R.style.dialog);\r\n\t\t\t\t\t\t\t\t\t\tdialog.setTitleAndInfo(\"登录手机银行\", \"\\n登录失败!\\n用户名或密码输入错误!\");\r\n\t\t\t\t\t\t\t\t\t\tdialog.show();\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t\t\tToast.makeText(Login.this, \"对不起,服务器未连接\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tToast.makeText(Login.this, \"没有连接网络\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t// 用Dialog提示密码为空\r\n\t\t\t\t\t\t\tMyDialogOne dialog = new MyDialogOne(Login.this, R.style.dialog);\r\n\t\t\t\t\t\t\tdialog.setTitleAndInfo(\"登录手机银行\", \"\\n\\n密码不能为空!\");\r\n\t\t\t\t\t\t\tdialog.show();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t// 用Dialog提示用户名为空\r\n\t\t\t\t\t\tMyDialogOne dialog = new MyDialogOne(Login.this, R.style.dialog);\r\n\t\t\t\t\t\tdialog.setTitleAndInfo(\"登录手机银行\", \"\\n\\n用户号不能为空!\");\r\n\t\t\t\t\t\tdialog.show();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// 用Dialog提示附加码不正确\r\n\t\t\t\t\tMyDialogOne dialog = new MyDialogOne(Login.this, R.style.dialog);\r\n\t\t\t\t\tdialog.setTitleAndInfo(\"登录手机银行\", \"\\n\\n附加码不正确!\");\r\n\t\t\t\t\tdialog.show();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n public void onClick(View v) {\r\n try {\r\n InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);\r\n imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\r\n } catch (Exception e) {\r\n // TODO: handle exception\r\n }\r\n\r\n otp = OTP_ET_1.getText().toString() +\r\n OTP_ET_2.getText().toString() + OTP_ET_3.getText().toString() +\r\n OTP_ET_4.getText().toString();\r\n if (otp.equals(\"null\")||otp.isEmpty()||otp.length()<4){\r\n Toast.makeText(ThirdActivity.this, \"Please enter OTP\", Toast.LENGTH_SHORT).show();\r\n return;\r\n }\r\n\r\n HashMap<String, String> params = new HashMap<>();\r\n params.put(\"action\", \"verifyOtp\");\r\n params.put(\"center_id\", centreId);\r\n params.put(\"otp\", otp);\r\n params.put(\"mobile\", number);\r\n progressDialog.show();\r\n apiCall.sendData(Request.Method.POST, OTP_VERIFY, params, \"sendOtp\");\r\n\r\n }", "@Test\n public void getEncryptedSummIDTest(){\n RiotApiHandler userTest=RiotApiHandler.getInstance();\n String testString=userTest.getEncryptedSummID(\"8f9zu86yj87xgh76\",\"eun1\");\n Assert.assertEquals(\"SOcIiFqhj5Qe7z8BhRygyYMJrNpr_M9ABs5seHddZ8n5K78\",testString);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(MainActivity.this, layout2Activity.class);\n\n //creo bundle que va a llevar los datos ingresados\n Bundle datos = new Bundle();\n\n //agrego datos ingresados al bundle creado\n datos.putString(\"nombre\", nombreIngresado.getText().toString());\n datos.putString(\"apellido\", apellidoIngresado.getText().toString());\n datos.putString(\"edad\", edadIngresada.getText().toString());\n\n //asocio el bundle con el intent creado arriba\n intent.putExtras(datos);\n\n //ejecuto el intent\n startActivity(intent);\n\n }", "@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tSharedPreferences.Editor editor = sharedPreferences.edit();\n\t\t\t editor.putString(\"password\", \"\");\n\t\t\t editor.putString(\"username\", \"\");\n\t\t\t\teditor.commit(); \n\t\t\t\tstartActivity(new Intent(getActivity(),LoginActivity.class));\n\t\t\t\tToast.makeText(getActivity(), \"a sec .. to logining\",Toast.LENGTH_LONG)\n\t\t\t\t.show();\n\t\t\t}", "public void navigateToBaseActivity() {\n\n //merchantKey = \"gtKFFx\"; //Testing\n merchantKey = \"ImrH8w\"; //Live\n //merchantKey = ((EditText) findViewById(R.id.editTextMerchantKey)).getText().toString();\n // String amount = ((EditText) findViewById(R.id.editTextAmount)).getText().toString();\n // String email = ((EditText) findViewById(R.id.editTextEmail)).getText().toString();\n\n // String value = environmentSpinner.getSelectedItem().toString();\n int environment;\n // String TEST_ENVIRONMENT = getResources().getString(R.string.test);\n // if (value.equals(TEST_ENVIRONMENT))\n //environment = PayuConstants.MOBILE_STAGING_ENV;\n // else\n environment = PayuConstants.PRODUCTION_ENV;\n\n userCredentials = merchantKey + \":\" + \"anafali2000@gmail.com\";// + new AppPreferences(PlaceOrderActivity.this).getEmail();\n\n //TODO Below are mandatory params for hash genetation\n mPaymentParams = new PaymentParams();\n /**\n * For Test Environment, merchantKey = \"gtKFFx\"\n * For Production Environment, merchantKey should be your live key or for testing in live you can use \"0MQaQP\"\n */\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(String.valueOf(discountedAmount));\n mPaymentParams.setProductInfo(\"FarmFresh24\");\n mPaymentParams.setFirstName(new AppPreferences(PlaceOrderActivity.this).getFname());\n mPaymentParams.setEmail(new AppPreferences(PlaceOrderActivity.this).getEmail());\n\n /*\n * Transaction Id should be kept unique for each transaction.\n * */\n mPaymentParams.setTxnId(\"\" + System.currentTimeMillis());\n\n /**\n * Surl --> Success url is where the transaction response is posted by PayU on successful transaction\n * Furl --> Failre url is where the transaction response is posted by PayU on failed transaction\n */\n mPaymentParams.setSurl(\"https://payu.herokuapp.com/success\");\n mPaymentParams.setFurl(\"https://payu.herokuapp.com/failure\");\n\n /*\n * udf1 to udf5 are options params where you can pass additional information related to transaction.\n * If you don't want to use it, then send them as empty string like, udf1=\"\"\n * */\n mPaymentParams.setUdf1(\"udf1\");\n mPaymentParams.setUdf2(\"udf2\");\n mPaymentParams.setUdf3(\"udf3\");\n mPaymentParams.setUdf4(\"udf4\");\n mPaymentParams.setUdf5(\"udf5\");\n\n /**\n * These are used for store card feature. If you are not using it then user_credentials = \"default\"\n * user_credentials takes of the form like user_credentials = \"merchant_key : user_id\"\n * here merchant_key = your merchant key,\n * user_id = unique id related to user like, email, phone number, etc.\n * */\n mPaymentParams.setUserCredentials(userCredentials);\n\n //TODO Pass this param only if using offer key\n //mPaymentParams.setOfferKey(\"cardnumber@8370\");\n\n //TODO Sets the payment environment in PayuConfig object\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n\n //TODO It is recommended to generate hash from server only. Keep your key and salt in server side hash generation code.\n //generateHashFromServer(mPaymentParams);\n\n /**\n * Below approach for generating hash is not recommended. However, this approach can be used to test in PRODUCTION_ENV\n * if your server side hash generation code is not completely setup. While going live this approach for hash generation\n * should not be used.\n * */\n String salt = \"BBq8CTgS\"; //Live\n // String salt = \"eCwWELxi\"; //Test\n generateHashFromSDK(mPaymentParams, salt);\n\n }", "public void decryptMessageClick(View view) {\n\n String receivedMessage = mMessageContentEditText.getText().toString();\n mMessage.extractEncryptedMessageAndKey(receivedMessage);\n\n if(!decryptMessage()) showToast(\"Error! failed to decrypt text.\");\n\n else{\n\n showDecryptedMessage();\n }\n }", "public final void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n C1341rz aW = mo8628aW();\n aW.mo15855c((int) C0126R.string.tp_other_payment_methods_title);\n aW.mo15860d(12);\n aW.mo15865f((int) C0126R.string.common_back);\n AccountInfo accountInfo = (AccountInfo) getIntent().getParcelableExtra(\"extra_account_info\");\n if (accountInfo == null) {\n bnsl bnsl = (bnsl) f108826f.mo68387b();\n bnsl.mo68432a(\"com.google.android.gms.tapandpay.tokenization.SelectOtherPaymentMethodChimeraActivity\", \"onCreate\", 74, \":com.google.android.gms@201515033@20.15.15 (120300-306758586)\");\n bnsl.mo68405a(\"Activity started without account info, finishing\");\n finish();\n return;\n }\n this.f108827b = getIntent().getStringExtra(\"extra_calling_package\");\n if (this.f108829d == null) {\n this.f108829d = new atam(getApplicationContext(), accountInfo);\n }\n setContentView((int) C0126R.C0128layout.tp_select_other_payment_method_activity);\n this.f108828c = new atqn(this, new ArrayList());\n ((ListView) findViewById(C0126R.C0129id.PaymentMethodList)).setAdapter((ListAdapter) this.f108828c);\n }", "private void m56322b(String str, boolean z, String str2) {\n AppMethodBeat.m2504i(41903);\n C4990ab.m7417i(this.TAG, \"go to card manager: %s\", str);\n Intent intent = new Intent(this, HoneyPayCardManagerUI.class);\n intent.putExtra(\"key_card_no\", str);\n intent.putExtra(\"key_scene\", 0);\n intent.putExtra(\"key_is_create\", z);\n intent.putExtra(\"key_card_type\", str2);\n startActivityForResult(intent, 3);\n AppMethodBeat.m2505o(41903);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tLog.i(\"my\",\"1\");\n\t\tapp = (MyApplication)getApplication();\n\t\tsetContentView(R.layout.activity_my);\n\t\tTextView accountname = (TextView)findViewById(R.id.accountname);\n\t\taccountname.setText(app.getAccountName());\n\t\tbt_exit = (Button)findViewById(R.id.bt_exit);\t\t\n\t\tbt_exit.setOnClickListener(new bt_exit());\n\t\tre_myitem = (RelativeLayout)findViewById(R.id.myitem1);\t\t\n\t\tre_myitem.setOnClickListener(new re_myitem());\n\t\tre_adress= (RelativeLayout)findViewById(R.id.myadress1);\t\t\n\t\tre_adress.setOnClickListener(new re_adress());\n\t\t//re_pingjia= (RelativeLayout)findViewById(R.id.pingjia1);\t\t\n\t\t//re_pingjia.setOnClickListener(new re_pingjia());\n\t\t\n\t\tint i = app.getLoginFlag();\n\t\tLog.i(\"my\",\"2\");\n\t\tLog.i(\"LoginFlag\",\"\"+i);\n\t\t\n\t\t\n\t\tRelativeLayout mimadizhi = (RelativeLayout)findViewById(R.id.mimadizhi1);\n\t\tmimadizhi.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\tAlertDialog.Builder build=new AlertDialog.Builder(MyActivity.this); \n\t\t\t\tbuild.setCancelable(false);\n\t build.setTitle(\"饭小二提示\") \n\t .setMessage(\"请问您要?\") \n\t .setPositiveButton(\"修改密码\", new DialogInterface.OnClickListener() { \n\t \n\t @Override \n\t public void onClick(DialogInterface dialog, int which) { \n\t // TODO Auto-generated method stub \n\t Intent intent = new Intent(MyActivity.this,ConPasswordChange.class);\n\t startActivity(intent);\n\t \n\t } \n\t }) \n\t .setNegativeButton(\"修改默认地址\", new DialogInterface.OnClickListener() { \n\t \n\t @Override \n\t public void onClick(DialogInterface dialog, int which) { \n\t // TODO Auto-generated method stub \n\t \tIntent intent = new Intent(MyActivity.this,ConAddressChange.class);\n\t \t\n\t \tstartActivity(intent);\n\t \t\n\t } \n\t }) \n\t .show(); \n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\n\t\t});\n\t\t\n\t\t\n\t\tif(app.getLoginFlag() == 0)\n\t\t{\tLog.i(\"my\",\"4\");\n\t\t\tAlertDialog.Builder build=new AlertDialog.Builder(this); \n\t\t\tbuild.setCancelable(false);\n build.setTitle(\"找饭提示\") \n .setMessage(\"您还没有登录,现在去登陆?\") \n .setPositiveButton(\"登陆\", new DialogInterface.OnClickListener() { \n \n @Override \n public void onClick(DialogInterface dialog, int which) { \n // TODO Auto-generated method stub \n Intent intent = new Intent(MyActivity.this,denglu_Activity.class);\n startActivity(intent);\n finish();\n \n } \n }) \n .setNegativeButton(\"先看看我附近有什么\", new DialogInterface.OnClickListener() { \n \n @Override \n public void onClick(DialogInterface dialog, int which) { \n // TODO Auto-generated method stub \n \tIntent intent = new Intent(MyActivity.this,MainActivity.class);\n \tintent.putExtra(\"toWhichTab\", \"1\");\n \tstartActivity(intent);\n \tfinish();\n } \n }) \n .show(); \n\t\t}\n\t\telse\n\t\t{\n\t\t\tTextView accountName = (TextView)findViewById(R.id.accountname);\n\t\t\tif(app.getAccountName()!= null )\n\t\t\taccountName.setText(app.getAccountName());\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@Override\n public void onClick(View v) {\n Bundle bdl = new Bundle();\n String emailid = txt_Body.getText().toString().trim();\n String Subject = txt_Subject.getText().toString().trim();\n bdl.putString(\"body\", EmailBody);\n bdl.putString(\"subject\", Subject);\n Intent intent1 = new Intent(Emails_DetailsActivity.this,\n Email_Forword_Activity.class);\n intent1.putExtras(bdl);\n startActivity(intent1);\n }", "private void userInformation()\n {\n name = eName.getText().toString();\n userName = eUserName.getText().toString();\n email = eEmail.getText().toString();\n password = ePassword.getText().toString();\n password = encryptionAlgo.encryptPass(password);//initialize new encrypt password\n address = eAddress.getText().toString();\n favouriteWord = eFavourite.getText().toString();\n }", "public static void main(String args []) throws Exception\n {\n decryptor myEncryptor= new decryptor();\n \n String stringToEncrypt=\"Sanjaal.com\";\n String encrypted=myEncryptor.encrypt(stringToEncrypt);\n String enctptor=\"qsYVyDFK624cSomY9Ob9lw==\";\n String decrypted=myEncryptor.decrypt(enctptor);\n \n System.out.println(\"String To Encrypt: \"+stringToEncrypt);\n System.out.println(\"Encrypted Value :\" + encrypted);\n System.out.println(\"Decrypted Value :\"+decrypted);\n \n }", "public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}", "public static String _activity_create(boolean _firsttime) throws Exception{\nmostCurrent._activity.LoadLayout(\"frmpass\",mostCurrent.activityBA);\n //BA.debugLineNum = 28;BA.debugLine=\"txtval.Typeface = Typeface.LoadFromAssets(\\\"BYekan.ttf\\\")\";\nmostCurrent._txtval.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets(\"BYekan.ttf\"));\n //BA.debugLineNum = 29;BA.debugLine=\"btnlogin.Typeface = Typeface.LoadFromAssets(\\\"BYekan.ttf\\\")\";\nmostCurrent._btnlogin.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets(\"BYekan.ttf\"));\n //BA.debugLineNum = 30;BA.debugLine=\"btndelete.Typeface = Typeface.LoadFromAssets(\\\"BYekan.ttf\\\")\";\nmostCurrent._btndelete.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.LoadFromAssets(\"BYekan.ttf\"));\n //BA.debugLineNum = 31;BA.debugLine=\"txtval.Color = Colors.Transparent\";\nmostCurrent._txtval.setColor(anywheresoftware.b4a.keywords.Common.Colors.Transparent);\n //BA.debugLineNum = 33;BA.debugLine=\"If myLibrary.getSettingBoolean(\\\"first\\\") = False Then\";\nif ((mostCurrent._mylibrary._getsettingboolean(mostCurrent.activityBA,\"first\")).equals(BA.ObjectToString(anywheresoftware.b4a.keywords.Common.False))) { \n //BA.debugLineNum = 34;BA.debugLine=\"ToastMessageShow(\\\"رمز عبور پیش فرض 00 میباشد\\\",False)\";\nanywheresoftware.b4a.keywords.Common.ToastMessageShow(\"رمز عبور پیش فرض 00 میباشد\",anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 35;BA.debugLine=\"myLibrary.setBoolean(\\\"first\\\",True)\";\nmostCurrent._mylibrary._setboolean(mostCurrent.activityBA,\"first\",anywheresoftware.b4a.keywords.Common.True);\n };\n //BA.debugLineNum = 38;BA.debugLine=\"StartService(handleCall)\";\nanywheresoftware.b4a.keywords.Common.StartService(mostCurrent.activityBA,(Object)(mostCurrent._handlecall.getObject()));\n //BA.debugLineNum = 39;BA.debugLine=\"StartService(handleSMS)\";\nanywheresoftware.b4a.keywords.Common.StartService(mostCurrent.activityBA,(Object)(mostCurrent._handlesms.getObject()));\n //BA.debugLineNum = 41;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Button b1=(Button)findViewById(R.id.button1);\n final AlertDialog ad=new AlertDialog.Builder(this).create();\n\n b1.setOnClickListener(new OnClickListener() {\n\n @Override public void onClick(View arg0) {\n // TODO Auto-generated method stub\n\n try\n {\n EditText ed1=(EditText)findViewById(R.id.editText1);\n EditText ed2=(EditText)findViewById(R.id.editText2);\n EditText ed3=(EditText)findViewById(R.id.editText3);\n int a=Integer.parseInt(ed1.getText().toString());\n String b=ed2.getText().toString();\n int ce=Integer.parseInt(ed3.getText().toString());\n rslt=\"START\";\n Caller c=new Caller(); c.a=a;\n c.b=b;c.c=ce;\n c.join(); c.start();\n startActivity(new Intent(\"android.intent.action.FIRST\"));\n while(rslt==\"START\") {\n try {\n Thread.sleep(10);\n }catch(Exception ex) {\n }\n }\n //ad.setTitle(\"RESULT \");\n //ad.setMessage(rslt);\n rslt=rslt.replace(\"[\", \" \").replace(\"\\n]\", \" \").replace(\".\",\"-\").replace(\", \",\"\");\n part=rslt.split(\"\\n\");\n }catch(Exception ex) {\n //ad.setTitle(\"Error!\"); ad.setMessage(ex.toString());\n }\n // ad.show();\n } });\n }", "@Override\n public void onClick(View v) {\n Intent i=new Intent(getApplicationContext(),pagos.class);\n String user=bl.getString(\"user\");\n //pasar a la nueva ventana el user del usuario\n i.putExtra(\"user\",String.valueOf(user));\n //pasar a la nueva ventana el saldo del usuario\n i.putExtra(\"saldo\",etSaldo.getText().toString());\n //lanzar la nueva ventana\n startActivity(i);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n Button button1;\n Button button2;\n Button button3;\n\n button1 = (Button)findViewById(R.id.actOneButton);\n button2 = (Button)findViewById(R.id.actTwoButton);\n button3 = (Button)findViewById(R.id.actThreeButton);\n\n final EditText num1Text = (EditText)findViewById(R.id.num1Text);\n final EditText num2Text = (EditText)findViewById(R.id.num2Text);\n final EditText num3Text = (EditText)findViewById(R.id.num3Text);\n final EditText num4Text = (EditText)findViewById(R.id.num4Text);\n final EditText num5Text = (EditText)findViewById(R.id.num5Text);\n\n button1.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View view){\n int num1 = 100;\n int num2 = 400;\n int num3 = 300;\n int num4 = 50;\n int num5 = 102;\n\n Intent intent = new Intent(Activity_main.this, Activity_one.class);\n\n Bundle dataBundle = new Bundle();\n dataBundle.putInt(\"num1\", num1);\n dataBundle.putInt(\"num2\", num2);\n dataBundle.putInt(\"num3\", num3);\n dataBundle.putInt(\"num4\", num4);\n dataBundle.putInt(\"num5\", num5);\n\n intent.putExtras(dataBundle);\n startActivityForResult(intent, 1010);\n }\n });\n\n button2.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n String[] data = new String[5];\n\n //cater for blank strings\n\n //get input from text areas\n data[0] = num1Text.getText().toString();\n data[1] = num2Text.getText().toString();\n data[2] = num3Text.getText().toString();\n data[3] = num4Text.getText().toString();\n data[4] = num5Text.getText().toString();\n for(int i = 0; i < data.length; i ++){\n if (data[i].compareTo(\"\")==0) {\n data[i] = \"0\";\n }\n }\n Bundle dataBundle = new Bundle();\n dataBundle.putStringArray(\"data\",data);\n Intent intent = new Intent(Activity_main.this, Activity_two.class);\n\n intent.putExtras(dataBundle);\n startActivityForResult(intent, 2020);\n }\n });\n }", "@Override\n public void onClick(View arg0) {\n\n String messageToSend = \"Thank you for shopping. Your order will be delivered soon.\";\n String number = \"6476710881\";\n SmsManager.getDefault().sendTextMessage(number, null, messageToSend, null,null);\n Toast.makeText(getApplicationContext(), \"Your Payment is done\", Toast.LENGTH_LONG).show();\n\n Intent myIntent = new Intent(getApplicationContext(),LoginActivity.class);\n startActivity(myIntent);\n\n }", "public void resta(View v){\n presenter.Operacion(main_number_one.getText().toString(),main_number_two.getText().toString(),2);\n }", "public void onClick(View view){\n String name = Name.getText().toString();\n String age = Age.getText().toString();\n\n // Change Main Activity into NewActivity in screen through intent.\n Intent intent = new Intent(getApplicationContext(), NewActivity.class);\n\n // Send data values that name and age .\n intent.putExtra(\"loginName\", name);\n intent.putExtra(\"loginAge\", age);\n\n startActivity(intent);\n }", "@Override\n\t\t\tpublic void onClick(View v)\n\t\t\t{\n\t\t\t\tIntent intent = new Intent(DeviceActivity.this, sdw.com.CountyActivity.class);// ����������Activity\n\t\t\t\t Bundle bundle = new Bundle(0); \n\t bundle.putString(\"fun1\",transferValue);\n\t Log.e(\"TAG\",transferValue);\n\t bundle.putString(\"search1\",\"btnRunRecord\"); \n\t intent.putExtras(bundle);//can't \n\t\t\t\tstartActivity(intent);\n//\t\t\t\tfinish();\n\t\t\t}", "public void Click(View view){\n\n\n EditText editText=(EditText)findViewById(R.id.e);\n String str = editText.getText().toString();\n Intent intent = new Intent(NewActivity.this, WeatherActivity.class);\n//使用putExtra(key,value)方法传递数据\n intent.putExtra(\"editTextValue\",str);\n//跳转到第2个Activity页面\n startActivity(intent);\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_second);\n \n silent=(EditText)findViewById(R.id.silent);\n ring=(EditText)findViewById(R.id.ring);\n vibrate=(EditText)findViewById(R.id.vibrate);\n \n // setting default values///\n silent.setText(\"\"+StaticDB.getSilent());\n ring.setText(\"\"+StaticDB.getRing());\n vibrate.setText(\"\"+StaticDB.getVibrate());\n \n \n \n\n\t\t save=(Button)findViewById(R.id.save);\n\t\t \n\t save.setOnClickListener(new OnClickListener() {\n\t\t\t\t\n\t\t\t\t@SuppressLint(\"ShowToast\") @Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tStaticDB.setSilent( new String(silent.getText().toString()));\n\t\t\t\t\tStaticDB.setRing(new String(ring.getText().toString()));\n\t\t\t\t\tStaticDB.setVibrate(new String(vibrate.getText().toString()));\n\t\t\t\t\t\n\t\t\t\t\tToast.makeText(getApplicationContext(), StaticDB.getSilent(), 100).show();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tIntent it=new Intent(SecondActivity.this,ThirdActivity.class);\n\t\t\t\tstartActivity(it);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t \n\t\t\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\t\tSharedPreferences preferences=getSharedPreferences(\"user\",Context.MODE_PRIVATE);\n\n\t\t\t str2=preferences.getString(\"str1\", \"defaultname\");\n\t\t\t\t//Toast.makeText(MainActivity.this, str2, Toast.LENGTH_SHORT).show();\n\t\t\t\tTextView txCounter2 = (TextView) findViewById(R.id.textView2);\n\t\t txCounter2.setText(str2);\n\t\t\t}", "@Override\n protected String doInBackground(String... arg0) {\n\n\n\n try {\n AESCryptography mcrypt = new AESCryptography();\n/* Encrypt */\n b = AESCryptography.bytesToHex(mcrypt.encrypt(b));\n/* Decrypt */\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n\n\n HashMap<String, String> m = new HashMap<String, String>();\n\n m.put(\"phone\", a);\n m.put(\"password\", b);\n\n\n\n jobj = clientServerInterface.makeHttpRequest(\"http://www.campusdost.com/movies/jlogin.php\", m);\n\n try {\n ab = jobj.getString(\"status\");\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return ab;\n }", "@Override\n\tpublic void onClick(View view) {\n\t\tIntent intent = new Intent();\n\t\tif (view.getId() == R.id.ast_back_icon) {\n\t\t\tintent.setClass(this, AstLoginActivity.class);\n\t\t} else if (view.getId() == R.id.ast_mob_sdk_next_step_btn) {\n\t\t\tnew GuestPhoneCanBindHandler(AstGamePlatform.getInstance()\n\t\t\t\t\t.isDebugMode(), new HttpCallback() {\n\t\t\t\tpublic void onSuccess(int code, String msg, final Object data) {\n\t\t\t\t\tIntent intent = new Intent();\n\t\t\t\t\tintent.setClass(getApplicationContext(),\n\t\t\t\t\t\t\tDeclareGetPasswdActivity.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * 登陆失败处理\n\t\t\t\t */\n\t\t\t\tpublic void onFailure(int code, final String msg, Object data) {\n\t\t\t\t\tif (code != 317) {\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), msg,\n\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tIntent intent = new Intent();\n\t\t\t\t\t\tintent.setClass(getApplicationContext(),\n\t\t\t\t\t\t\t\tRegetPasswdActivity.class);\n\t\t\t\t\t\tintent.putExtra(\"mobile\", ed.getText().toString());\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, ed.getText().toString()).post();\n\t\t\treturn;\n\t\t}\n\t\tfinish();\n\t\tstartActivity(intent);\n\t}", "public void run() {\n Intent intent = new Intent(MainActivity.this, Summit.class);\n String description = woeid.getWoeid();\n intent.putExtra(EXTRA_MESSAGE, description);\n // Log.d(\"Long\", description);\n startActivity(intent);\n }", "public void onClick(View v) {\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString uniquecode1=ucodeET.getText().toString();\n\t\t\t\t\t\t\tif(uniquecode1.equals(\"\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"Enter Unique Code\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{/*\n\t\t\t\t\t\t\t\tif(uniquecode1.equals(uniquecode))\n\t\t\t\t\t\t\t\t{*/\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\tString password=\"\";\n\t\t\t\t\t\t\t\t\tsqldb=openOrCreateDatabase(\"aman\",MODE_PRIVATE,null);\n\t\t\t\t\t\t\t\t\tCursor c =sqldb.rawQuery(\"select * from aman1DB\",null);\n\t\t\t\t\t\t\t\t\tint count=c.getCount();\n\t\t\t\t\t\t\t\t\tif (c.getCount() > 0) \n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t c.moveToFirst();\n\t\t\t\t\t\t\t\t\t password=c.getString(0);\n\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/*\t} \n\t\t\t\t\t\t\t else \n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"No Data\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t }*/\n\t\t\t\t\t\t\t\t Toast.makeText(getApplicationContext(),\"Code Matched\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t builder.setIcon(R.drawable.ic_launcher);\n\t\t\t\t\t\t\t\t\t//builder.setTitle(\"Exit\");\n\t\t\t\t\t\t\t\t\tbuilder.setMessage(\"Kindly Change Your Password !!\")\n\t\t\t\t\t\t\t\t\t //.setCancelable(false)\n\t\t\t\t\t\t\t\t\t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t\t public void onClick(DialogInterface dialog, int id) {\n\t\t\t\t\t\t\t\t\t //System.exit(0);\n\t\t\t\t\t\t\t\t\t \tfinish();\n\t\t\t\t\t\t\t\t\t\t\tIntent i=new Intent(getApplicationContext(),Login.class);\n\t\t\t\t\t\t\t\t\t\t\tstartActivity(i);\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\tAlertDialog alert = builder.create();\n\t\t\t\t\t\t\t\t\t alert.setTitle(\"PASSWORD\");\n\t\t\t\t\t\t\t\t\t alert.show();\n\n\t\t\t\t\t\t\t\t\t//Toast.makeText(getApplicationContext(),password,Toast.LENGTH_LONG).show();\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/*\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"Wrong Code\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\t\tucodeET.setText(\"\");\n\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\tcatch(Exception ex)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),ex.toString(),Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"Msg not Sent\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tEditText phoneNb = (EditText) findViewById(R.id.edt_portable);\n\t\t\t\tif (phoneNb.length() == 10) {\n\t\t\t\t\tphoneNb.getText();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Invalid phone number\");\n\t\t\t\t}\n\n\t\t\t\t// Second verification\n\t\t\t\t// to verify that the password is the same in the confirmation\n\t\t\t\t// field\n\t\t\t\tEditText password = (EditText) findViewById(R.id.edt_password);\n\t\t\t\tEditText repassword = (EditText) findViewById(R.id.edt_repassword);\n\t\t\t\tif (repassword.getText().equals(password.getText())) {\n\t\t\t\t\tSystem.out.println(\"same password right \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"your password is not confirmed \");\n\t\t\t\t}\n\n\t\t\t\t// Third verification\n\t\t\t\t// to verify the email\n\t\t\t\tEditText email = (EditText) findViewById(R.id.edt_email);\n\t\t\t\tif (email.getText().equals(emailPattern)) {\n\t\t\t\t\tSystem.out.println(\"Valid mail\");\n\t\t\t\t\t// here we'll take this mail and save it into the user class\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Invalid mail\");\n\t\t\t\t}\n\t\t\t\tEditText nom= (EditText) findViewById(R.id.edt_nom); \n\t\t\t\tEditText prenom= (EditText) findViewById(R.id.edt_prenom); \n\t\t\t\tEditText portable= (EditText)findViewById(R.id.edt_portable); \n\t\t\t\tUser u = new User(); \n\t\t\t\tu.setNom(nom.getText().toString()); \n\t\t\t\tu.setPrenom(prenom.getText().toString()); \n\t\t\t\tu.setPassword(password.getText().toString()); \n\t\t\t\t\n\t\t\t\tnew LongTask().execute(u); \n\t\t\t\n\t\t\t\t/*Intent authentification = new Intent(Formulaire.this,\n\t\t\t\t\t\tAuthentification.class);\n\t\t\t\tstartActivity(authentification);\n\t\t\t\t*/ \n\t\t\t\t\n\t\t\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.main);\r\n\r\n\r\n\t\tTextView txtDisp = (TextView) findViewById(R.id.display);\r\n\t\tcalc.setDisp(txtDisp,this);\r\n\r\n//\t\tButton btnTest = (Button) findViewById(R.id.clear);\r\n//\t\tbtnTest.setOnClickListener(new Button.OnClickListener() {\r\n//\t\t\tpublic void onClick(View v) {\r\n//\t\t\t\tLog.i(\"onClick\", \"Call Sub Activity\");\r\n//\t\t\t\tIntent intentSubActivity = new Intent(\r\n//\t\t\t\t\t\tBiscuitCalculatorActivity.this,\r\n//\t\t\t\t\t\tBiscuitWebActivity.class);\r\n//\t\t\t\tstartActivity(intentSubActivity);\r\n//\t\t\t}\r\n//\t\t});\r\n\r\n\t}", "@Override\n public void onClick(View view) {\n intent.putExtra(SEND_KEY,sendText.getText().toString());\n\n //Start next Activity/No data is passed back to this activity\n startActivity(intent);\n\n }", "@Override\n public void onClick(View v) {\n\n int totalAmt = (int) Math.ceil(Double.parseDouble(String.valueOf(txtTotalAmount.getText()))); //always rounds up to the nearest whole\n\n try {\n if ((PersistentData.callpermissiongranted)&&(PersistentData.smspermissiongranted))\n {\n\n if (executionComplete && validateFields(v))\n {\n\n //Mobile Money USSD code dialer\n startActivity(new Intent(Intent.ACTION_CALL).setData(Uri.parse(\"tel:*007*1*2*101248*\"+ totalAmt +\"*123456\"+Uri.encode(\"#\"))));\n\n\n // Magic here*/\n\n mHandler.postDelayed(new Runnable() {\n public void run() {\n Log.d(\"CheckOutActivity\",\": paymentconfirmed status \" + PersistentData.paymentConfirmed);\n if(PersistentData.paymentConfirmed){\n Log.d(\"CheckOutActivity\",\": Order Started\");\n RegisterOrder RO = new RegisterOrder();\n RO.execute(\"\");\n Log.d(\"CheckOutActivity\",\": Order Executed\");\n }\n doStuff();\n }\n }, 60000);\n }\n else\n {\n //Incorrect Error handling\n //Toast.makeText(getBaseContext(), \"Your order registration is still in progress.Please await its completion. Siyabonga.\",Toast.LENGTH_LONG).show();\n }\n }\n else\n {\n checkPermissions();\n }\n }\n catch(Exception ex)\n {\n Toast.makeText(getBaseContext(), ex.getMessage(),Toast.LENGTH_LONG).show();\n }\n\n }", "public void phone_validate(View v1) {\n Intent A2Intent = new Intent (v1.getContext(), Main2Activity.class);\n EditText phone = (EditText) findViewById(R.id.editText);\n // pass the entered phone number to the next activity\n //A2Intent.putExtra(\"phoneNumber\", tv2.getText());\n String ph = phone.getText().toString();\n A2Intent.putExtra(\"phoneNumber\", ph);\n\n // start the next activity/page\n startActivity(A2Intent);\n\n\n }" ]
[ "0.70158887", "0.64266604", "0.6020494", "0.59974605", "0.59838957", "0.5910563", "0.5886788", "0.58788496", "0.58752304", "0.58693767", "0.58579785", "0.58359027", "0.5811747", "0.5806614", "0.58012986", "0.57940406", "0.5783951", "0.57547957", "0.5713548", "0.5688353", "0.5675678", "0.5670493", "0.5651309", "0.5649025", "0.5622811", "0.5564769", "0.55396384", "0.5534315", "0.55175525", "0.55119336", "0.5507639", "0.5506674", "0.5493665", "0.54920906", "0.54775894", "0.54738724", "0.54661846", "0.5464829", "0.5447131", "0.543964", "0.54245293", "0.5408823", "0.5406976", "0.5406037", "0.54056853", "0.54023635", "0.5387735", "0.53859055", "0.5372521", "0.5364604", "0.5362912", "0.5362726", "0.53624356", "0.5360239", "0.5348788", "0.5346064", "0.53414917", "0.533924", "0.53374904", "0.53293353", "0.53285325", "0.5324393", "0.53119516", "0.53081185", "0.52987856", "0.5295543", "0.52943426", "0.5288443", "0.527768", "0.52754694", "0.5272721", "0.5269396", "0.5268411", "0.5262667", "0.5261509", "0.5261197", "0.52601534", "0.5256492", "0.525472", "0.5252163", "0.5251195", "0.52434325", "0.52384466", "0.52366996", "0.5235203", "0.5234536", "0.52283126", "0.5223688", "0.5222242", "0.52164483", "0.52149886", "0.5210623", "0.5203791", "0.51989686", "0.5191619", "0.5183534", "0.5180381", "0.51799256", "0.5177863", "0.51761335", "0.5175622" ]
0.0
-1
send oauth request /SendAuth.Req req = new SendAuth.Req(); req.scope = "snsapi_userinfo"; req.state = "wechat_sdk_demo_test"; api.sendReq(req);
@Override public void call(Void aVoid) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getUserInfo(boolean checkAccessTokenResult, final AccessToken accessToken) {\n if (!checkAccessTokenResult) {\n //access token is not valid refresh\n RequestParams params = new RequestParams(WeChatManager.getRefreshAccessTokenUrl(sURLRefreshAccessToken, accessToken));\n x.http().request(HttpMethod.GET, params, new Callback.CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n parseRefreshAccessTokenResult(result);\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n }\n\n showLoading();\n //get userinfo\n RequestParams requestParams = new RequestParams(WeChatManager.getUserInfoUrl(sURLUserInfo, accessToken));\n x.http().request(HttpMethod.GET, requestParams, new Callback.CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n userinfo = new Gson().fromJson(result, UserInfoWX.class);\n\n String device_id= JPushInterface.getRegistrationID(LoginActivity.this);\n RequestParams entity = new RequestParams(Configurations.URL_THIRD_PARTY_LOGIN);\n entity.addParameter(Configurations.OPEN_ID, userinfo.getUnionid());\n entity.addParameter(Configurations.NICKNAME, userinfo.getNickname());\n entity.addParameter(Configurations.AVATOR, userinfo.getHeadimgurl());\n entity.addParameter(\"from\", \"wx\");\n entity.addParameter(Configurations.REG_ID,device_id);\n\n\n long timeStamp= TimeUtil.getCurrentTime();\n entity.addParameter(Configurations.TIMESTAMP, String.valueOf(timeStamp));\n entity.addParameter(Configurations.DEVICE_ID,device_id );\n\n Map<String,String> map=new TreeMap<>();\n map.put(Configurations.OPEN_ID, userinfo.getUnionid());\n map.put(Configurations.NICKNAME, userinfo.getNickname());\n map.put(Configurations.AVATOR, userinfo.getHeadimgurl());\n map.put(\"from\", \"wx\");\n map.put(Configurations.REG_ID,device_id);\n entity.addParameter(Configurations.SIGN, SignUtils.createSignString(device_id,timeStamp,map));\n\n\n x.http().request(HttpMethod.POST, entity, new CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n LogUtil.d(TAG, result);\n hideLoading();\n\n try {\n JSONObject object = new JSONObject(result);\n if (object.getInt(Configurations.STATUSCODE) == 200) {\n User user = JSON.parseObject(object.getJSONObject(\"results\").getString(\"user\"), User.class);\n SharedPrefUtil.loginSuccess(SharedPrefUtil.LOGIN_VIA_WECHAT);\n UserUtils.saveUserInfo(user);\n\n MobclickAgent.onProfileSignIn(\"WeChat\", user.getNickname());\n finish();\n } else {\n ToastUtil.showShort(LoginActivity.this, object.getString(Configurations.STATUSMSG));\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n hideLoading();\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n\n\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n }", "com.bingo.server.msg.REQ.WeixinLoginRequest getWeixinLogin();", "private void sentRequestGG(FirebaseAuth firebaseAuth) {\n if (firebaseAuth.getCurrentUser() != null) {\n SharedPref.instance.putName(firebaseAuth.getCurrentUser().getDisplayName());\n SharedPref.instance.putPassword(firebaseAuth.getCurrentUser().getUid());\n SharedPref.instance.putUrlAvatar(String.valueOf(firebaseAuth.getCurrentUser().getPhotoUrl()));\n SharedPref.instance.putUser(firebaseAuth.getCurrentUser().getDisplayName());\n SharedPref.instance.putEmail(firebaseAuth.getCurrentUser().getEmail());\n username = firebaseAuth.getCurrentUser().getEmail();\n password = firebaseAuth.getCurrentUser().getUid();\n\n UserService userService = NetContext.instance.create(UserService.class);\n MediaType jsonType = MediaType.parse(\"application/json\");\n String loginJson = (new Gson().toJson(new UserRegisterResponseJson(username, password)));\n final RequestBody loginBody = RequestBody.create(jsonType, loginJson);\n // create call\n Call<Token> loginCall = userService.postNewAccount(loginBody);\n loginCall.enqueue(new Callback<Token>() {\n @Override\n public void onResponse(Call<Token> call, Response<Token> response) {\n DBContext.instance.cleanCart();\n SharedPref.instance.putCount(0);\n //EventBus.getDefault().postSticky(new SentUserIdEvent(u.getId().get$oid()));\n //Dang nhap 1 tai khoan moi hay tai khoan cu deu tra ve 307\n if (response.code() == 307){\n login(username, password);\n } else {\n Toast.makeText(LoginActivity.this, \"Could not parse body\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Token> call, Throwable t) {\n Toast.makeText(LoginActivity.this, \"Lỗi xác minh tài khoản google!\", Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n }\n });\n }\n }", "@Override\n public void onClick(View v) {\n String scopeParams=\"rw_nus+r_basicprofile\";\n oAuthService = LinkedInOAuthServiceFactory.getInstance()\n .createLinkedInOAuthService(Constants.CONSUMER_KEY,\n Constants.CONSUMER_SECRET);\n\n\n Log.e(\"oAuthService : \", \"*\" + oAuthService);\n\n factory = LinkedInApiClientFactory.newInstance(\n Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET);\n\n liToken = oAuthService\n .getOAuthRequestToken(Constants.OAUTH_CALLBACK_URL);\n Log.e(\"liToken : \", \"*\" + liToken.getAuthorizationUrl());\n Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(liToken\n .getAuthorizationUrl()));\n startActivity(i);\n\n }", "private void OpenABCWeChat(String[] params) {\n String appid = params[0];\n String partneridParam = params[1];\n String prepayidParam = params[2];\n String packageParam = params[3];\n String noncestrParam = params[4];\n String timestampParam = params[5];\n String signParam = params[6];\n\n IWXAPI api = WXAPIFactory.createWXAPI(context, subParam(appid, \"appid=\"));\n if (api.isWXAppInstalled()) {\n PayReq request = new PayReq();\n request.appId = subParam(appid, \"appid=\");\n request.partnerId = subParam(partneridParam, \"partnerid=\");\n request.prepayId = subParam(prepayidParam, \"prepayid=\");\n request.packageValue = subParam(packageParam, \"package=\");\n request.nonceStr = subParam(noncestrParam, \"noncestr=\");\n request.timeStamp = subParam(timestampParam, \"timestamp=\");\n request.sign = subParam(signParam, \"sign=\");\n\n boolean b = api.sendReq(request);\n int i = 0 ;\n } else {\n Toast.makeText(context, \"没有安装微信\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n public void fromWXRegister(Map<String, Object> data, String token, final IBaseModel.OnCallbackListener listener) {\n RequestBody body = RequestBody.create(MediaType.parse(\"application/json;charset=UTF-8\"),\n GsonUtils.parseToJson(data));\n final Request request = new Request.Builder()\n .url(\"URL\")\n .header(\"Authorization\", token)\n .post(body)//默认就是GET请求,可以不写\n .build();\n HttpProvider.getOkHttpClient().newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n Log.d(\"onFailure: \", e.getMessage());\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n if (response.isSuccessful()) {\n delayedExecuteCallback(response.body().string(), new TypeToken<ResponseEntity<UserInfoEntity>>() {\n }.getType(), listener);\n } else {\n delayedExecuteCallback(null, new TypeToken<ResponseEntity<UserInfoEntity>>() {\n }.getType(), listener);\n }\n }\n });\n\n /* HttpProvider.doPost(URL, data, new HttpProvider.ResponseCallback() {\n @Override\n public void callback(String responseText) {\n delayedExecuteCallback(responseText, new TypeToken<ResponseEntity<UserInfoEntity>>() {\n }.getType(), listener);\n }\n });*/\n }", "public interface IWeChatSingnCallBack {\n void onSignInSuccess(String uesrInfo);\n}", "abstract public String buildAuthRequest(String userId, String authCallback) throws IOException;", "private void sendAddFBAndChatInfoToServer(String fbid) {\n \tSBHttpRequest chatServiceAddUserRequest = new ChatServiceCreateUser(fbid);\r\n \tSBHttpClient.getInstance().executeRequest(chatServiceAddUserRequest);\r\n\t\tSBHttpRequest sendFBInfoRequest = new SaveFBInfoRequest(ThisUserConfig.getInstance().getString(ThisUserConfig.USERID), fbid, ThisUserConfig.getInstance().getString(ThisUserConfig.FBACCESSTOKEN));\r\n\t\tSBHttpClient.getInstance().executeRequest(sendFBInfoRequest);\t\t\t\r\n\t}", "public void sendYo (String username){\n try {\n URL obj = new URL(\"http://api.justyo.co/yo/\");\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setRequestMethod(\"POST\");\n String urlParameters = \"api_token=9831429c-5e02-4175-b0d1-c5cbe958e09a&username=\" + username;\n con.setDoOutput(true);\n DataOutputStream wr = new DataOutputStream(con.getOutputStream());\n wr.writeBytes(urlParameters);\n wr.flush();\n wr.close();\n int responseCode = con.getResponseCode();\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n String inputLine;\n StringBuffer response = new StringBuffer();\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n }\n catch(Exception e){\n System.out.println(\"Error\");\n }\n }", "public void req_publicprofile_API(final Context cont, int user_id)\n {\n final Context context = cont;\n final Configuration_Parameter m_config = Configuration_Parameter.getInstance();\n final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n final String bearertoken = sharedPreferences.getString(m_config.login_access_token,\"\");\n\n String url = m_config.web_api_link + \"/profile-id/\"+user_id;\n Log.d(\"url\", url.toString());\n // prepare the Request\n JsonObjectRequest profilerequest = new JsonObjectRequest(Request.Method.GET, url,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n // display response\n Log.d(\"Response\", response.toString());\n setPublicProfileData(response);\n CommonFunctions.hDialog();\n\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n CommonFunctions.hDialog();\n if(error.networkResponse != null)\n {\n String networkresponse_data = new String(error.networkResponse.data);\n if(error.networkResponse.statusCode == 500)\n {\n CommonFunctions.displayToast(context,context.getResources().getString(R.string.internal_server_error));\n }\n else {\n if (networkresponse_data != null) {\n JSONObject network_obj;\n try {\n network_obj = new JSONObject(networkresponse_data);\n if (network_obj.getInt(\"code\") == 12) {\n // Alert Dialog for access token expired\n CommonFunctions.alertdialog_token(context, \"accesstokenexpired\");\n } else if (network_obj.getInt(\"code\") == 16) {\n // Alert Dialog for refresh token expired\n CommonFunctions.alertdialog_token(context, \"refreshtokenexpired\");\n } else {\n CommonFunctions.displayToast(context, network_obj.getString(\"message\"));\n }\n\n\n } catch (JSONException e) {\n\n }\n\n }\n }\n } else {\n\n CommonFunctions.displayToast(context,context.getResources().getString(R.string.PublicProfile_failed));\n }\n\n\n }\n }) {\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n Map<String, String> params = new HashMap<>();\n params.put(\"Content-Type\", \"application/json\");\n params.put(\"version\", Constcore.version);\n params.put(\"devicetype\", \"android\");\n params.put(\"timezone:IST\", CommonFunctions.getTimeZoneIST());\n params.put(\"Authorization\",\"Bearer \"+bearertoken);\n params.put(\"timesstamp\",CommonFunctions.getTimeStamp());\n params.put(\"os_version\",m_config.os_version);\n Log.e(\"accestoken\",\" \"+bearertoken);\n return params;\n }\n };\n\n // add it to the RequestQueue\n int socketTimeout = 10000;//60 seconds\n RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);\n profilerequest.setRetryPolicy(policy);\n\n\n // Adding request to request queue\n ViintroApplication.getInstance().addToRequestQueue(profilerequest, \"public_profile_api\");\n\n\n\n }", "private void callWebServiceForSocialLogin(String fb_id, String name, String email)\n {\n final SpotsDialog spotsDialog = new SpotsDialog(this, R.style.Custom);\n spotsDialog.setCancelable(false);\n spotsDialog.show();\n JsonObject jsonObject = new JsonObject();\n jsonObject.addProperty(Keys.FULLNAME, name);\n if (from.equals(Keys.FROM_FIND_JOB))\n jsonObject.addProperty(Keys.USER_TYPE, Keys.SEEKER);\n else\n jsonObject.addProperty(Keys.USER_TYPE, Keys.EMPLOYER);\n jsonObject.addProperty(Keys.EMAIL, email);\n jsonObject.addProperty(Keys.FB_ID, fb_id);\n jsonObject.addProperty(Keys.DEVICE_ID, new MyFcmTokenModel(this).getToken());\n retrofit.Call<GetSocialLoginResponse> call = AppRetrofit.\n getAppRetrofitInstance().getApiServices().\n getSocialLoginResponse(jsonObject);\n ServiceCreator.enqueueCall(call, new retrofit.Callback<GetSocialLoginResponse>() {\n @Override\n public void onResponse(retrofit.Response<GetSocialLoginResponse> response, retrofit.Retrofit retrofit) {\n spotsDialog.dismiss();\n GetSocialLoginResponse getSocialLoginResponse = response.body();\n\n if (getSocialLoginResponse.isSuccess())\n {\n\n\n if(getSocialLoginResponse.getRegister().\n equalsIgnoreCase(\"0\")||\n getSocialLoginResponse.getRegister().\n equalsIgnoreCase(\"1\"))\n {\n\n Intent intents = new Intent(LoginSignupOptionActivity.this,\n LoginFacebookSignUpSeekerActivity.class);\n intents.putExtra(Keys.TYPE, getSocialLoginResponse);\n intents.putExtra(Keys.FROM, from);\n intents.putExtra(Keys.NAME, name);\n intents.putExtra(Keys.FB_ID, fb_id);\n startActivity(intents);\n return;\n }\n if (from.equals(Keys.FROM_FIND_JOB))\n {\n addUserOnFireBase(getSocialLoginResponse, \"seeker\");\n addUserOnFireBaseOnRegistrations(getSocialLoginResponse,\"seeker\");\n }\n else {\n addUserOnFireBase(getSocialLoginResponse, \"recruiter\");\n addUserOnFireBaseOnRegistrations(getSocialLoginResponse,\"recruiter\");\n\n }\n CommonUtils.showToast(LoginSignupOptionActivity.this, getSocialLoginResponse.getMsg());\n Singleton.getUserInfoInstance().setFirst_name(getSocialLoginResponse.getData().get(0).getFull_name());\n // Singleton.getUserInfoInstance().setLast_name(getSocialLoginResponse.getData().get(0).getLast_name());\n //Singleton.getUserInfoInstance().setUsername(getSocialLoginResponse.getData().get(0).getUsername());\n Singleton.getUserInfoInstance().setEmail(getSocialLoginResponse.getData().get(0).getEmail());\n Singleton.getUserInfoInstance().setUser_id(getSocialLoginResponse.getData().get(0).getUser_id());\n Singleton.getUserInfoInstance().setAuthKey(getSocialLoginResponse.getData().get(0).getAuthKey());\n Singleton.getUserInfoInstance().setEmail_notification(getSocialLoginResponse.getData().get(0).getEmail_notification());\n Singleton.getUserInfoInstance().setMobile_notification(getSocialLoginResponse.getData().get(0).getMobile_notification());\n Singleton.getUserInfoInstance().setPassword(getSocialLoginResponse.getData().get(0).getChat_password());\n Singleton.getUserInfoInstance().setMobile_number(getSocialLoginResponse.getData().get(0).getMobile_number());\n Singleton.getUserInfoInstance().setEnterprise_name(getSocialLoginResponse.getData().get(0).getEnterprise_name());\n Singleton.getUserInfoInstance().setChatId(Keys.BONJOB_ + getSocialLoginResponse.getData().get(0).getUser_id());\nif(getSocialLoginResponse.getPrevLogined().equalsIgnoreCase(\"1\"))\n{\n if (from.equals(Keys.FROM_FIND_JOB))\n Singleton.getUserInfoInstance().setFirstTimeHomePopUpsSeeker(false);\n else\n Singleton.getUserInfoInstance().setFirstTimeHomePopUpRecruiter(false);\n}else {\n if (from.equals(Keys.FROM_FIND_JOB))\n Singleton.getUserInfoInstance().setFirstTimeHomePopUpsSeeker(true);\n\n else\n Singleton.getUserInfoInstance().setFirstTimeHomePopUpRecruiter(true);\n}\n\n if (from.equals(Keys.FROM_FIND_JOB)) {\n Singleton.getUserInfoInstance().setLogin(true);\n Singleton.getUserInfoInstance().setLoginRecriter(false);\n Intent intent = new Intent(LoginSignupOptionActivity.this, HomeSeekerActivity.class);\n intent.putExtra(Keys.FROM, \"\");\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);\n } else {\n Singleton.getUserInfoInstance().setLoginRecriter(true);\n /*if (getSocialLoginResponse.getData().get(0).getMobile_number().equals(\"\")) {\n Singleton.getUserInfoInstance().setLogin(false);\n *//* Intent intent = new Intent(LoginSignupOptionActivity.this, VerifyPhoneNumberActivity.class);\n startActivity(intent);*//*\n } else {*/\n Singleton.getUserInfoInstance().setLogin(true);\n Intent intent = new Intent(LoginSignupOptionActivity.this,\n HomeRecruiterActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n intent.putExtra(Keys.FROM, \"\");\n startActivity(intent);\n // }\n overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);\n }\n\n } else {\n CommonUtils.showSimpleMessageBottom(LoginSignupOptionActivity.this, getSocialLoginResponse.getMsg());\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n spotsDialog.dismiss();\n CommonUtils.showSimpleMessageBottom(LoginSignupOptionActivity.this, t.getMessage());\n }\n });\n }", "private void sendUserAuthorization(String authUrl, String clientID, String redirectUrl, String scopes){\n\t\ttry {\n\t\t\tthis.user.sendGlobal(\"JWWFOauth-go\", \"{\\\"url\\\":\"+Json.escapeString(authUrl + \"?client_id=\" + clientID + \n\t\t\t\t\t\"&redirect_uri=\" + URLEncoder.encode(redirectUrl, \"UTF-8\") + \"&scope=\" + URLEncoder.encode(scopes, \"UTF-8\"))+\"}\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void sendHttp() {\n String url = \"https://openwhisk.ng.bluemix.net/api/v1/namespaces/1tamir198_tamirSpace/actions/testing_trigger\";\n //api key that i got from blumix EndPoins\n String apiKey = \"530f095a-675e-4e1c-afe0-4b421201e894:0HriiSRoYWohJ4LGOjc5sGAhHvAka1gwASMlhRN8kA5eHgNu8ouogt8BbmXtX21N\";\n try {\n //JSONObject jsonObject = new JSONObject().put(\"openwhisk.ng.bluemix.net\" ,\"c1165fd1-f4cf-4a62-8c64-67bf20733413:hdVl64YRzbHBK0n2SkBB928cy2DUO5XB3yDbuXhQ1uHq8Ir0dOEwT0L0bqMeWTTX\");\n String res = (new HttpRequest(url)).prepare(HttpRequest.Method.POST).withData(apiKey).sendAndReadString();\n //String res = new HttpRequest(url).prepare(HttpRequest.Method.POST).withData(jsonObject.toString()).sendAndReadString();\n System.out.println( res + \"***********\");\n\n } catch ( IOException exception) {\n exception.printStackTrace();\n System.out.println(exception + \" some some some\");\n System.out.println(\"catched error from response ***********\");\n }\n }", "public interface IWeChatSignInCallback {\n\n void onSignInSuccess(String userInfo);\n\n}", "private void requestToken(){\n APIAuth auth = new APIAuth(this.prefs.getString(\"email\", \"\"), this.prefs.getString(\"password\", \"\"), this.prefs.getString(\"fname\", \"\") + \" \" +this.prefs.getString(\"lname\", \"\"), this.prefs, null);\n auth.authenticate();\n }", "@FormUrlEncoded\n @POST(\"oauth/request_token\")\n Flowable<ResponseBody> requestToken(@Field(\"oauth_callback\") String oauthCallback);", "public java.lang.String getOauth_token(){\r\n return localOauth_token;\r\n }", "public void beforeSendingeGainChatRequest();", "public void customLoginTwitter() {\n //check if user is already authenticated or not\n if (getTwitterSession() == null) {\n\n //if user is not authenticated start authenticating\n client.authorize(this, new Callback<TwitterSession>() {\n @Override\n public void success(Result<TwitterSession> result) {\n\n // Do something with result, which provides a TwitterSession for making API calls\n TwitterSession twitterSession = result.data;\n fetchTwitterEmail(twitterSession);\n }\n\n @Override\n public void failure(TwitterException e) {\n // Do something on failure\n Toast.makeText(SignInActivity.this, \"Failed to authenticate. Please try again.\", Toast.LENGTH_SHORT).show();\n }\n });\n } else {\n //if user is already authenticated direct call fetch twitter email api\n Toast.makeText(this, \"User already authenticated\", Toast.LENGTH_SHORT).show();\n// fetchTwitterEmail(getTwitterSession());\n }\n }", "private void logIn(LogSignTemplate credentials){\n Call<LogSignTemplate> callNewTrack = nightAPI.authorize(credentials);\n callNewTrack.enqueue(new Callback<LogSignTemplate>() {\n @Override\n public void onResponse(Call<LogSignTemplate> call, Response<LogSignTemplate> response) {\n if(response.isSuccessful()){\n Log.d(\"QuestionsCallback\", \"//////////////////////////////////// SUCCESFUL LOGIN !!!!!!!!!!!!!!! /////////////////////////////////////\");\n Toasty.success(getContext(), \"Succes, welcome.\", Toast.LENGTH_SHORT, true).show();\n Intent intent = new Intent(getContext(), MenuActivity.class);\n startActivity(intent);\n }\n else{\n Log.d(\"QuestionsCallback\", \"//////////////////////////////////// NO SUCCESFUL RESPONSE /////////////////////////////////////\");\n Toasty.error(getContext(), \"Incorrect username or password.\", Toast.LENGTH_SHORT, true).show();\n }\n }\n\n @Override\n public void onFailure(Call<LogSignTemplate> call, Throwable t) {\n Log.d(\"QuestionsCallback\", \"//////////////////////////////////////// ERROR /////////////////////////////////\");\n Toasty.error(getContext(), \"Error while validating..\", Toast.LENGTH_SHORT, true).show();\n t.printStackTrace();\n }\n });\n }", "void sendChat(SendChatParam param);", "private void makeMeRequest(final Session session) {\n Request request = Request.newMeRequest(session, \n new Request.GraphUserCallback() {\n @Override\n public void onCompleted(GraphUser user, Response response) {\n // If the response is successful\n if (session == Session.getActiveSession()) {\n if (user != null) {\n mUser.setFacebookID(user.getId());\n mUser.setFacebookName(user.getName());\n mWelcome.setText(\"Hello \" + mUser.getFacebookName());\n \n mServerConnection.registerGCMId();\n }\n }\n if (response.getError() != null) {\n // Handle errors, will do so later.\n }\n }\n });\n request.executeAsync();\n }", "void login(){\n emailVal=email.getText().toString();\n passVal=password.getText().toString();\n JSONObject obj=null;\n try{\n obj=new JSONObject();\n obj.put(\"action\", \"requestSignin\");\n obj.put(\"email\", emailVal);\n obj.put(\"password\", passVal);\n\n }\n catch (JSONException e)\n {\n e.printStackTrace();\n Log.d(\"ReplyInfo\",\"catch\", e);\n }\n\n webSocket.send(obj.toString());\n }", "public void sendUserProfile(int retailerID, String proprietor, String shopName, String mobileNo\n , double longitude, double latitude\n , String cityName, String stateName, String countryName) {\n\n headers = new HashMap<>();\n headers.put(\"Content-Type\", \"application/json\");\n headers.put(\"retailerId\",String.valueOf(retailerID));\n headers.put(\"enterpriseName\", shopName);\n headers.put(\"propritor\", proprietor);\n headers.put(\"contactNo\", mobileNo);\n headers.put(\"profilePhoto\", \"\");\n headers.put(\"latLocation\", String.valueOf(latitude));\n headers.put(\"longLocation\", String.valueOf(longitude));\n headers.put(\"address\", \"\");\n headers.put(\"city\", cityName);\n headers.put(\"state\", stateName);\n headers.put(\"country\", countryName);\n headers.put(\"membership\", \"0\");\n headers.put(\"subDate\", \"2010-01-01\");\n headers.put(\"openCloseIsManual\", \"0\");\n headers.put(\"shopOpenTime\", \"00:00:00\");\n headers.put(\"shopCloseTime\", \"00:00:00\");\n headers.put(\"shopOpenTime2\", \"00:00:00\");\n headers.put(\"shopCloseTime2\", \"00:00:00\");\n headers.put(\"shopPhoto\", \"\");\n headers.put(\"shopActLicense\", \"\");\n headers.put(\"currentState\", \"0\");\n\n try {\n jsonObject = new JSONObject();\n jsonObject.put(\"enterpriseName\", shopName);\n jsonObject.put(\"propritor\", proprietor);\n jsonObject.put(\"retailerId\",retailerID);\n jsonObject.put(\"contactNo\", mobileNo);\n jsonObject.put(\"profilePhoto\", \"\");\n jsonObject.put(\"latLocation\", String.valueOf(latitude));\n jsonObject.put(\"longLocation\", String.valueOf(longitude));\n jsonObject.put(\"address\", \"\");\n jsonObject.put(\"city\", cityName);\n jsonObject.put(\"state\", stateName);\n jsonObject.put(\"country\", countryName);\n jsonObject.put(\"membership\", \"0\");\n jsonObject.put(\"subDate\", \"2010-01-01\");\n jsonObject.put(\"openCloseIsManual\", \"0\");\n jsonObject.put(\"shopOpenTime\", \"00:00:00\");\n jsonObject.put(\"shopCloseTime\", \"00:00:00\");\n jsonObject.put(\"shopOpenTime2\", \"00:00:00\");\n jsonObject.put(\"shopCloseTime2\", \"00:00:00\");\n jsonObject.put(\"shopPhoto\", \"\");\n jsonObject.put(\"shopActLicense\", \"\");\n jsonObject.put(\"currentState\", \"0\");\n reqBody = jsonObject.toString();\n databaseURL = \"http://ec2-18-216-46-195.us-east-2.compute.amazonaws.com:6868/update_retailer\";\n sendRequest(databaseURL);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\n public void onObtained(HttpURLConnection connection) {\n\n String clientId = getClientId();\n String clientSecret = getClientSecret();\n\n String header = \"Basic \" + IoUtils.base64(clientId + \":\" + clientSecret, Charsets.ASCII);\n connection.setRequestProperty(OAuthClient.AUTHORIZATION, header);\n }", "@Override\r\n\tpublic void SendInfo(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e(\"SendInfo:\" + _in_data);\r\n\t\ttry {\r\n\t\t\tuserInfo.StringToData(_in_data);\r\n\t\t\t\r\n\t\t\tString extendInfo = new StringBuilder()\r\n\t\t\t.append(\"gameId=\").append(platform.GetData(AttName.APP_ID))\r\n\t\t\t.append(\"&service=\").append(userInfo.GetData(AttName.SERVER_NAME))\r\n\t\t\t.append(\"&role=\").append(userInfo.GetData(AttName.ROLE_ID))\r\n\t\t\t.append(\"&grade=\").append(userInfo.GetData(AttName.ROLE_LEVEL)).toString();\r\n\t\t\tTypeSDKLogger.e(\"extendInfo:\" + extendInfo);\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tTypeSDKLogger.e(\"上传用户信息:\" + e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public void authenticate() {\n JSONObject jsonRequest = new JSONObject();\n try {\n jsonRequest.put(\"action\", \"authenticate\");\n jsonRequest.put(\"label\", \"label\");\n JSONObject dataObject = new JSONObject();\n dataObject.put(\"device_token\", CMAppGlobals.TOKEN);\n jsonRequest.put(\"data\", dataObject);\n\n if(CMAppGlobals.DEBUG) Logger.i(TAG, \":: AuthWsManager.authenticate : jsonRequest : \" + jsonRequest);\n\n // send JSON data\n WSManager.getInstance().con(mContext).sendJSONData(jsonRequest);\n\n\n } catch (JSONException e) {\n\n mContext.onWsFailure(e);\n }\n\n }", "@Override\r\n\tpublic void SendInfo(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e( \"SendInfo:\" + _in_data);\r\n\t\ttry {\r\n\t\t\tuserInfo.StringToData(_in_data);\r\n\t\t\t\r\n\t\t\tString extendInfo = new StringBuilder()\r\n\t\t\t.append(\"gameId=\").append(platform.GetData(AttName.APP_ID))\r\n\t\t\t.append(\"&service=\").append(userInfo.GetData(AttName.SERVER_NAME))\r\n\t\t\t.append(\"&role=\").append(userInfo.GetData(AttName.ROLE_ID))\r\n\t\t\t.append(\"&grade=\").append(userInfo.GetData(AttName.ROLE_LEVEL)).toString();\r\n\t\t\tTypeSDKLogger.e( \"extendInfo:\" + extendInfo);\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tTypeSDKLogger.e( \"上传用户信息:\" + e.getMessage());\r\n\t\t}\r\n\r\n\t}", "private void performOAuthLogin(View arg) {\n hideKeyboard(arg);\n // Pass the username and password to the OAuth login activity for OAuth login.\n // Once the login is successful, we automatically check in the merchant in the OAuth activity.\n Intent intent = new Intent(LoginScreenActivity.this, OAuthLoginActivity.class);\n intent.putExtra(\"username\", mUsername);\n intent.putExtra(\"password\", mPassword);\n String serverName = mServerName;\n if(null != serverName && serverName.equals(PayPalHereSDK.ControlledSandbox)){\n serverName = PayPalHereSDK.Live;\n }\n intent.putExtra(\"servername\",serverName);\n startActivity(intent);\n\n }", "@Override\n public void success(Result<TwitterSession> result) {\n String username=result.data.getUserName();\n\n Toast.makeText(MainActivity.this,\"Hi.. \"+username,Toast.LENGTH_LONG).show();\n\n\n TwitterSession session = TwitterCore.getInstance().getSessionManager()\n .getActiveSession();\n\n Intent intent = new Intent(MainActivity.this,ComposeTweetActivity.class);\n\n startActivity(intent);\n\n /* TwitterSession session = TwitterCore.getInstance().getSessionManager()\n .getActiveSession();\n\n Intent intent = new ComposerActivity.Builder(MainActivity.this)\n .session(session)\n .createIntent();\n startActivity(intent); */\n\n\n\n\n }", "Future<Void> createPubSubUser(OkapiConnectionParams params);", "public void sendAuthMessage(MobileAuthRequest request,MobileAuthResponse response){\n \t\t// check status and limit\r\n \t\t//\r\n \t\tint status = response.getStatus();\r\n \t\tif (status != DeviceStatus.Init.getStatus()\r\n \t\t\t\t&& status != DeviceStatus.Authing.getStatus()) {\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorStatusViolate,\r\n \t\t\t\t\t\"device status isn't init or authing\");\r\n \t\t}\r\n \t\tint retryLimit = (Integer) applicationConfig.get(\"general\").get(\r\n \t\t\t\t\"auth_retry_limit\");\r\n \t\t//\r\n \t\t// check retry count\r\n \t\t//\r\n \t\tdontTryService.doTry(request.getRequestId(), DontTryType.Life,\r\n \t\t\t\tretryLimit);\r\n \t\t//\r\n \t\t// prepare message.\r\n \t\t//\r\n \t\tString phone = encodeUtility.decrypt(request.getMobilePhone(),\r\n \t\t\t\tUser.ENCRYPT_KEY);\r\n\t\tUser user = response.getUser();\r\n \t\tif (user == null) {\r\n \t\t\tthrow new RentException(RentException.RentErrorCode.ErrorGeneral,\r\n \t\t\t\t\t\"user can't be null in mobile auth response\");\r\n \t\t}\r\n \t\tResourceBundle resource = ResourceBundle.getBundle(\"user\",\r\n \t\t\t\tuser.getLocale());\r\n \t\tString message = MessageFormat.format(\r\n \t\t\t\tresource.getString(\"mobile_auth_request_message\"),\r\n \t\t\t\tencodeUtility.decrypt(request.getToken(), Device.ENCRYPT_KEY));\r\n \t\tlogger.debug(\"message is \" + message);\r\n \t\t//\r\n \t\t// send message through gateway.\r\n \t\t//\r\n \t\tmobileGatewayService.sendSMS(phone, message);\r\n \t\tDevice device = response.getDevice();\r\n \t\tif (device != null && device.getStatus() == DeviceStatus.Init.getStatus()) {\r\n \t\t\tdevice.setStatus(DeviceStatus.Authing.getStatus());\r\n \t\t\tdevice.setModified(0);\r\n \t\t\tint ret = this.deviceDao.updateDeviceStatus(device.getId(),\r\n \t\t\t\t\tdevice.getUserId(), DeviceStatus.Authing.getStatus(),\r\n \t\t\t\t\tDeviceStatus.Init.getStatus(), device.getModified());\r\n \t\t\tif (ret != 1) {\r\n \t\t\t\tthrow new RentException(\r\n \t\t\t\t\t\tRentException.RentErrorCode.ErrorGeneral,\r\n \t\t\t\t\t\t\"update device status fail\");\r\n \t\t\t}\r\n \t\t}\r\n \t\tint ret = this.mobileAuthResponseDao.updateResponseStatus(response);\r\n \t\tif (ret != 1) {\r\n \t\t\tthrow new RentException(RentException.RentErrorCode.ErrorGeneral,\r\n \t\t\t\t\t\"update mobile response status fail\");\r\n \t\t}\r\n }", "com.bingo.server.msg.REQ.WeixinLoginRequestOrBuilder getWeixinLoginOrBuilder();", "public void callForProfileData(){\n socket.emit(\"user\");\n }", "private void createRequest() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(default_web_client_id))\n .requestEmail()\n .build();\n\n mGoogleSignInClient = GoogleSignIn.getClient(Signup.this, gso);\n\n\n }", "public static void main(String[] args) {\n\t\tString apiKey = \"100443832\";\n\t\tString apiSecret = \"82be7260c81c68408e71e46d3da7ed75\";\n\t\tOAuthService service = new ServiceBuilder().provider(QQApi.class)\n\t\t\t\t.apiKey(apiKey).apiSecret(apiSecret).callback(\"http://1.ifeeds.duapp.com/oauth/qq/callback\").build();\n\t\tScanner in = new Scanner(System.in);\n\n\t\tSystem.out.println(\"=== \" + NETWORK_NAME + \"'s OAuth Workflow ===\");\n\t\tSystem.out.println();\n\n\t\t// Obtain the Authorization URL\n\t\tSystem.out.println(\"Fetching the Authorization URL...\");\n\t\tString authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN);\n\t\tSystem.out.println(\"Got the Authorization URL!\");\n\t\tSystem.out.println(\"Now go and authorize Scribe here:\");\n\t\tSystem.out.println(authorizationUrl);\n\t\tSystem.out.println(\"And paste the authorization code here\");\n\t\tSystem.out.print(\">>\");\n\t\tVerifier verifier = new Verifier(in.nextLine());\n\t\tSystem.out.println();\n\n\t\t// Trade the Request Token and Verifier for the Access Token\n\t\tSystem.out.println(\"Trading the Request Token for an Access Token...\");\n\t\tToken accessToken = service.getAccessToken(EMPTY_TOKEN, verifier);\n\t\tSystem.out.println(\"Got the Access Token!\");\n\t\tSystem.out.println(\"(if your curious it looks like this: \"\n\t\t\t\t+ accessToken + \" )\");\n\t\tSystem.out.println();\n\n\t\t// Now let's go and ask for a protected resource!\n\t\tSystem.out.println(\"Now we're going to access a protected resource...\");\n\t\tOAuthRequest request = new OAuthRequest(Verb.GET,\n\t\t\t\tPROTECTED_RESOURCE_URL);\n\t\tservice.signRequest(accessToken, request);\n\t\tResponse response = request.send();\n\t\tSystem.out.println(\"Got it! Lets see what we found...\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(response.getCode());\n\t\tSystem.out.println(response.getBody());\n\t\t\n\t\tOAuthRequest request2 = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL_2);\n\t\tservice.signRequest(accessToken, request2);\n\t\trequest2.addQuerystringParameter(\"oauth_consumer_key\", apiKey);\n\t\trequest2.addQuerystringParameter(\"openid\", \"6E2B92E99F8EAF71D016BCA14EB7ED9A\");\n\t\tResponse response2 = request2.send();\n\t\tSystem.out.println(\"Got it! Lets see what we found...\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(response2.getCode());\n\t\tSystem.out.println(response2.getBody());\n\n\t\tSystem.out.println();\n\t\tSystem.out\n\t\t\t\t.println(\"Thats it man! Go and build something awesome with Scribe! :)\");\n\n\t}", "public static void main(String... args) {\n\n OAuthRequest oathReq = new OAuthRequest();\n Gson gson = new Gson();\n String hostname = get(\"ne.url.hostname\");\n String urlOAuth2 = hostname + get(\"ne.url.auth\");\n\n try {\n // 3. Set the generated Client ID, Secret generated in https://developer.equinix.com (Your App).\n // 4. Set the grant type to \"password' or 'client_credentials' if you want API Gateway to generate the Access token.\n oathReq.clientId(get(\"ne.client.access.client.id\"));\n oathReq.clientSecret(get(\"ne.client.access.client.secret\"));\n oathReq.grantType(get(\"ne.client.access.client.granttype\"));\n oathReq.userName(get(\"ne.client.access.client.username\"));\n String password = new String(Base64.getDecoder().decode(get(\"ne.client.access.client.base64.password\")), \"UTF-8\");\n oathReq.userPassword(password);\n\n HttpResponse<String> response = Unirest.post(urlOAuth2)\n .header(\"Content-Type\", get(\"ne.client.http.body.contenttype\"))\n .body(gson.toJson(oathReq)).asString();\n OAuthResponse oauthResponse = gson.fromJson(response.getBody(), OAuthResponse.class);\n\n\n System.out.println(\"OAuth2 Access Token: \" + oauthResponse.getAccessToken());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void makeAuthorizationRequest(OnAuthCompleteListener onAuthCompleteListener);", "public void sendTokenToRemote() { }", "public void sendLogin() {\n WsMessage.LoginMsg_Req loginMsg_req = new WsMessage.LoginMsg_Req();\n loginMsg_req.token = Util.getMConfig(NTVDefine.KEY_MCONF_GAME_TICKET);\n loginMsg_req.userid = Util.getMConfig(NTVDefine.KEY_MCONF_GAME_OPENID);\n loginMsg_req.username = Util.getMConfig(NTVDefine.KEY_MCONF_GAME_USERNAME);\n loginMsg_req.usericon = \"\";\n loginMsg_req.biz = getBizByGameid(Util.getMConfig(NTVDefine.KEY_MCONF_GAME_GAMEID));\n loginMsg_req.env = Util.getString(NTVDefine.KCONF_STRING_CHAT_ENV);\n loginMsg_req.chatid = this.chatid;\n this.wsManager.sendMessage(loginMsg_req.type, loginMsg_req.toString());\n }", "private void sendToAPI(final View v, JSONObject jsonLogin){\n APIClient apiClient = new APIClient();\n Service apiService = apiClient.getClient().create(Service.class);\n Call<User> call = apiService.login(new Login(\"efef\",\"dfwd\"));\n call.enqueue(new Callback<User>() {\n @Override\n public void onResponse(Call<User> call, Response<User> response) {\n if (response.isSuccessful()) {\n new CustomToast().displyToast(getContext(), v, \"Error:\"+response.code()+\" \"+response.body().getMessage()+\n \"Token is: \"+response.body().getAccessToken());\n }\n else{\n new CustomToast().displyToast(getContext(), v, \"Error: \"+response.code()+\" \"+\n response.headers()+ \"...Incorrect username or password!\");\n }\n }\n\n @Override\n public void onFailure(Call<User> call, Throwable t) {\n new CustomToast().displyToast(getContext(), v, \"Server unreachable, Please retry again later\");\n }\n });\n\n }", "@RequestMapping(\"/sendCode\")\n\t@ResponseBody\n\t// check该用户是否关联了小程序\n\tpublic Map<String, String> sendCode(String code, HttpServletRequest request) {\n\t\tMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"appid\", appId);\n\t\tparams.put(\"secret\", secret);\n\t\tparams.put(\"js_code\", code);\n\t\tparams.put(\"grant_type\", \"authorization_code\");\n\n\t\tString jsonResult = WebUrlUtils.getRemoteByUrl(url, params);\n\t\tJSONObject jsonobject = JSONObject.fromObject(jsonResult);\n\t\tWeiXin weiXin = (WeiXin) JSONObject.toBean(jsonobject, WeiXin.class);\n\t\tSystem.out.println(weiXin.getOpenid() + \"|\" + weiXin.getSession_key());\n\n\t\tMap<String, String> map = new HashMap<String, String>();\n\t\tUnitBean unitBean = unitService.findByOpenid(weiXin.getOpenid());\n\t\tif (unitBean != null) {\n\t\t\tString sessionKey = unitBean.getSessionKey();\n\t\t\tmap.put(\"is_login\", \"1\");\n\t\t\tmap.put(\"session_key\", sessionKey);\n\t\t\tUnitBean updateBean = unitService.findById(unitBean.getId());\n\t\t\tupdateBean.setSessionKey(sessionKey);\n\t\t\tunitService.update(updateBean);\n\t\t} else {\n\t\t\tmap.put(\"is_login\", \"2\");\n\t\t}\n\t\treturn map;\n\t}", "private void sendGenericApiRequest(String apiUrl, String apiKey, String username, String url, SuccessCallback callback) {\n try {\n \n //create http client and post data\n final CloseableHttpClient httpclient = HttpClients.createDefault();\n final HttpPost httpPost = new HttpPost(apiUrl);\n final List<NameValuePair> postData = new ArrayList<NameValuePair>();\n postData.add(new BasicNameValuePair(\"api_token\", apiKey));\n if (username != null) {\n postData.add(new BasicNameValuePair(\"username\", username));\n }\n if (url != null) {\n postData.add(new BasicNameValuePair(\"link\", url));\n }\n \n //set the post data\n httpPost.setEntity(new UrlEncodedFormEntity(postData));\n \n //receive the response\n final CloseableHttpResponse response = httpclient.execute(httpPost);\n final InputStream is = response.getEntity().getContent();\n final String json = IOUtils.toString(is, \"UTF-8\");\n EntityUtils.consume(response.getEntity());\n response.close();\n \n //parse the json and call the callback\n final String result = parseJsonResult(json);\n if(result.equalsIgnoreCase(\"ok\")) {\n informCallback(callback, true);\n } else {\n callback.setError(result);\n informCallback(callback, false);\n }\n \n } catch (IOException ex) {\n Logger.getLogger(YoCommunicator.class.getName()).log(Level.SEVERE, null, ex);\n callback.setError(\"IOException\");\n informCallback(callback, false);\n }\n }", "boolean hasWeixinLogin();", "public static void trySendReqOSS()\n {\n Auth auth = new Auth();\n String authorization = generateOSSAuthHeader(auth.getId(), auth.getSecret(), \"GET\", \"/xeduo/index.html\");\n String date = getDateGMT();\n HttpRequest request = HttpUtil.createRequest(Method.GET, \"http://xeduo.oss-cn-hongkong.aliyuncs.com/index.html\");\n request.header(\"Authorization\", authorization);\n request.header(\"Date\",date);\n HttpResponse response = request.execute();\n System.out.println(request);\n System.out.println(response);\n }", "@Override\n\tpublic WechatUserInfo acquireOauthUserInfo(String accessToken, String openId, String lang) \n\t{\n\t\tString url = WeChatConst.WECHATOAUTHURL+WeChatConst.OAUTHUSERINFOURI;\n\t\tMap<String, String> param = new HashMap<String, String>();\n\t\tparam.put(\"access_token\",accessToken);\n\t\tparam.put(\"openid\", openId);\n\t\tparam.put(\"lang\", lang);\n\t\tString response = HttpClientUtils.doGetWithoutHead(url, param);\n\t\tlog.debug(\" acquireWechatUserInfo response :\"+response);\n\t\ttry {\n\t\t\tJSONObject responseJson = JSONObject.parseObject(response);\n\t\t\tWechatUserInfo wechatUserInfo = new WechatUserInfo();\n\t\t\tif(!responseJson.containsKey(\"errcode\"))\n\t\t\t{\n\t\t\t\twechatUserInfo.setOpenId(responseJson.getString(\"openid\"));\n\t\t\t\twechatUserInfo.setNickname(responseJson.getString(\"nickname\"));\n\t\t\t\twechatUserInfo.setSex(responseJson.getString(\"sex\"));\n\t\t\t\twechatUserInfo.setProvince(responseJson.getString(\"province\"));\n\t\t\t\twechatUserInfo.setCity(responseJson.getString(\"city\"));\n\t\t\t\twechatUserInfo.setCountry(responseJson.getString(\"country\"));\n\t\t\t\twechatUserInfo.setHeadimgurl(responseJson.getString(\"headimgurl\"));\n\t\t\t\twechatUserInfo.setPrivilege(responseJson.getString(\"privilege\"));\n\t\t\t\twechatUserInfo.setUnionid(responseJson.getString(\"unionid\"));\n\t\t\t\treturn wechatUserInfo;\n\t\t\t}\n\t\t\treturn null;\n\t\t} catch (Exception e) {\n\t\t\tlog.error(e);\n\t\t}\n\t\treturn null;\n\t}", "public void auth(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"AUTH\";\n\t\tAPI = \"bp10emu\";\n\t\tAMOUNT = params.get(\"amount\");\n\t\tif (params.containsKey(\"transactionID\")) {\n\t\t\tRRNO = params.get(\"transactionID\");\n\t\t}\n\t}", "void setOAuthConsumer(String consumerKey, String consumerSecret);", "public void setOauth_token(java.lang.String param){\r\n \r\n if (param != null){\r\n //update the setting tracker\r\n localOauth_tokenTracker = true;\r\n } else {\r\n localOauth_tokenTracker = false;\r\n \r\n }\r\n \r\n this.localOauth_token=param;\r\n \r\n\r\n }", "public void sendTokenEmailToUser(Long userid, String email, String token, Tokentype type) throws MessagingException;", "Boolean sendFollowRequest(User user);", "private void createRequest() {\n GoogleSignInOptions gso = new GoogleSignInOptions\n .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n googleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this, this)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n signInButton = (SignInButton) findViewById(R.id.sign_in_button);\n signInButton.setSize(SignInButton.SIZE_WIDE);\n signInButton.setColorScheme(signInButton.COLOR_DARK);\n signInButton.setOnClickListener((v) -> {\n Intent intent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);\n startActivityForResult(intent, SIGN_IN_CODE);\n });\n }", "@Override\r\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\r\n\t\t if (requestCode==1)\t{\r\n\t\t\t\tif (resultCode==OAuthV1AuthorizeWebView.RESULT_CODE)\t{\r\n\t\t\t\t\t//从返回的Intent中获取验证码\r\n\t\t\t\t\ttenoAuth=(OAuthV1) data.getExtras().getSerializable(\"oauth\");\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\ttenoAuth=OAuthV1Client.accessToken(tenoAuth);\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * 注意:此时oauth中的Oauth_token和Oauth_token_secret将发生变化,用新获取到的\r\n\t\t\t\t\t\t * 已授权的access_token和access_token_secret替换之前存储的未授权的request_token\r\n\t\t\t\t\t\t * 和request_token_secret.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\ttencent_token=tenoAuth.getOauthToken();\r\n\t\t\t\t\t\ttencent_access_token_secret=tenoAuth.getOauthTokenSecret();\r\n\t\t\t\t\t\tshellRW.putStringValue(\"tencent_token\", tencent_token);\r\n\t\t\t\t\t\tshellRW.putStringValue(\"tencent_access_token_secret\", tencent_access_token_secret);\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\t\tIntent intent=new Intent(NewNoticeInfoActivity.this, TencentShareActivity.class);\r\n\t\t\t\t\tintent.putExtra(\"tencent\", LotnoDetailView.shareString);\r\n\t\t intent.putExtra(\"oauth\", tenoAuth);\r\n\t\t startActivity(intent);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t}", "public interface WechatService {\n\n /**\n * wechat公众号注册token校验\n * @param signature 微信加密签名\n * @param timestamp 时间戳\n * @param nonce 随机数\n * @param echostr 随机字符串\n *\n * @return echostr\n */\n String getToken(String signature, String timestamp, String nonce, String echostr);\n\n /**\n * 获取 access_token\n * access_token是公众号的全局唯一接口调用凭据,公众号调用各接口时都需使用access_token。\n * access_token的存储至少要保留512个字符空间。access_token的有效期目前为2个小时,需定时刷新,\n * 重复获取将导致上次获取的access_token失效。\n *\n * @return {\"access_token\":\"ACCESS_TOKEN\",\"expires_in\":7200}\n * access_token获取到的凭证 expires_in凭证有效时间,单位:秒\n */\n String getAccessToken();\n\n /**\n * 刷新token\n */\n String refreshToken();\n\n /**\n * 获取微信服务器IP地址\n * 如果公众号基于安全等考虑,需要获知微信服务器的IP地址列表,\n * 以便进行相关限制,可以通过该接口获得微信服务器IP地址列表或者IP网段信息。\n * @return {\"ip_list\": [\"127.0.0.1\",\"127.0.0.2\",\"101.226.103.0/25\"]}\n * ip_list 微信服务器IP地址列表\n */\n String ServerIP();\n\n\n String createMenu();\n\n}", "@Override\n public void run() {\n mTencent.shareToQzone(activity, params, new IUiListener() {\n\n @Override\n public void onCancel() {\n Log.v(\"activity\", \"onCancel: \");\n }\n\n @Override\n public void onError(UiError e) {\n // TODO Auto-generated method stub\n Log.v(\"onError: \" + e.errorMessage, \"e\");\n }\n\n @Override\n public void onComplete(Object response) {\n // TODO Auto-generated method stub\n Log.v(\"onComplete: \", response.toString());\n UMPlatformData platform = new UMPlatformData(UMPlatformData.UMedia.TENCENT_QZONE, AppSharedPref.newInstance(ctx).getUserId());\n MobclickAgent.onSocialEvent(ctx, platform);\n Toast.makeText(ctx,\"分享成功!\",Toast.LENGTH_LONG).show();\n }\n\n });\n }", "@Override\n public Response intercept(Chain chain) throws IOException {\n Request authorisedRequest = chain.request().newBuilder()\n .header(\"Authorization:\", \"Token \" + sharedPrefsWrapper.getString(KEY))\n .build();\n\n\n return chain.proceed(authorisedRequest);\n }", "@Override\n public void onComplete(Object arg0) {\n if(arg0!=null){\n Log.i(\"Tian===>\",arg0.toString());\n org.json.JSONObject jsonObject = (org.json.JSONObject) arg0;\n try {\n String token = jsonObject.getString(com.tencent.connect.common.Constants.PARAM_ACCESS_TOKEN);\n String expires = jsonObject.getString(com.tencent.connect.common.Constants.PARAM_EXPIRES_IN);\n String openId = jsonObject.getString(com.tencent.connect.common.Constants.PARAM_OPEN_ID);\n BmobUser.BmobThirdUserAuth authInfo = new BmobUser.BmobThirdUserAuth(BmobUser.BmobThirdUserAuth.SNS_TYPE_QQ,token, expires,openId);\n loginWithAuth(authInfo);\n } catch (JSONException e) {\n } catch (org.json.JSONException e) {\n e.printStackTrace();\n }\n }\n }", "public interface IWeixinService {\n\n String getRequestURI(HttpServletRequest request);\n\n String getRequestURI(HttpServletRequest request, String requestUri);\n\n /**\n * 获取当前页面的重定向页面链接\n * @param request\n * @param delParams\n * @return\n */\n String getRequestUrl(HttpServletRequest request, String... delParams);\n\n /**\n * 获取指定页面的重定向页面链接\n * @param request\n * @param servletPath\n * @param delParams\n * @return\n */\n String setRequestUrl(HttpServletRequest request, String servletPath, String[] delParams);\n\n boolean isWechatAccess(HttpServletRequest request);\n\n String getMpWxOauth2(String redirect_uri, boolean flag);\n\n WxMpUser getWxMpUser(HttpServletRequest request, HttpServletResponse response);\n\n String getAccessToken() throws Exception;\n\n MpAccessToken getMpAccessToken() throws Exception;\n\n WxJsapiSignature createJsapiSignature(String url) throws WxErrorException;\n\n String[] getCallbackIP() throws WxErrorException;\n\n String refreshToken(String refreshToken) throws WxErrorException;\n\n String getAuthorizationUrl(String type, String state) throws UnsupportedEncodingException;\n\n void putWxMpUserToCache(String sessionId, WxMpUser wxMpUser);\n\n WxMpUser getWxMpUserFromCache(String sessionId);\n\n void putSessionStatusToCache(String sessionId, String status);\n\n String getSessionStatusFromCache(String sessionId);\n\n String getRedirectUrl(HttpServletRequest request, String servletPath);\n\n WxMpUser getWxMpUser(String code, String sessionId);\n}", "public String fbWebSignup(String accessToken, String expires, String msoString, HttpServletRequest req, HttpServletResponse resp) {\r\n log.info(\"msoString:\" + msoString);\r\n FacebookMe me = new FacebookLib().getFbMe(accessToken);\r\n return this.fbSignup(me, expires, msoString, req, resp);\r\n }", "private void makeMeRequest(final Session session) {\n\t\tRequest request = Request.newMeRequest(session, \n\t\t\t\tnew Request.GraphUserCallback() {\n\t\t\t@Override\n\t\t\tpublic void onCompleted(final GraphUser user, Response response) {\n\t\t\t\t// If the response is successful\n\t\t\t\tif (session == Session.getActiveSession()) {\n\t\t\t\t\tif (user != null) {\n\t\t\t\t\t\tToast.makeText(getBaseContext(), \"Hello \"+user.getName()+\"!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t\tParseClass p = new ParseClass(getBaseContext());\n\t\t\t\t\t\tp.Signup(user,user.getProperty(\"email\").toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (response.getError() != null) {\n\n\t\t\t\t\tToast.makeText(getBaseContext(), \"Error with connection\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\n\n\t\t});\n\n\t\tBundle params = request.getParameters();\n\t\tparams.putString(\"fields\", \"email,name\");\n\t\trequest.setParameters(params);\n\t\trequest.executeAsync();\n\t}", "private static HttpResponse sendAuthenticated(HttpUriRequest request) throws Exception {\n if (accessToken == null) {\n throw new Exception(\"GitLab access token not set\");\n }\n request.addHeader(\"PRIVATE-TOKEN\", accessToken);\n return createClient().execute(request);\n }", "private void connectToApp(Business business){\n\n HashMap<String, String> connect = new HashMap<>();\n connect.put(\"email\",business.getEmail()) ;\n connect.put(\"password\",business.getPassword());\n Call<String[]> call = rtfBase.connect(connect); //we get token and id\n call.enqueue(new Callback<String[]>() {\n @Override\n public void onResponse(Call<String[]> call, Response<String[]> response) {\n if(response.code() == 200)\n {\n assert response.body() != null;\n // business.setToken(response.body()[0]);\n // business.setId(response.body()[1]);\n\n TOKEN=response.body()[0];\n ID=response.body()[1];\n Toast.makeText(RegisterNewBusiness.this, \"registered successfully\",Toast.LENGTH_LONG).show();\n\n GetUser();\n\n\n }\n if(response.code() == 400)\n {\n Toast.makeText(RegisterNewBusiness.this, \"fail to connect\",Toast.LENGTH_LONG).show();\n\n }\n if(response.code() == 401)\n {\n Toast.makeText(RegisterNewBusiness.this, \"Email or password invalid\",Toast.LENGTH_LONG).show();\n\n }\n }\n\n @Override\n public void onFailure(Call<String[]> call, Throwable t) {\n Toast.makeText(RegisterNewBusiness.this,t.getMessage(),Toast.LENGTH_LONG).show();\n\n }\n });\n\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public interface Constants {\n public static final String APP_KEY = \"2870170017\";\n public static final String APP_SECRET =\"a1ba9b85a74e3e15b2d6f80106ea42f1\";\n public static final String REDIRECT_URL = \"https://api.weibo.com/oauth2/default.html\";\n public static final String SCOPE =null;\n}", "public void customLoginTwitter(View view) {\n if (getTwitterSession() == null) {\n\n //if user is not authenticated start authenticating\n client.authorize(getActivity(), new Callback<TwitterSession>() {\n @Override\n public void success(Result<TwitterSession> result) {\n // Do something with result, which provides a TwitterSession for making API calls\n TwitterSession twitterSession = result.data;\n fetchTwitterAccount();\n dismiss();\n }\n\n @Override\n public void failure(TwitterException e) {\n // Do something on failure\n Toast.makeText(getActivity().getApplicationContext(), \"Failed to authenticate. Please try again.\", Toast.LENGTH_SHORT).show();\n }\n });\n } else {\n //if user is already authenticated direct call fetch twitter email api\n Toast.makeText(getActivity().getApplicationContext(), \"User already authenticated\", Toast.LENGTH_SHORT).show();\n }\n }", "public void sendYo(final SuccessCallback callback, final String username, final String url) throws NoApiKeyException {\n if (app.getApiKey() == null) {\n throw new NoApiKeyException();\n }\n new Thread(new Runnable() {\n @Override\n public void run() {\n sendGenericApiRequest(\"https://api.justyo.co/yo/\", app.getApiKey(), username, url, callback);\n }\n }).start();\n }", "public void doLoginWithFacebook() {\n System.out.println(\"Fetching the Authorization URL...\");\n String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN);\n System.out.println(\"Got the Authorization URL!\");\n System.out.println(\"Now go and authorize Scribe here:\");\n this.authorizationUrl = authorizationUrl;\n }", "public static void sendToken(SendTokenRequest tokenRequest) {\n APICalls invocations = getRetrofitEngine().create(APICalls.class);\n\n Call<SendTokenDAO> call = invocations.sendFCMToken(tokenRequest);\n call.enqueue(new retrofit2.Callback<SendTokenDAO>() {\n @Override\n public void onResponse(Call<SendTokenDAO> call, Response<SendTokenDAO> response) {\n BankCraftApplication.getInstance().getEventBus().post(new SendTokenResponseEvent(response.body()));\n }\n\n @Override\n public void onFailure(Call<SendTokenDAO> call, Throwable t) {\n BankCraftApplication.getInstance().getEventBus().post(new SendTokenResponseEvent(t.getMessage()));\n }\n });\n }", "@GET(\"users/signin\")\r\n Call<User> signIn(@Header(\"Authorization\") String token);", "public void callSessionConfirmationApi() {\n if (Utils.isNetworkConnected(mContext)) {\n\n Utils.showDialog(mContext);\n ApiHandler.getApiService().get_Session_ContactEnrollment(getSessionConfirmationdetail(), new retrofit.Callback<TeacherInfoModel>() {\n @Override\n public void success(TeacherInfoModel sessionconfirmationInfoModel, Response response) {\n Utils.dismissDialog();\n if (sessionconfirmationInfoModel == null) {\n Utils.ping(mContext, getString(R.string.something_wrong));\n return;\n }\n if (sessionconfirmationInfoModel.getSuccess() == null) {\n Utils.ping(mContext, getString(R.string.something_wrong));\n return;\n }\n if (sessionconfirmationInfoModel.getSuccess().equalsIgnoreCase(\"false\")) {\n Utils.ping(mContext, getString(R.string.false_msg));\n return;\n }\n if (sessionconfirmationInfoModel.getSuccess().equalsIgnoreCase(\"True\")) {\n// Utils.ping(mContext, \"Login succesfully\");\n confimDialog.dismiss();\n Intent isearchBYuser = new Intent(mContext, PaymentSuccessActivity.class);\n isearchBYuser.putExtra(\"transactionId\", orderIDStr);\n isearchBYuser.putExtra(\"responseCode\", \"0\");\n isearchBYuser.putExtra(\"order_id\", orderIDStr);\n startActivity(isearchBYuser);\n\n }\n }\n\n @Override\n public void failure(RetrofitError error) {\n Utils.dismissDialog();\n error.printStackTrace();\n error.getMessage();\n Utils.ping(mContext, getString(R.string.something_wrong));\n }\n });\n } else {\n Utils.ping(mContext, getString(R.string.internet_connection_error));\n }\n }", "public interface getAuth {\n @FormUrlEncoded\n @POST(\"auth/facebook\")\n Call<AuthResponse> facebookUserAuth(\n @Field(\"access_token\") String access_token,\n @Field(\"user_id\") String user_id,\n @Field(\"firebase_token\") String firebase_token\n );\n @FormUrlEncoded\n @POST(\"auth/fbUpdateAcessToken\")\n Call<AuthResponse> facebookTokenUpdate(\n @Field(\"access_token\") String access_token,\n @Field(\"user_id\") String user_id\n );\n\n @FormUrlEncoded\n @POST(\"auth/updateFcmToken\")\n Call<AuthResponse> fcmTokenUpdate(\n @Field(\"token\") String fcmToken,\n @Field(\"user_id\") String userId\n );\n\n @FormUrlEncoded\n @POST(\"auth/updateTopics\")\n Call<AuthResponse> updateUserTopics(\n @Field(\"user_topics\") String user_topics,\n @Field(\"user_id\") String user_id\n );\n\n @FormUrlEncoded\n @POST(\"auth/updateNotification\")\n Call<AuthResponse> updateNotification(\n @Field(\"user_id\") String user_id,\n @Field(\"notification\") Boolean notification\n );\n\n @FormUrlEncoded\n @POST(\"auth/saveFcm\")\n Call<FcmKey> saveFcm(\n @Field(\"fcmToken\") String fcmToken\n );\n\n}", "@Test\n public void testTokenEndPointAnonymousTokenRequestWithInvalidScope() throws Exception {\n String callback = \"Backplane.callback\";\n \n refreshRequestAndResponse();\n \n request.setRequestURI(\"/v2/token\");\n request.setMethod(\"GET\");\n request.setParameter(\"grant_type\", \"client_credentials\");\n setOAuthBasicAuthentication(request, \"anonymous\", \"\");\n request.setParameter(\"scope\",\"channel:notmychannel\");\n request.setParameter(\"callback\", callback);\n \n handlerAdapter.handle(request, response, controller);\n logger.info(\"testTokenEndPointAnonymousTokenRequestWithInvalidScope() => \" + response.getContentAsString());\n assertTrue(response.getContentAsString().contains(ERR_RESPONSE));\n \n refreshRequestAndResponse();\n \n request.setRequestURI(\"/v2/token\");\n request.setMethod(\"GET\");\n request.setParameter(\"grant_type\", \"client_credentials\");\n setOAuthBasicAuthentication(request, \"anonymous\", \"\");\n request.setParameter(\"scope\",\"bus:notmybus\");\n request.setParameter(\"callback\", callback);\n \n handlerAdapter.handle(request, response, controller);\n logger.info(\"testTokenEndPointAnonymousTokenRequestWithInvalidScope() => \" + response.getContentAsString());\n assertTrue(response.getContentAsString().contains(ERR_RESPONSE));\n }", "private void signInRequest() throws Exception {\n if (progressDialog != null) {\n progressDialog.setIndeterminate(true);\n progressDialog.setMessage(\"Authenticating...\");\n progressDialog.show();\n }\n String url = Constants.BASE_LOCAL__URL + \"signin/A\";\n JSONObject paramsJsonObj = new JSONObject();\n try {\n String android_id = Settings.Secure.getString(getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);\n Log.d(\"androidid\",android_id );\n paramsJsonObj.put(\"loginId\", _emailText.getText().toString());\n\n paramsJsonObj.put(\"password\", _passwordText.getText().toString());\n\n paramsJsonObj.put(\"androidId\", android_id);\n\n } catch (JSONException e) {\n e.printStackTrace();\n\n }\n Log.d(\"URL :- \", url);\n Log.d(\"paramsJsonObj :- \", paramsJsonObj.toString());\n JsonObjectRequest jsonObjRequest = new JsonObjectRequest(Request.Method.POST, url, paramsJsonObj, this.createRequestSuccessListener(), this.createRequestErrorListener(System.currentTimeMillis()));\n jsonObjRequest.setRetryPolicy(new DefaultRetryPolicy(Constants.TIMEOUT_TIME,\n DefaultRetryPolicy.DEFAULT_MAX_RETRIES,\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\n Log.d(\"No resul :- \", paramsJsonObj.toString());\n Volley.newRequestQueue(this).add(jsonObjRequest);\n // Adding request to request queue\n\n // Cancelling request\n// AppController.getInstance().getRequestQueue().cancelAll(TAG);\n }", "@Override\n public ResponseSignIn signInProducer(@RequestParam(\"username\") String username){\n ResponseSignIn responseSignIn = new ResponseSignIn(\"testUserName\",\"testName\",\"testSurname\",\"test@gmail.com\",25L,\"testVariety\",\"https://en.wikipedia.org/wiki/Main_Page\");\n return responseSignIn;\n }", "private void doSignup(RoutingContext ctx){\n // Get Data from view\n JsonObject req = ctx.getBodyAsJson();\n String username = req.getString(\"username\");\n String password = req.getString(\"password\");\n\n GoogleAuthenticator authenticator = new GoogleAuthenticator();\n\n //Get Generate Key\n System.out.println(\" Calling Google Authenticator to generate AuthKey\");\n GoogleAuthenticatorKey authKey = authenticator.createCredentials();\n String key = authKey.getKey();\n System.out.println(\" Google Authenticator generated AuthKey\");\n\n //Store Data from Repository\n User user = new User(username,password,key);\n\n //send response to the user\n JsonObject res = new JsonObject().put(\"key\",key);\n ctx.response().setStatusCode(200).end(res.encode());\n }", "@Override\n protected String doInBackground(String... params) {\n\n try {\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());\n String username = prefs.getString(\"username\", \"\");\n String password = prefs.getString(\"username\", \"\");\n\n if (TextUtils.isEmpty(username) || TextUtils.isEmpty(password)){\n getActivity().startActivity(new Intent(getActivity(), StatusActivity.class ));\n return \"please update you username and password\";\n }\n\n YambaClient yambaCloud = new YambaClient(username, password);\n yambaCloud.postStatus(params[0]);\n\n return \"status posted\";\n\n } catch (Exception e) {\n e.printStackTrace();\n return \"failed to post status to Yamba services\";\n }\n\n }", "public void doSendMsg() {\n FacesContext fctx = FacesContext.getCurrentInstance();\n HttpSession sess = (HttpSession) fctx.getExternalContext().getSession(false);\n SEHRMessagingListener chatHdl = (SEHRMessagingListener) sess.getAttribute(\"ChatHandler\");\n if (chatHdl.isSession()) {\n //TODO implement chat via sehr.xnet.DOMAIN.chat to all...\n if (room.equalsIgnoreCase(\"public\")) {\n //send public inside zone\n chatHdl.sendMsg(this.text, SEHRMessagingListener.PUBLIC, moduleCtrl.getLocalZoneID(), -1, -1);\n } else {\n chatHdl.sendMsg(this.text, SEHRMessagingListener.PRIVATE_USER, moduleCtrl.getLocalZoneID(), -1, curUserToChat.getUsrid());\n }\n this.text = \"\";\n }\n //return \"pm:vwChatRoom\";\n }", "public void signUpNew(String mail,String password){\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n String dateTime = simpleDateFormat.format(Calendar.getInstance().getTime());\n\n //device ID\n String deviceId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);\n\n headers = new HashMap<>();\n headers.put(\"mail\",mail);\n headers.put(\"password\",password);\n headers.put(\"subscriptionDateTime\",dateTime);\n headers.put(\"deviceId\",deviceId);\n\n String url = serverUrl + \"/sign_up\";\n sendRequestNew(url,headers);\n }", "@Override\n protected Boolean doInBackground(Void... params) {\n String url = getResources().getString(R.string.base_url) + \"/users\";\n mContext = getApplicationContext();\n\n StringRequest postRequest = new StringRequest(Request.Method.PUT, url,\n new Response.Listener<String>()\n {\n @Override\n public void onResponse(String response) {\n // response\n try {\n JSONObject JSONResponse = new JSONObject(response);\n if (JSONResponse.getBoolean(\"success\")) {\n Toast.makeText(getApplicationContext(), \"Success\", Toast.LENGTH_SHORT).show();\n SettingsActivity.this.finish();\n } else {\n Toast.makeText(getApplicationContext(), \"Error\", Toast.LENGTH_SHORT).show();\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n },\n new Response.ErrorListener()\n {\n @Override\n public void onErrorResponse(VolleyError error) {\n // error\n //Log.d(\"Error.Response\", error.toString());\n }\n }\n ) {\n @Override\n protected Map<String, String> getParams()\n {\n Map<String, String> params = new HashMap<>();\n params.put(\"bio\", mBio);\n if(!mPassword.equals(\"\")) {\n params.put(\"password\", mPassword);\n }\n return params;\n }\n\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n SharedPreferences sharedPref = getSharedPreferences(getString(R.string.user_token), Context.MODE_PRIVATE);\n\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"Authorization\", \"Bearer \" + sharedPref.getString(\"token\", \"\"));\n\n return params;\n }\n };\n volleySingleton.getInstance(mContext).getRequestQueue().add(postRequest);\n return true;\n }", "public void getRequest_withBasicAuth() {\n apiUtil = new APIUtil();\n // As this is an API call , we are not setting up any base url but defining the individual calls\n apiUtil.setBaseURI(configurationReader.get(\"BaseURL\"));\n //This is used to validate the get call protected with basic authentication mechanism\n basicAuthValidation();\n }", "private void weChatPay(WeChatPayBean.BodyBean body) {\n IWXAPI api = WXAPIFactory.createWXAPI(this, \"wxb4ba3c02aa476ea1\");\n if (body != null && body.getAppid() != null) {\n PayReq req = new PayReq();\n //req.appId = \"wxf8b4f85f3a794e77\"; // 测试用appId\n req.appId = body.getAppid();\n req.partnerId = body.getPartnerid();\n req.prepayId = body.getPrepayid();\n req.nonceStr = body.getNoncestr();\n req.timeStamp = body.getTimestamp();\n req.packageValue = body.getPackageX();\n req.sign = body.getSign();\n // 在支付之前,如果应用没有注册到微信,应该先调用IWXMsg.registerApp将应用注册到微信\n api.sendReq(req);\n }\n\n\n }", "private void creatRequest() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id)) //R.string.default_web_client_id需要將系統執行一次,讓他產生\n .requestEmail()\n .build();\n\n mGoogleSignInClient = GoogleSignIn.getClient(this,gso);\n }", "@Override\n protected Void doInBackground(Void... _) {\n Bundle appActivities = new Bundle();\n String scopes = \"oauth2:email profile\";\n Context cxt = DSUAccountAuthActivity.this;\n try {\n String accountName = Plus.AccountApi.getAccountName(mGoogleApiClient);\n String googleAccessToken = GoogleAuthUtil.getToken(\n DSUAccountAuthActivity.this, // Context context\n accountName, // String accountName\n scopes, // String scope\n appActivities // Bundle bundle\n );\n Bundle options = DSUAccountAuthActivity.this.getIntent().getBundleExtra(\"options\");\n DSUClient client = DSUClient.getDSUClientFromOptions(options, DSUAccountAuthActivity.this);\n\n Response response = client.signin(googleAccessToken);\n // clear token and default account from cache immediately to avoid stable state in the future\n GoogleAuthUtil.clearToken(DSUAccountAuthActivity.this, googleAccessToken);\n Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);\n\n String responseBody = \"\";\n if (response != null && response.isSuccessful()) {\n try {\n responseBody = response.body().string();\n // use the google access token to sign in the dsu\n JSONObject token = new JSONObject(responseBody);\n final String accessToken = token.getString(DSUAuth.ACCESS_TOKEN_TYPE);\n final String refreshToken = token.getString(DSUAuth.REFRESH_TOKEN_TYPE);\n // Get an instance of the Android account manager\n AccountManager accountManager = (AccountManager) getSystemService(ACCOUNT_SERVICE);\n final Account account = DSUAuth.getDefaultAccount(cxt);\n // set options bundle as the userdata\n accountManager.addAccountExplicitly(account, null, options);\n\n // make the account syncable and automatically synced\n // TODO JARED: this is only used to access the SyncAdapter. Do we want to make it generic?\n // TODO ANDY: I make authorities to be string value in the xml configuration\n String providerAuthorities = DSUAuth.getDSUProviderAuthorities(cxt);\n ContentResolver.setIsSyncable(account, providerAuthorities, 1);\n ContentResolver.setSyncAutomatically(account, providerAuthorities, true);\n ContentResolver.setMasterSyncAutomatically(true);\n\n accountManager.setAuthToken(account, DSUAuth.ACCESS_TOKEN_TYPE, accessToken);\n accountManager.setAuthToken(account, DSUAuth.REFRESH_TOKEN_TYPE, refreshToken);\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Intent i = new Intent();\n i.putExtra(AccountManager.KEY_ACCOUNT_NAME, account.name);\n i.putExtra(AccountManager.KEY_ACCOUNT_TYPE, account.type);\n DSUAccountAuthActivity.this.setAccountAuthenticatorResult(i.getExtras());\n setResult(RESULT_OK);\n finish();\n }\n });\n } catch (JSONException e) {\n Log.e(TAG, \"Fail to parse response from google-sign-in endpoint:\" + responseBody, e);\n onDsuAuthFailed(INVALID_ACCESS_TOKEN);\n }\n } else {\n Log.e(TAG, \"Failed to sign in: \" + responseBody);\n onDsuAuthFailed(FAILED_TO_SIGN_IN);\n }\n\n // ** Step 3. Check Returned Access Tokens **\n\n } catch (UserRecoverableAuthException e) {\n // Requesting an authorization code will always throw\n // UserRecoverableAuthException on the first call to GoogleAuthUtil.getToken\n // because the user must consent to offline access to their data. After\n // consent is granted control is returned to your activity in onActivityResult\n // and the second call to GoogleAuthUtil.getToken will succeed.\n DSUAccountAuthActivity.this.startActivityForResult(e.getIntent(), AUTH_CODE_REQUEST_CODE);\n\n } catch (Exception e) {\n Log.e(TAG, \"Failed to sign in\", e);\n onDsuAuthFailed(FAILED_TO_SIGN_IN);\n }\n return null;\n }", "public void authorize(Context context, final VoidOperationCallback callback) {\n InstagramDialog.OAuthDialogListener listener = new InstagramDialog.OAuthDialogListener() {\n @Override\n public void onComplete(String code) {\n getAccessToken(code, new OperationCallback<User>() {\n @Override\n protected void onCompleted(User result) {\n // Store access token and user data\n mSession.storeAccessToken(result.getAccessToken(), result.getId(), result.getUsername(),\n result.getFullName());\n \n // Notify caller application\n callback.notifyCompleted();\n }\n \n @Override\n protected void onError(Exception error) {\n callback.notifyError(error);\n }\n });\n }\n \n @Override\n public void onError(String error) {\n callback.notifyError(new Exception(error));\n }\n };\n \n InstagramDialog dialog = new InstagramDialog(context, mAuthUrl, listener);\n dialog.show();\n }", "@Override\r\n\tpublic void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\r\n\t\tOAuthConsumer consumer = null;\r\n\t\t//log.info(\" MineTwitterConsumer START\");\r\n\t\tthis.setRedirectUrl(request.getParameter(JpSocialSystemConstants.TW_REDIRECT_URL));\r\n\t\tConfigInterface configInterface = (ConfigInterface) ApsWebApplicationUtils.getBean(\"BaseConfigManager\", request);\r\n\t\tString devMode = configInterface.getParam(JpSocialSystemConstants.DEV_MODE_PARAM_NAME);\r\n\t\tString loginrequest = request.getParameter(\"loginrequest\");\r\n\t\tif (\"true\".equalsIgnoreCase(devMode)) {\r\n\t\t\t_logger.info(\" DEV MODE :: {} - auth url {}\", devMode, this.getDevLoginUrl());\r\n\t\t\tthis.setRedirectUrl(this.getDevLoginUrl());\r\n\t\t\tif (this.getDomain().equals(loginrequest)) {\r\n\t\t\t\tUserDetails userDetails = this.getFakeUser();\r\n\t\t\t\trequest.getSession().setAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER, userDetails);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tITwitterCookieConsumer twitterConsumerManager =\r\n\t\t\t\t\t(ITwitterCookieConsumer) ApsWebApplicationUtils.getBean(JpSocialSystemConstants.TWITTER_CONSUMER_MANAGER, request);\r\n\t\t\ttry {\r\n\t\t\t\tconsumer = twitterConsumerManager.getTwitterConsumer(request);\r\n\t\t\t\tOAuthAccessor accessor = twitterConsumerManager.getAccessor(request, response, consumer);\r\n\t\t\t\tOAuthClient client = new OAuthClient(new TwitterHttpClient());\r\n\t\t\t\tOAuthResponseMessage result = client.access(accessor.newRequestMessage(OAuthMessage.GET,\r\n\t\t\t\t\t\t\"https://api.twitter.com/1.1/account/verify_credentials.json\", null), ParameterStyle.AUTHORIZATION_HEADER);\r\n\t\t\t\tint status = result.getHttpResponse().getStatusCode();\r\n\t\t\t\tif (status != HttpResponseMessage.STATUS_OK) {\r\n\t\t\t\t\tOAuthProblemException problem = result.toOAuthProblemException();\r\n\t\t\t\t\tif (problem.getProblem() != null) {\r\n\t\t\t\t\t\tthrow problem;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tMap<String, Object> dump = problem.getParameters();\r\n\t\t\t\t\tresponse.setContentType(\"text/plain\");\r\n\t\t\t\t\tPrintWriter out = response.getWriter();\r\n\t\t\t\t\tout.println(dump.get(HttpMessage.REQUEST));\r\n\t\t\t\t\tout.println(\"----------------------\");\r\n\t\t\t\t\tout.println(dump.get(HttpMessage.RESPONSE));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Simply pass the data through to the browser:\r\n\t\t\t\t\tString json = twitterConsumerManager.copyResponse(result);\r\n//\t\t\t\tSystem.out.println(\"****************************************\");\r\n//\t\t\t\tSystem.out.println(json);\r\n//\t\t\t\tSystem.out.println(\"****************************************\");\r\n\t\t\t\t\tJSONObject jsonObject = new JSONObject(json);\r\n\t\t\t\t\tString id = jsonObject.getString(\"id\");\r\n\t\t\t\t\t//String id_str = jsonObject.getString(\"id_str\");\t\t\t\t\r\n\t\t\t\t\tString name = jsonObject.getString(\"name\");\r\n\t\t\t\t\t//log.info(\" id \" + jsonObject.getString(\"id\"));\r\n\t\t\t\t\t//log.info(\" id_str \" + jsonObject.getString(\"id_str\"));\r\n// log.info(\" name \" + jsonObject.getString(\"name\"));\r\n\t\t\t\t\tITwitterManager twitterManager = (ITwitterManager) ApsWebApplicationUtils.getBean(JpSocialSystemConstants.TWITTER_CLIENT_MANAGER, request);\r\n\t\t\t\t\tTwitterCredentials credentials = (TwitterCredentials) twitterManager.createSocialCredentials(accessor.accessToken, accessor.tokenSecret);\r\n//\t\t\t\t\t((HttpServletRequest) request).getSession().setAttribute(JpSocialSystemConstants.SESSION_PARAM_TWITTER, credentials);\r\n\t\t\t\t\tString currentAction = getAndRemoveNoLoginAction(request);\r\n\t\t\t\t\tURI uri = new URI(this.getRedirectUrl());\r\n\t\t\t\t\tList<NameValuePair> urlMap = URLEncodedUtils.parse(uri, \"UTF-8\");\r\n\t\t\t\t\tboolean login = true;\r\n\t\t\t\t\tfor (int i = 0; i < urlMap.size(); i++) {\r\n\t\t\t\t\t\tNameValuePair nameValuePair = urlMap.get(i);\r\n\t\t\t\t\t\tString namePair = nameValuePair.getName();\r\n\t\t\t\t\t\tif(null != namePair && namePair.endsWith(\"login\")){\r\n\t\t\t\t\t\t\tlogin = Boolean.parseBoolean(nameValuePair.getValue());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!JpSocialSystemConstants.NO_LOGIN.equals(currentAction) && login){\r\n\t\t\t\t\t\tUserDetails userDetails = new TwitterUser(id + this.getDomain(), name);\r\n\t\t\t\t\t\trequest.getSession().setAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER, userDetails);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tJpSocialSystemUtils.saveTwitterCredentialsCookie(credentials, response, request);\r\n\t\t\t\t\t//log.info(\" MineTwitterConsumer REDIRECT URL \" + redirectUrl);\r\n\t\t\t\t\tif (null != this.getRedirectUrl() && this.getRedirectUrl().length() > 0) {\r\n\t\t\t\t\t\t//log.info(\" MineTwitterConsumer REDIRECT\");\r\n\t\t\t\t\t\tresponse.sendRedirect(this.getRedirectUrl());\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//log.info(\" MineTwitterConsumer END \");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\ttwitterConsumerManager.handleException(e, request, response, consumer);\r\n\t\t\t} \r\n\t\t}\r\n\t\t\r\n\t}", "public void OnConfHostRequest(BoUserInfoBase user, int permission);", "private void login_finally(String token, String user_name){\n RequestBody requestBody = new FormBody.Builder()\r\n .add(\"username\", user_name)\r\n .add(\"password\", password)\r\n .build();\r\n\r\n HttpUtil.sendOkHttpRequest(Login.this, login_url, requestBody, new Callback(){\r\n int check_login_user = 0;\r\n String user_name;\r\n\r\n @Override\r\n public void onResponse(Call call, Response response) throws IOException{\r\n Slog.d(TAG, \"========header :\"+response.headers());\r\n String responseText = response.body().string();\r\n Slog.d(TAG, \"login response : \"+responseText);\r\n if(!TextUtils.isEmpty(responseText)){\r\n try {\r\n JSONObject login_response= new JSONObject(responseText);\r\n String sessionId = login_response.getString(\"sessid\");\r\n String session_name = login_response.getString(\"session_name\");\r\n JSONObject user = login_response.getJSONObject(\"user\");\r\n Slog.d(TAG, \"sessionId: \"+sessionId+\"===session name: \"+session_name);\r\n\r\n SharedPreferences.Editor editor = getSharedPreferences(\"session\", MODE_PRIVATE).edit();\r\n editor.putString(\"sessionId\", sessionId);\r\n editor.putString(\"sessionName\", session_name);\r\n editor.putInt(\"uid\", user.getInt(\"uid\"));\r\n editor.apply();\r\n\r\n Intent intent = new Intent(Login.this, MainActivity.class);\r\n startActivity(intent);\r\n\r\n\r\n }catch (JSONException e){\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n\r\n @Override\r\n public void onFailure(Call call, IOException e){\r\n runOnUiThread(new Runnable(){\r\n @Override\r\n public void run(){\r\n closeProgressDialog();\r\n Toast.makeText(Login.this, \"登录失败\", Toast.LENGTH_SHORT).show();\r\n }\r\n });\r\n }\r\n });\r\n }", "public interface HuobiConsts {\n String API_HOST_PRO = \"api.huobi.pro\";\n String API_HOST_HADAX = \"api.hadax.com\";\n\n String USER_AGENT = \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36\";\n\n String ENDPOINT_SECURITY_TYPE_APIKEY = \"AccessKeyId\";\n String ENDPOINT_SECURITY_TYPE_APIKEY_HEADER = ENDPOINT_SECURITY_TYPE_APIKEY + \":#\";\n\n String ENDPOINT_SECURITY_TYPE_SIGNED = \"Signature\";\n String ENDPOINT_SECURITY_TYPE_SIGNED_HEADER = ENDPOINT_SECURITY_TYPE_SIGNED + \":#\";\n\n String SIGNATURE_METHOD = \"HmacSHA256\";\n String SIGNATURE_VERSION = \"2\";\n\n DateTimeFormatter DT_FORMAT = DateTimeFormatter.ofPattern(\"uuuu-MM-dd'T'HH:mm:ss\");\n ZoneId ZONE_GMT = ZoneId.of(\"Z\");\n\n\n interface WsCode {\n int manualClose = 4999;\n int autoReconnect = 4998;\n int pingExpired = 1003;\n }\n\n\n}", "void send(WebhookMessage msg);", "RequestToken getOAuthRequestToken(String callbackURL) throws MoefouException;", "@Override\n public String execute() {\n final OAuth20Service service = new ServiceBuilder(API_APP_KEY)\n .apiSecret(API_APP_SECRET)\n .callback(\"http://127.0.0.1:8080/connectFacebook\")\n .scope(\"publish_actions\")\n .build(FacebookApi.instance());\n\n final OAuth2AccessToken accessToken;\n try {\n accessToken = service.getAccessToken(code);\n\n // Get user id and name\n final OAuthRequest request = new OAuthRequest(Verb.GET, URL);\n service.signRequest(accessToken, request);\n\n // Get response from API\n final Response response = service.execute(request);\n System.out.println(response);\n System.out.println(response.getCode());\n System.out.println(response.getMessage());\n System.out.println(response.getBody());\n\n // Parse response\n JSONObject body = (JSONObject) JSONValue.parse(response.getBody());\n\n\n this.getLigacaoFbBean().setUtilizador((String) session.get(\"UTILIZADOR\"));\n this.getLigacaoFbBean().setFacebookId((String) body.get(\"id\"));\n this.getLigacaoFbBean().setAcessToken(accessToken.getAccessToken());\n resultado = this.getLigacaoFbBean().ligacaoFB();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n\n return SUCCESS;\n }", "public void sendOTP(String username){\n }", "@Override\n public void onClick(DialogInterface dialog,\n int which) {\n showDialog(getResources()\n .getString(\n R.string.smssdk_get_verification_code_content));\n new MessageVerify(phone, new MessageVerify.SuccessCallBack() {\n @Override\n public void onSuccess(JSONObject obj) {\n try {\n String message = obj.getString(Config.KEY_RETURN_MESSAGE);\n sessionId = obj.getString(Config.KEY_SESSIONID);\n //token = obj.getString(Config.KEY_TOKEN);\n\n\n Config.cacheSessionId(RegisterActivity.this, sessionId);\n // Config.cacheToken(RegisterActivity.this, token);\n Log.i(\"info\",\"从服务器获取的sessionId:\" + sessionId);\n Log.i(\"info\",\"从缓存中取出的sessionId:\" + Config.getCacheSessionId(RegisterActivity.this));\n\n Toast.makeText(RegisterActivity.this, message, Toast.LENGTH_SHORT).show();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new MessageVerify.FailCallBack() {\n @Override\n public void onFail(String message) {\n Toast.makeText(RegisterActivity.this, message, Toast.LENGTH_SHORT).show();\n }\n });\n\n closeDialog();\n\n }", "private JSONObject postRequestWithOkHttp(String msg) {\n JSONObject json = null;\n\n RequestBody requestBody = new FormBody.Builder()\n .add(\"chatroom_id\", chatroom_id)\n .add(\"user_id\", \"1155080901\")\n .add(\"name\", name)\n .add(\"message\", msg)\n .build();\n String url = \"http://13.112.156.96/api/asgn3/send_message\";\n OkHttpClient client = new OkHttpClient();\n Log.d(POST, url);\n Request request = new Request.Builder()\n .url(url)\n .post(requestBody)\n .build();\n try {\n Response response = client.newCall(request).execute();\n String responseData = response.body().string();\n json = new JSONObject(responseData);\n Log.d(POST, String.valueOf(json.get(\"status\")));\n } catch (Exception e) {\n e.printStackTrace();\n Log.d(POST, \"POST request error\");\n }\n return json;\n }", "public void loginc( String id1, String id2, final IViewCallback<JSONObject> call)\n{\n Log.d(\"payload run\",id1);\n Payload payload = new Payload();\n payload.add(\"user_name\",id1);\n payload.add(\"user_pass\",id2);\n\n Request request = RequestFactory.createRequest(\n HttpMethod.POST, \"http://stage.overboxd.com/index.php/loginapi/\", null, payload, null, 60000, null, null);\n\n if(request==null)\n {\n Log.d(\"request not going\",\"goo na\");\n }\n VolleyQueueUtils.getGeneralRequestQueue().add(new VolleyStringRequest(request, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n try {\n\n HttpResponse<JSONObject> httpResponse = new HttpResponse<>(\n new HttpResponseStatus(),\n new JSONObject(response)\n );\n\n\n\n\n notifyResponse(httpResponse, call);\n }\n\n catch (JSONException e) {\n //Toast.makeText(context,\"Msg\", Toast.LENGTH_LONG).show();\n\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n }\n }));\n}", "private void sendRegistrationRequest(AccountCredentials credentials) {\n final String url = API_BASE_URL + \"register/send\";\n\n GsonRequest<AuthenticationResponse> request = new GsonRequest<>(\n Request.Method.POST, url, credentials, AuthenticationResponse.class,\n\n new Response.Listener<AuthenticationResponse>() {\n\n @Override\n public void onResponse(AuthenticationResponse authenticationResponse) {\n Intent intent = new Intent(RegisterActivity.this, EmailNotConfirmedActivity.class);\n startActivity(intent);\n }\n },\n\n new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n HttpRequestHelper.handleErrorResponse(error.networkResponse, RegisterActivity.this);\n }\n });\n VolleyController.getInstance(this).addToRequestQueue(request);\n }", "@Override\n public void success(Result<TwitterSession> twitterSessionResult) {\n strAccountId = \"\" + twitterSessionResult.data.getUserId();\n strUserName = \"\" + twitterSessionResult.data.getUserName();\n registerInfo(strAccountId, mStringlat, mStringlong,deviceToken = prefsManager.getDevicetoken(), \"twitter\", \"\", \"email\",strUserName);\n // strEmail = \"abc@gmail.com\"; //Now static.\n // strUserName = twitterSessionResult.data.getUserName();\n // strLastName = twitterSessionResult.data.getUserName();\n //// strContact = \"\";//Now static.\n //TypeCast Long to String to get user ID from Twitter.\n //strTokenId = Long.toString(twitterSessionResult.data.getUserId()); //now static\n\n //Save info to params and pass Login Type [Twitch,Facebook,Twitter].\n //saveInfoToParams(WebUrl.TAG_LOGIN_TYPE_TT);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t fOAuth = sActivity.getOAuthToken();\n\t\t\t\t\tOAuthTask task = new OAuthTask (mactivity);\n\t\t\t\t\ttask.execute();\t\t\t\t\n\t\t\t}", "GetToken.Req getGetTokenReq();", "@Override\n public void onHuaweiLogoClick() {\n// HuaweiIdAuthParams authParams= new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM).setAccessToken().createParams();\n// HuaweiIdAuthService service = HuaweiIdAuthManager.getService (MainActivity.this, authParams);\n// startActivityForResult(service.getSignInIntent(), AppConstants.REQUEST_SIGN_IN_LOGIN_CODE);\n\n// if (AGConnectAuth.getInstance().getCurrentUser() != null) {\n// onLoginCorrect();\n// }\n\n HuaweiIdAuthParamsHelper huaweiIdAuthParamsHelper = new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM);\n HuaweiIdAuthParams authParams = huaweiIdAuthParamsHelper.setAccessToken().createParams();\n service = HuaweiIdAuthManager.getService(MainActivity.this, authParams);\n startActivityForResult(service.getSignInIntent(), AppConstants.REQUEST_SIGN_IN_LOGIN_CODE);\n }" ]
[ "0.5753749", "0.57170093", "0.570248", "0.56622094", "0.5648376", "0.5617101", "0.5613002", "0.5564436", "0.55135995", "0.5507116", "0.54698694", "0.5453604", "0.5449773", "0.54492044", "0.54072815", "0.53793865", "0.5376597", "0.5362779", "0.53117526", "0.5299517", "0.52942264", "0.5285147", "0.52628875", "0.52531224", "0.5227714", "0.52111655", "0.5210748", "0.5197864", "0.5190499", "0.5185793", "0.5167399", "0.515287", "0.5133204", "0.51320297", "0.5118097", "0.5117764", "0.5108779", "0.50984883", "0.50544614", "0.50441945", "0.5041955", "0.50392336", "0.50335854", "0.5032245", "0.50251913", "0.50245726", "0.5023914", "0.5013172", "0.49981058", "0.49958742", "0.4985864", "0.49656788", "0.49644956", "0.49643698", "0.4943818", "0.49251494", "0.4924577", "0.49151447", "0.49079674", "0.4892218", "0.48849946", "0.48834807", "0.48820382", "0.48750576", "0.48708987", "0.4857343", "0.48506635", "0.48502466", "0.4844735", "0.4835136", "0.48349977", "0.48298186", "0.4828902", "0.48284826", "0.48266128", "0.48213747", "0.48156404", "0.4811614", "0.48083627", "0.4797851", "0.479473", "0.479249", "0.47919616", "0.4788046", "0.4784968", "0.478232", "0.4781433", "0.47810894", "0.47755656", "0.47719958", "0.47703326", "0.47701034", "0.4769258", "0.47690526", "0.4766218", "0.47640955", "0.47606173", "0.47568443", "0.47561428", "0.47432098", "0.4739762" ]
0.0
-1
load all the sprites from the images folder
public static void load(){ try { // load and set all sprites setBlueGarbage(ImageIO.read(classPath.getResourceAsStream("/images/blueGarbage.png"))); setRank(ImageIO.read(classPath.getClass().getResourceAsStream("/images/rank.png"))); setRedGarbage(ImageIO.read(classPath.getResourceAsStream("/images/redGarbage.png"))); setYellowGarbage(ImageIO.read(classPath.getResourceAsStream("/images/yellowGarbage.png"))); setGreenGarbage(ImageIO.read(classPath.getResourceAsStream("/images/greenGarbage.png"))); setBlueSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream("/images/blueSnakeBodyPart.png"))); setRedSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream("/images/redSnakeBodyPart.png"))); setYellowSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream("/images/yellowSnakeBodyPart.png"))); setGreenSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream("/images/greenSnakeBodyPart.png"))); setHeart(ImageIO.read(classPath.getResourceAsStream("/images/heart.png"))); setGameScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream("/images/gameScreenBackground.png"))); setGameScreenHeader(ImageIO.read(classPath.getClass().getResourceAsStream("/images/gameScreenHeader.png"))); setGameOver(ImageIO.read(classPath.getClass().getResourceAsStream("/images/gameOver.png"))); setHitsOwnBody(ImageIO.read(classPath.getClass().getResourceAsStream("/images/hitsOwnBody.png"))); setHitsWall(ImageIO.read(classPath.getClass().getResourceAsStream("/images/hitsWall.png"))); setWrongColor(ImageIO.read(classPath.getClass().getResourceAsStream("/images/wrongColor.png"))); setHelpScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream("/images/helpScreenBackground.png"))); setWarningScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream("/images/warningScreenBackground.png"))); setOkButton(ImageIO.read(classPath.getClass().getResource("/images/okButton.png"))); setMenuScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream("/images/menuScreenBackground.png"))); setStartButton(ImageIO.read(classPath.getClass().getResourceAsStream("/images/startButton.png"))); setExitButton(ImageIO.read(classPath.getClass().getResourceAsStream("/images/exitButton.png"))); setHelpButton(ImageIO.read(classPath.getClass().getResourceAsStream("/images/helpButton.png"))); } catch (Exception e) { JOptionPane.showMessageDialog(null, e.getStackTrace(), "Erro ao carregar imagens", JOptionPane.ERROR_MESSAGE); System.exit(0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void loadImages() {\n PonySprite.loadImages(imgKey, \"graphics/ponies/GrannySmith.png\");\n }", "private void loadSprites() throws IOException {\n \t\tsprites.put(\"fullBin\", ImageIO.read(new File(\"user-trash-full64.png\")));\n \t\tsprites.put(\"emptyBin\", ImageIO.read(new File(\"user-trash64.png\")));\n \t\tsprites.put(\"sysfileLarge\", ImageIO.read(new File(\"sysfile1-48.png\")));\n \t\tsprites.put(\"sysfileMedium\", ImageIO.read(new File(\"sysfile2-32.png\")));\n \t\tsprites.put(\"sysfileSmall\", ImageIO.read(new File(\"sysfile3-16.png\")));\n \t\tsprites.put(\"junk\", ImageIO.read(new File(\"junk.png\")));\n \t\tsprites.put(\"grass\", ImageIO.read(new File(\"grass.jpg\")));\n \t}", "private void loadImages(){\n try{\n System.out.println(System.getProperty(\"user.dir\"));\n\n t1img = read(new File(\"resources/tank1.png\"));\n t2img = read(new File(\"resources/tank1.png\"));\n backgroundImg = read(new File(\"resources/background.jpg\"));\n wall1 = read(new File(\"resources/Wall1.gif\"));\n wall2 = read(new File(\"resources/Wall2.gif\"));\n heart = resize(read(new File(\"resources/Hearts/basic/heart.png\")), 35,35);\n heart2 = resize(read( new File(\"resources/Hearts/basic/heart.png\")), 25,25);\n bullet1 = read(new File(\"resources/bullet1.png\"));\n bullet2 = read(new File(\"resources/bullet2.png\"));\n\n }\n catch(IOException e){\n System.out.println(e.getMessage());\n }\n }", "public void loadImages() {\n\t\tcowLeft1 = new ImageIcon(\"images/animal/cow1left.png\");\n\t\tcowLeft2 = new ImageIcon(\"images/animal/cow2left.png\");\n\t\tcowLeft3 = new ImageIcon(\"images/animal/cow1left.png\");\n\t\tcowRight1 = new ImageIcon(\"images/animal/cow1right.png\");\n\t\tcowRight2 = new ImageIcon(\"images/animal/cow2right.png\");\n\t\tcowRight3 = new ImageIcon(\"images/animal/cow1right.png\");\n\t}", "public void loadTileImages() {\n // keep looking for tile A,B,C, etc. this makes it\n // easy to drop new tiles in the images/ directory\n tiles = new ArrayList();\n char ch = 'A';\n while (true) {\n String name = \"tile_\" + ch + \".png\";\n File file = new File(\"images/\" + name);\n if (!file.exists()) {\n break;\n }\n tiles.add(loadImage(name));\n ch++;\n }\n }", "private void loadSprites(String s){\n try {\n BufferedImage spriteSheet = ImageIO.read(\n getClass().getResourceAsStream(s));\n sprites = new BufferedImage[1];\n sprites[0] = spriteSheet.getSubimage(0, 0, width, height);\n\n } catch (Exception e){\n e.printStackTrace();\n }\n\n }", "private void initSprites(){\r\n try\r\n {\r\n spriteSheet = ImageIO.read (spriteSheetFile);\r\n }\r\n catch (IOException e)\r\n {\r\n System.out.println(\"SPRITE spritesheet not found\");\r\n } \r\n try\r\n {\r\n iconSheet=ImageIO.read(playerIconFile);\r\n }\r\n catch (IOException e)\r\n {\r\n System.out.println(\"PLAYERICON spritesheet not found\");\r\n } \r\n\r\n // saves images to array\r\n for(int i=0;i<3;i++){\r\n bomb[i]=new BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB); \r\n bomb[i]=spriteSheet.getSubimage(i*32,6,32,32);\r\n }\r\n for(int i=0;i<4;i++){\r\n icons[i] = new BufferedImage(30,30,BufferedImage.TYPE_INT_ARGB);\r\n icons[i] = iconSheet.getSubimage(0, 31*i, 30, 30);\r\n }\r\n }", "public static void loadSprites(MediaTracker m)\r\n\t{\r\n\t\tsprites = new ArrayList<String>();\r\n\t\t\r\n\t\t//Get list of files in pedestrian sprite directory\r\n\t\tFile folder = new File(\"res/pedestrians\");\r\n\t\tString[] files = folder.list();\r\n\t\t\r\n\t\t//Load all .gif files from the directory\r\n\t\tfor(String fileName : files){\r\n\t\t\tif (fileName.endsWith(\".gif\")) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (fileName.endsWith(\"Walk1.gif\")) {\r\n\t\t\t\t\t\tsprites.add(fileName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnew Sprite(\"pedestrians/\"+fileName, m);\r\n\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t\tSystem.err.println(\"ERROR: Unable to load pedestrian sprite \"+fileName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Ensure at least one sprite was loaded\r\n\t\tif (sprites.isEmpty()) {\r\n\t\t\tSystem.err.println(\"ERROR: Unable to load any pedestrian sprites\");\r\n\t\t}\r\n\t}", "public static void load() {\n\t\tspritesheet = new Spritesheet(\"src/de/kaffeeliebhaber/assets/pyxel/voland_spritesheet_new.png\", 32, 32);\n\t\tspritesheet.load();\n\t\t\n\t\t// load player\n\t\tAssetsLoader.loadPlayerAssets();\n\t\t\n\t\t// load crate\n\t\tAssetsLoader.loadCrates();\n\t\t\n\t\t// load item spritesheet \n\t\tspritesheetInventory = new Spritesheet(Config.ITEM_SPRITESHEET, Config.ITEM_SIZE, Config.ITEM_SIZE);\n\t\tspritesheetInventory.load();\n\t\t\n\t\t// load font \n\t\tloadFonts();\n\t\t\n\t\t// ui\n\t\timageUI = ImageLoader.loadImage(\"src/de/kaffeeliebhaber/assets/ui/ui.png\");\n\t\t\n\t\tAssetsLoader.loadInfoPaneAssets();\n\t\t\n\t\t// npc\n\t\tspritesheetNPC = new Spritesheet(\"src/de/kaffeeliebhaber/assets/AH_SpriteSheet_People1.png\", 16, 16);\n\t\tspritesheetNPC.load();\n\t\t\n\t\t// fox\n\t\tspritesheetNPCFox = new Spritesheet(\"src/de/kaffeeliebhaber/assets/imgs/72c68863962b7a6b5a9f5f5bcc5afb16.png\", 32, 32);\n\t\tspritesheetNPCFox.load();\n\n\t\t// *** LOAD NPCs\n\t\tAssetsLoader.loadFoxAssets();\n\t\t\n\t\tAssetsLoader.loadNPCs();\n\t\t\n\t\tspritesheetFemale = new Spritesheet(\"src/de/kaffeeliebhaber/assets/imgs/Female 01-1.png\", 32, 32);\n\t\tspritesheetFemale.load();\n\t}", "private void ini_Sprites()\r\n\t{\r\n\t\tLogger.DEBUG(\"ini_Sprites\");\r\n\t\tResourceCache.LoadSprites(false);\r\n\t}", "public static void LoadSpritesIntoArray() {\r\n\t\t// Get all nodes for the settings\r\n\t\t// Node main = document.getElementById(\"main\");\r\n\t\t// Node textures = document.getElementById(\"textures\");\r\n\t\t// NodeList nList = document.getElementsByTagName(\"TexturePath\");\r\n\r\n\t\t// for (Element texPath : texturePathElements) {\r\n\t\t// System.out.println(texPath.getAttribute(\"name\") + \" \" +\r\n\t\t// texPath.getAttribute(\"name\"));\r\n\t\t// sprites.add(new Sprite(texPath.getAttribute(\"name\"),\r\n\t\t// texPath.getAttribute(\"path\")));\r\n\t\t// }\r\n\r\n\t\tsprites = ImageTools.LoadAllSpriteTexturesFromSpriteSheet(\"In_Game\");\r\n\r\n\t\t/*\r\n\t\t * This method i got from a stack overflow question\r\n\t\t * https://stackoverflow.com/questions/22610526/how-to-append-elements-\r\n\t\t * at-the-end-of-arraylist-in-java\r\n\t\t */\r\n\t\tint endOfList = sprites.size();\r\n\t\tsprites.addAll(endOfList, ImageTools.LoadAllSpriteTexturesFromSpriteSheet(\"In_Game_HUD\"));\r\n\t\tendOfList = sprites.size();\r\n\t\tsprites.addAll(endOfList, ImageTools.LoadAllSpriteTexturesFromSpriteSheet(\"In_Game_Custom\"));\r\n\t\tSystem.out.println(endOfList);\r\n\r\n\t\tfor (Element el : texturePathElements) {\r\n\r\n\t\t\ttry {\r\n\t\t\t\tsprites.add(new Sprite(el.getAttribute(\"name\"), el.getAttribute(\"path\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tisTexturesDone = true;\r\n\t}", "public void findImages() {\n URL imgURL = ImageLoader.class.getResource(\"/BackgroundMenu.jpg\");\n this.backgroundImages.put(MenuP.TITLE, loadImage(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/backgroundGame.png\");\n this.backgroundImages.put(ArenaView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/gameOver.jpg\");\n this.backgroundImages.put(GameOverView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Player.png\");\n this.entityImages.put(ID.PLAYER, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Enemy1.png\");\n this.entityImages.put(ID.BASIC_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/boss.png\");\n this.entityImages.put(ID.BOSS_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/meteorBrown_big1.png\");\n this.entityImages.put(ID.METEOR, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/BlueBullet.png\");\n this.bulletImages.put(new Pair<>(ID.PLAYER_BULLET, ID.PLAYER), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/redBullet.png\");\n this.entityImages.put(ID.ENEMY_BULLET, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_FireBoost.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Freeze.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL)); \n \n imgURL = ImageLoader.class.getResource(\"/powerup_Health.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.HEALTH), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Shield.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.SHIELD), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/bulletSpeedUp.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadEffect(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Explosion.png\");\n this.AnimationsEffect.put(new Pair<>(ID.EFFECT, SpecialEffectT.EXPLOSION), loadEffect(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/freeze.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL));\n }", "public void loadImage() {\n\t\tif (images.containsKey(name)) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tString fullPath = BASE_PATH + this.sprite_sheet;\n\t\t\tFile imageFile = new File(fullPath);\n\t\t\tImage initialImage = ImageIO.read(imageFile);\n\t\t\tImage scaledImage = initialImage.getScaledInstance(\n\t\t\t\t\tMainPanel.TILE_SIZE, MainPanel.TILE_SIZE, 0);\n\n\t\t\tBufferedImage image = new BufferedImage(scaledImage.getWidth(null),\n\t\t\t\t\tscaledImage.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\t\t\tGraphics2D imageGraphicsContext = image.createGraphics();\n\t\t\timageGraphicsContext.drawImage(scaledImage, 0, 0, null);\n\t\t\timageGraphicsContext.dispose();\n\t\t\timages.put(name, image);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Could not load image for\" + this.name);\n\t\t}\n\t}", "private void importImages() {\n\n\t\t// Create array of the images. Each image pixel map contains\n\t\t// multiple images of the animate at different time steps\n\n\t\t// Eclipse will look for <path/to/project>/bin/<relative path specified>\n\t\tString img_file_base = \"Game_Sprites/\";\n\t\tString ext = \".png\";\n\n\t\t// Load background\n\t\tbackground = createImage(img_file_base + \"Underwater\" + ext);\n\t}", "private void loadSpritesheet() {\n\t\tobjects = new SpriteSheet(\"res\\\\pong.png\");\n\t\tobjects_hires = new SpriteSheet(\"res\\\\ponghires.png\",\n\t\t\t\tSpriteSheet.LINEAR);\n\t}", "public static void loadImages(){\n\t\tsetPath(main.getShop().inventory.getEquipID());\n\t\ttry {\n\t\t\tbackground = ImageIO.read(new File(\"res/world/bg.png\"));\n\t\t\tterrain = ImageIO.read(new File(\"res/world/solids.png\"));\n\t\t\t// Character and Armour\n\t\t\tcharacters = ImageIO.read(new File(\"res/world/char3.png\"));\n\t\t\tcharactersHead =ImageIO.read(new File(\"res/world/charhead\"+path[0]+\".png\"));\n\t\t\tcharactersTop = ImageIO.read(new File(\"res/world/chartop\"+path[2]+\".png\"));\n\t\t\tcharactersShoulder = ImageIO.read(new File(\"res/world/charshoulders\"+path[3]+\".png\"));\n\t\t\tcharactersHand = ImageIO.read(new File(\"res/world/charhands\"+path[5]+\".png\"));\n\t\t\tcharactersBottom = ImageIO.read(new File(\"res/world/charbottom\"+path[8]+\".png\"));\n\t\t\tcharactersShoes = ImageIO.read(new File(\"res/world/charshoes\"+path[9]+\".png\"));\n\t\t\tcharactersBelt = ImageIO.read(new File(\"res/world/charBelt\"+path[4]+\".png\"));\n\n\t\t\tweaponBow = ImageIO.read(new File(\"res/world/bow.png\"));\n\t\t\tweaponArrow = ImageIO.read(new File(\"res/world/arrow.png\"));\n\t\t\tweaponSword = ImageIO.read(new File(\"res/world/sword.png\"));\n\t\t\titems = ImageIO.read(new File(\"res/world/items.png\"));\n\t\t\tnpc = ImageIO.read(new File(\"res/world/npc.png\"));\n\t\t\thealth = ImageIO.read(new File(\"res/world/health.png\"));\n\t\t\tenemies = ImageIO.read(new File(\"res/world/enemies.png\"));\n\t\t\tcoin = ImageIO.read(new File(\"res/world/coin.png\"));\n\t\t\tmana = ImageIO.read(new File(\"res/world/mana.gif\"));\n\t\t\tarrowP = ImageIO.read(new File(\"res/world/arrowP.png\"));\n\t\t\tbutton = ImageIO.read(new File(\"res/world/button.png\"));\n\t\t\tblood = ImageIO.read(new File(\"res/world/blood.png\"));\n\t\t\tarrowDisp = ImageIO.read(new File(\"res/world/arrowDisp.png\"));\n\t\t\tboss1 = ImageIO.read(new File(\"res/world/boss1.png\"));\n\t\t\tmagic = ImageIO.read(new File(\"res/world/magic.png\"));\n\t\t\tmainMenu = ImageIO.read(new File(\"res/world/MainMenu.png\"));\n\t\t\tinstructions = ImageIO.read(new File(\"res/world/instructions.png\"));\n\t\t\trespawn = ImageIO.read(new File(\"res/world/respawn.png\"));\n\t\t\tinventory = ImageIO.read(new File(\"res/world/inventory.png\"));\n shop = ImageIO.read(new File(\"res/world/shop.png\"));\n dizzy = ImageIO.read(new File(\"res/world/dizzy.png\"));\n pet = ImageIO.read(new File(\"res/world/pet.png\"));\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error Loading Images\");\n\t\t}\n\t}", "private void loadImages() {\n\t\ttry {\n\t\t\timage = ImageIO.read(Pillar.class.getResource(\"/Items/Pillar.png\"));\n\t\t\tscaledImage = image;\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Failed to read Pillar image file: \" + e.getMessage());\n\t\t}\n\t}", "public void loadImages() {\n\t\tpigsty = new ImageIcon(\"images/property/pigsty.png\");\n\t}", "private static void loadSprites(){\n \t\tshipSprites.put(\"SCOUT_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/scout.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"HUNTER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/hunter.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"DESTROYER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/destroyer.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"COLONIZER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/colonizer.png\"), 0.5f, 0.5f));\n \t\t\n \t\t/*\n \t\t * Ships Red Player\n \t\t */\n \t\tshipSprites.put(\"SCOUT_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/scout.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"HUNTER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/hunter.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"DESTROYER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/destroyer.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"COLONIZER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/colonizer.png\"), 0.5f, 0.5f));\n \n \t\t/*\n \t\t * Path Arrows\n \t\t */\n\t\tpathTextures.put(\"HEAD\", Toolkit.getDefaultToolkit().getImage(\"res/path/head.png\"));\n\t\tpathTextures.put(\"START\", Toolkit.getDefaultToolkit().getImage(\"res/path/start.png\"));\n\t\tpathTextures.put(\"STRAIGHT\", Toolkit.getDefaultToolkit().getImage(\"res/path/straight.png\"));\n\t\tpathTextures.put(\"TURN\", Toolkit.getDefaultToolkit().getImage(\"res/path/turn.png\"));\n \t\t\n \t\t/*\n \t\t * Planets\n \t\t */\n \t\tmetalplanets.put(0, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_0.png\"), 0.5f, 0));\n \t\tmetalplanets.put(1, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_1.png\"), 0.5f, 0));\n \t\tmetalplanets.put(2, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_2.png\"), 0.5f, 0));\n \t\tmetalplanets.put(3, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_3.png\"), 0.5f, 0));\n \t\tgasplanets.put(0, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_0.png\"), 0.5f, 0));\n \t\tgasplanets.put(1, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_1.png\"), 0.5f, 0));\n \t\tgasplanets.put(2, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_2.png\"), 0.5f, 0));\n \t\t\n \t\t/*\n \t\t * Colony Sprite\n \t\t */\n \t\tloadColonySprites(Color.RED, \"RED\");\n \t\tloadColonySprites(Color.BLUE, \"BLUE\");\n \t}", "private void loadImages() {\n\t\ttry {\n\t\t\tall_images = new Bitmap[img_files.length];\n\t\t\tfor (int i = 0; i < all_images.length; i++) {\n\t\t\t\tall_images[i] = loadImage(img_files[i] + \".jpg\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tToast.makeText(this, \"Unable to load images\", Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tfinish();\n\t\t}\n\t}", "public static void load(){\n\t\trobot=new BufferedImage[5];\n\t\ttry {\n\t\t\tfor(int i=0;i<5;i++)\n\t\t\t\trobot[i]=ImageIO.read(new File(\"robot\" + i +\".png\"));\n\t\t\t\n\t\t\tminiRobot=ImageIO.read(new File(\"miniRobot.png\"));\n\t\t\toil=ImageIO.read(new File(\"oil.png\"));\n\t\t\tslime=ImageIO.read(new File(\"slime.png\"));\n\t\t\tmap=ImageIO.read(new File(\"map.png\"));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e + \"Failed to load images\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "private void loadAnimations() {\n loadImages(imagesFront, \"F\");\n loadImages(imagesLeft, \"L\");\n loadImages(imagesRight, \"R\");\n loadImages(imagesBack, \"B\");\n }", "private void addAllSprites(String heroName) throws IOException {\n BufferedReader reader = new BufferedReader(\n new FileReader(\"assets/config/characters/\"+heroName+\"Sprites.txt\")\n );\n String line = reader.readLine();\n String[] data;\n BufferedImage[] sprites;\n while (line != null) {\n data = line.split(\"\\\\s+\"); //regex for spliting all spaces\n sprites = new BufferedImage[data.length-1];\n for (int i = 1; i < data.length; i++) {\n sprites[i-1] = Util.urlToImage(\"characters/\"+heroName+\"/\"+data[i]);\n \n }\n this.sprites.put(data[0], sprites);\n line = reader.readLine();\n }\n reader.close();\n }", "public static void loadImages()\n \t{\n \t\tSystem.out.print(\"Loading images... \");\n \t\t\n \t\tallImages = new TreeMap<ImageEnum, ImageIcon>();\n \t\t\n \t\ttry {\n \t\taddImage(ImageEnum.RAISIN, \"images/parts/raisin.png\");\n \t\taddImage(ImageEnum.NUT, \"images/parts/nut.png\");\n \t\taddImage(ImageEnum.PUFF_CHOCOLATE, \"images/parts/puff_chocolate.png\");\n \t\taddImage(ImageEnum.PUFF_CORN, \"images/parts/puff_corn.png\");\n \t\taddImage(ImageEnum.BANANA, \"images/parts/banana.png\");\n \t\taddImage(ImageEnum.CHEERIO, \"images/parts/cheerio.png\");\n \t\taddImage(ImageEnum.CINNATOAST, \"images/parts/cinnatoast.png\");\n\t\taddImage(ImageEnum.CORNFLAKE, \"images/parts/flake_corn.png\");\n \t\taddImage(ImageEnum.FLAKE_BRAN, \"images/parts/flake_bran.png\");\n \t\taddImage(ImageEnum.GOLDGRAHAM, \"images/parts/goldgraham.png\");\n \t\taddImage(ImageEnum.STRAWBERRY, \"images/parts/strawberry.png\");\n \t\t\n \t\taddImage(ImageEnum.PART_ROBOT_HAND, \"images/robots/part_robot_hand.png\");\n \t\taddImage(ImageEnum.KIT_ROBOT_HAND, \"images/robots/kit_robot_hand.png\");\n \t\taddImage(ImageEnum.ROBOT_ARM_1, \"images/robots/robot_arm_1.png\");\n \t\taddImage(ImageEnum.ROBOT_BASE, \"images/robots/robot_base.png\");\n \t\taddImage(ImageEnum.ROBOT_RAIL, \"images/robots/robot_rail.png\");\n \t\t\n \t\taddImage(ImageEnum.KIT, \"images/kit/empty_kit.png\");\n \t\taddImage(ImageEnum.KIT_TABLE, \"images/kit/kit_table.png\");\n \t\taddImage(ImageEnum.KITPORT, \"images/kit/kitport.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_IN, \"images/kit/kitport_hood_in.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_OUT, \"images/kit/kitport_hood_out.png\");\n \t\taddImage(ImageEnum.PALLET, \"images/kit/pallet.png\");\n \t\t\n \t\taddImage(ImageEnum.FEEDER, \"images/lane/feeder.png\");\n \t\taddImage(ImageEnum.LANE, \"images/lane/lane.png\");\n \t\taddImage(ImageEnum.NEST, \"images/lane/nest.png\");\n \t\taddImage(ImageEnum.DIVERTER, \"images/lane/diverter.png\");\n \t\taddImage(ImageEnum.DIVERTER_ARM, \"images/lane/diverter_arm.png\");\n \t\taddImage(ImageEnum.PARTS_BOX, \"images/lane/partsbox.png\");\n \t\t\n \t\taddImage(ImageEnum.CAMERA_FLASH, \"images/misc/camera_flash.png\");\n \t\taddImage(ImageEnum.SHADOW1, \"images/misc/shadow1.png\");\n \t\taddImage(ImageEnum.SHADOW2, \"images/misc/shadow2.png\");\n \t\t\n \t\taddImage(ImageEnum.GANTRY_BASE, \"images/gantry/gantry_base.png\");\n \t\taddImage(ImageEnum.GANTRY_CRANE, \"images/gantry/gantry_crane.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_H, \"images/gantry/gantry_truss_h.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_V, \"images/gantry/gantry_truss_v.png\");\n \t\taddImage(ImageEnum.GANTRY_WHEEL, \"images/gantry/gantry_wheel.png\");\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t\tSystem.exit(1);\n \t\t}\n \t\tSystem.out.println(\"Done\");\n \t}", "protected void load(SpriteInfo[] arr) {\n\t\tassert arr != null;\n\t\tassert arr.length > 0;\n\n\t\tfor (SpriteInfo s : arr) {\n\t\t\tassert s != null;\n\t\t\tsprites.put(s.name, sheet.getSubimage(s.getX(), s.getY(), s.getWidth(), s.getHeight()));\n\t\t}\n\t}", "private void loadImages() {\n Glide\n .with(Activity_Game.this)\n .load(R.drawable.game_alien_img)\n .into(game_IMAGE_p1);\n\n Glide\n .with(Activity_Game.this)\n .load(R.drawable.game_predator_img)\n .into(game_IMAGE_p2);\n }", "private static void loadImagesInDirectory(String dir){\n\t\tFile file = new File(Files.localize(\"images\\\\\"+dir));\n\t\tassert file.isDirectory();\n\t\n\t\tFile[] files = file.listFiles();\n\t\tfor(File f : files){\n\t\t\tif(isImageFile(f)){\n\t\t\t\tString name = dir+\"\\\\\"+f.getName();\n\t\t\t\tint i = name.lastIndexOf('.');\n\t\t\t\tassert i != -1;\n\t\t\t\tname = name.substring(0, i).replaceAll(\"\\\\\\\\\", \"/\");\n\t\t\t\t//Image image = load(f,true);\n\t\t\t\tImageIcon image;\n\t\t\t\tFile f2 = new File(f.getAbsolutePath()+\".anim\");\n\t\t\t\tif(f2.exists()){\n\t\t\t\t\timage = evaluateAnimFile(dir,f2,load(f,true));\n\t\t\t\t}else{\n\t\t\t\t\timage = new ImageIcon(f.getAbsolutePath());\n\t\t\t\t}\n\t\t\t\tdebug(\"Loaded image \"+name+\" as \"+f.getAbsolutePath());\n\t\t\t\timages.put(name, image);\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tloadImagesInDirectory(dir+\"\\\\\"+f.getName());\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void loadImages() {\n\t\tsuper.setImage((new ImageIcon(\"pacpix/QuestionCandy.png\")).getImage());\t\n\t}", "private void loadResource() {\n\t\ttry {\n\t\t\ttarmacTexture = scaleResourceImagePaint(\"/textures/tarmac2.jpg\", 300, 300);\n\t\t\tgrassTexture = scaleResourceImagePaint(\"/textures/grass.jpg\", 300, 300);\n\t\t\tstopwayTexture = scaleResourceImagePaint(\"/textures/stopway.jpg\", 300, 300);\n\t\t} catch (IOException e) {\n\t\t\tsetUsingTextures(false);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void preloadAllAssets() {\r\n\t\tbackground = new Image(fileURL(\"./assets/gifs/background.gif\"));\r\n\r\n\t\tbackgroundGif = new Background(new BackgroundImage(background, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT));\r\n\r\n\t\t//Michael Bay Mode gifs\r\n\t\tcollisionGif = new Image(fileURL(\"./assets/gifs/collision.gif\"));\r\n\t\trunAwayGif = new Image(fileURL(\"./assets/gifs/run_away.gif\"));\r\n\r\n\t\t//Regular Simulation Images \r\n\t\tearthImage = new ImagePattern(new Image(fileURL(\"./assets/images/earth.png\")));\r\n\t\tneptuneImage = new ImagePattern(new Image(fileURL(\"./assets/images/neptune.png\")));\r\n\t\tsunImage = new ImagePattern(new Image(fileURL(\"./assets/images/sun.png\")));\r\n\t\tstarImage = new ImagePattern(new Image(fileURL(\"./assets/images/star.png\")));\r\n\t\tmarsImage = new ImagePattern(new Image(fileURL(\"./assets/images/mars.png\")));\r\n\t\tmoonImage = new ImagePattern(new Image(fileURL(\"./assets/images/moon.png\")));\r\n\t\tasteroidImage = new ImagePattern(new Image(fileURL(\"./assets/images/asteroid.png\")));\r\n\r\n\t\t//Michael Bay mode images\r\n\t\tmichaelBayExplosionImage = new ImagePattern(new Image(fileURL(\"./assets/images/bay_explosion.jpg\")));\r\n\t\tmichaelBayPointingImage = new Image(fileURL(\"./assets/images/bay_pointing.jpg\"));\r\n\t\tmichaelBayGangsterImage = new ImagePattern(new Image(fileURL(\"./assets/images/bay_gangster.jpg\")));\r\n\t\tgenericExplosionImage = new ImagePattern(new Image(fileURL(\"./assets/images/generic_explosion.png\")));\r\n\t\tusaFlagImage = new Image(fileURL(\"./assets/images/usa_flag.jpg\"));\r\n\t\tusaBackground = new Background(new BackgroundImage(usaFlagImage, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT));\r\n\t}", "abstract public void loadSprite();", "@Override\n\tpublic void onLoadResources() {\n\t\tBitmapTextureAtlasTextureRegionFactory.setAssetBasePath(\"gfx/\");\t\t\n\t\tmBitmapParralaxTextureAtlas=new BitmapTextureAtlas(1024,1024);\n\t\tmBitmapTextureAtlas=new BitmapTextureAtlas(512, 512);\n\t\tmTextureRegion=BitmapTextureAtlasTextureRegionFactory.createFromAsset(mBitmapParralaxTextureAtlas, this, \"parallax_background_layer_back.png\", 0, 0);\n\t\tbananaRegion=BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(mBitmapTextureAtlas, this, \"banana_tiled.png\", 0, 0, 4,2);\n\t\tmEngine.getTextureManager().loadTextures(mBitmapParralaxTextureAtlas,mBitmapTextureAtlas);\n\t}", "public static void loadTextures() {\n loadFontTextures();\n loadAlternatePaletteTextures(); // Load alternate tiles.\n findAllTextures(); // Should be run last.\n System.out.println(\"Textures have been successfully loaded.\");\n }", "public void loadAllTextures() {\n loadEntityTextures();\n loadDynamicEntityTextures();\n loadTileTextures();\n loadLiveTileTextures();\n }", "private void loadImages(BufferedImage[] images, String direction) {\n for (int i = 0; i < images.length; i++) {\n String fileName = direction + (i + 1);\n images[i] = GameManager.getResources().getMonsterImages().get(\n fileName);\n }\n\n }", "public void getPictures(){\n\t\t\ttry{\n\t\t\t\timg = ImageIO.read(new File(\"background.jpg\"));\n\t\t\t\ttank = ImageIO.read(new File(\"Tank.png\"));\n\t\t\t\tbackground2 = ImageIO.read(new File(\"background2.png\"));\n\t\t\t\t\n\t\t\t\trtank = ImageIO.read(new File(\"RTank.png\"));\n\t\t\t\tboom = ImageIO.read(new File(\"Boom.png\"));\n\t\t\t\tboom2 = ImageIO.read(new File(\"Boom2.png\"));\n\t\t\t\tinstructions = ImageIO.read(new File(\"Instructions.png\"));\n\t\t\t\tshotman = ImageIO.read(new File(\"ShotMan.png\"));\n\t\t\t\tlshotman = ImageIO.read(newFile(\"LShotMan.png\"));\n\t\t\t\tboomshotman = ImageIO.read(new File(\"AfterShotMan\"));\n\t\t\t\tlboomshotman = ImageIO.read(new File(\"LAfterShotMan\"));\n\t\t\t\t\n\t\t\t}catch(IOException e){\n\t\t\t\tSystem.err.println(\"d\");\n\t\t\t}\n\t\t}", "public abstract void createSprites() throws FileNotFoundException;", "private static void initResources() {\n\t\tString[] res = new String[4];\r\n\t\tres[0] = \"res/entity/spaceshipv1.png\";\r\n\t\tres[1] = \"res/entity/prob.png\";\r\n\t\tres[2] = \"res/dot.png\";\r\n\t\tres[3] = \"res/entity/spaceshipv2.png\";\r\n\t\tSResLoader.addSpriteArray(res);\r\n\t}", "private void loadBackground() {\n\t\ttry {\n\t\t\timgBackground[0] = ImageIO.read(new File(System.getProperty(\"user.dir\")+\"/assets/Background1.jpg\")); // attempts to load the three\n\t\t\timgBackground[1] = ImageIO.read(new File(System.getProperty(\"user.dir\")+\"/assets/Background2.jpg\")); // default backgrounds from the\n\t\t\timgBackground[2] = ImageIO.read(new File(System.getProperty(\"user.dir\")+\"/assets/Background3.jpg\")); // assets folder\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void loadGameFiles(){\n\t}", "public void mostrarSprites() throws MalformedURLException, IOException, InterruptedException{\n URL url = new URL(miPokemon.getSprites().get(\"front_default\").toString());\n Image img = ImageIO.read(url);\n lblSprites.setIcon(new ImageIcon(img));\n // 1 segundo para cada cambio de sprite\n Thread.sleep(1000);\n \n url = new URL(miPokemon.getSprites().get(\"back_default\").toString());\n img = ImageIO.read(url);\n lblSprites.setIcon(new ImageIcon(img));\n Thread.sleep(1000);\n \n url = new URL(miPokemon.getSprites().get(\"front_shiny\").toString());\n img = ImageIO.read(url);\n lblSprites.setIcon(new ImageIcon(img));\n Thread.sleep(1000);\n \n url = new URL(miPokemon.getSprites().get(\"back_shiny\").toString());\n img = ImageIO.read(url);\n lblSprites.setIcon(new ImageIcon(img));\n Thread.sleep(1000);\n }", "private void loadSheet() {\n\t\ttry {\n\t\t\tBufferedImage image = ImageIO.read(SpriteSheet.class\n\t\t\t\t\t.getResource(path));\n\t\t\tint w = image.getWidth();\n\t\t\tint h = image.getHeight();\n\t\t\timage.getRGB(0, 0, w, h, sheetPixles, 0, w);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void load(){\n for(TextureHandler t : textures){\n if(t.texture!=null)t.texture.dispose();\n }\n textures.clear();\n \n //if the textures are corrupt or just arent there then the error TextureHandler will\n //be a placeholder which is generated programatically so it is always there\n int size = 64;\n Pixmap pixmap = new Pixmap(size,size, Format.RGBA8888 );\n pixmap.setColor(1f,0f,0f,1f);\n pixmap.fillCircle(size/2,size/2,size/2);\n pixmap.setColor(0f,0f,0f,1f);\n pixmap.fillCircle(size/2,size/2,(size/2)-2);\n pixmap.setColor(1f,0f,0f,1f);\n int offset = size/6;\n int length = (size+size)/3;\n pixmap.drawLine(offset,offset,offset+length,offset+length);\n pixmap.drawLine(offset+length,offset,offset,offset+length);\n error = new Texture(pixmap);\n pixmap.dispose();\n //things that get rendered the most get put at the top so theyre the first in the list\n textures.add(new TextureHandler(\"Block\" ,\"Block.png\",true));\n textures.add(new TextureHandler(\"Block1\",\"Block1.png\",true));\n textures.add(new TextureHandler(\"Block2\",\"Block2.png\",true));\n textures.add(new TextureHandler(\"Block3\",\"Block3.png\",true));\n textures.add(new TextureHandler(\"Block4\",\"Block4.png\",true));\n textures.add(new TextureHandler(\"GameBackground\",\"GameBackground.png\",true));\n \n textures.add(new TextureHandler(\"Hints\",\"Hints.png\",false));\n textures.add(new TextureHandler(\"Left\" ,\"ButtonLeft.png\",true));\n textures.add(new TextureHandler(\"Right\" ,\"ButtonRight.png\",true));\n textures.add(new TextureHandler(\"Rotate\",\"ButtonRotate.png\",true));\n textures.add(new TextureHandler(\"Pause\" ,\"ButtonPause.png\",true));\n textures.add(new TextureHandler(\"Label\" ,\"TextBox.png\",true));\n \n textures.add(new TextureHandler(\"Locked\",\"levels/Locked.png\",false));\n textures.add(new TextureHandler(\"Timer\",\"levels/Clock.png\",false));\n \n textures.add(new TextureHandler(\"PauseSelected\",\"SelectedPause.png\",true));\n textures.add(new TextureHandler(\"LeftSelected\",\"SelectedLeft.png\",true));\n textures.add(new TextureHandler(\"RightSelected\",\"SelectedRight.png\",true));\n textures.add(new TextureHandler(\"RotateSelected\",\"SelectedRotate.png\",true));\n \n textures.add(new TextureHandler(\"Background\",\"Background.png\",false));\n textures.add(new TextureHandler(\"Title\",\"MainMenuTitle.png\",false));\n\n }", "private void loadTextures() {\r\n int[] imgData;\r\n int width;\r\n int height;\r\n\r\n BitmapFactory.Options options = new BitmapFactory.Options();\r\n //圖片質量,數字越大越差\r\n options.inSampleSize = 1;\r\n Bitmap bitmap = BitmapFactory.decodeByteArray(path, 0, path.length, options);\r\n width = bitmap.getWidth();\r\n height = bitmap.getHeight();\r\n imgData = new int[width * height * 4];\r\n bitmap.getPixels(imgData, 0, width, 0, 0, width, height);\r\n bitmap.recycle();\r\n System.gc();\r\n\r\n mTextures.add(Texture.loadTextureFromIntBuffer(imgData, width, height));\r\n }", "@Override\n\tpublic void loadStateImages() {\n\t\tif (imageFilename[0][0] != null)\n\t\t\tthis.addStateImage(imageFilename[0][0], 0, 0);\n\t\tif (imageFilename[0][1] != null)\n\t\t\tthis.addStateImage(imageFilename[0][1], 1, 0);\n\t\tif (imageFilename[1][0] != null)\n\t\t\tthis.addStateImage(imageFilename[1][0], 0, 1);\n\t\tif (imageFilename[1][1] != null)\n\t\t\tthis.addStateImage(imageFilename[1][1], 1, 1);\n\t}", "private void loadMap(ArrayList<Sprite> allSprites) {\n\t\tint numTargets = 0;\n\t\t\n\t\tfor (Sprite thisSprite : allSprites) {\n\t\t\tif(!(thisSprite instanceof Explosion)) {\n\t\t\t\tputInCell(thisSprite.getX(), thisSprite.getY(), thisSprite);\n\t\t\t}\n\t\t\tif (thisSprite instanceof Target) {\n\t\t\t\tnumTargets++;\n\t\t\t}\n\t\t\tif(thisSprite instanceof Door) {\n\t\t\t\tthis.theDoor = (Door)thisSprite;\n\t\t\t}\n\t\t\tif(thisSprite instanceof Player) {\n\t\t\t\tthis.thePlayer = (Player)thisSprite;\n\t\t\t}\n\t\t}\n\t\tthis.numTargets = numTargets;\n\t}", "public HashMap<String, InputStream> getSprites() {\n\t\treturn getFilesByPath(simulationConfig.getString(\"spritepath\"));\n\t}", "private void initTextures() {\n\n\t\ttextureManager.loadTexture(\"PNG\", \"menu_bg\", \"res/menu_bg.png\");\n\t\ttextureManager.loadTexture(\"PNG\", \"mountain_bg\", \"res/mountain_bg.png\");\n\t\ttextureManager.loadTexture(\"PNG\", \"ball\", \"res/ball_sm.png\");\n\t\ttextureManager.loadTexture(\"PNG\", \"inner_bg1\", \"res/inner_bg1.png\");\r\n\t\ttextureManager.loadSheet(\"stand_still\", \"res/stand_still.png\", 32, 64);\n\t\ttextureManager.loadSheet(\"testAnim\", \"res/testAnim.png\", 32, 64);\n\t\ttextureManager.loadSheet(\"tileSet\", \"res/tileset_small.png\", 32, 32);\n\t\ttextureManager.loadSheet(\"walking\", \"res/walking.png\", 32, 64);\r\n\t\ttextureManager.loadSheet(\"jumping\", \"res/jumping.png\", 32, 64);\n\t\ttextureManager.loadSheet(\"slime_still\", \"res/slime_still_small.png\", 32, 32);\n\t}", "public BufferedImage loadImage(String path){\n\t\ttry {\n\t\t\timage = ImageIO.read(getClass().getResource(path));\n\t\t\tSystem.out.println(\"Sprite Sheet Loaded\");\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Image file not found\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn image;\n\t}", "private void initImages() throws SlickException {\n\t\t// laser images\n\t\tlaserbeamimageN = new Image(\"resources/images_Gameplay/laserBeam_Norm.png\");\n\t\tlaserbeamimageA = new Image(\"resources/images_Gameplay/laserBeam_Add.png\");\n\t\tlasertipimageN = new Image(\"resources/images_Gameplay/laserTip_Norm.png\");\n\t\tlasertipimageA = new Image(\"resources/images_Gameplay/laserTip_Add.png\");\n\t}", "public void loadImage() {\r\n // creates a new image icon with the characters array and the count as a file path\r\n ImageIcon ii = new ImageIcon(game.characters[count]);\r\n // load the image\r\n image = ii.getImage(); \r\n \r\n // sets width\r\n w = image.getWidth(null);\r\n // sets height\r\n h = image.getHeight(null);\r\n }", "private void loadAssets()\n {\n assetManager.setErrorListener(this);\n // load texture atlas\n assetManager.load(Constants.TEXTURE_ATLAS_OBJECTS, TextureAtlas.class);\n // start loading assets and wait until finished\n assetManager.finishLoading();\n\n // load texture atlas\n assetManager.load(Constants.TEXTURE_ATLAS_OBJECTS_02, TextureAtlas.class);\n // start loading assets and wait until finished\n assetManager.finishLoading();\n\n // Load strings resource file\n assetManager.load(Constants.I18N_BUNDLE, I18NBundle.class);\n // start loading assets and wait until finished\n assetManager.finishLoading();\n\n Gdx.app.debug(TAG, \"# of assets loaded: \" + assetManager.getAssetNames().size);\n }", "@Override\n\tpublic void loadUnits() {\n\t\tsprites.put(\"axeman\", RES.getSprite(\"axeman\"));\n\t\tsprites.put(\"warg\", RES.getSprite(\"warg_right\"));\n\t}", "private void loadTextures() {\n\t\tspriteSheet01 = new Texture(\"data/buttonsspritesheet02.png\");\n\n\t\tnew TextureRegion(spriteSheet01, BROKEN_COLUMN * SQUARE_SIZE,\n\t\t\t\tBROKEN_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, EMPTY_BUTTON_COLUMN * SQUARE_SIZE,\n\t\t\t\tEMPTY_BUTTON_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, ACTIVATED_COLUMN * SQUARE_SIZE,\n\t\t\t\tSPECIALS_ROW_TWO * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, DEPRESSED_BUTTON * SQUARE_SIZE,\n\t\t\t\tSPECIALS_ROW_TWO * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, HIGHLIGHTED_COLUMN * SQUARE_SIZE,\n\t\t\t\tSPECIALS_ROW_TWO * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, CAROUSEL_COLUMN * SQUARE_SIZE,\n\t\t\t\t(CAROUSEL_ROW * SQUARE_SIZE) + CAROUSEL_PIXELS, SQUARE_SIZE,\n\t\t\t\tCAROUSEL_PIXELS);\n\n\t\tnew TextureRegion(spriteSheet01, FIX_BUTTON_COLUMN * SQUARE_SIZE,\n\t\t\t\tFIX_BUTTON_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, WILD_BUTTON_COLUMN * SQUARE_SIZE,\n\t\t\t\tWILD_BUTTON_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tcarousel = new TextureRegion[MAIN_COLOUR_AMOUNT];\n\t\tfor (int i = 0; i < MAIN_COLOUR_AMOUNT; i++) {\n\t\t\tcarousel[i] = new TextureRegion(spriteSheet01,\n\t\t\t\t\t(CAROUSEL_COLUMN * SQUARE_SIZE) + (i * CAROUSEL_PIXELS),\n\t\t\t\t\tCAROUSEL_ROW * SQUARE_SIZE, CAROUSEL_PIXELS,\n\t\t\t\t\tCAROUSEL_PIXELS);\n\t\t}\n\n\t\trings = new TextureRegion[RING_AMOUNT];\n\t\tfor (int i = 0; i < RING_AMOUNT; i++) {\n\t\t\trings[i] = new TextureRegion(spriteSheet01, i * SQUARE_SIZE,\n\t\t\t\t\tRING_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\t\t}\n\n\t\tmainColour = new TextureRegion[MAIN_COLOUR_AMOUNT];\n\t\tfor (int i = 0; i < MAIN_COLOUR_AMOUNT; i++) {\n\t\t\tmainColour[i] = new TextureRegion(spriteSheet01,\n\t\t\t\t\t(i + MAIN_COLOUR_COLUMN) * SQUARE_SIZE, MAIN_COLOUR_ROW,\n\t\t\t\t\tSQUARE_SIZE, SQUARE_SIZE);\n\t\t}\n\n\t\tspecials = new TextureRegion[SPECIALS_AMOUNT];\n\t\tfor (int i = 0; i < SPECIALS_ROW_ONE_AMOUNT; i++) {\n\t\t\tspecials[i] = new TextureRegion(spriteSheet01, i * SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\t\t}\n\t\tfor (int i = SPECIALS_ROW_ONE_AMOUNT; i < SPECIALS_AMOUNT; i++) {\n\t\t\tspecials[i] = new TextureRegion(spriteSheet01,\n\t\t\t\t\t(i - SPECIALS_ROW_ONE_AMOUNT) * SQUARE_SIZE,\n\t\t\t\t\tSPECIALS_ROW_TWO * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\t\t}\n\n\t\tenemyBaseColours = new TextureRegion[ENEMY_COLOURS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_COLOURS_AMOUNT; i++) {\n\t\t\tenemyBaseColours[i] = new TextureRegion(spriteSheet01, i\n\t\t\t\t\t* SQUARE_SIZE, ENEMY_BASE_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\n\t\tenemyHalfColours = new TextureRegion[ENEMY_COLOURS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_COLOURS_AMOUNT; i++) {\n\t\t\tenemyHalfColours[i] = new TextureRegion(spriteSheet01, i\n\t\t\t\t\t* SQUARE_SIZE, ENEMY_HALF_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\n\t\tenemyThirdColours = new TextureRegion[ENEMY_COLOURS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_COLOURS_AMOUNT; i++) {\n\t\t\tenemyThirdColours[i] = new TextureRegion(spriteSheet01, i\n\t\t\t\t\t* SQUARE_SIZE, ENEMY_THIRD_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\n\t\tenemyRimColours = new TextureRegion[ENEMY_COLOURS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_COLOURS_AMOUNT; i++) {\n\t\t\tenemyRimColours[i] = new TextureRegion(spriteSheet01, i\n\t\t\t\t\t* SQUARE_SIZE, ENEMY_RIM_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\n\t\tenemyConnectors = new TextureRegion[ENEMY_CONNECTORS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_CONNECTORS_AMOUNT; i++) {\n\t\t\tenemyConnectors[i] = new TextureRegion(spriteSheet01,\n\t\t\t\t\t(i + ENEMY_CONNECTORS_COLUMN) * SQUARE_SIZE,\n\t\t\t\t\tENEMY_CONNECTORS_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\t}", "public void initSpriteSheet() {\n\t\tString url = \"https://amiealbrecht.files.wordpress.com/2016/08/set-cards.jpg?w=1250\";\n\n\t\tcimg = loadImage(url, \"png\");\n\t}", "public void loadAllTextures()\n {\n int numChildren = androidRobot3DObject.numChildren();\n for(int i = 0;i<numChildren;i++)\n {\n String name = androidRobot3DObject.getChildAt(i).name();\n\n Log.d(\"min3d\", \"Texture name: \" + name);\n\n // The name is either extracted from the _mtl file\n // or directly from the *.3ds file\n // The name can be given directly into Blender\n if(name.indexOf(\"body\")!=-1)\n {\n androidRobot3DObject.getChildAt(i).textures().clear();\n androidRobot3DObject.getChildAt(i).textures().addById(\"squared_robot_body\");\n }\n\n if(name.indexOf(\"head\")!=-1)\n {\n androidRobot3DObject.getChildAt(i).textures().clear();\n androidRobot3DObject.getChildAt(i).textures().addById(\"squared_robot_head\");\n }\n\n if(name.indexOf(\"foot\")!=-1)\n {\n androidRobot3DObject.getChildAt(i).textures().clear();\n androidRobot3DObject.getChildAt(i).textures().addById(\"squared_robot_foot\");\n }\n\n\n if(name.indexOf(\"arm\")!=-1)\n {\n androidRobot3DObject.getChildAt(i).textures().clear();\n androidRobot3DObject.getChildAt(i).textures().addById(\"squared_robot_arm\");\n }\n\n if(name.indexOf(\"antenna\")!=-1)\n {\n androidRobot3DObject.getChildAt(i).textures().clear();\n androidRobot3DObject.getChildAt(i).textures().addById(\"squared_robot_antenna\");\n }\n }\n\n }", "public void picLoader() {\n if (num==0){\n image.setImageResource(R.drawable.mario);\n }\n if(num==1){\n image.setImageResource(R.drawable.luigi);\n }\n if(num==2){\n image.setImageResource(R.drawable.peach);\n }\n if(num==3){\n image.setImageResource(R.drawable.rosalina);\n }\n }", "private void loadTextures() {\n textureIdMap.keySet().forEach((i) -> {\n //for (int i = 0; i < textureFileNames.length; i++) {\n try {\n URL textureURL;\n textureURL = getClass().getClassLoader().getResource(textureIdMap.get(i));\n if (textureURL != null) {\n BufferedImage img = ImageIO.read(textureURL);\n ImageUtil.flipImageVertically(img);\n Texture temp = AWTTextureIO.newTexture(GLProfile.getDefault(), img, true);\n temp.setTexParameteri(gl, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE);\n temp.setTexParameteri(gl, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE);\n textures.put(i, temp);\n }\n } catch (IOException | GLException e) {\n e.printStackTrace();\n }\n });\n textures.get(0).enable(gl);\n }", "public void loadTextures(){\n switch (playerCarColor){\n case \"Black\":\n playerTexture = new Texture(Gdx.files.internal(\"images/playerCarBlack.png\"));\n fadedPlayerTexture = new Texture(Gdx.files.internal(\"images/playerCarBlackFaded.png\"));\n break;\n case \"White\":\n playerTexture = new Texture(Gdx.files.internal(\"images/playerCarWhite.png\"));\n fadedPlayerTexture = new Texture(Gdx.files.internal(\"images/playerCarWhiteFaded.png\"));\n break;\n }\n\n enemyPistolTexture = new Texture(Gdx.files.internal(\"images/enemyPistol.png\"));\n enemyAWPTexture = new Texture(Gdx.files.internal(\"images/enemyAWP.png\"));\n enemyStalkerTexture = new Texture(Gdx.files.internal(\"images/enemyStalker.png\"));\n bulletTexture = new Texture(Gdx.files.internal(\"images/bullet.png\"));\n enemyBossTexture = new Texture(Gdx.files.internal(\"images/enemyBoss.png\"));\n }", "private void buildSprites() {\n\t\tSpriteRotatable sprite = new SpriteRotatable(new Vec2f(0, 0), 1);\n\t\tsprite.setCentered(true);\n\t\tspriteManager.addSprite(sprite, \"avenger.png\");\n\t\tsprite.setVisible(true);\n\t\ttarget = new SpriteRotatable(new Vec2f(2, 2), 1);\n\t\ttarget.setCentered(true);\n\t\tspriteManager.addSprite(target, \"fighter.png\");\n\t\ttarget.setVisible(true);\n\n\t}", "public void preLoadContent(AssetManager manager) {\n\t\tif (worldAssetState != AssetState.EMPTY) {\n\t\t\treturn;\n\t\t}\n\n\t\tworldAssetState = AssetState.LOADING;\n\n\t\tmanager.load(KOI_TEXTURE, Texture.class);\n\t\tassets.add(KOI_TEXTURE);\n\n\t\tmanager.load(ENEMY_TEXTURE, Texture.class);\n\t\tassets.add(ENEMY_TEXTURE);\n\n\t\tmanager.load(LILY_TEXTURE, Texture.class);\n\t\tassets.add(LILY_TEXTURE);\n\t\t\n\t\tmanager.load(LILY_TEXTURE_N, Texture.class);\n\t\tassets.add(LILY_TEXTURE_N);\n\t\t\n\t\tmanager.load(LILY_TEXTURE_S, Texture.class);\n\t\tassets.add(LILY_TEXTURE_S);\n\n\t\tmanager.load(LANTERN_TEXTURE, Texture.class);\n\t\tassets.add(LANTERN_TEXTURE);\n\n\t\tmanager.load(LIGHTING_TEXTURE, Texture.class);\n\t\tassets.add(LIGHTING_TEXTURE);\n\n\t\tmanager.load(SHADOW_TEXTURE, Texture.class);\n\t\tassets.add(SHADOW_TEXTURE);\n\n\t\tmanager.load(GOAL_TEXTURE, Texture.class);\n\t\tassets.add(GOAL_TEXTURE);\n\n\t\tmanager.load(EARTH_FILE,Texture.class);\n\t\tassets.add(EARTH_FILE);\n\n\t\tmanager.load(EARTH_FILE_D,Texture.class);\n\t\tassets.add(EARTH_FILE_D);\n\t\tmanager.load(EARTH_FILE_N,Texture.class);\n\t\tassets.add(EARTH_FILE_N);\n\t\tmanager.load(EARTH_FILE_S,Texture.class);\n\t\tassets.add(EARTH_FILE_S);\n\t\tmanager.load(SHORE_FILE,Texture.class);\n\t\tassets.add(SHORE_FILE);\n\n\t\tmanager.load(ROCK_FILE_D,Texture.class);\n\t\tassets.add(ROCK_FILE_D);\n\t\tmanager.load(ROCK_FILE_N,Texture.class);\n\t\tassets.add(ROCK_FILE_N);\n\t\tmanager.load(ROCK_FILE_S,Texture.class);\n\t\tassets.add(ROCK_FILE_S);\n\n\t\tmanager.load(WHIRLPOOL_TEXTURE, Texture.class);\n\t\tassets.add(WHIRLPOOL_TEXTURE);\n\t\t\n\t\tmanager.load(ENERGYBAR_TEXTURE, Texture.class);\n\t\tassets.add(ENERGYBAR_TEXTURE);\n\n\t\tmanager.load(UI_FLOWER, Texture.class);\n\t\tassets.add(UI_FLOWER);\n\n\t\tmanager.load(OVERLAY, Texture.class);\n\t\tassets.add(OVERLAY);\n\n\t\tmanager.load(BACKGROUND_FILE_N, Texture.class);\n\t\tassets.add(BACKGROUND_FILE_N);\n\n\t\tmanager.load(BACKGROUND_FILE_D, Texture.class);\n\t\tassets.add(BACKGROUND_FILE_D);\n\n\t\tmanager.load(BACKGROUND_FILE_S, Texture.class);\n\t\tassets.add(BACKGROUND_FILE_S);\n\t\t\n\t\t\n\n\t\tmanager.load(OVERLAY_FILE, Texture.class);\n\t\tassets.add(OVERLAY_FILE);\n\n\t\tmanager.load(KOI_ARROW, Texture.class);\n\t\tassets.add(KOI_ARROW);\n\t\tmanager.load(WHIRL_ARROW, Texture.class);\n\t\tassets.add(WHIRL_ARROW);\n\t\t\n\t\tmanager.load(TUTORIAL_TEXTURE1, Texture.class);\n\t\tassets.add(TUTORIAL_TEXTURE1);\n\t\tmanager.load(TUTORIAL_TEXTURE2, Texture.class);\n\t\tassets.add(TUTORIAL_TEXTURE2);\n\t\tmanager.load(TUTORIAL_TEXTURE3, Texture.class);\n\t\tassets.add(TUTORIAL_TEXTURE3);\n\t\tmanager.load(TUTORIAL_TEXTURE4, Texture.class);\n\t\tassets.add(TUTORIAL_TEXTURE4);\n\t\tmanager.load(TUTORIAL_TEXTURE5, Texture.class);\n\t\tassets.add(TUTORIAL_TEXTURE5);\n\t\tmanager.load(TUTORIAL_TEXTURE6, Texture.class);\n\t\tassets.add(TUTORIAL_TEXTURE6);\n\t\t\n\t\tmanager.load(HELP_TEXTURE, Texture.class);\n\t\tassets.add(HELP_TEXTURE);\n\t\t\n\n\t\treferenceC.a = 0f;\n\n\t\t// Load the font\n\t\tFreetypeFontLoader.FreeTypeFontLoaderParameter size2Params = new FreetypeFontLoader.FreeTypeFontLoaderParameter();\n\t\tsize2Params.fontFileName = FONT_FILE;\n\t\tsize2Params.fontParameters.size = FONT_SIZE;\n\t\tmanager.load(FONT_FILE, BitmapFont.class, size2Params);\n\t\tassets.add(FONT_FILE);\n\n\t\tFreetypeFontLoader.FreeTypeFontLoaderParameter size3Params = new FreetypeFontLoader.FreeTypeFontLoaderParameter();\n\t\tsize3Params.fontFileName = FONT_FILE2;\n\t\tsize3Params.fontParameters.size = FONT_SIZE2;\n\t\tmanager.load(FONT_FILE2, BitmapFont.class, size3Params);\n\t\tassets.add(FONT_FILE2);\n\t\t\n\t\t\n\t}", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "public Sprite(String pathname) throws IOException {\n\t\tBufferedImage img = ImageIO.read(new File(pathname));\n\t\tint nbcol = img.getWidth() / SPRITE_WIDTH;\n\t\tint nblig = img.getHeight() / SPRITE_HEIGHT;\n\t\tm_length = nblig * nbcol;\n\t\tm_sprites = new BufferedImage[m_length];\n\t\tfor (int i = 0; i < m_length; i++) {\n\t\t\tint x = i % nbcol;\n\t\t\tint y = i / nbcol;\n\t\t\tm_sprites[i] = img.getSubimage(x * SPRITE_WIDTH, y * SPRITE_HEIGHT, SPRITE_WIDTH, SPRITE_HEIGHT);\n\t\t}\n\t}", "public void loadMapTiles(String[] paths) throws FileNotFoundException {\n\t\tthis.paths=paths;\n\t\tfor (int i = 0; i < tileMap.length; i++) {\n\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\n\t\t\t\tif (tileMap[i][j] < 0) {\n\t\t\t\t\ttiles[i][j] = null;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tTile tile = new Tile();\n\t\t\t\ttile.getPosition().setX(j*tileDimensions.getX());\n\t\t\t\ttile.getPosition().setY(i*tileDimensions.getY());\n\t\t\t\ttile.getDimensions().setX(tileDimensions.getX());\n\t\t\t\ttile.getDimensions().setY(tileDimensions.getY());\n\t\t\t\tFileInputStream fin = new FileInputStream(paths[tileMap[i][j]]);\n\t\t\t\tImage img = new Image(fin, tileDimensions.getX(), tileDimensions.getY(), false, false);\n\t\t\t\tSprite sprite = new Sprite(img);\n\t\t\t\ttile.setSprite(sprite);\n\t\t\t\ttiles[i][j] = tile;\n\t\t\t}\n\t\t}\n\t}", "private void addAllDrawables() {\n \t\n \tfor (int i = 0; i < 10; i++) {\n \t\tint res_id = c.getResources().getIdentifier(\"puzzle_\"+i, \"drawable\", c.getPackageName());\n \t\t\n \t\tif (res_id != 0) {\n \t\t\timage_id_array.add(res_id);\n \t\t}\n \t}\n }", "public void gatherAssets(AssetDirectory directory) {\r\n\r\n\t\tassets = directory;\r\n\t\tavatarTexture = new TextureRegion(directory.getEntry(\"platform:Somni_Idle\",Texture.class));\r\n\t\tcombinedTexture = new TextureRegion(directory.getEntry(\"platform:somni_phobia_stand\",Texture.class));\r\n\r\n\t\t// Tiles\r\n\t\tlightTexture = new TextureRegion(directory.getEntry( \"shared:solidCloud_light\", Texture.class ));\r\n\t\tdarkTexture = new TextureRegion(directory.getEntry( \"shared:solidCloud_dark\", Texture.class ));\r\n\t\tallTexture = new TextureRegion(directory.getEntry( \"shared:solidCloud_all\", Texture.class ));\r\n\t\trainLightTexture = new TextureRegion(directory.getEntry( \"shared:rain_cloud_light\", Texture.class ));\r\n\t\trainDarkTexture = new TextureRegion(directory.getEntry( \"shared:rain_cloud_dark\", Texture.class ));\r\n\t\trainAllTexture = new TextureRegion(directory.getEntry( \"shared:rain_cloud_all\", Texture.class ));\r\n\t\tlightningLightTexture = new TextureRegion(directory.getEntry( \"shared:lightning_cloud_light\", Texture.class ));\r\n\t\tlightningDarkTexture = new TextureRegion(directory.getEntry( \"shared:lightning_cloud_dark\", Texture.class ));\r\n\t\tlightningAllTexture = new TextureRegion(directory.getEntry( \"shared:lightning_cloud_all\", Texture.class ));\r\n\t\tcrumbleLightTexture = new TextureRegion(directory.getEntry( \"shared:rain_crumble_light\", Texture.class ));\r\n\t\tcrumbleDarkTexture = new TextureRegion(directory.getEntry( \"shared:rain_crumble_dark\", Texture.class ));\r\n\t\tcrumbleAllTexture = new TextureRegion(directory.getEntry( \"shared:rain_crumble_all\", Texture.class ));\r\n\r\n\t\trainLightTextureReduced = new TextureRegion(directory.getEntry( \"shared:rain_cloud_light_reduced\", Texture.class ));\r\n\t\trainDarkTextureReduced = new TextureRegion(directory.getEntry( \"shared:rain_cloud_dark_reduced\", Texture.class ));\r\n\t\trainAllTextureReduced = new TextureRegion(directory.getEntry( \"shared:rain_cloud_all_reduced\", Texture.class ));\r\n\t\tlightningLightTextureReduced = new TextureRegion(directory.getEntry( \"shared:lightning_cloud_light_reduced\", Texture.class ));\r\n\t\tlightningDarkTextureReduced = new TextureRegion(directory.getEntry( \"shared:lightning_cloud_dark_reduced\", Texture.class ));\r\n\t\tlightningAllTextureReduced = new TextureRegion(directory.getEntry( \"shared:lightning_cloud_all_reduced\", Texture.class ));\r\n\t\tcrumbleLightTextureReduced = new TextureRegion(directory.getEntry( \"shared:rain_crumble_light_reduced\", Texture.class ));\r\n\t\tcrumbleDarkTextureReduced = new TextureRegion(directory.getEntry( \"shared:rain_crumble_dark_reduced\", Texture.class ));\r\n\t\tcrumbleAllTextureReduced = new TextureRegion(directory.getEntry( \"shared:rain_crumble_all_reduced\", Texture.class ));\r\n\r\n\t\t// Tutorial\r\n\t\ttutorial_signs = new TextureRegion[]{\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:camera_pan\", Texture.class)), //0\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:phobia_dash\", Texture.class)), //1\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:phobia_jump\", Texture.class)), //2\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:phobia_propel\", Texture.class)), //3\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:phobia_walk\", Texture.class)), //4\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:somni_dash\", Texture.class)), //5\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:somni_jump\", Texture.class)), //6\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:somni_propel\", Texture.class)), //7\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:somni_walk\", Texture.class)), //8\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:spirit_switch\", Texture.class)), //9\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:spirit_separate\", Texture.class)), //10\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:spirit_unify\", Texture.class)), //11\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:dash_catch\", Texture.class)),\t //12\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"tutorial:propel_dash_vertical\", Texture.class))\t //13\r\n\r\n\t\t};\r\n\r\n\t\t// Base models\r\n\t\tsomniTexture = new TextureRegion(directory.getEntry(\"platform:somni_stand\",Texture.class));\r\n\t\tsomniIdleTexture = new TextureRegion(directory.getEntry(\"platform:Somni_Idle\",Texture.class));\r\n\t\tsomniWalkTexture = new TextureRegion(directory.getEntry(\"platform:somni_walk_cycle\",Texture.class));\r\n\t\tsomniDashSideTexture = new TextureRegion(directory.getEntry(\"platform:Somni_Jump_Dash\",Texture.class));\r\n\t\tsomniDashUpTexture = new TextureRegion(directory.getEntry(\"platform:Somni_Falling\",Texture.class));\r\n\t\tsomniFallTexture = new TextureRegion(directory.getEntry(\"platform:Somni_Falling\", Texture.class));\r\n\r\n\t\tphobiaTexture = new TextureRegion(directory.getEntry(\"platform:phobia_stand\",Texture.class));\r\n\t\tphobiaIdleTexture = new TextureRegion(directory.getEntry(\"platform:Phobia_Idle\",Texture.class));\r\n\t\tphobiaWalkTexture = new TextureRegion(directory.getEntry(\"platform:phobia_walk_cycle\",Texture.class));\r\n\t\tphobiaDashSideTexture = new TextureRegion(directory.getEntry(\"platform:Phobia_Jump_Dash\",Texture.class));\r\n\t\tphobiaDashUpTexture = new TextureRegion(directory.getEntry(\"platform:Phobia_Falling\",Texture.class));\r\n\t\tphobiaFallTexture = new TextureRegion(directory.getEntry(\"platform:Phobia_Falling\", Texture.class));\r\n\r\n\r\n\t\t// Combined models\r\n\t\tsomniPhobiaTexture = new TextureRegion(directory.getEntry(\"platform:somni_phobia_stand\",Texture.class));\r\n\t\tsomniPhobiaWalkTexture = new TextureRegion(directory.getEntry(\"platform:somni_phobia_walk\",Texture.class));\r\n\t\tsomniPhobiaDashSideTexture = new TextureRegion(directory.getEntry(\"platform:somni_phobia_dash_side\",Texture.class));\r\n\t\tsomniPhobiaDashUpTexture = new TextureRegion(directory.getEntry(\"platform:somni_phobia_dash_up\",Texture.class));\r\n\t\tphobiaSomniTexture = new TextureRegion(directory.getEntry(\"platform:phobia_somni_stand\",Texture.class));\r\n\t\tphobiaSomniWalkTexture = new TextureRegion(directory.getEntry(\"platform:phobia_somni_walk\",Texture.class));\r\n\t\tphobiaSomniDashSideTexture = new TextureRegion(directory.getEntry(\"platform:phobia_somni_dash_side\",Texture.class));\r\n\t\tphobiaSomniDashUpTexture = new TextureRegion(directory.getEntry(\"platform:phobia_somni_dash_up\",Texture.class));\r\n\r\n\t\tsomniPhobiaHandsTexture = new TextureRegion(directory.getEntry(\"platform:somni_phobia_hands\",Texture.class));\r\n\t\tphobiaSomniHandsTexture = new TextureRegion(directory.getEntry(\"platform:phobia_somni_hands\",Texture.class));\r\n\t\tblueRingBigTexture = new TextureRegion(directory.getEntry(\"platform:blue_ring_big\",Texture.class));\r\n\t\tyellowRingBigTexture = new TextureRegion(directory.getEntry(\"platform:yellow_ring_big\",Texture.class));\r\n\t\tblueRingSmallTexture = new TextureRegion(directory.getEntry(\"platform:blue_ring_small\",Texture.class));\r\n\t\tyellowRingSmallTexture = new TextureRegion(directory.getEntry(\"platform:yellow_ring_small\",Texture.class));\r\n\t\tsomniHandFrontTexture = new TextureRegion(directory.getEntry(\"platform:somni_hand_front\",Texture.class));\r\n\t\tsomniHandBackTexture = new TextureRegion(directory.getEntry(\"platform:somni_hand_back\",Texture.class));\r\n\t\tphobiaHandFrontTexture = new TextureRegion(directory.getEntry(\"platform:phobia_hand_front\",Texture.class));\r\n\t\tphobiaHandBackTexture = new TextureRegion(directory.getEntry(\"platform:phobia_hand_back\",Texture.class));\r\n\r\n\t\tbackgrounds = new TextureRegion[] {\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_light_forest\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_dark_forest\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_light_gear\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_dark_gear\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_light_dreams\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_dark_dreams\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_light_house\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_dark_house\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_light_statues\", Texture.class)),\r\n\t\t\t\tnew TextureRegion(directory.getEntry(\"platform:background_dark_statues\", Texture.class)),\r\n\r\n\t\t};\r\n\r\n\r\n\t\tTextureRegion [] somnis = {somniIdleTexture,somniWalkTexture,somniDashSideTexture,somniDashUpTexture, somniFallTexture, somniDashUpTexture};\r\n\t\tsomnisTexture = somnis;\r\n\t\tTextureRegion [] phobias = {phobiaIdleTexture,phobiaWalkTexture,phobiaDashSideTexture,phobiaDashUpTexture, phobiaFallTexture, phobiaDashUpTexture};\r\n\t\tphobiasTexture = phobias;\r\n\t\tTextureRegion [] somniphobias = {somniPhobiaTexture,somniPhobiaWalkTexture,somniPhobiaDashSideTexture,somniPhobiaDashUpTexture, somniPhobiaDashUpTexture};\r\n\t\tsomniphobiasTexture = somniphobias;\r\n\t\tTextureRegion [] phobiasomnis = {phobiaSomniTexture,phobiaSomniWalkTexture,phobiaSomniDashSideTexture,phobiaSomniDashUpTexture, phobiaSomniDashUpTexture};\r\n\t\tphobiasomnisTexture = phobiasomnis;\r\n\t\tTextureRegion [] somniHands = {somniHandFrontTexture, somniHandBackTexture, somniPhobiaHandsTexture};\r\n\t\tsomniHandsTextures = somniHands;\r\n\t\tTextureRegion [] phobiaHands = {phobiaHandFrontTexture, phobiaHandBackTexture, phobiaSomniHandsTexture};\r\n\t\tphobiaHandsTextures = phobiaHands;\r\n\r\n\t\tanimationSpeed = new float[]{0.1f, 0.5f, 0.1f, 0.1f, 0.1f, 0.1f};\r\n\t\tframePixelWidth = new double[]{32, 64, 32, 32, 32, 32};\r\n\t\toffsetsX = new float[]{12, 19, 0, 0, 15, 0};\r\n\t\toffsetsY = new float[]{0, 0, 0, 0, 0, 0};\r\n\t\tsecOffsetsX = new float[]{-20, -16, 52, 60, -18, 35, -18};\r\n\t\tsecOffsetsY = new float[]{0, 0, -80, -60, 0, -70, 0};\r\n\t\tthirdOffsetsX = new float[]{0, -18, -22, -22, 0, -22, 10, -15, 0, 0, 5, 0, 0, -20, 0, 0, -2, 0};\r\n\t\tthirdOffsetsY = new float[]{0, 0, 0, 0, 0, 0};\r\n\t\tdashAngles = new float[] {0, 0, -1.55f, 0, 0, 3.14f};\r\n\t\tpropelAngles = new float[] {0, 0, 0, 1.55f, 0, -1.55f};\r\n\r\n\r\n\t\t// Setup masking\r\n\t\tcircle_mask = new TextureRegion(directory.getEntry(\"circle_mask\",Texture.class));\r\n\t\tVector2 mask_size = new Vector2(circle_mask.getRegionWidth(), circle_mask.getRegionHeight());\r\n\t\tMIN_MASK_DIMENSIONS = new Vector2(mask_size).scl(mask_shrink_factor);\r\n\t\tmaskWidth = MIN_MASK_DIMENSIONS.x;\r\n\t\tmaskHeight = MIN_MASK_DIMENSIONS.y;\r\n\r\n\t\tsliderBarTexture = directory.getEntry( \"platform:sliderbar\", Texture.class);\r\n\t\tsliderKnobTexture = directory.getEntry( \"platform:sliderknob\", Texture.class);\r\n\r\n\t\tjumpSound = directory.getEntry( \"platform:jump\", SoundBuffer.class );\r\n\t\tfireSound = directory.getEntry( \"platform:pew\", SoundBuffer.class );\r\n\t\tplopSound = directory.getEntry( \"platform:plop\", SoundBuffer.class );\r\n\r\n\t\tconstants = directory.getEntry( \"constants\", JsonValue.class );\r\n\r\n\r\n\r\n\r\n\r\n//Gather sound assets\r\n\t\twinTrack = directory.getEntry(\"winTrack\", SoundBuffer.class);\r\n\t\tSoundController.getInstance().setWinTrack(winTrack);\r\n\r\n\t\tfailTrack = directory.getEntry(\"failTrack\", SoundBuffer.class);\r\n\t\tSoundController.getInstance().setFailTrack(failTrack);\r\n\r\n\r\n\r\n//\t\tsomniTrack = directory.getEntry(\"somniTrack\", SoundBuffer.class);\r\n//\t\tphobiaTrackPath = directory.getEntry(\"phobiaTrack\", SoundBuffer.class);\r\n//\t\tcombinedTrackPath = directory.getEntry(\"combinedTrack\", SoundBuffer.class);\r\n\r\n\r\n//\t\tmenu drawables\r\n\t\torangeUnderline = new TextureRegionDrawable(directory.getEntry(\"pause_menu:pausemenu_underline_red\", Texture.class));\r\n\t\tblueUnderline = new TextureRegionDrawable(directory.getEntry(\"pause_menu:pausemenu_underline\", Texture.class));\r\n\t\tblueRectangle = new TextureRegionDrawable(directory.getEntry(\"pause_menu:bluerectangle\", Texture.class));\r\n\t\tblueExit = new TextureRegionDrawable(directory.getEntry(\"pause_menu:exit_blue\", Texture.class));\r\n\t\tblueResume = new TextureRegionDrawable(directory.getEntry(\"pause_menu:resume_blue\", Texture.class));\r\n\t\tblueRestart = new TextureRegionDrawable(directory.getEntry(\"pause_menu:restart_blue\", Texture.class));\r\n\t\torangeRectangle = new TextureRegionDrawable(directory.getEntry(\"pause_menu:orangerectangle\", Texture.class));\r\n\t\torangeExit = new TextureRegionDrawable(directory.getEntry(\"pause_menu:exit_orange\", Texture.class));\r\n\t\torangeResume = new TextureRegionDrawable(directory.getEntry(\"pause_menu:resume_orange\", Texture.class));\r\n\t\torangeRestart = new TextureRegionDrawable(directory.getEntry(\"pause_menu:restart_orange\", Texture.class));\r\n\t\t//\t\tSliders\r\n\t\torangeSlider = new TextureRegionDrawable(directory.getEntry(\"pause_menu:slider_orange\", Texture.class));\r\n\t\tblueSlider = new TextureRegionDrawable(directory.getEntry(\"pause_menu:slider_blue\", Texture.class));\r\n\t\torangeKnob = new TextureRegionDrawable(directory.getEntry(\"pause_menu:knob_orange\", Texture.class));\r\n\t\tblueKnob = new TextureRegionDrawable(directory.getEntry(\"pause_menu:knob_blue\", Texture.class));\r\n\t\torangeSound = new TextureRegionDrawable(directory.getEntry(\"pause_menu:sound_orange\", Texture.class));\r\n\t\tblueSound = new TextureRegionDrawable(directory.getEntry(\"pause_menu:sound_blue\", Texture.class));\r\n\t\tblueMusicNote = new TextureRegionDrawable(directory.getEntry(\"pause_menu:musicnote_blue\", Texture.class));\r\n\t\torangeMusicNote = new TextureRegionDrawable(directory.getEntry(\"pause_menu:musicnote_orange\", Texture.class));\r\n\r\n\t\tblueNext = new TextureRegionDrawable(directory.getEntry(\"pause_menu:nextblue\", Texture.class));\r\n\t\torangeNext = new TextureRegionDrawable(directory.getEntry(\"pause_menu:nextorange\", Texture.class));\r\n\r\n\t\tbluePauseButton = new TextureRegionDrawable(directory.getEntry(\"pause_menu:pause_button_blue\", Texture.class));\r\n\t\torangePauseButton = new TextureRegionDrawable(directory.getEntry(\"pause_menu:pause_button_red\", Texture.class));\r\n\t\tblurBackground = new TextureRegion(directory.getEntry(\"pause_menu:blur\", Texture.class));\r\n\r\n\r\n\t\tsuper.gatherAssets(directory);\r\n\r\n\r\n\t}", "static void loadCardIcons()\n {\n if(iconsLoaded == false)\n {\n //arrays for suits and ranks\n String[] suits = {\"C\", \"D\", \"H\", \"S\"};\n String[] ranks = {\"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \n \"T\", \"A\", \"J\", \"Q\", \"K\", \"X\"};\n //load iconCards array\n for(int i = 0; i < suits.length; i++)\n {\n for(int k = 0; k < ranks.length; k++)\n {\n iconCards[i][k] = new ImageIcon(\"images/\" + ranks[k] + suits[i] + \".gif\");\n }\n }\n //set iconsLoaded to true\n iconsLoaded = true;\n }\n else //do nothing if icons have already been loaded\n {\n return;\n }\n }", "private void loadImages(File file) {\n\t\timages = new ArrayList<PerceptronImage>();\n\t\ttry {\n\t\t\tScanner scan = new Scanner(file);\n\t\t\twhile (scan.hasNext()) {\n\t\t\t\timages.add(load(scan));\n\t\t\t}\n\t\t\tscan.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void loadGraphics() {\n\t\ttopAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 1024);\r\n\t\ttopRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(topAtlas, activity, \"pizza_top.png\", 0, 0);\r\n\t\ttopAtlas.load();\r\n\t\t\r\n\t\t\r\n\t\tbottomAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 1024);\r\n\t\tbottomRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(bottomAtlas, activity, \"pizza_bottom.png\", 0, 0);\r\n\t\tbottomAtlas.load();\t\r\n\t\t\t\t\t\t\r\n\t\t\r\n\t\tbalanceAtlas = new BuildableBitmapTextureAtlas(engine.getTextureManager(), 1024, 512);\r\n\t\trod = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"baserod.png\");\r\n\t\tbase = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"balancebase.png\");\r\n\t\tbalanceRod = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"balancerod.png\");\r\n\t\tchain = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"chain.png\");\r\n\t\tpan = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"pan.png\");\r\n\t\tok = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"OK.png\");\r\n\t\twinner = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"winner.png\");\r\n\t\ticon = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"icon.png\");\r\n\t\t\r\n\t\tweight = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"w.png\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\tbalanceAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 1));\r\n\t\t} catch (TextureAtlasBuilderException e) {\r\n\t\t\tLog.e(\"PLAYSCENE\", \"ERROR BUILDING BALANCEATLAS\");\r\n\t\t}\r\n\t\tbalanceAtlas.load();\r\n\t\t\r\n\t}", "public static void init()\n {\n \tSpriteSheet sheet = new SpriteSheet(ImageLoader.loadImage(\"/sprites/spritesheet.png\"));\n BufferedImage img;\n /*for(int y = 0;y<4;y++)\n \t{\n \t\t\n \timg = sheet.crop(width*y,0,width,height);\n \t\t\n \t\tplayer.add(img);\n \t}*/\n hero = sheet.crop(0,0,width,height);\n heroUp = sheet.crop(width,0,width,height);\n heroLeft = sheet.crop(width*2,0,width,height);\n heroRight = sheet.crop(width*3,0,width,height);\n \n heroDown1 = sheet.crop(0,height+32,width+1,height);\n heroDown2 = sheet.crop(width+1,height+32,width+1,height);\n heroUp1 = sheet.crop(width*2+2,height+32,width,height);\n heroUp2 = sheet.crop(width*3+2,height+32,width,height);\n heroLeft1 = sheet.crop(width*4+2,height+32,width,height);\n heroLeft2 = sheet.crop(width*5+2,height+32,width,height);\n heroRight1 = sheet.crop(width*6+2,height+32,width,height);\n heroRight2 = sheet.crop(width*7+2,height+32,width,height);\n \n /*for(int i = 0;i<4;i++)\n {\n \tfor(int y = 0;y<4;y++)\n \t{\n \t\tif(y==1)\n \t\t{\n \t\t\timg = sheet.crop(width*y,height*i,width,height);\n \t\t}\n \t\telse\n \t\t{\n \t\t\timg = sheet.crop(width*y+1,height*i+1,width,height);\n \t\t}\n \t\tplayer.add(img);\n \t}\n }*/\n sheet = new SpriteSheet(ImageLoader.loadImage(\"/sprites/PokemonTileSet.png\"));\n for(int i = 0;i<50;i++)\n {\n \tfor(int y = 0;y<8;y++)\n \t{\n \t\timg = sheet.crop(tileW*y,tileH*i,tileW,tileH);\n \t\tassets.add(img);\n \t}\n }\n \n /*\n hero = sheet.crop(0,0,width,height);\n heroUp = sheet.crop(width,0,width,height);\n heroLeft = sheet.crop(width*2,0,width,height);\n heroRight = sheet.crop(width*3,0,width,height);\n \n treeTopLeft = sheet.crop(0,firstRow,tWidth,tHeight);\n treeTopRight = sheet.crop(tWidth,firstRow,tWidth,tHeight);\n treeMidLeft = sheet.crop(tWidth*2,firstRow,tWidth,tHeight);\n treeMidRight = sheet.crop(tWidth*3,firstRow,tWidth,tHeight);\n treeBotLeft = sheet.crop(tWidth*4,firstRow,tWidth,tHeight);\n treeBotRight = sheet.crop(tWidth*5,firstRow,tWidth,tHeight);\n treeTopLeftGrass = sheet.crop(tWidth*6,firstRow,tWidth,tHeight);\n treeTopRightGrass = sheet.crop(tWidth*7,firstRow,tWidth,tHeight);\n treeTopLeftMushroom = sheet.crop(tWidth*8,firstRow,tWidth,tHeight);\n grass = sheet.crop(tWidth*9,firstRow,tWidth,tHeight);\n \n wildGrass = sheet.crop(0,secondRow,tWidth,tHeight);\n mushroom = sheet.crop(tWidth,secondRow,tWidth,tHeight);\n logLeft = sheet.crop(tWidth*2,secondRow,tWidth,tHeight);\n logRight = sheet.crop(tWidth*3,secondRow,tWidth,tHeight);\n ledgeLeft = sheet.crop(tWidth*4,secondRow,tWidth,tHeight);\n ledgeMid = sheet.crop(tWidth*5,secondRow,tWidth,tHeight);\n ledgeRight = sheet.crop(tWidth*6,secondRow,tWidth,tHeight);\n treeLeftOverlap = sheet.crop(tWidth*7,secondRow,tWidth,tHeight);\n treeRightOverlap = sheet.crop(tWidth*8,secondRow,tWidth,tHeight);\n \n heroWalkingDown1 = sheet.crop(0,thirdRow,width+1,height);\n heroWalkingDown2 = sheet.crop(width+1,thirdRow,width+1,height);\n heroWalkingUp1 = sheet.crop(width*2+1,thirdRow,width,height);\n heroWalkingUp2 = sheet.crop(width*3+1,thirdRow,width,height);\n heroWalkingLeft1 = sheet.crop(width*4+1,thirdRow,width,height);\n heroWalkingLeft2 = sheet.crop(width*5+1,thirdRow,width,height);\n heroWalkingRight1 = sheet.crop(width*6+1,thirdRow,width,height);\n heroWalkingRight2 = sheet.crop(width*7+1,thirdRow,width,height);\n */\n }", "private void graphicsLoader() {\n\t\tff2Logo = new Texture(Gdx.files.internal(uiName + \"/ff2logo.png\"));\n\t\tff2LogoHit = new Texture(Gdx.files.internal(uiName + \"/ff2logohit.png\"));\n\t\tplayerword = new Texture(Gdx.files.internal(uiName + \"/playerword.png\"));\n\t\tplayerwordHit = new Texture(Gdx.files.internal(uiName + \"/playerwordhit.png\"));\n\t\tturretword = new Texture(Gdx.files.internal(uiName + \"/turretword.png\"));\n\t\tturretwordHit = new Texture(Gdx.files.internal(uiName + \"/turretwordhit.png\"));\n\t\tfenceword = new Texture(Gdx.files.internal(uiName + \"/fenceword.png\"));\n\t\tfencewordHit = new Texture(Gdx.files.internal(uiName + \"/fencewordhit.png\"));\n\t\tbarrierword = new Texture(Gdx.files.internal(uiName + \"/barrierword.png\"));\n\t\tbarrierwordHit = new Texture(Gdx.files.internal(uiName + \"/barrierwordhit.png\"));\n\t\tgatewayword = new Texture(Gdx.files.internal(uiName + \"/gatewayword.png\"));\n\t\tgatewaywordHit = new Texture(Gdx.files.internal(uiName + \"/gatewaywordhit.png\"));\n\t\tpowerupword = new Texture(Gdx.files.internal(uiName + \"/powerupword.png\"));\n\t\tpowerupwordHit = new Texture(Gdx.files.internal(uiName + \"/powerupwordhit.png\"));\n\t\tswitchword = new Texture(Gdx.files.internal(uiName + \"/switchword.png\"));\n\t\tswitchwordHit = new Texture(Gdx.files.internal(uiName + \"/switchwordhit.png\"));\n\t\tenemyfighterword = new Texture(Gdx.files.internal(uiName + \"/enemyfighterword.png\"));\n\t\tenemyfighterwordHit = new Texture(Gdx.files.internal(uiName + \"/enemyfighterwordhit.png\"));\n\t\tmineword = new Texture(Gdx.files.internal(uiName + \"/mineword.png\"));\n\t\tminewordHit = new Texture(Gdx.files.internal(uiName + \"/minewordhit.png\"));\n\t\tpushblockword = new Texture(Gdx.files.internal(uiName + \"/pushblockword.png\"));\n\t\tpushblockwordHit = new Texture(Gdx.files.internal(uiName + \"/pushblockwordhit.png\"));\n\t\tbombupword = new Texture(Gdx.files.internal(uiName + \"/bombupword.png\"));\n\t\tbombupwordHit = new Texture(Gdx.files.internal(uiName + \"/bombupwordhit.png\"));\n\t\t\n\t\t// ui\n\t\tsoundonbutton = new Texture(Gdx.files.internal(uiName + \"/soundon.png\"));\n\t\tsoundoffbutton = new Texture(Gdx.files.internal(uiName + \"/soundoff.png\"));\n\t\tcreatebutton = new Texture(Gdx.files.internal(uiName + \"/createbutton.png\"));\n\t\tnocreatebutton = new Texture(Gdx.files.internal(uiName + \"/nocreatebutton.png\"));\n\t\tloaderTexture = new Texture(Gdx.files.internal(uiName + \"/ff2loader.png\"));\n\t\tgameOverTexture = new Texture(Gdx.files.internal(uiName + \"/gameover.png\"));\n\t\tnextFieldTexture = new Texture(Gdx.files.internal(uiName + \"/nextfield.png\"));\n\t\t\n\t\tmenubutton = new Texture(Gdx.files.internal(uiName + \"/menubutton.png\"));\n\t\tnomenubutton = new Texture(Gdx.files.internal(uiName + \"/nomenubutton.png\"));\n\t\tdiffEasyButton = new Texture(Gdx.files.internal(uiName + \"/diffeasybutton.png\"));\n\t\tdiffNormButton = new Texture(Gdx.files.internal(uiName + \"/diffnormbutton.png\"));\n\t\tdiffHardButton = new Texture(Gdx.files.internal(uiName + \"/diffhardbutton.png\"));\n\t\tosdButton = new Texture(Gdx.files.internal(uiName + \"/osdbutton.png\"));\n\t\t\n\t\texoFFfont = new BitmapFont(Gdx.files.internal(uiName + \"/font/exo-ff.fnt\"), true);\n\t\t\n\t\t// creator\n\t\texitbutton = new Texture(Gdx.files.internal(creatorName + \"/exitbutton.png\"));\n\t\tfilebutton = new Texture(Gdx.files.internal(creatorName + \"/filebutton.png\"));\n\t\ttoolsbutton = new Texture(Gdx.files.internal(creatorName + \"/toolsbutton.png\"));\n\t\tnextbutton = new Texture(Gdx.files.internal(creatorName + \"/nextbutton.png\"));\n\t\tprevbutton = new Texture(Gdx.files.internal(creatorName + \"/prevbutton.png\"));\n\t\tdeletebutton = new Texture(Gdx.files.internal(creatorName + \"/deletebutton.png\"));\n\t\tyesbutton = new Texture(Gdx.files.internal(creatorName + \"/yesbutton.png\"));\n\t\tnobutton = new Texture(Gdx.files.internal(creatorName + \"/nobutton.png\"));\n\t\tbuildbutton = new Texture(Gdx.files.internal(creatorName + \"/buildbutton.png\"));\n\t\tprocbutton = new Texture(Gdx.files.internal(creatorName + \"/procbutton.png\"));\n\t\trandbutton = new Texture(Gdx.files.internal(creatorName + \"/randbutton.png\"));\n\t\tgroupsbutton = new Texture(Gdx.files.internal(creatorName + \"/groupsbutton.png\"));\n\t\tarenabutton = new Texture(Gdx.files.internal(creatorName + \"/arenabutton.png\"));\n\t\tfileExitButton = new Texture(Gdx.files.internal(creatorName + \"/fileexitbutton.png\"));\n\t\tfileLoadButton = new Texture(Gdx.files.internal(creatorName + \"/loadbutton.png\"));\n\t\tfileSaveButton = new Texture(Gdx.files.internal(creatorName + \"/savebutton.png\"));\n\t\tfilePlayButton = new Texture(Gdx.files.internal(creatorName + \"/playbutton.png\"));\n\t\tfileNoPlayButton = new Texture(Gdx.files.internal(creatorName + \"/noplaybutton.png\"));\n\t\tfileSendButton = new Texture(Gdx.files.internal(creatorName + \"/sendbutton.png\"));\n\t\ttoasterBack = new Texture(Gdx.files.internal(creatorName + \"/toasterback.png\"));\n\t\twindowBack = new Texture(Gdx.files.internal(creatorName + \"/windowback.png\"));\n\t\temptyCellTexture = new Texture(Gdx.files.internal(creatorName + \"/emptycell.png\"));\n\t\tcreateSplashTexture = new Texture(Gdx.files.internal(creatorName + \"/createsplash.png\"));\n\t\t\n\t\tplayerDef = new Texture(Gdx.files.internal(creatorName + \"/player_def.png\"));\n\t\tgatewayDef = new Texture(Gdx.files.internal(creatorName + \"/gateway_def.png\"));\n\t\tpowerupDef = new Texture(Gdx.files.internal(creatorName + \"/powerup_def.png\"));\n\t\tbombupDef = new Texture(Gdx.files.internal(creatorName + \"/bombup_def.png\"));\n\t\tswitchDef = new Texture(Gdx.files.internal(creatorName + \"/switch_def.png\"));\n\t\tscaffoldDef = new Texture(Gdx.files.internal(creatorName + \"/scaffold_def.png\"));\n\t\tbarrierDef = new Texture(Gdx.files.internal(creatorName + \"/barrier_def.png\"));\n\t\tfenceDef = new Texture(Gdx.files.internal(creatorName + \"/fence_def.png\"));\n\t\tturretDef = new Texture(Gdx.files.internal(creatorName + \"/turret_def.png\"));\n\t\tenemyDef = new Texture(Gdx.files.internal(creatorName + \"/enemy_def.png\"));\n\t\tmineDef = new Texture(Gdx.files.internal(creatorName + \"/mine_def.png\"));\n\t\tpushblockDef = new Texture(Gdx.files.internal(creatorName + \"/pushblock_def.png\"));\n\t\thangerDef = new Texture(Gdx.files.internal(creatorName + \"/hanger_def.png\"));\n\t\t\n\t\tdeleteDef = new Texture(Gdx.files.internal(creatorName + \"/delete_def.png\"));\n\t\tdeleteSel = new Texture(Gdx.files.internal(creatorName + \"/delete_sel.png\"));\n\t\tlockUnlock = new Texture(Gdx.files.internal(creatorName + \"/lock_unlock.png\"));\n\t\tlockLock = new Texture(Gdx.files.internal(creatorName + \"/lock_lock.png\"));\n\t\ttoolSelect = new Texture(Gdx.files.internal(creatorName + \"/toolselect.png\"));\n\t\t\n\t\t// game stuff\n\t\tplayerShipTexture = new Texture(Gdx.files.internal(gameName + \"/player2ship.png\"));\n\t\tplayerShipPowerupTexture = new Texture(Gdx.files.internal(gameName + \"/player2shippowerup.png\"));\n\t\tplayerShipBombupTexture = new Texture(Gdx.files.internal(gameName + \"/player2shipbombup.png\"));\n\t\tenemyShipTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2ship.png\"));\n\t\tenemyShipPowerupTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shippowerup.png\"));\n\t\tenemyShipBombupTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shipbombup.png\"));\n\t\tenemyShipOrderedTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shipordered.png\"));\n\t\tplayerBulletTexture = new Texture(Gdx.files.internal(gameName + \"/playerlaser.png\"));\n\t\tplayerCableTexture = new Texture(Gdx.files.internal(gameName + \"/playercable.png\"));\n\t\tenemyBulletTexture = new Texture(Gdx.files.internal(gameName + \"/enemylaser.png\"));\n\t\tenemyCableTexture = new Texture(Gdx.files.internal(gameName + \"/enemycable.png\"));\n\t\tbombCableTexture = new Texture(Gdx.files.internal(gameName + \"/bombcable.png\"));\n\t\tturretTexture = new Texture(Gdx.files.internal(gameName + \"/turret.png\"));\n\t\tturrethitTexture = new Texture(Gdx.files.internal(gameName + \"/turrethit.png\"));\t\n\t\tfenceTexture = new Texture(Gdx.files.internal(gameName + \"/fence.png\"));\n\t\tfencehitTexture = new Texture(Gdx.files.internal(gameName + \"/fencehit.png\"));\n\t\tbarrierTexture = new Texture(Gdx.files.internal(gameName + \"/barrier.png\"));\n\t\tbarrierhitTexture = new Texture(Gdx.files.internal(gameName + \"/barrierhit.png\"));\n\t\tgatewayonTexture = new Texture(Gdx.files.internal(gameName + \"/gatewayon.png\"));\n\t\tgatewayoffTexture = new Texture(Gdx.files.internal(gameName + \"/gatewayoff.png\"));\n\t\tpowerupTexture = new Texture(Gdx.files.internal(gameName + \"/powerup.png\"));\n\t\tbombupTexture = new Texture(Gdx.files.internal(gameName + \"/bombup.png\"));\n\t\tbombupCharge = new Texture(Gdx.files.internal(gameName + \"/bombupcharge.png\"));\n\t\texplosion = new Texture(Gdx.files.internal(gameName + \"/explosion.png\"));\n\t\tdeath = new Texture(Gdx.files.internal(gameName + \"/death.png\"));\n\t\tpowerupCharge = new Texture(Gdx.files.internal(gameName + \"/powerupcharge.png\"));\n\t\tswitchonTexture = new Texture(Gdx.files.internal(gameName + \"/switchon.png\"));\n\t\tswitchoffTexture = new Texture(Gdx.files.internal(gameName + \"/switchoff.png\"));\n\t\tscaffoldTexture = new Texture(Gdx.files.internal(gameName + \"/scaffold.png\"));\n\t\tmineTexture = new Texture(Gdx.files.internal(gameName + \"/mine.png\"));\n\t\tminehitTexture = new Texture(Gdx.files.internal(gameName + \"/minehit.png\"));\n\t\tmineDebrisTexture = new Texture(Gdx.files.internal(gameName + \"/minedebris.png\"));\n\t\tpushblockTexture = new Texture(Gdx.files.internal(gameName + \"/pushblock.png\"));\n\t\thangerTexture = new Texture(Gdx.files.internal(gameName + \"/hanger.png\"));\n\t\thangerhitTexture = new Texture(Gdx.files.internal(gameName + \"/hangerhit.png\"));\n\t\t// have a catch here for the loaded=true?\n\t\tloaded = true;\n\t}", "private <T> void loadAllFromFolder(String name,Class<T> type){\n\t\tFileHandle dirHandle;\n\t\tif (Gdx.app.getType() == ApplicationType.Desktop) {\n\t\t dirHandle = new FileHandle(\"./bin/\"+name);\n\t\t \n\t\t} else {\n\t\t dirHandle = Gdx.files.internal(name);\n\t\t}\n\t\t \n\t\tfor (FileHandle entry: dirHandle.list()) {\n\t\t assetManager.load(entry.path(),type);\n\t\t}\n\t}", "public void load(String path) {\n try {\n texId = new TextureId(path);\n BufferedImage image = ImageIO.read(new FileInputStream(\"resources\" + texId.getPath()));\n createImage(image);\n } catch (Exception e) {\n e.printStackTrace();\n unload();\n }\n }", "public static void loadTiles() {\n\t\tTILE_SETS.put(\"grass\", TileSet.loadTileSet(\"plains\"));\n\t}", "public static void loadItemTextures() {\n\t\tspriteTItem = ModLoader.addOverride(\"/gui/items.png\",\n\t\t\t\t\"/WirelessSprites/txOn.png\");\n\t\tspriteRItem = ModLoader.addOverride(\"/gui/items.png\",\n\t\t\t\t\"/WirelessSprites/rxOn.png\");\n\t}", "public void createImages(){\r\n\t\ttry {\r\n\t\t\timg_bg = Image.createImage(GAME_BG);\r\n\t\t\timg_backBtn = Image.createImage(BACK_BTN);\r\n\t\t\timg_muteBtn = Image.createImage(MUTE_BTN);\r\n\t\t\timg_resetBtn = Image.createImage(RESET_BTN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "Board() {\n currentlyPlacedShip = null;\n imageMap = new TreeMap<ShipType, Image>();\n fillImageMap();\n try {\n hit = ImageIO.read(getClass().getResource(\"img/hit.gif\"));\n board = ImageIO.read(getClass().getResource(\"img/board.gif\"));\n mishit = ImageIO.read(getClass().getResource(\"img/mishit.gif\"));\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public static void reloadAll(){\n for(TextureHandler t : textures){\n if(t.themed){\n if(!t.theme.equals(preference.theme)){\n Gdx.app.debug(\"Blocktoidz\",\"reloading textures\");\n unloadAll();\n load();\n break;\n }\n }\n }\n }", "private void drawImages() {\n\t\t\r\n\t}", "public void initialiseAvatars() {\n\n\t\timage1 = null;\n\t\timage2 = null;\n\t\timage3 = null;\n\t\timage4 = null;\n\t\timage5 = null;\n\t\timage6 = null;\n\n\t\ttry {\n\t\t\timage1 = new Image(new FileInputStream(\"avatars/avatar1.png\"));\n\t\t\timage2 = new Image(new FileInputStream(\"avatars/avatar2.png\"));\n\t\t\timage3 = new Image(new FileInputStream(\"avatars/avatar3.png\"));\n\t\t\timage4 = new Image(new FileInputStream(\"avatars/avatar4.png\"));\n\t\t\timage5 = new Image(new FileInputStream(\"avatars/avatar5.png\"));\n\t\t\timage6 = new Image(new FileInputStream(\"avatars/avatar6.png\"));\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tav1.setImage(image1);\n\t\tav2.setImage(image2);\n\t\tav3.setImage(image3);\n\t\tav4.setImage(image4);\n\t\tav5.setImage(image5);\n\t\tav6.setImage(image6);\n\n\t}", "public void preload() {\n\t\ttry {\n\t\t\ttexture = TextureLoader.getTexture(\"PNG\",\n\t\t\t\t\tResourceLoader.getResourceAsStream(file));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tloaded = true;\n\t}", "public static BufferedImage loadSpriteSheet(String name) {\n\n\t\tBufferedImage sprite = null;\n\n\t\ttry {\n\n\t\t\tsprite = ImageIO\n\t\t\t\t\t.read(new File(System.getProperty(\"user.dir\").replace(\"\\\\\", \"//\") + \"//Assets//\" + name + \".png\"));\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn sprite;\n\t}", "public void cargarHashMap() throws IOException {\r\n\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.BUTTERFLY,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/butterfly.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.AMOEBA,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/amoeba.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.DIAMOND,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/diamond.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.FALLINGDIAMOND,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/diamond.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.WALL,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/wall.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.DIRT,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/dirt.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.EMPTY,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/empty.jpg\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.PLAYER,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/rockford.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.ROCK,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/boulder.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.FALLINGROCK,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/boulder.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.FIREFLY,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/firefly.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.TITANIUM,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/steel.gif\")));\r\n\t\timagenes.put(\r\n\t\t\t\tBDTile.EXIT,\r\n\t\t\t\ttoolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t\t.getResource(\"resources/exit.gif\")));\r\n\t\t//imagenes.put(\r\n\t\t\t//\tBDTile.EXPLOSION,\r\n\t\t\t\t//toolkit.getImage(this.getClass().getClassLoader()\r\n\t\t\t\t\t//\t.getResource(\"resources/explosion.gif\")));\r\n\r\n\t}", "public static void load(Resources resources) {\n mBitmap1 = BitmapFactory.decodeResource(resources, R.mipmap.a);\n mBitmap2 = BitmapFactory.decodeResource(resources, R.mipmap.b);\n mBitmap3 = BitmapFactory.decodeResource(resources, R.mipmap.c);\n mBitmap4 = BitmapFactory.decodeResource(resources, R.mipmap.d);\n mBitmap5 = BitmapFactory.decodeResource(resources, R.mipmap.e);\n mBitmap6 = BitmapFactory.decodeResource(resources, R.mipmap.f);\n\n }", "public void resetSprites() {\n\t\tSPRITE_LIST.clear();\n\t}", "public static void loadFruitPic() {\n //images are from the public domain website: https://www.clipartmax.com/\n Toolkit toolkit = Toolkit.getDefaultToolkit();\n Banana.fruitPic = toolkit.getImage(\"Images/banana.png\");\n Banana.fruitSlice = toolkit.getImage(\"Images/bananaSlice.png\");\n }", "private void setSprite(String filepath){\n try {\n this.sprite = new Sprite(new Texture(Gdx.files.internal(filepath)));\n }\n catch (Exception e){\n }\n }", "private void createCircleImages(){\n offScreenCircles = new Image[8];\n try {\n offScreenCircles[0] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleDown.png\"));\n offScreenCircles[1] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeftDown.png\"));\n offScreenCircles[2] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeft.png\"));\n offScreenCircles[3] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeftUp.png\"));\n offScreenCircles[4] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleUp.png\"));\n offScreenCircles[5] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRightUp.png\"));\n offScreenCircles[6] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRight.png\"));\n offScreenCircles[7] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRightDown.png\"));\n } catch (IOException ex) {\n System.out.println(\"Bild konnte nicht geladen werden!\");\n }\n activeOffScreenCircle = offScreenCircles[0];\n }", "private BufferedImage[] loadImages(String directory, BufferedImage[] img) throws Exception {\n\t\tFile dir = new File(directory);\n\t\tFile[] files = dir.listFiles();\n\t\tArrays.sort(files, (s, t) -> s.getName().compareTo(t.getName()));\n\t\t\n\t\timg = new BufferedImage[files.length];\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\timg[i] = ImageIO.read(files[i]);\n\t\t}\n\t\treturn img;\n\t}", "public void removeSprites(){\r\n\r\n\t}", "public HashMap<String, BufferedImage> getSprites() {\n \t\treturn sprites;\n \t}", "public void createImageSet() {\n\t\t\n\t\t\n\t\tString image_folder = getLevelImagePatternFolder();\n \n String resource = \"0.png\";\n ImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(\"navigable\", ii.getImage());\n\n\t}", "public void load (){\n try{\n FileInputStream fis = new FileInputStream(\"game.data\");\n ObjectInputStream o = new ObjectInputStream(fis);\n for (int i = 0; i < 8; i++){\n for (int j = 0; j < 8; j++){\n String loaded = o.readUTF();\n if (loaded.equals(\"null\")){\n Tiles[i][j].removePiece();\n }else if (loaded.equals(\"WhiteLeftKnight\")){\n Tiles[i][j].setPiece(WhiteLeftKnight);\n }else if (loaded.equals(\"WhiteRightKnight\")){\n Tiles[i][j].setPiece(WhiteRightKnight);\n }else if (loaded.equals(\"WhiteLeftBishop\")){\n Tiles[i][j].setPiece(WhiteLeftBishop);\n }else if (loaded.equals(\"WhiteRightBishop\")){\n Tiles[i][j].setPiece(WhiteRightBishop);\n }else if (loaded.equals(\"WhiteLeftRook\")){\n Tiles[i][j].setPiece(WhiteLeftRook);\n }else if (loaded.equals(\"WhiteRightRook\")){\n Tiles[i][j].setPiece(WhiteRightRook);\n }else if (loaded.equals(\"WhiteQueen\")){\n Tiles[i][j].setPiece(WhiteQueen);\n }else if (loaded.equals(\"WhiteKing\")){\n Tiles[i][j].setPiece(WhiteKing);\n }else if (loaded.equals(\"WhitePromotedRookPawn\")){\n Rook WhitePromotedRookPawn = new Rook(\"WhitePromotedRookPawn\");\n WhitePromotedRookPawn.setIcon(WhiteRookImg);\n Tiles[i][j].setPiece(WhitePromotedRookPawn);\n }else if (loaded.equals(\"WhitePromotedBishopPawn\")){\n Bishop WhitePromotedBishopPawn = new Bishop(\"WhitePromotedBishopPawn\");\n WhitePromotedBishopPawn.setIcon(WhiteBishopImg);\n Tiles[i][j].setPiece(WhitePromotedBishopPawn);\n }else if (loaded.equals(\"WhitePromotedKnightPawn\")){\n Knight WhitePromotedKnightPawn = new Knight(\"WhitePromotedKnightPawn\");\n WhitePromotedKnightPawn.setIcon(WhiteKnightImg);\n Tiles[i][j].setPiece(WhitePromotedKnightPawn);\n }else if (loaded.equals(\"WhitePromotedQueenPawn\")){\n Queen WhitePromotedQueenPawn = new Queen(\"WhitePromotedQueenPawn\");\n WhitePromotedQueenPawn.setIcon(WhiteQueenImg);\n Tiles[i][j].setPiece(WhitePromotedQueenPawn);\n }else if (loaded.equals(\"BlackLeftKnight\")){\n Tiles[i][j].setPiece(BlackLeftKnight);\n }else if (loaded.equals(\"BlackRightKnight\")){\n Tiles[i][j].setPiece(BlackRightKnight);\n }else if (loaded.equals(\"BlackLeftBishop\")){\n Tiles[i][j].setPiece(BlackLeftBishop);\n }else if (loaded.equals(\"BlackRightBishop\")){\n Tiles[i][j].setPiece(BlackRightBishop);\n }else if (loaded.equals(\"BlackLeftRook\")){\n Tiles[i][j].setPiece(BlackLeftRook);\n }else if (loaded.equals(\"BlackRightRook\")){\n Tiles[i][j].setPiece(BlackRightRook);\n }else if (loaded.equals(\"BlackQueen\")){\n Tiles[i][j].setPiece(BlackQueen);\n }else if (loaded.equals(\"BlackKing\")){\n Tiles[i][j].setPiece(BlackKing);\n }else if (loaded.equals(\"BlackPromotedQueenPawn\")){\n Queen BlackPromotedQueenPawn = new Queen(\"BlackPromotedQueenPawn\");\n BlackPromotedQueenPawn.setIcon(BlackQueenImg);\n Tiles[i][j].setPiece(BlackPromotedQueenPawn);\n }else if (loaded.equals(\"BlackPromotedRookPawn\")){\n Rook BlackPromotedRookPawn = new Rook(\"BlackPromotedRookPawn\");\n BlackPromotedRookPawn.setIcon(BlackRookImg);\n Tiles[i][j].setPiece(BlackPromotedRookPawn);\n }else if (loaded.equals(\"BlackPromotedBishopPawn\")){\n Bishop BlackPromotedBishopPawn = new Bishop(\"BlackPromotedBishopPawn\");\n BlackPromotedBishopPawn.setIcon(BlackBishopImg);\n Tiles[i][j].setPiece(BlackPromotedBishopPawn);\n }else if (loaded.equals(\"BlackPromotedKnightPawn\")){\n Knight BlackPromotedKnightPawn = new Knight(\"BlackPromotedKnightPawn\");\n BlackPromotedKnightPawn.setIcon(BlackKnightImg);\n Tiles[i][j].setPiece(BlackPromotedKnightPawn);\n }else if (loaded.equals(\"WhitePawn0\")){\n Tiles[i][j].setPiece(WhitePawns[0]);\n }else if (loaded.equals(\"WhitePawn1\")){\n Tiles[i][j].setPiece(WhitePawns[1]);\n }else if (loaded.equals(\"WhitePawn2\")){\n Tiles[i][j].setPiece(WhitePawns[2]);\n }else if (loaded.equals(\"WhitePawn3\")){\n Tiles[i][j].setPiece(WhitePawns[3]);\n }else if (loaded.equals(\"WhitePawn4\")){\n Tiles[i][j].setPiece(WhitePawns[4]);\n }else if (loaded.equals(\"WhitePawn5\")){\n Tiles[i][j].setPiece(WhitePawns[5]);\n }else if (loaded.equals(\"WhitePawn6\")){\n Tiles[i][j].setPiece(WhitePawns[6]);\n }else if (loaded.equals(\"WhitePawn7\")){\n Tiles[i][j].setPiece(WhitePawns[7]);\n }else if (loaded.equals(\"BlackPawn0\")){\n Tiles[i][j].setPiece(BlackPawns[0]);\n }else if (loaded.equals(\"BlackPawn1\")){\n Tiles[i][j].setPiece(BlackPawns[1]);\n }else if (loaded.equals(\"BlackPawn2\")){\n Tiles[i][j].setPiece(BlackPawns[2]);\n }else if (loaded.equals(\"BlackPawn3\")){\n Tiles[i][j].setPiece(BlackPawns[3]);\n }else if (loaded.equals(\"BlackPawn4\")){\n Tiles[i][j].setPiece(BlackPawns[4]);\n }else if (loaded.equals(\"BlackPawn5\")){\n Tiles[i][j].setPiece(BlackPawns[5]);\n }else if (loaded.equals(\"BlackPawn6\")){\n Tiles[i][j].setPiece(BlackPawns[6]);\n }else if (loaded.equals(\"BlackPawn7\")){\n Tiles[i][j].setPiece(BlackPawns[7]);\n }\n }\n }\n player = o.readInt();\n if (player == 1){\n area.setText(\"\\t\\t\\tPlayer \"+player+\" (White)\");\n }else{\n area.setText(\"\\t\\t\\tPlayer \"+player+\" (Black)\");\n }\n o.close();\n OriginalColor();\n }catch (Exception ex){\n\n }\n }", "public void loadResources();", "private void fillImageMap() {\n Image shipImage;\n try {\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat.png\"));\n imageMap.put(ShipType.PATROL_BOAT, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat_sunken.png\"));\n imageMap.put(ShipType.PATROL_BOAT_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL_SUNKEN, shipImage);\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public void initImages(ArrayList<Produit> l) {\r\n\r\n if (l.size() > 0) {\r\n loadImage1(l.get(0).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 1) {\r\n loadImage2(l.get(1).getImg_url());\r\n }\r\n\r\n if (l.size() > 2) {\r\n loadImage3(l.get(2).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 3) {\r\n loadImage4(l.get(3).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 4) {\r\n loadImage5(l.get(4).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 5) {\r\n loadImage6(l.get(5).getImg_url());\r\n \r\n }\r\n\r\n }", "private void loadImages() {\n\t\t\n\t\tImageView playerImage1;\n\t\tImageView playerImage2;\n Bitmap selectedPicture;\n \n\t\tplayerImage1 = (ImageView)findViewById(R.id.player_image_1);\n\t\tplayerImage2 = (ImageView)findViewById(R.id.player_image_2);\n\t\t\n\t\tif (playerUri1 != null) {\n\t \n\t try {\n\t selectedPicture = MediaStore.Images.Media.getBitmap(\n\tthis.getContentResolver(),playerUri1);\n\t playerImage1.setImageBitmap(selectedPicture);\n\t } catch (Exception e) {\n\t \tLog.e(DISPLAY_SERVICE, \"Pic not displaying\");\n\t \tfinish();\n\t }\n\t\t} else {\n\t\t\tplayerImage1.setImageResource(R.drawable.red);\n\t\t}\n \n\t\tif (playerUri2 != null) {\t \n\t try {\n\t selectedPicture = MediaStore.Images.Media.getBitmap(\n\tthis.getContentResolver(),playerUri2);\n\t playerImage2.setImageBitmap(selectedPicture);\n\t } catch (Exception e) {\n\t \tLog.e(DISPLAY_SERVICE, \"Pic not displaying\");\n\t \tfinish(); \n\t }\n\t\t} else {\n\t\t\tplayerImage2.setImageResource(R.drawable.green);\n\t\t}\n\t}", "private void initResources()\n {\n try\n {\n searchBackgroundImage = ImageIO.read(new File(IMAGES_DIR + \"logo.jpg\"));\n searchIcon = ImageIO.read(new File(IMAGES_DIR + \"search_icon.png\"));\n miniMenuAddImage = ImageIO.read(new File(IMAGES_DIR + \"addSmallIcon.png\"));\n miniMenuRemoveImage = ImageIO.read(new File(IMAGES_DIR + \"removeSmallIcon.png\"));\n updateMiniImage = ImageIO.read(new File(IMAGES_DIR + \"up.png\"));\n playButtonImage = ImageIO.read(new File(IMAGES_DIR + \"play_arrow.png\"));\n stopButtonImage = ImageIO.read(new File(IMAGES_DIR + \"stop_square.png\"));\n openFileImage = ImageIO.read(new File(IMAGES_DIR + \"open_icon.png\"));\n newFileImage = ImageIO.read(new File(IMAGES_DIR + \"new_file.png\"));\n settingsImage = ImageIO.read(new File(IMAGES_DIR + \"settings.png\"));\n spiderImage = ImageIO.read(new File(IMAGES_DIR + \"spider_icon.png\"));\n searchIconDark = ImageIO.read(new File(IMAGES_DIR + \"search_icon_dark.png\"));\n webIconImage = ImageIO.read(new File(IMAGES_DIR + \"web_icon.png\"));\n clipboardImage = ImageIO.read(new File(IMAGES_DIR + \"clipboard.png\"));\n colorIconImage = ImageIO.read(new File(IMAGES_DIR + \"color_icon.png\"));\n transitionSpinnerImage = IMAGES_DIR + \"loading.gif\";\n processingImage = IMAGES_DIR + \"processing.gif\";\n processingMiniImage = IMAGES_DIR + \"spinner.gif\";\n }\n \n catch(IOException e)\n {\n JOptionPane.showMessageDialog(null, \"[Error] Failed to load resource(s)\");\n }\n }", "public void loadContent(){\n\t\tspriteBatch = new SpriteBatch(getGraphicsDevice());\n\t\t//TODO: put content loading code here\n\t\t\n\t}", "@Override\r\n\tpublic void createSprites(World world) {\r\n \t// the height of the map since 0,0 in Tiled is in the top left\r\n // compared to the TiledMap's 0,0 in the bottom left\r\n int height = 2400;\r\n\r\n // file locations of different trees\r\n TextureAtlas atlas = new TextureAtlas(\"Game Tilesets/Trees/Trees.pack\");\r\n Skin skin = new Skin();\r\n skin.addRegions(atlas);\r\n TextureRegion T2 = skin.getRegion(\"T2\");\r\n TextureRegion T3 = skin.getRegion(\"T3\");\r\n TextureRegion T7 = skin.getRegion(\"T7\");\r\n TextureRegion T9 = skin.getRegion(\"T9\");\r\n TextureRegion T10 = skin.getRegion(\"T10\");\r\n \r\n // add all of the trees\r\n \tthis.addSprite(new ObjectSprites(T2, 236, height - 1490));\r\n \r\n this.addSprite(new ObjectSprites(T9, 622, height - 1907));\r\n this.addSprite(new ObjectSprites(T9, 683, height - 1687));\r\n this.addSprite(new ObjectSprites(T9, 174, height - 1851));\r\n this.addSprite(new ObjectSprites(T9, 361, height - 1643));\r\n \r\n this.addSprite(new ObjectSprites(T10, 572, height - 1354));\r\n this.addSprite(new ObjectSprites(T10, 0, height - 1475));\r\n this.addSprite(new ObjectSprites(T10, -9, height - 1707));\r\n this.addSprite(new ObjectSprites(T10, 675, height - 1479));\r\n this.addSprite(new ObjectSprites(T10, 416, height - 1903));\r\n\r\n this.addSprite(new ObjectSprites(T3, 428, height - 1453));\r\n this.addSprite(new ObjectSprites(T3, 596, height - 1122));\r\n this.addSprite(new ObjectSprites(T3, -32, height - 988));\r\n this.addSprite(new ObjectSprites(T3, 476, height - 864));\r\n this.addSprite(new ObjectSprites(T3, 640, height - 725));\r\n this.addSprite(new ObjectSprites(T3, 424, height - 2123));\r\n \r\n this.addSprite(new ObjectSprites(T7, 145, height - 1347));\r\n this.addSprite(new ObjectSprites(T7, 83, height - 1935));\r\n this.addSprite(new ObjectSprites(T7, 585, height - 2031));\r\n this.addSprite(new ObjectSprites(T7, 290, height - 2304));\r\n \r\n Bandit b1 = new Bandit();\r\n b1.defineBody(world, 215, 1305);\r\n super.addSprite(b1);\r\n \r\n Bandit b2 = new Bandit();\r\n b2.defineBody(world, 60, 1445);\r\n super.addSprite(b2);\r\n \r\n Bandit b3 = new Bandit();\r\n b3.defineBody(world, 90, 1640);\r\n super.addSprite(b3);\r\n \r\n Bandit b4 = new Bandit();\r\n b4.defineBody(world, 530, 1740);\r\n super.addSprite(b4);\r\n \r\n Bandit b5 = new Bandit();\r\n b5.defineBody(world, 730, 1655);\r\n super.addSprite(b5);\r\n \r\n Bandit b6 = new Bandit();\r\n b6.defineBody(world, 90, 2235);\r\n super.addSprite(b6);\r\n \r\n Bandit b7 = new Bandit();\r\n b7.defineBody(world, 715, 1490);\r\n super.addSprite(b7);\r\n \r\n Bandit b8 = new Bandit();\r\n b8.defineBody(world, 318, 1605);\r\n super.addSprite(b8);\r\n }" ]
[ "0.7965051", "0.7787473", "0.7733941", "0.7645384", "0.7559833", "0.754288", "0.7454749", "0.74373186", "0.7418593", "0.73960686", "0.73852944", "0.7358035", "0.73379725", "0.73100656", "0.7300563", "0.7283239", "0.72817034", "0.7214118", "0.7108134", "0.6984256", "0.6901343", "0.68894005", "0.68677944", "0.68635505", "0.68582636", "0.68553394", "0.6819346", "0.6817761", "0.6728178", "0.6721301", "0.67139995", "0.67106396", "0.66917396", "0.6685753", "0.6680724", "0.66602075", "0.66250366", "0.6599328", "0.6593298", "0.6588418", "0.6586601", "0.6525392", "0.65217364", "0.64897794", "0.64839923", "0.647088", "0.64639825", "0.6458348", "0.64102304", "0.640274", "0.6395642", "0.6390073", "0.63783747", "0.6359883", "0.63589925", "0.63307893", "0.63249344", "0.62149835", "0.61965704", "0.61907125", "0.61848295", "0.6179304", "0.6175747", "0.61733633", "0.61138576", "0.61015356", "0.60981715", "0.60829365", "0.6077108", "0.6066615", "0.60658497", "0.6061001", "0.60577804", "0.605152", "0.60445267", "0.60412055", "0.6032332", "0.60167664", "0.6016388", "0.6010145", "0.5993003", "0.5989581", "0.5983245", "0.5975424", "0.596736", "0.5949751", "0.5948654", "0.59479666", "0.5945786", "0.5945688", "0.59439737", "0.59376985", "0.59349656", "0.5919762", "0.5913279", "0.5905213", "0.5895229", "0.58836615", "0.5881864", "0.58740306" ]
0.76516956
3
Parses a path into segments Wildcards are not permitted in paths parsed by this method.
public static Object[] parse(final String path) { final boolean allowWildcards = false; return parse(path, allowWildcards); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ArrayList<PathItem> parsePath(String path) {\n\t\tArrayList<PathItem> pathItems = new ArrayList<PathItem>();\n\t\tString[] items = path.split(\"~\\\\\\\\\");\n\t\tString[] item;\n\t\tfor (int i = 0; i < items.length; i++) {\n\t\t\titem = items[i].split(\"~\");\n\t\t\tif (item.length >= 2)\n\t\t\t\tpathItems.add(new PathItem(item[0], item[1]));\n\t\t}\n\t\treturn pathItems;\n\t}", "PathSegments getPath();", "private static final String subPath(String path, int fromSegmentIndex) {\n if (path == null) {\n return null;\n }\n int index = 0;\n int segment = 0;\n while (segment++ < fromSegmentIndex) {\n index = path.indexOf('/', index) + 1;\n if (index <= 0) {\n if (segment == fromSegmentIndex) {\n index = path.length();\n } else {\n throw new IllegalArgumentException(\n \"Path \\\"\" + path + \"\\\" does not contain \" + fromSegmentIndex + \" segments.\");\n }\n }\n }\n return path.substring(index);\n }", "static Set<String> parsePathParameters(String path) {\n Matcher m = PARAM_URL_REGEX.matcher(path);\n Set<String> patterns = new LinkedHashSet<>();\n while (m.find()) {\n patterns.add(m.group(1));\n }\n return patterns;\n }", "public static String[] splitPath(String path){\n if(org.apache.commons.lang3.StringUtils.isEmpty(path)){\n return new String[0];\n }\n\n int first = path.indexOf('.');\n\n if(first >=0 ){\n String firstPart = path.substring(0,first);\n if(path.length() > (first+1)) {\n String restPart = path.substring(first + 1, path.length());\n return new String[]{firstPart,restPart};\n }else{\n return new String[]{firstPart};\n }\n }else{\n return new String[]{path};\n }\n }", "public static List<String> splitPathElements(final String path) {\n final List<String> pathElements = new ArrayList<String>();\n\n if (!isNullOrEmpty(path)) {\n final StringTokenizer tokenizer = new StringTokenizer(path, \"/\");\n\n while (tokenizer.hasMoreTokens()) {\n pathElements.add(tokenizer.nextToken());\n }\n }\n return pathElements;\n }", "@Override\n\tprotected void doParse(String value, ListHandler handler) throws ParseException {\n\n\t\tPathParser pathParser = new PathParser();\n\n\t\tPathSegListBuilder builder = new PathSegListBuilder(handler);\n\n\t\tpathParser.setPathHandler(builder);\n\t\tpathParser.parse(value);\n\n\t}", "private Route append(Map<QualifiedName, PathParamDescriptor> pathParamDescriptors, String path) throws MalformedRouteException\n {\n if (path.length() == 0 || path.charAt(0) != '/')\n {\n throw new MalformedRouteException();\n }\n\n //\n int pos = path.length();\n int level = 0;\n List<Integer> start = new ArrayList<Integer>();\n List<Integer> end = new ArrayList<Integer>();\n for (int i = 1;i < path.length();i++)\n {\n char c = path.charAt(i);\n if (c == '{')\n {\n if (level++ == 0)\n {\n start.add(i);\n }\n }\n else if (c == '}')\n {\n if (--level == 0)\n {\n end.add(i);\n }\n }\n else if (c == '/')\n {\n if (level == 0)\n {\n pos = i;\n break;\n }\n }\n }\n\n //\n Route next;\n if (start.isEmpty())\n {\n String segment = path.substring(1, pos);\n SegmentRoute route = new SegmentRoute(router, segment);\n add(route);\n next = route;\n }\n else\n {\n if (start.size() == end.size())\n {\n PatternBuilder builder = new PatternBuilder();\n builder.expr(\"^\").expr('/');\n List<String> chunks = new ArrayList<String>();\n List<PathParam> parameterPatterns = new ArrayList<PathParam>();\n\n //\n int previous = 1;\n for (int i = 0;i < start.size();i++)\n {\n builder.litteral(path, previous, start.get(i));\n chunks.add(path.substring(previous, start.get(i)));\n String parameterName = path.substring(start.get(i) + 1, end.get(i));\n\n //\n QualifiedName parameterQName = QualifiedName.parse(parameterName);\n\n // Now get path param metadata\n PathParamDescriptor parameterDescriptor = pathParamDescriptors.get(parameterQName);\n\n //\n PathParam param;\n if (parameterDescriptor != null)\n {\n param = PathParam.create(parameterDescriptor, router);\n }\n else\n {\n param = PathParam.create(parameterQName, router);\n }\n\n // Append routing regex to the route regex surrounded by a non capturing regex\n // to isolate routingRegex like a|b or a(.)b\n builder.expr(\"(?:\").expr(param.routingRegex).expr(\")\");\n\n // Add the path param with the rendering regex\n parameterPatterns.add(param);\n previous = end.get(i) + 1;\n }\n\n //\n builder.litteral(path, previous, pos);\n\n // We want to satisfy one of the following conditions\n // - the next char after the matched expression is '/'\n // - the expression matched until the end\n // - the match expression is the '/' expression\n builder.expr(\"(?:(?<=^/)|(?=/)|$)\");\n\n //\n chunks.add(path.substring(previous, pos));\n PatternRoute route = new PatternRoute(router, router.compile(builder.build()), parameterPatterns, chunks);\n\n // Wire\n add(route);\n\n //\n next = route;\n }\n else\n {\n throw new UnsupportedOperationException(\"Report error\");\n }\n }\n\n //\n if (pos < path.length())\n {\n return next.append(pathParamDescriptors, path.substring(pos));\n }\n else\n {\n return next;\n }\n }", "public static void parseFullPath(char[] path, IUriListener listener) {\n UriParser parser = new UriParser(listener);\n parser.parseFullPath(path, 0);\n }", "public static void parseFullPath(String path, IUriListener listener) {\n if (path == null) {\n path = \"\";\n }\n char[] array = path.toCharArray();\n parseFullPath(array, listener);\n }", "public void testUptoSegment() {\n \tIPath anyPath = new Path(\"/first/second/third\");\r\n \r\n \tassertEquals(\"1.0\", Path.EMPTY, anyPath.uptoSegment(0));\r\n \tassertEquals(\"1.1\", new Path(\"/first\"), anyPath.uptoSegment(1));\r\n \tassertEquals(\"1.2\", new Path(\"/first/second\"), anyPath.uptoSegment(2));\r\n \tassertEquals(\"1.3\", new Path(\"/first/second/third\"), anyPath.uptoSegment(3));\r\n \tassertEquals(\"1.4\", new Path(\"/first/second/third\"), anyPath.uptoSegment(4));\r\n \r\n \t//Case 2, absolute path with trailing separator\r\n \tanyPath = new Path(\"/first/second/third/\");\r\n \r\n \tassertEquals(\"2.0\", Path.EMPTY, anyPath.uptoSegment(0));\r\n \tassertEquals(\"2.1\", new Path(\"/first/\"), anyPath.uptoSegment(1));\r\n \tassertEquals(\"2.2\", new Path(\"/first/second/\"), anyPath.uptoSegment(2));\r\n \tassertEquals(\"2.3\", new Path(\"/first/second/third/\"), anyPath.uptoSegment(3));\r\n \tassertEquals(\"2.4\", new Path(\"/first/second/third/\"), anyPath.uptoSegment(4));\r\n }", "public void visitPath(Path path) {\n\t\t\n\t}", "@Override\r\n public List<PathSegment> getPathSegments() {\n return pathSegments;\r\n }", "public static int[] getPathResolved(String path)\n throws NumberFormatException\n {\n try\n {\n // Initialize the token array\n int[] returnArray = new int[0];\n \n // Tokenize the path\n StringTokenizer st = new StringTokenizer(path,\":\");\n \n // Reset the array with the number of tokens\n returnArray = new int[st.countTokens()];\n \n // Save value of each token in the array\n if (st.countTokens() > 0)\n {\n for (int i = 0; i < returnArray.length; i++)\n {\n returnArray[i] = Integer.parseInt\n (st.nextToken().trim());\n }\n }\n \n // Return path array\n return returnArray;\n }\n catch (Exception e)\n {\n // Wrap the exception in a NumberFormatException\n throw new NumberFormatException(e.getMessage());\n }\n }", "@Override\n public DefaultUrlBuilder pathSegment(String thePath) {\n this.pathSegments.add(BaseUrl.UrlEncoder.encodePathSegment(thePath));\n return this;\n }", "com.google.ads.googleads.v6.common.Segments getSegments();", "@Override\r\n public List<PathSegment> getPathSegments(boolean arg0) {\n return pathSegments;\r\n }", "com.google.ads.googleads.v6.common.SegmentsOrBuilder getSegmentsOrBuilder();", "public Path(\n XRISegment... components\n ){\n \tthis(components.length, components);\n }", "public NodeKey parseSegments(String[] segments);", "private static Path speculativeFastParsePath(String path) {\n String s = ConfigImplUtil.unicodeTrim(path);\n if (s.isEmpty())\n return null;\n if (hasUnsafeChars(s))\n return null;\n if (s.startsWith(\".\") || s.endsWith(\".\") || s.contains(\"..\"))\n return null; // let the full parser throw the error\n\n PathBuilder pb = new PathBuilder();\n appendPathString(pb, s);\n return pb.result();\n }", "AssignmentPathSegment getSegment(int index);", "public Path(\n String[] components\n ){\n \tthis(components.length, XRISegment.valueOf(components));\n }", "public interface JsonPath {\n\n JsonPath parent();\n\n Optional<JsonObject> getJsonObject(JsonObject jsonObject);\n\n Optional<JsonArray> getJsonArray(JsonObject jsonObject);\n\n static JsonPath root() {\n return new JsonPathImpl(ImmutableList.of());\n }\n\n boolean isRoot();\n\n JsonPath concat(JsonObjectPathSpecImpl jsonObjectPathSpec);\n\n JsonPath concat(JsonArrayPathSpecImpl jsonArrayPathSpec);\n\n JsonPath concat(JsonPath jsonPath);\n\n List<PathSpec> parts();\n\n JsonPath subpath(int start, int end);\n\n int size();\n\n static JsonPath parse(final String pathStr) {\n\n Objects.requireNonNull(pathStr);\n\n ImmutableList.Builder<PathSpec> listBuilder = ImmutableList.builder();\n\n String[] split = pathStr.split(\"\\\\.\");\n for (int i = 0; i < split.length; i++) {\n String strPart = split[i];\n\n if (strPart.isEmpty()) {\n continue;\n }\n\n int start = strPart.indexOf('[');\n\n if (start > 0) {\n int end = strPart.indexOf(']');\n\n listBuilder.add(\n new JsonArrayPathSpecImpl(\n strPart.substring(0, start),\n Integer.parseInt(strPart.substring(start + 1, end))\n )\n );\n continue;\n }\n\n listBuilder.add(\n new JsonObjectPathSpecImpl(\n strPart\n )\n );\n }\n return new JsonPathImpl(\n listBuilder.build()\n );\n }\n\n static void main(String[] asdf) {\n\n String[] ss = {};\n JsonPath parse = JsonPath.parse(\"departments[0].department.department.employee.departments[0].name\");\n System.out.println(\"path: [\" + parse + \"] size: \" + parse.size());\n }\n}", "private void parseSegment( final String segment )\n throws MalformedURLException\n {\n if( shouldStart() == null && segment.equalsIgnoreCase( ServiceConstants.OPTION_NO_START ) )\n {\n setShouldStart( false );\n return;\n }\n if( shouldUpdate() == null && segment.equalsIgnoreCase( ServiceConstants.OPTION_UPDATE ) )\n {\n setShouldUpdate( true );\n return;\n }\n if( getStartLevel() == null )\n {\n try\n {\n setStartLevel( Integer.parseInt( segment ) );\n return;\n }\n catch( NumberFormatException e )\n {\n throw new MalformedURLException( \"Invalid option [\" + segment + \"]. Syntax \" + SYNTAX );\n }\n }\n throw new MalformedURLException( \"Duplicate option [\" + segment + \"]. Syntax \" + SYNTAX );\n }", "private HashMap<String, String> parsePathType(String path) {\n LOG.debug(\"Path: \" + path);\n Pattern systemPattern = Pattern.compile(\"v[0-9]+/systems/?(\\\\?.*)?$\");\n Matcher systemMatcher = systemPattern.matcher(path);\n\n Pattern systemStatusPattern = Pattern.compile(\"v[0-9]+/systems/status/?(\\\\?.*)?$\");\n Matcher systemStatusMatcher = systemStatusPattern.matcher(path);\n\n Pattern systemReportsPattern = Pattern.compile(\"v[0-9]+/systems/(.*)/reports/?(\\\\?.*)?$\");\n Matcher systemReportsMatcher = systemReportsPattern.matcher(path);\n\n Pattern reportsPattern = Pattern.compile(\"v[0-9]+/reports/?(\\\\?.*)?$\");\n Matcher reportsMatcher = reportsPattern.matcher(path);\n\n Pattern acksPattern = Pattern.compile(\"v[0-9]+/acks/?(\\\\?.*)$\");\n Matcher acksMatcher = acksPattern.matcher(path);\n\n Pattern rulesPattern = Pattern.compile(\"v[0-9]+/rules/?(\\\\?.*)$\");\n Matcher rulesMatcher = rulesPattern.matcher(path);\n\n Pattern uploadsPattern = Pattern.compile(\"uploads(/.*)?(/\\\\?.*)?$\");\n Matcher uploadsMatcher = uploadsPattern.matcher(path);\n\n HashMap<String, String> response = new HashMap<String, String>();\n if (systemMatcher.matches()) {\n response.put(\"type\", Constants.SYSTEMS_PATH);\n response.put(\"index\", Integer.toString(path.indexOf(\"systems\")));\n } else if (systemReportsMatcher.matches()) {\n response.put(\"type\", Constants.SYSTEM_REPORTS_PATH);\n response.put(\"index\", Integer.toString(path.indexOf(\"reports\")));\n String id = (String) systemReportsMatcher.group(1);\n if (id != null) {\n response.put(\"id\", id);\n }\n } else if (reportsMatcher.matches()) {\n response.put(\"type\", Constants.REPORTS_PATH);\n response.put(\"index\", Integer.toString(path.indexOf(\"reports\")));\n } else if (acksMatcher.matches()) {\n response.put(\"type\", Constants.ACKS_PATH);\n response.put(\"index\", Integer.toString(path.indexOf(\"acks\")));\n } else if (rulesMatcher.matches()) {\n response.put(\"type\", Constants.RULES_PATH);\n response.put(\"index\", Integer.toString(path.indexOf(\"rules\")));\n } else if (uploadsMatcher.matches()) {\n response.put(\"type\", Constants.UPLOADS_PATH);\n response.put(\"index\", Integer.toString(path.indexOf(\"uploads\")));\n } else if (systemStatusMatcher.matches()) {\n response.put(\"type\", Constants.SYSTEMS_STATUS_PATH);\n response.put(\"index\", Integer.toString(path.indexOf(\"systems\")));\n } else {\n response.put(\"type\", \"-1\");\n response.put(\"index\", \"-1\");\n }\n return response;\n }", "public FindSegments() {\n\t\tthis(\"find_segments\", null);\n\t}", "public Path parsePath(final String s) {\n setString(s);\n p = preparePath();\n\n setString(s);\n\n currentX = 0;\n currentY = 0;\n smoothQCenterX = 0;\n smoothQCenterY = 0;\n smoothCCenterX = 0;\n smoothCCenterY = 0;\n\n current = read();\n skipSpaces();\n\n // Multiple coordinate pairs after a moveto\n // are like a moveto followed by lineto\n switch(current) {\n case 'm':\n parsem();\n parsel();\n break;\n case 'M':\n parseM();\n parseL();\n break;\n\tcase -1:\n \t //an empty path is valid.\n \t break; \n default:\n throw new IllegalArgumentException();\n }\n\n loop: for (;;) {\n switch (current) {\n case 0xD:\n case 0xA: \n case 0x20:\n case 0x9:\n current = read();\n break;\n case 'z':\n case 'Z':\n current = read();\n p.close();\n currentX = lastMoveToX;\n currentY = lastMoveToY;\n break;\n case 'm':\n parsem();\n case 'l':\n parsel();\n break;\n case 'M':\n parseM();\n case 'L':\n parseL();\n break;\n case 'h':\n parseh();\n break;\n case 'H':\n parseH();\n break;\n case 'v':\n parsev();\n break;\n case 'V':\n parseV();\n break;\n case 'c':\n parsec();\n break;\n case 'C':\n parseC();\n break;\n case 'q':\n parseq();\n break;\n case 'Q':\n parseQ();\n break;\n case 's':\n parses();\n break;\n case 'S':\n parseS();\n break;\n case 't':\n parset();\n break;\n case 'T':\n parseT();\n break;\n case -1:\n break loop;\n default:\n throw new IllegalArgumentException();\n }\n \n }\n\n skipSpaces();\n if (current != -1) {\n throw new IllegalArgumentException();\n }\n\n return p;\n }", "Set<S> getSegments();", "String getMatchingSegments(Integer pointId);", "public UriSegment(String uriSegment) {\n this.pattern = extractPattern(uriSegment);\n this.paramId = extractParamId();\n this.paramClass = extractParamClass();\n this.paramField = extractParamField();\n this.paramMethod = extractParamMethod();\n this.segments = new HashSet<>();\n }", "public Path(Path parent, String path) {\n this.parts = (parent == null) ? ArrayUtils.EMPTY_STRING_ARRAY : parent.parts;\n path = StringUtils.stripStart(path, \"/\");\n this.index = path.equals(\"\") || path.endsWith(\"/\");\n path = StringUtils.stripEnd(path, \"/\");\n if (!path.equals(\"\")) {\n String[] child = path.split(\"/\");\n String[] res = new String[this.parts.length + child.length];\n for (int i = 0; i < this.parts.length; i ++) {\n res[i] = this.parts[i];\n }\n for (int i = 0; i < child.length; i++) {\n res[this.parts.length + i] = child[i];\n }\n this.parts = res;\n }\n }", "public List<String> paths(String path) throws SystemException;", "Enumeration<String> getEntryPaths(String path) throws IOException;", "private boolean recognizeGesturePath(MotionEvent event, int policyFlags,\n ArrayList<PointF> path) {\n\n if (path.size() == 2) {\n PointF start = path.get(0);\n PointF end = path.get(1);\n\n float dX = end.x - start.x;\n float dY = end.y - start.y;\n int direction = toDirection(dX, dY);\n switch (direction) {\n case LEFT:\n return mListener.onGestureCompleted(AccessibilityService.GESTURE_SWIPE_LEFT);\n case RIGHT:\n return mListener.onGestureCompleted(AccessibilityService.GESTURE_SWIPE_RIGHT);\n case UP:\n return mListener.onGestureCompleted(AccessibilityService.GESTURE_SWIPE_UP);\n case DOWN:\n return mListener.onGestureCompleted(AccessibilityService.GESTURE_SWIPE_DOWN);\n default:\n // Do nothing.\n }\n\n } else if (path.size() == 3) {\n PointF start = path.get(0);\n PointF mid = path.get(1);\n PointF end = path.get(2);\n\n float dX0 = mid.x - start.x;\n float dY0 = mid.y - start.y;\n\n float dX1 = end.x - mid.x;\n float dY1 = end.y - mid.y;\n\n int segmentDirection0 = toDirection(dX0, dY0);\n int segmentDirection1 = toDirection(dX1, dY1);\n int gestureId = DIRECTIONS_TO_GESTURE_ID[segmentDirection0][segmentDirection1];\n return mListener.onGestureCompleted(gestureId);\n }\n // else if (path.size() < 2 || 3 < path.size()) then no gesture recognized.\n return mListener.onGestureCancelled(event, policyFlags);\n }", "public static List<String> getPathParameters(String pathInfo) {\n List<String> pathParams = new ArrayList<>();\n if (pathInfo == null) {\n return pathParams;\n }\n String[] pathParts = pathInfo.split(\"/\");\n for (String pathSegement : pathParts) {\n if (pathSegement.startsWith(\"{\") && pathSegement.endsWith(\"}\")) {\n pathParams.add(pathSegement.substring(1, pathSegement.length() - 1));\n }\n }\n return pathParams;\n }", "abstract public List<S> getPath();", "void getSegmentFiles(DataSegment segment, File dir) throws SegmentLoadingException;", "private void initializePath(String p_uriSpec, int p_nStartIndex)\n throws MalformedURIException {\n if (p_uriSpec == null) {\n throw new MalformedURIException(\n \"Cannot initialize path from null string!\");\n }\n \n int index = p_nStartIndex;\n int start = p_nStartIndex;\n int end = p_uriSpec.length();\n char testChar = '\\0';\n \n // path - everything up to query string or fragment\n if (start < end) {\n // RFC 2732 only allows '[' and ']' to appear in the opaque part.\n if (getScheme() == null || p_uriSpec.charAt(start) == '/') {\n \n // Scan path.\n // abs_path = \"/\" path_segments\n // rel_path = rel_segment [ abs_path ]\n while (index < end) {\n testChar = p_uriSpec.charAt(index);\n \n // check for valid escape sequence\n if (testChar == '%') {\n if (index+2 >= end ||\n !isHex(p_uriSpec.charAt(index+1)) ||\n !isHex(p_uriSpec.charAt(index+2))) {\n throw new MalformedURIException(\n \"Path contains invalid escape sequence!\");\n }\n index += 2;\n }\n // Path segments cannot contain '[' or ']' since pchar\n // production was not changed by RFC 2732.\n else if (!isPathCharacter(testChar)) {\n if (testChar == '?' || testChar == '#') {\n break;\n }\n throw new MalformedURIException(\n \"Path contains invalid character: \" + testChar);\n }\n ++index;\n }\n }\n else {\n \n // Scan opaque part.\n // opaque_part = uric_no_slash *uric\n while (index < end) {\n testChar = p_uriSpec.charAt(index);\n \n if (testChar == '?' || testChar == '#') {\n break;\n }\n \n // check for valid escape sequence\n if (testChar == '%') {\n if (index+2 >= end ||\n !isHex(p_uriSpec.charAt(index+1)) ||\n !isHex(p_uriSpec.charAt(index+2))) {\n throw new MalformedURIException(\n \"Opaque part contains invalid escape sequence!\");\n }\n index += 2;\n }\n // If the scheme specific part is opaque, it can contain '['\n // and ']'. uric_no_slash wasn't modified by RFC 2732, which\n // I've interpreted as an error in the spec, since the \n // production should be equivalent to (uric - '/'), and uric\n // contains '[' and ']'. - mrglavas\n else if (!isURICharacter(testChar)) {\n throw new MalformedURIException(\n \"Opaque part contains invalid character: \" + testChar);\n }\n ++index;\n }\n }\n }\n m_path = p_uriSpec.substring(start, index);\n \n // query - starts with ? and up to fragment or end\n if (testChar == '?') {\n index++;\n start = index;\n while (index < end) {\n testChar = p_uriSpec.charAt(index);\n if (testChar == '#') {\n break;\n }\n if (testChar == '%') {\n if (index+2 >= end ||\n !isHex(p_uriSpec.charAt(index+1)) ||\n !isHex(p_uriSpec.charAt(index+2))) {\n throw new MalformedURIException(\n \"Query string contains invalid escape sequence!\");\n }\n index += 2;\n }\n else if (!isURICharacter(testChar)) {\n throw new MalformedURIException(\n \"Query string contains invalid character: \" + testChar);\n }\n index++;\n }\n m_queryString = p_uriSpec.substring(start, index);\n }\n \n // fragment - starts with #\n if (testChar == '#') {\n index++;\n start = index;\n while (index < end) {\n testChar = p_uriSpec.charAt(index);\n \n if (testChar == '%') {\n if (index+2 >= end ||\n !isHex(p_uriSpec.charAt(index+1)) ||\n !isHex(p_uriSpec.charAt(index+2))) {\n throw new MalformedURIException(\n \"Fragment contains invalid escape sequence!\");\n }\n index += 2;\n }\n else if (!isURICharacter(testChar)) {\n throw new MalformedURIException(\n \"Fragment contains invalid character: \"+testChar);\n }\n index++;\n }\n m_fragment = p_uriSpec.substring(start, index);\n }\n }", "public static String[] slashPartition(String str) {\n return partition(str, '/');\n }", "@Test\n public void testPathParsing_withAlternateSeparator() {\n PathService windowsPathService = PathServiceTest.fakeWindowsPathService();\n assertEquals(\n windowsPathService.parsePath(\"foo\\\\bar\\\\baz\"), windowsPathService.parsePath(\"foo/bar/baz\"));\n assertEquals(\n windowsPathService.parsePath(\"C:\\\\foo\\\\bar\"), windowsPathService.parsePath(\"C:\\\\foo/bar\"));\n assertEquals(\n windowsPathService.parsePath(\"c:\\\\foo\\\\bar\\\\baz\"),\n windowsPathService.parsePath(\"c:\", \"foo/\", \"bar/baz\"));\n }", "private static List<GenomeSegment> loadSegments() {\n JamLogger.info(\"Loading genome segments...\");\n\n ArrayList<GenomeSegment> segments =\n new ArrayList<GenomeSegment>();\n\n DataReader reader =\n DataReader.open(resolveDefinitionFile(),\n DEFINITION_FILE_COMMENT);\n\n try {\n for (String line : reader)\n segments.add(parseSegment(line));\n }\n finally {\n reader.close();\n }\n\n segments.trimToSize();\n return Collections.unmodifiableList(segments);\n }", "private void parseUrlsPaths(String localPath) {\n String[] pathArray = localPath.split(\"/\");\n // Geometry_305_v6_fb_coupe_frontlightbulb1_a001.b3d.dflr\n this.fileName = pathArray[pathArray.length - 1];\n // /cars/mustang2015/geometry/\n this.subDirectory = localPath.replace(\"/\" + this.fileName, \"\");\n }", "private void processPath(String str) {\r\n if (str.equals(\"\")) {\r\n return;\r\n }\r\n\r\n int id1 = Integer.valueOf(str.split(\"->\")[0].trim());\r\n int id2 = Integer.valueOf(str.split(\"->\")[1].trim());\r\n Node node1 = null;\r\n Node node2 = null;\r\n\r\n // Find node according to its id\r\n for (Node node : NodeSet) {\r\n if (node.getID() == id1) {\r\n node1 = node;\r\n } else if (node.getID() == id2) {\r\n node2 = node;\r\n }\r\n }\r\n\r\n g.add(new Edge(node1, node2));\r\n }", "void path(String path);", "void path(String path);", "public static String[] getDatabaseTableAndPartition(String path) {\n\t\tif(path == null){\n\t\t\treturn null;\n\t\t}\n\t\tif(path.equals(\"/\")){\n\t\t\treturn new String[]{};\n\t\t}else if (path.startsWith(\"/\")) {\n\t\t\treturn path.substring(1).split(\"/\");\n\t\t} else if (path.contains(\"/\")) {\n\t\t\treturn path.split(\"/\");\n\t\t} else {\n\t\t\tString[] paths = new String[] { path };\n\t\t\treturn paths;\n\t\t}\n\t}", "URISegmentWithParameter createURISegmentWithParameter();", "public FindSegments(String alias) {\n\t\tthis(alias, FIND_SEGMENTS);\n\t}", "public static void addPaths(String pathLine) {\n if (pathLine == null || \"\".equals(pathLine)) {\n return;\n }\n try {\n String[] paths = pathLine.split(\"[:;]\");\n for (String path : paths) {\n if (!\"\".equals(path)) {\n addPath(path);\n }\n }\n } catch (MalformedURLException e) {\n System.out.println(\"File not found\");\n } catch (Exception e) {\n System.out.println(\"File not found\");\n }\n }", "public static byte[] preparePath(final byte[] path) {\n String p = MetaData.normPath(string(path));\n if(Strings.endsWith(p, '/')) p = p.substring(0, p.length() - 1);\n return concat(SLASH, token(p));\n }", "String extractPathWithinPattern(String pattern, String path);", "public void setPath(String path)\n {\n try\n {\n // Tokenize the path\n pathArray = getPathResolved(path);\n \n // Set path property\n this.path = path;\n }\n catch (NumberFormatException nfe)\n {\n // Reset path property\n this.path = \"\";\n }\n }", "public AParser(String RootPath) {\n\t\tthis.mngr = new AFileManager(RootPath, true);\n\t\tthis.parrsedArray = new ArrayList<String>();\n\t}", "public String[] separatePathName(String path) {\r\n // check if this is the path to the root\r\n if (path.equals(\"/\")) {\r\n return new String[]{\"/\", \"\"};\r\n }\r\n String name, parentPath;\r\n int lastSlash = path.lastIndexOf('/');\r\n if (lastSlash == path.length() - 1) {\r\n lastSlash = path.lastIndexOf('/', lastSlash - 1);\r\n }\r\n if (lastSlash == -1) {\r\n // path is relative\r\n name = path;\r\n parentPath = workingDirectory.getData();\r\n } else if (path.charAt(0) == '/') {\r\n // path is absolute\r\n name = path.substring(lastSlash + 1);\r\n parentPath = path.substring(0, lastSlash + 1);\r\n } else {\r\n name = path.substring(lastSlash + 1);\r\n parentPath =\r\n workingDirectory.getData() + path.substring(0, lastSlash + 1);\r\n }\r\n return new String[]{name, parentPath};\r\n }", "public GJGeneralPath2D() {\n\t\tthis.segments = new ArrayList<Segment>();\n\t}", "@Override\r\n\t\tpublic boolean accept(Path path) {\n\t\t\tboolean flag = path.toString().matches(regex);\r\n\t\t\treturn flag;\r\n\t\t}", "protected abstract int[] getPathElements();", "public abstract ScaledPathArray getPathList();", "public Path resolve(String part) {\n return Paths.get(part);\n }", "boolean getPathPatternSupported();", "public void process(Path path, int offset, List<String> groups) {\n String text = \"^\" + path.getName(offset).toString().replace('%', '*') + \"$\";\n Pattern pattern = Pattern.compile(text);\n File folder = ((offset == 0) ? absolutePath : absolutePath.resolve(path.subpath(0, offset))).toFile();\n if (folder.isDirectory()) {\n for (File file : folder.listFiles(new PatternFilter(pattern))) {\n List<String> values = new ArrayList<String>(groups);\n Matcher matcher = pattern.matcher(file.getName());\n if (matcher.find()) {\n for (int index = 0; index < matcher.groupCount(); index++) {\n values.add(matcher.group(index + 1));\n }\n }\n Path newPath =\n (offset == 0) ? Paths.get(file.getName()) : path.subpath(0, offset).resolve(Paths.get(file.getName()));\n if (offset + 1 < path.getNameCount())\n newPath = newPath.resolve(path.subpath(offset + 1, path.getNameCount()));\n\n if (offset + 1 >= path.getNameCount())\n matches.add(new PathMapper(absolutePath, newPath, values));\n else {\n process(newPath, offset + 1, values);\n }\n }\n }\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 }", "protected Path preparePath() {\n int commandCapacity = 0;\n int dataCapacity = 0;\n\n current = read();\n \n while (current != -1) {\n skipCommaSpaces();\n switch (current) {\n case 'z':\n case 'Z':\n commandCapacity++;\n break;\n case 'm':\n case 'l':\n case 'M':\n case 'L':\n case 'h':\n case 'H':\n case 'v':\n case 'V':\n commandCapacity++;\n dataCapacity += 1;\n break;\n case 'c':\n case 'C':\n case 's':\n case 'S':\n commandCapacity++;\n dataCapacity += 3;\n break;\n case 'q':\n case 'Q':\n case 't':\n case 'T':\n commandCapacity++;\n dataCapacity += 2;\n break;\n default:\n break;\n }\n current = read();\n }\n\n return new Path(commandCapacity, dataCapacity);\n }", "public Position.PositionList buildSegment() {\n List<Position> positions = new ArrayList<>(3);\n\n // determine the middle point of the descending segment\n Position middlePos;\n if (startPoint.getElevation() > endPoint.getElevation()) {\n middlePos = new Position(\n Position.interpolateGreatCircle(1 - PATH_INTERPOLATE_AMOUNT, startPoint, endPoint), startPoint.getElevation());\n } else {\n middlePos = new Position(\n Position.interpolateGreatCircle(PATH_INTERPOLATE_AMOUNT, startPoint, endPoint), endPoint.getElevation());\n }\n\n // add the last points\n positions.add(middlePos);\n positions.add(endPoint);\n\n return new Position.PositionList(positions);\n }", "private List<String> processDirectory(Path path) {\n\t\treturn null;\r\n\t}", "public static String[] splitArcName( String pathName )\n \t{\n \t\tString[] res = new String[2];\n \t\tint arcSeparatorPos = pathName.indexOf(ARC_SEPARATOR);\n \t\tif ( arcSeparatorPos>=0 ) {\n \t\t\t// from archive\n \t\t\tres[1] = pathName.substring(0, arcSeparatorPos);\n \t\t\tres[0] = pathName.substring(arcSeparatorPos + ARC_SEPARATOR.length());\n \t\t} else {\n \t\t\tres[0] = pathName;\n \t\t}\n \t\treturn res;\n \t}", "private void parse(String path) {\n dump = new ExternalCSVDump(path, true);\n File folder = new File(path);\n File[] files = folder.listFiles();\n for(File f : files)\n try {\n parseDump(f.getName());\n } catch (IOException e) {\n System.err.println(\"IOException parsing file \" + f.getName());\n }\n }", "URISegment createURISegment();", "String[] getParts();", "Route route(String path);", "@Override\r\n\t\tpublic boolean accept(Path path) {\n\t\t\tboolean flag = path.toString().matches(regex);\r\n\t\t\treturn !flag;\r\n\t\t}", "public List<String> getImagesFromModel(String path) {\n List<String> res = (Arrays.asList(path.split(\",\")));\n res.forEach(x -> x += uploadpath);\n return res;\n }", "public abstract ArrayList<CustomPath> getAnnotationPathList();", "ArrayList<TTC> generateSegments() {\n if ((START_STATION instanceof Station) && (endStation instanceof Station)) {\n ArrayList<TTC> route = TTC.SUBWAY_LIST.get(NUMBER);\n if (route.contains(START_STATION) && route.contains(endStation)) {\n return generateSegmentsHelper(route);\n } else {\n return new ArrayList<>();\n }\n } else {\n ArrayList<TTC> route = TTC.BUS_MAP.get((START_STATION).getNUMBER());\n if (route.contains(START_STATION) && route.contains(endStation)) {\n return generateSegmentsHelper(route);\n } else {\n return new ArrayList<>();\n }\n }\n }", "public pathlist()\r\n {\r\n try{\r\n FileInputStream fstream = new FileInputStream\r\n (\"citiesconnect.txt\");\r\n DataInputStream in = new DataInputStream(fstream);\r\n BufferedReader br = new BufferedReader\r\n (new InputStreamReader(in));\r\n String strLine;\r\n while ((strLine = br.readLine()) != null) {\r\n if(!strLine.equals(\"\")){\r\n String[] str = strLine.split(\":\");\r\n\r\n String [] secondPart = str[1].split(\" - \");\r\n\r\n String [] xCoords = secondPart[1].split(\" , \");\r\n String [] yCoords = secondPart[2].split(\" , \");\r\n\r\n ArrayList<Integer> xIntCoords = \r\n new ArrayList<Integer>(); \r\n for(String x: xCoords){\r\n xIntCoords.add(Integer.parseInt(x));\r\n //System.out.println(x); \r\n }\r\n ArrayList<Integer> yIntCoords = \r\n new ArrayList<Integer>(); \r\n for(String y: yCoords)\r\n yIntCoords.add(Integer.parseInt(y));\r\n\r\n path q = new path(new City(str[0]),new City\r\n (secondPart[0]),xIntCoords,yIntCoords); \r\n paths.add(q);\r\n }\r\n }\r\n in.close();\r\n }\r\n catch (Exception e){\r\n System.err.println(\"Error: \" + e.getMessage());\r\n }\r\n }", "public Path subPath(int pos) {\n int len = Math.max(Math.min(parts.length - pos, parts.length), 0);\n String[] newParts = new String[len];\n for (int i = 0; i < len; i++) {\n newParts[i] = parts[i + pos];\n }\n return new Path(newParts, index || len == 0);\n }", "public abstract List<String> path();", "void addPath(String path) {\n\t\t\tsearchPath.add(path);\n\t\t}", "private TrackSegment readSegment(XmlPullParser parser) throws IOException, XmlPullParserException {\n List<TrackPoint> points = new ArrayList<>();\n parser.require(XmlPullParser.START_TAG, ns, TAG_SEGMENT);\n while (loopMustContinue(parser.next())) {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n continue;\n }\n String name = parser.getName();\n switch (name) {\n case TAG_TRACK_POINT:\n points.add(readTrackPoint(parser));\n break;\n default:\n skip(parser);\n break;\n }\n }\n parser.require(XmlPullParser.END_TAG, ns, TAG_SEGMENT);\n return new TrackSegment.Builder()\n .setTrackPoints(points)\n .build();\n }", "public void parseQuery(String queryString) {\r\n\t\t// call the methods\r\n\t\tgetSplitStrings(queryString);\r\n\t\tgetFile(queryString);\r\n\t\tgetBaseQuery(queryString);\r\n\t\tgetConditionsPartQuery(queryString);\r\n\t\tgetConditions(queryString);\r\n\t\tgetLogicalOperators(queryString);\r\n\t\tgetFields(queryString);\r\n\t\tgetOrderByFields(queryString);\r\n\t\tgetGroupByFields(queryString);\r\n\t\tgetAggregateFunctions(queryString);\r\n\t}", "public final ObservableList<T> getSegments() {\n return segments.get();\n }", "public List<TrackSegment> segments() {\n\t\t\treturn new NonNullList<>(_segments);\n\t\t}", "@Override\n public void visit(P_Mod pathMod) {\n\n if ( pathMod.isZeroOrMore() ) {\n // :p{0,}\n engine.doOneOrMoreN(pathMod.getSubPath(), node, output) ;\n return ;\n }\n if ( pathMod.isOneOrMore() ) {\n engine.doOneOrMoreN(pathMod.getSubPath(), node, output) ;\n return ;\n }\n\n if ( pathMod.isFixedLength() )\n engine.doFixedLengthPath(pathMod.getSubPath(), node, pathMod.getFixedLength(), output) ;\n else\n engine.doMultiLengthPath(pathMod.getSubPath(), node, pathMod.getMin(), pathMod.getMax(), output) ;\n }", "private String normalizePath(String path)\n {\n return path.replaceAll(\"\\\\\\\\{1,}\", \"/\");\n }", "public ResourcePathIterator(String path) {\n\n if (path == null || path.length() == 0) {\n\n // null or empty path, there is nothing to return\n nextPath = null;\n\n } else {\n\n // find last non-slash character\n int i = path.length() - 1;\n while (i >= 0 && path.charAt(i) == '/') {\n i--;\n }\n\n if (i < 0) {\n // only slashes, assume root node\n nextPath = \"/\";\n\n } else if (i < path.length() - 1) {\n // cut off slash\n nextPath = path.substring(0, i + 1);\n\n } else {\n // no trailing slash\n nextPath = path;\n }\n }\n }", "public static boolean isValidCarbideProjectPathSegment(String pathSegment) {\r\n\t\tIWorkspace workspace = ResourcesPlugin.getWorkspace();\r\n\t\tint typeMask = IResource.FILE | IResource.FOLDER;\r\n\t\tboolean valid = pathSegment.length() == 0 || \r\n\t\t\tworkspace.validateName(pathSegment, typeMask).isOK();\r\n\t\tif (valid) {\r\n\t\t\tfor (int i = 0; i < pathSegment.length(); i++) {\r\n\t\t\t\tchar c = pathSegment.charAt(i);\r\n\t\t\t\tvalid = Character.isLetterOrDigit(c) || (c == '-') || (c == '_') || (c == '.');\r\n\t\t\t\tif (!valid)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}", "public void addSegment(PathSegment segment) {\n segments.add(segment);\n }", "public static final String normalizePath(String path) {\n\t\t// Normalize the slashes and add leading slash if necessary\n\t\tString normalized = path;\n\t\tif (normalized.indexOf('\\\\') >= 0) {\n\t\t\tnormalized = normalized.replace('\\\\', '/');\n\t\t}\n\n\t\tif (!normalized.startsWith(\"/\")) {\n\t\t\tnormalized = \"/\" + normalized;\n\t\t}\n\n\t\t// Resolve occurrences of \"//\" in the normalized path\n\t\twhile (true) {\n\t\t\tint index = normalized.indexOf(\"//\");\n\t\t\tif (index < 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnormalized = normalized.substring(0, index)\n\t\t\t\t\t+ normalized.substring(index + 1);\n\t\t}\n\n\t\t// Resolve occurrences of \"%20\" in the normalized path\n\t\twhile (true) {\n\t\t\tint index = normalized.indexOf(\"%20\");\n\t\t\tif (index < 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnormalized = normalized.substring(0, index) + \" \"\n\t\t\t\t\t+ normalized.substring(index + 3);\n\t\t}\n\n\t\t// Resolve occurrences of \"/./\" in the normalized path\n\t\twhile (true) {\n\t\t\tint index = normalized.indexOf(\"/./\");\n\t\t\tif (index < 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnormalized = normalized.substring(0, index)\n\t\t\t\t\t+ normalized.substring(index + 2);\n\t\t}\n\n\t\twhile (true) {\n\t\t\tint index = normalized.indexOf(\"/../\");\n\t\t\tif (index < 0)\n\t\t\t\tbreak;\n\t\t\tif (index == 0) {\n\t\t\t\treturn (null); // Trying to go outside our context\n\t\t\t}\n\t\t\tint index2 = normalized.lastIndexOf('/', index - 1);\n\t\t\tnormalized = normalized.substring(0, index2)\n\t\t\t\t\t+ normalized.substring(index + 3);\n\t\t}\n\n\t\t// Return the normalized path that we have completed\n\t\treturn (normalized);\n\t}", "@SuppressWarnings(\"unused\")\n\tpublic static void main(String[] args) throws URISyntaxException {\n\t\tSystem.out.println(\"Creating \\\"Path\\\" instances:\");\n\t\tSystem.out.println(\" p1 = d:/Temp/E53Z/Archives/\");\n\t\tSystem.out.println(\" p2 = /tmp/foo\");\n\t\tSystem.out.println(\" p3 = file:///Users/joe/FileTest.java\");\n\t\tPath p1 = Paths.get(\"d:/Temp/E53Z/Archives/\");\n\t\tPath p2 = Paths.get(\"/tmp/foo\");\n\t\tPath p3 = Paths.get(URI.create(\"file:///Users/joe/FileTest.java\"));\n\n\t\t/* Retrieving Information about a Path */\n\t\tSystem.out.println(\"\\nRetrieving information about a Path\");\n\t\tSystem.out.format(\" p1.toString: %s%n\", p1.toString() );\n\t\tSystem.out.format(\" p1.getFileName: %s%n\", p1.getFileName() );\n\t\tSystem.out.format(\" p1.getName(0): %s%n\", p1.getName(0) );\n\t\tSystem.out.format(\" p1.getNameCount: %d%n\", p1.getNameCount());\n\t\tSystem.out.format(\" p1.subpath(0,2): %s%n\", p1.subpath(0,2) );\n\t\tSystem.out.format(\" p1.getParent: %s%n\", p1.getParent() );\n\t\tSystem.out.format(\" p1.getRoot: %s%n\", p1.getRoot() );\n\t\t\n\t\t/* Removing Redundancies From a Path */\n\t\tSystem.out.println(\"\\nRemoving redundancies From a Path\");\n\t\tPath p4 = Paths.get(\"/home/sally/../joe/foo\");\n\t\tSystem.out.println(\" Ful path: \" + p4);\n\t\tSystem.out.println(\" Normalized path: \" + p4.normalize());\n\n\t\t/* Converting a Path */\n\t\tSystem.out.println(\"\\nConverting a Path\");\n\t\tPath p5 = Paths.get(\"/Home/logFile/\");\n\t\tSystem.out.println(\" p5.toUri: \" + p5.toUri());\n\t\tSystem.out.println(\" p5.toAbsolutePath: \" + p5.toAbsolutePath());\n\t\ttry {\n\t\t\tSystem.out.println(\" p5.toRealPath: \" + p5.toRealPath(LinkOption.NOFOLLOW_LINKS));\n\t\t} catch (NoSuchFileException x) {\n\t\t System.out.format(\" Exception: p5 = %s: no such\" + \" file or directory%n\", p5);\n\t\t // Logic for case when file doesn't exist.\n\t\t} catch (IOException x) {\n\t\t System.out.format(\" Exception: %s%n\", x);\n\t\t // Logic for other sort of file error.\n\t\t}\n\t\t\n\t\t/* Joining two paths */\n\t\tSystem.out.println(\"\\nJoining two paths\");\n\t\tPath p6 = Paths.get(\"/Home/logFile/\");\n\t\tPath p7 = Paths.get(\"log.txt\");\n\t\tSystem.out.println(\" p6 = \" + p6);\n\t\tSystem.out.println(\" p7 = \" + p7);\n\t\tSystem.out.println(\" p6.resolve(p7) = \" + p6.resolve(p7));\n\t\t\n\t\t/* Creating a path between two paths */\n\t\tSystem.out.println(\"\\nCreating a path between two paths\");\n\t\tPath p8 = Paths.get(\"D:/Home/logFileS/\");\n\t\tPath p9 = Paths.get(\"D:/Home/TextFiles/\");\n\t\tSystem.out.println(\" p8 = \" + p8);\n\t\tSystem.out.println(\" p9 = \" + p9);\n\t\tSystem.out.println(\" p8.relativize(p9) = \" + p8.relativize(p9));\n\t\tSystem.out.println(\" !!! Paths.get(\\\"\\\").toAbsolutePath().toString(); = \" + Paths.get(\"\").toAbsolutePath().toString());\n\t\tSystem.out.println(\" !!! p8.relativize(p9).toAbsolutePath() = \" + p8.relativize(p9).toAbsolutePath());\n\t\t\n\t\t/* Comparing Two Paths */\n\t\tSystem.out.println(\"\\nComparing two paths\");\n\t\tPath p10 = Paths.get(\"D:/Home/logFiles\");\n\t\tPath p11 = Paths.get(\"D:/Home\");\n\t\tPath p12 = Paths.get(\"logFiles\");\n\t\tPath p13 = Paths.get(\"D:/Home/logFiles\");\n\t\tPath p14 = Paths.get(\"D:/Home/TextFiles/../logFiles\");\n\t\tSystem.out.println(\" p10 = \" + p10);\n\t\tSystem.out.println(\" p11 = \" + p11);\n\t\tSystem.out.println(\" p12 = \" + p12);\n\t\tSystem.out.println(\" p13 = \" + p13);\n\t\tSystem.out.println(\" p14 = \" + p14);\n\t\tSystem.out.println(\" p10.equils(p13) = \" + p10.equals(p13));\n\t\tSystem.out.println(\" p10.startsWith(p11) = \" + p10.startsWith(p11));\n\t\tSystem.out.println(\" p10.endsWith(p12) = \" + p10.endsWith(p12));\n\t\tSystem.out.println(\" p10.equils(p14) = \" + p10.equals(p14));\n\t\ttry {\n\t\t\tSystem.out.println(\" Files.isSameFile(p10, p14) = \" + Files.isSameFile(p10, p14)); // It is true if both files(folders) exist.\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t/* Iterating over Path \"p10\") */\n\t\tSystem.out.print(\"\\nIterating over Path \\\"p10\\\"\\n \");\n\t\tfor(Path name: p10){\n\t\t\tSystem.out.print(\"[\" + name + \"]\");\n\t\t}\n\t\t\n\t\t\n\t}", "public String path(String path1, String path2);", "public interface AssignmentPath extends DebugDumpable, ShortDumpable, Cloneable {\n\n\tList<? extends AssignmentPathSegment> getSegments();\n\t\n\t/**\n\t * Returns segment specified by index. Negative indexes work in reverse direction.\n\t * @throws IndexOutOfBoundsException\n\t */\n\tAssignmentPathSegment getSegment(int index);\n\n\tAssignmentPathSegment first();\n\n\tboolean isEmpty();\n\n\tint size();\n\n//\tEvaluationOrder getEvaluationOrder();\n\n\tAssignmentPathSegment last();\n\n\t// beforeLast(0) means last()\n\t// beforeLast(1) means one before last()\n\tAssignmentPathSegment beforeLast(int n);\n\n\tint countTargetOccurrences(ObjectType target);\n\n\t/**\n\t * Returns a \"user understandable\" part of this path. I.e. only those objects that are of \"order 1\" above the focal object.\n\t * E.g. from chain of\n\t *\n\t * jack =(a)=> Engineer =(i)=> Employee =(a)=> PersonMetarole =(i2)=> Person =(i)=> Entity\n\t *\n\t * the result would be\n\t *\n\t * Engineer -> Employee -> Person -> Entity\n\t *\n\t * TODO find a better name\n\t */\n\t@NotNull\n\tList<ObjectType> getFirstOrderChain();\n\t\n\t/**\n\t * In the context of meta-roles this is the role that the currently-processed inducement \"applies to\".\n\t * I.e. the role that would contain this inducement in case that meta-roles were not used.\n\t * Technically, this is the last element in the \"first order chain\" or roles.\n\t * \n\t * Note: proto- is the opposite of meta-\n\t */\n\tObjectType getProtoRole();\n\n\t/**\n\t * Shallow clone.\n\t */\n\tAssignmentPath clone();\n\n\tAssignmentPath cloneFirst(int n);\n\n\tAssignmentPathType toAssignmentPathType(boolean includeAssignmentsContent);\n\n\tExtensionType collectExtensions(int startAt) throws SchemaException;\n\n\tstatic ExtensionType collectExtensions(AssignmentPathType path, int startAt, ModelService modelService, Task task, OperationResult result)\n\t\t\tthrows CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException,\n\t\t\tConfigurationException, ExpressionEvaluationException {\n\t\treturn AssignmentPathUtil.collectExtensions(path, startAt, modelService, task, result);\n\t}\n\t\n\t// Groovy [] operator\n\tdefault AssignmentPathSegment getAt(int index) {\n\t\treturn getSegment(index);\n\t}\n\n\t/**\n\t * Returns true if the path matches specified order constraints. All of them must match.\n\t * Although there are some defaults, it is recommended to specify constraints explicitly.\n\t * Currently not supported on empty paths.\n\t *\n\t * Not all parts of OrderConstraintsType are supported. Namely, resetOrder item has no meaning here.\n\t */\n\tboolean matches(@NotNull List<OrderConstraintsType> orderConstraints);\n\n\t/**\n\t * Preliminary (limited) implementation. To be used to compare paths pointing to the same target object. Use with care.\n\t */\n\tboolean equivalent(AssignmentPath other);\n}", "final public void updatePath(EventPacket<?> in) {\n if (!pathsEnabled) {\n return;\n }\n path.add(new PathPoint(location.x, location.y, in.getLastTimestamp(), numEvents - previousNumEvents));\n previousNumEvents = numEvents;\n if (path.size() > getPathLength()) {\n path.remove(path.get(0));\n }\n updateVelocity();\n }", "@Test\r\n public void testRegexp() throws Exception {\n\r\n String a = \"a/b/100/test\";\r\n\r\n Pattern pattern = Pattern.compile(\".+/(\\\\d+)/test\");\r\n\r\n System.out.println(parseIdFromUriPath(a, pattern));\r\n\r\n }", "private static File parsePath(String path) {\n\t\tpath = (path == null ? \"\" : path.trim());\n\t\tif (path.startsWith(\"file://\")) {\n\t\t\tpath = path.substring(\"file://\".length());\n\t\t} else if (path.startsWith(\"file:\")) { \n\t\t\tpath = path.substring(\"file:\".length());\t\n\t\t}\n\t\t\n\t\tif (path.length() == 0 || path.equals(\".\")) {\n\t\t\tpath = System.getProperty(\"user.dir\", \".\"); // CWD\n\t\t} else {\t\n\t\t\t// convert separators to native format\n\t\t\tpath = path.replace('\\\\', File.separatorChar);\n\t\t\tpath = path.replace('/', File.separatorChar);\n\t\t\t\n\t\t\tif (path.startsWith(\"~\")) {\n\t\t\t\t// substitute Unix style home dir: ~ --> user.home\n\t\t\t\tString home = System.getProperty(\"user.home\", \"~\");\n\t\t\t\tpath = home + path.substring(1);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new File(path);\n\t}", "public List<Tile> getPathSegment() {\n return pathSegment;\n }", "@Override\n public List<MatchSegment> getMatch(final String text)\n {\n final List<String> split = splitNameTypeAndInitialValues(text);\n if (split.size() < 1)\n return List.of();\n\n final List<MatchSegment> segs = new ArrayList<>(split.size());\n\n String name = split.get(0).trim();\n if (name.equals(\"loc://\"))\n { // Just \"loc://\" matches, add \"name\"\n segs.add(MatchSegment.match(name));\n segs.add(MatchSegment.normal(\"name\"));\n }\n else // Show (partial) match between entered name and this proposal\n segs.addAll(super.getMatch(name));\n\n // No type provided?\n if (split.get(1) == null)\n segs.add(MatchSegment.comment(\"<VType>\"));\n else if (type.toLowerCase().indexOf(split.get(1).toLowerCase()) >= 0)\n // Recognize piece of type, accept for full type\n segs.add(MatchSegment.match(\"<\" + type + \">\"));\n else\n // No type entered, would use this proposal's type when accepted\n segs.add(MatchSegment.normal(\"<\" + type + \">\"));\n\n // Add initial values\n final int common = Math.min(split.size()-2, initial_values.length);\n int parm;\n for (parm = 0; parm < common; ++parm)\n {\n final String another = parm < initial_values.length-1 ? \",\" : \")\";\n if (parm == 0)\n segs.add(MatchSegment.match(\"(\" + split.get(parm+2) + another,\n \"(\" + initial_values[parm] + another));\n else\n segs.add(MatchSegment.match(split.get(parm+2) + another,\n initial_values[parm] + another));\n }\n\n // Add remaining init.values as COMMENT\n final StringBuilder buf = new StringBuilder();\n if (parm < initial_values.length)\n {\n if (parm == 0)\n buf.append('(');\n for (/**/; parm<initial_values.length; ++parm)\n {\n buf.append(initial_values[parm]);\n if (parm < initial_values.length-1)\n buf.append(\", \");\n }\n buf.append(')');\n }\n if (buf.length() > 0)\n segs.add(MatchSegment.comment(buf.toString()));\n\n return segs;\n }", "private static void createPath(Path path) {\r\n\t\tString tempStr = \"\";\r\n\t\tint finished = 1;\r\n\t\tint tempId = -1;\r\n\t\tList<GeoCoordinate> polyline = new ArrayList<GeoCoordinate>();\r\n\t\tList<Place> placeList = new ArrayList<Place>();\r\n\t\tContainerNII pathNii = new ContainerNII();\r\n\t\tPlace place;\r\n\t\t\r\n\t\twhile (finished == 1){\r\n\t\t\t\r\n\t\t\tplace = new Place();\r\n\t\t\tcreatePlace(place);\r\n\t\t\tplaceList.add(place);\r\n\t\t\tfinished = checkContinue(\"place\");\r\n\t\t}\r\n\t\tpath.setPlaces(placeList);\r\n\t\t\r\n\t\tif ((tempId = insertInteger(\"path id: \")) != -1)\r\n\t\t\tpath.setId(tempId);\t\r\n\t\t\r\n\t\tinsertNIIValues(pathNii, \"path\");\r\n\t\tpath.setNii(pathNii);\r\n\t\t\r\n\t\tif ((tempStr = insertString(\"path length: \")) != null)\r\n\t\t\tpath.setLength(tempStr);\r\n\t\t\r\n\t\tinsertPolyline(polyline, strPath);\r\n\t\tpath.setPolyline(polyline);\r\n\t\t\r\n\t\tif ((tempStr = insertString(\"path duration: \")) != null)\r\n\t\t\tpath.setDuration(tempStr);\r\n\t\t\r\n\t}", "private void handleSlash() {\n // Single line comment\n if (secondCharIs('/')) {\n // Rune has C-style comments, so goes until end of line\n while ((peek() != '\\n') && !reachedEnd()) {\n advance(); // Keep advancing until newline or EOF, thus ignoring the comment lexeme\n }\n } else if (secondCharIs('*')) {\n // Block comments go until * / is reached\n while (!reachedEnd()) {\n if (peek() == '*' && peekFurther(1) == '/') {\n advance();\n advance();\n return;\n }\n advance();\n }\n } else {\n addToken(SLASH);\n }\n }", "String resolvePath(String root_url, Enumeration path)\n {\n if (! root_url.endsWith(URL_PATH_SEPARATOR))\n root_url = root_url+URL_PATH_SEPARATOR;\n\n StringBuffer sb = new StringBuffer();\n while (path.hasMoreElements())\n {\n sb.append(path.nextElement());\n sb.append(URL_PATH_SEPARATOR);\n }\n String p = sb.toString();\n if (p.startsWith(URL_PATH_SEPARATOR))\n p = p.substring(1);\n\n return root_url + p;\n }" ]
[ "0.6213344", "0.60207367", "0.5676899", "0.5652066", "0.5529787", "0.5350379", "0.5304408", "0.52347785", "0.5230724", "0.52230203", "0.5211109", "0.5200282", "0.519164", "0.5103823", "0.50985193", "0.50327814", "0.4979258", "0.49512964", "0.4943677", "0.49231148", "0.49186844", "0.48715568", "0.48630396", "0.4792327", "0.47644275", "0.47496194", "0.47409835", "0.47117394", "0.46525723", "0.4610898", "0.45833486", "0.45830145", "0.45572996", "0.45465085", "0.45229164", "0.4522795", "0.45117542", "0.45088115", "0.45007968", "0.44851637", "0.44795027", "0.44665098", "0.4444759", "0.44324163", "0.44073465", "0.44073465", "0.4405634", "0.4350915", "0.43455777", "0.43428773", "0.43303123", "0.4328734", "0.4325652", "0.43208358", "0.43116766", "0.4308961", "0.43006805", "0.43002528", "0.42903322", "0.42728832", "0.42692587", "0.42654616", "0.42570046", "0.42438304", "0.423069", "0.42285308", "0.42254043", "0.42230302", "0.4216093", "0.4208421", "0.42074698", "0.4200601", "0.41990718", "0.41930217", "0.41818273", "0.41669518", "0.41629568", "0.41610724", "0.41562536", "0.41459778", "0.41390815", "0.4132414", "0.41307977", "0.41307893", "0.41242197", "0.41224015", "0.41178805", "0.41171432", "0.41155463", "0.41036734", "0.41013587", "0.40851623", "0.40746185", "0.40743685", "0.40696487", "0.40680856", "0.4065737", "0.40618706", "0.4051176", "0.40329885" ]
0.5736525
2
Encodes the specified path segments as a path string
public static String toString(final Object[] segments) { final StringBuilder builder = new StringBuilder(); for (final Object segment: segments) { if (segment instanceof Integer) { builder.append('[').append(segment).append(']'); } else if (segment == ANY_INDEX) { builder.append(segment); } else { if (builder.length() > 0) { builder.append('.'); } if (segment == ANY_KEY) { builder.append(segment); } else { builder.append(encodeSegment(segment.toString())); } } } return builder.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected String pathBuilder(String... segments) {\n\t\t\n\t\tStringBuffer path = new StringBuffer();\n\t\tfor(String seg : segments){\n\t\t\tif(seg != null){\n\t\t\t\tpath.append(seg);\n\t\t\t\tpath.append(\"/\");\n\t\t\t}\n\t\t}\n\t\treturn path.toString();\n\t}", "public static final String toPath(final List<PathSegment> paths) {\n final StringBuffer result = new StringBuffer();\n LOGGER.trace(\"converting URI path to JCR path: {}\", paths);\n\n int i = 0;\n\n for (final PathSegment path : paths) {\n final String p = path.getPath();\n\n if (p.equals(\"\")) {\n LOGGER.trace(\"Ignoring empty segment {}\", p);\n } else if (i == 0 &&\n (p.startsWith(\"tx:\") || p.startsWith(\"workspace:\"))) {\n LOGGER.trace(\"Ignoring internal segment {}\", p);\n i++;\n } else {\n\n LOGGER.trace(\"Adding segment {}\", p);\n\n if (!p.startsWith(\"[\")) {\n result.append('/');\n }\n result.append(p);\n i++;\n }\n }\n\n final String path = result.toString();\n\n if (path.isEmpty()) {\n return \"/\";\n } else {\n return path;\n }\n }", "PathSegments getPath();", "public void testEncodePath() throws Exception {\n\n Object[] test_values = {\n new String[]{\"abc def\", \"abc%20def\"},\n new String[]{\"foo/bar?n=v&N=V\", \"foo/bar%3Fn=v&N=V\"}\n };\n for (int i = 0; i < test_values.length; i++) {\n String tests[] = (String[]) test_values[i];\n String original = tests[0];\n String expected = tests[1];\n\n String result = NetUtils.encodePath(original);\n String message = \"Test \" +\n \" original \" + \"'\" + original + \"'\";\n assertEquals(message, expected, result);\n }\n }", "public String getEncodedPath() {\n return getEncodedPath(false);\n }", "@Override\n public DefaultUrlBuilder pathSegment(String thePath) {\n this.pathSegments.add(BaseUrl.UrlEncoder.encodePathSegment(thePath));\n return this;\n }", "Uri encryptedPath();", "protected StringBuilder convertPath(final String path) {\n\t\tStringBuilder pathBuffer = new StringBuilder(\"/app:company_home\");\n\t\tString[] parts = path.split(\"/\");\n\n\t\tString subpath;\n\n\t\tfor(String part : parts) {\n\t\t\tsubpath = part.trim();\n\n\t\t\tif(subpath.length() > 0) {\n\t\t\t\tpathBuffer.append(\"/cm:\").append(ISO9075.encode(subpath));\n\t\t\t}\n\t\t}\n\n\t\treturn pathBuffer;\n\t}", "static void formatPath(final Appendable out, final CharSequence[] path, int pathOffset, final int[] indices) throws IOException {\n while (pathOffset < path.length) {\n if (pathOffset != 0) {\n out.append(Keywords.PATH_SEPARATOR);\n }\n out.append(path[pathOffset]);\n if (indices != null) {\n final int index = indices[pathOffset];\n if (index != 0) {\n out.append('[').append(Integer.toString(index)).append(']');\n }\n }\n pathOffset++;\n }\n }", "private static String encodeSegment(final String segment) {\r\n\t\tfinal Matcher matcher = SPECIAL_CHARACTERS_PATTERN.matcher(segment);\r\n\t\treturn matcher.replaceAll(\"\\\\\\\\$1\");\r\n\t}", "public String encode(List<String> strs) {\n String res = \"\";\n for(String s : strs)\n {\n int len = s.length();\n res += len + \"/\" + s;\n }\n return res;\n }", "public String path(String path1, String path2);", "BitOutputStore encodePath(int depth, SymbolNode[] path) {\n BitOutputStore bitpath = new BitOutputStore();\n for (int i = 1; i < depth; i++) {\n SymbolNode node = path[i];\n bitpath.appendBit(node.bit);\n }\n return bitpath;\n }", "public static String joinPath(String... parts) {\n StringBuilder sb = new StringBuilder();\n if (parts.length > 0) {\n sb.append(parts[0]);\n }\n for (int i = 1; i < parts.length; i++) {\n String part = parts[i];\n if (part.isEmpty() || (part.length() == 1 && part.charAt(0) == '/')) {\n continue;\n }\n boolean gotTrailingSlash = sb.length() == 0 ? false : sb.charAt(sb.length() - 1) == '/';\n boolean gotLeadingSlash = part.charAt(0) == '/';\n if (gotTrailingSlash != !gotLeadingSlash) {\n sb.append(part);\n } else {\n if (!gotTrailingSlash) {\n sb.append('/');\n } else {\n sb.append(part.substring(1));\n }\n }\n }\n return sb.toString();\n }", "@Override\r\n\tpublic String toString() {\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tfor (String str : this) {\r\n\t\t\tif (sb.length() > 0) {\r\n\t\t\t\tsb.append(PATH_SEPARATOR);\r\n\t\t\t}\r\n\t\t\tsb.append(str);\r\n\t\t}\r\n\t\treturn sb.toString().toLowerCase();\r\n\t}", "public String getPath(String from, String to, String pathAlgo);", "public Encode(Path inputPath, Path outputPath) {\n this.inputPath = inputPath;\n this.outputPath = outputPath;\n }", "@Override\n public String toString() {\n return ArrayHelper.join(this.toArray(new Part[0]), \"/\");\n }", "public static String append(String... parts) {\n StringBuilder builder = new StringBuilder();\n for (int i = 0; i < parts.length; ++i) {\n if (i != 0) {\n builder.append(\"/\");\n }\n builder.append(parts[i]);\n }\n return builder.toString();\n }", "public String getEncodedPath(boolean shouldAddParameters) {\n StringBuilder completeUrlBuilder = new StringBuilder();\n completeUrlBuilder.append(getBaseEndpointPath());\n completeUrlBuilder.append(path);\n if (shouldAddParameters && requestType == HttpRequest.NetworkOperationType.GET && parameters != null) {\n boolean first = true;\n for (String key : parameters.keySet()) {\n if (first) {\n first = false;\n completeUrlBuilder.append(\"?\");\n } else {\n completeUrlBuilder.append(\"&\");\n }\n completeUrlBuilder.append(key).append(\"=\").append(parameters.get(key));\n }\n }\n return completeUrlBuilder.toString().replace(getBaseEndpoint(), \"\");\n }", "public static String uriEncodeParts(final String value) {\n if (Strings.isNullOrEmpty(value)) {\n return value;\n }\n final int length = value.length();\n final StringBuilder builder = new StringBuilder(length << 1);\n for (int i = 0; i < length; i++) {\n final char c = value.charAt(i);\n if (CharMatcher.ASCII.matches(c)) {\n builder.append(String.valueOf(c));\n } else {\n builder.append(encodeCharacter(c));\n }\n }\n return builder.toString();\n }", "@Override\n\tpublic String toString() {\n\t\tString path = \"\";\n\tfor (int i = 0; i < paths.size(); i ++) {\n\t\tfor (int j = 0; j < paths.get(i).size(); j++)\n\t\t\tpath += paths.get(i).get(j) + \", \";\n\t\tpath += \"\\n\";\n\t}\n\treturn path;\n\t\t\n\t}", "private String escapeFragment(String pathFragment) {\n\t\treturn pathFragment.replaceAll(\"~\", \"~0\").replaceAll(\"\\\\/\", \"~1\");\n\t}", "static String escapePathName(String path) {\n if (path == null || path.length() == 0) {\n throw new RuntimeException(\"Path should not be null or empty: \" + path);\n }\n\n StringBuilder sb = null;\n for (int i = 0; i < path.length(); i++) {\n char c = path.charAt(i);\n if (needsEscaping(c)) {\n if (sb == null) {\n sb = new StringBuilder(path.length() + 2);\n for (int j = 0; j < i; j++) {\n sb.append(path.charAt(j));\n }\n }\n escapeChar(c, sb);\n } else if (sb != null) {\n sb.append(c);\n }\n }\n if (sb == null) {\n return path;\n }\n return sb.toString();\n }", "public String toString() {\n\t\tString pathString = \"\";\n\t\tfor(Point point : path) {\n\t\t\tpathString = pathString + \"[ \" + point.getX() + \", \" + point.getY() + \" ]\";\n\t\t}\n\t\treturn pathString;\n\t}", "private String sep(String path) {\n return path == null ? \"\" : \"/\" + path;\n }", "public String encode(String text) {\n\t\t// TODO fill this in.\n\t\tString binaryCode = \"\";\n\n\t\tchar[] array = text.toCharArray();\n\n\t\tfor(char c : chars.keySet()){\n\t\t\tString code = findPath(c, root, \"\");\n\t\t\tcodeMap.put(c, code);\n\t\t\tSystem.out.println(c + \" \" + code);\t\t\t\t\t\t\t// print char codes\n\t\t}\n\n\t\tfor(char t : array){\n\t\t\tString charCode = codeMap.get(t);\n\t\t\tbinaryCode = binaryCode + charCode;\n\t\t}\n\n\t\treturn binaryCode;\n\t}", "public abstract String getPath(boolean urlEncode, boolean includeOwner) throws\n\t\t\tUnsupportedEncodingException;", "void toJSON(Path path);", "@Override\n\tpublic String toString() {\n\t\treturn path.toString();\n\t}", "public static String generatePartitionPath(LinkedHashMap<String, String> partitionSpec) {\n if (partitionSpec.isEmpty()) {\n return \"\";\n }\n StringBuilder suffixBuf = new StringBuilder();\n int i = 0;\n for (Map.Entry<String, String> e : partitionSpec.entrySet()) {\n if (i > 0) {\n suffixBuf.append(Path.SEPARATOR);\n }\n suffixBuf.append(escapePathName(e.getKey()));\n suffixBuf.append('=');\n suffixBuf.append(escapePathName(e.getValue()));\n i++;\n }\n suffixBuf.append(Path.SEPARATOR);\n return suffixBuf.toString();\n }", "public final String path() {\n return string(preparePath(concat(path, SLASH, name)));\n }", "Uri decryptedPath();", "public String getHierarchicalPath() {\r\n \t\tStringBuilder builder = new StringBuilder();\r\n \t\tfor (String id : hierarchicalId) {\r\n \t\t\tbuilder.append('/');\r\n \t\t\tbuilder.append(id);\r\n \t\t}\r\n \r\n \t\treturn builder.toString();\r\n \t}", "public Path(\n String[] components\n ){\n \tthis(components.length, XRISegment.valueOf(components));\n }", "@Override\n public String toString() {\n final StringBuilder buffer = new StringBuilder();\n try {\n formatPath(buffer, path, 0, indices);\n } catch (IOException e) {\n throw new AssertionError(e); // Should never happen, since we are writting to a StringBuilder.\n }\n return buffer.toString();\n }", "public static byte[] preparePath(final byte[] path) {\n String p = MetaData.normPath(string(path));\n if(Strings.endsWith(p, '/')) p = p.substring(0, p.length() - 1);\n return concat(SLASH, token(p));\n }", "public String getPath(int level)\n {\n // Check property\n if (level > pathArray.length) \n { \n level = pathArray.length; \n }\n \n // New StringBuffer for the path generation\n StringBuffer autoPath = new StringBuffer();\n \n // For each node\n for (int i = 0; i < level; i++)\n {\n // Add node index (read from the path array)\n autoPath.append(pathArray[i]);\n \n // Add path separator (colon)\n if (i < (level - 1)) \n { \n autoPath.append(\":\"); \n }\n }\n \n // Return generated path\n return autoPath.toString();\n }", "public static String addToPath(String path, String path2) { return path + \"/\" + path2; }", "String getPath();", "String getPath();", "String getPath();", "String getPath();", "String getPath();", "public String getPath() \r\n\t{\r\n\t\tStringBuilder pathBuilder = new StringBuilder();\r\n\t\tfor(Cell c: path)\r\n\t\t\tpathBuilder.append(\" (\" + c.getRow() + ',' + c.getColumn() + ')');\r\n\t\t\r\n\t\treturn pathBuilder.toString();\r\n\t}", "public String getPathAsString() {\n if (list.isEmpty()) {\n return \"\";\n }\n StringBuilder buf = new StringBuilder();\n\n for (String dir : list) {\n buf.append(dir);\n buf.append(pathSeparator());\n }\n return buf.substring(0, buf.length() - 1); // remove the trailing pathSeparator...\n }", "private String constructPath(MetadataEntity metadataEntity) {\n StringBuilder builder = new StringBuilder();\n metadataEntity.iterator().forEachRemaining(keyValue -> {\n if (ENTITY_TYPE_TO_API_PART.containsKey(keyValue.getKey())) {\n builder.append(ENTITY_TYPE_TO_API_PART.get(keyValue.getKey()));\n } else {\n builder.append(keyValue.getKey());\n }\n builder.append(\"/\");\n builder.append(keyValue.getValue());\n builder.append(\"/\");\n });\n // remove the last /\n builder.replace(builder.length() - 1, builder.length(), \"\");\n return builder.toString();\n }", "public static void setPath (int equipID[]){\n\t\tfor (int i = 0; i < equipID.length; i++){\n\t\t\tpath[i] = Integer.toString(equipID[i]);\n\t\t}\n\t}", "public String toPathString() {\n return path();\n }", "public static String pathModifier(String path, int start, int end) {\n\t\t\n\t\tStringBuilder builder = new StringBuilder(path);\n\t\tbuilder.delete(start, end);\n\t\tString newPath = builder.toString();\n\t\t\n\t\treturn newPath;\n\t\t\n\t}", "private String addSubsetToPath(String path, String hash) {\n String index = \"-1\";\n HashMap<String, String> pathType = parsePathType(path);\n index = pathType.get(\"index\");\n\n if (index != \"-1\") {\n path = new StringBuilder(path).insert(\n Integer.parseInt(index), Constants.SUBSETS_URL + hash + \"/\").toString();\n }\n return path;\n }", "private void encode(StringBuilder builder, String component) {\n int length = component.length();\n for (int i = 0; i < length; i++) {\n char currentChar = component.charAt(i);\n if (currentChar == SEPARATOR_CHAR) {\n builder.append(SEPARATOR_CHAR);\n }\n builder.append(currentChar);\n }\n }", "@Override\n public String toString() {\n final ToString ts = new ToString(this);\n\n ts.append(\"path\", getPath());\n\n return ts.toString();\n }", "private String encodeUri(String uri) {\n\t\t\tString newUri = \"\";\n\t\t\tStringTokenizer st = new StringTokenizer(uri, \"/ \", true);\n\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\tString tok = st.nextToken();\n\t\t\t\tif (\"/\".equals(tok)) {\n\t\t\t\t\tnewUri += \"/\";\n\t\t\t\t} else if (\" \".equals(tok)) {\n\t\t\t\t\tnewUri += \"%20\";\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnewUri += URLEncoder.encode(tok, \"UTF-8\");\n\t\t\t\t\t} catch (UnsupportedEncodingException ignored) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn newUri;\n\t\t}", "public String getPath(boolean p_includeQueryString,\n boolean p_includeFragment) {\n StringBuffer pathString = new StringBuffer(m_path);\n \n if (p_includeQueryString && m_queryString != null) {\n pathString.append('?');\n pathString.append(m_queryString);\n }\n \n if (p_includeFragment && m_fragment != null) {\n pathString.append('#');\n pathString.append(m_fragment);\n }\n return pathString.toString();\n }", "private Route append(Map<QualifiedName, PathParamDescriptor> pathParamDescriptors, String path) throws MalformedRouteException\n {\n if (path.length() == 0 || path.charAt(0) != '/')\n {\n throw new MalformedRouteException();\n }\n\n //\n int pos = path.length();\n int level = 0;\n List<Integer> start = new ArrayList<Integer>();\n List<Integer> end = new ArrayList<Integer>();\n for (int i = 1;i < path.length();i++)\n {\n char c = path.charAt(i);\n if (c == '{')\n {\n if (level++ == 0)\n {\n start.add(i);\n }\n }\n else if (c == '}')\n {\n if (--level == 0)\n {\n end.add(i);\n }\n }\n else if (c == '/')\n {\n if (level == 0)\n {\n pos = i;\n break;\n }\n }\n }\n\n //\n Route next;\n if (start.isEmpty())\n {\n String segment = path.substring(1, pos);\n SegmentRoute route = new SegmentRoute(router, segment);\n add(route);\n next = route;\n }\n else\n {\n if (start.size() == end.size())\n {\n PatternBuilder builder = new PatternBuilder();\n builder.expr(\"^\").expr('/');\n List<String> chunks = new ArrayList<String>();\n List<PathParam> parameterPatterns = new ArrayList<PathParam>();\n\n //\n int previous = 1;\n for (int i = 0;i < start.size();i++)\n {\n builder.litteral(path, previous, start.get(i));\n chunks.add(path.substring(previous, start.get(i)));\n String parameterName = path.substring(start.get(i) + 1, end.get(i));\n\n //\n QualifiedName parameterQName = QualifiedName.parse(parameterName);\n\n // Now get path param metadata\n PathParamDescriptor parameterDescriptor = pathParamDescriptors.get(parameterQName);\n\n //\n PathParam param;\n if (parameterDescriptor != null)\n {\n param = PathParam.create(parameterDescriptor, router);\n }\n else\n {\n param = PathParam.create(parameterQName, router);\n }\n\n // Append routing regex to the route regex surrounded by a non capturing regex\n // to isolate routingRegex like a|b or a(.)b\n builder.expr(\"(?:\").expr(param.routingRegex).expr(\")\");\n\n // Add the path param with the rendering regex\n parameterPatterns.add(param);\n previous = end.get(i) + 1;\n }\n\n //\n builder.litteral(path, previous, pos);\n\n // We want to satisfy one of the following conditions\n // - the next char after the matched expression is '/'\n // - the expression matched until the end\n // - the match expression is the '/' expression\n builder.expr(\"(?:(?<=^/)|(?=/)|$)\");\n\n //\n chunks.add(path.substring(previous, pos));\n PatternRoute route = new PatternRoute(router, router.compile(builder.build()), parameterPatterns, chunks);\n\n // Wire\n add(route);\n\n //\n next = route;\n }\n else\n {\n throw new UnsupportedOperationException(\"Report error\");\n }\n }\n\n //\n if (pos < path.length())\n {\n return next.append(pathParamDescriptors, path.substring(pos));\n }\n else\n {\n return next;\n }\n }", "public String toString() {\n StringBuffer buf = new StringBuffer();\n\n // Append context-path\n buf.append(contextPath);\n\n // Append real path (path besides control params, think \"niceuri\")\n if (realPath != null) {\n buf.append(realPath);\n }\n\n // Append \"control-parameters\"\n if (!pathParams.isEmpty()) {\n buf.append(\"/\");\n for (Iterator iter = pathParams.keySet().iterator(); iter.hasNext();) {\n String name = (String) iter.next();\n String[] values = (String[]) pathParams.get(name);\n buf.append(name);\n buf.append(\"/\");\n buf.append(PathParser.encodeValues(values));\n\n if (iter.hasNext()) {\n buf.append(\"/\");\n }\n }\n }\n\n // Append servlet-path (infoglue-action)\n if (webWorkAction != null) {\n buf.append(\"/\");\n buf.append(webWorkAction);\n }\n\n // Append query-parameters\n if (!queryParams.isEmpty()) {\n buf.append(\"?\");\n for (Iterator iter = queryParams.keySet().iterator(); iter.hasNext();) {\n // Iterating over names\n String name = (String) iter.next();\n String[] values = (String[]) queryParams.get(name);\n for (int i = 0; i < values.length; i++) {\n // Iterating over values\n buf.append(name);\n buf.append(\"=\");\n buf.append(values[i]);\n if (i < values.length - 1) {\n buf.append(\"&\");\n }\n }\n if (iter.hasNext()) {\n buf.append(\"&\");\n }\n }\n }\n\n // Append local navigation (reference)\n if (local != null && local.length() > 0) {\n buf.append(\"#\");\n buf.append(local);\n }\n if (log.isDebugEnabled()) {\n log.debug(\"Generated URL: \" + buf.toString());\n }\n return buf.toString();\n }", "void path(String path);", "void path(String path);", "public String simplifyPath2(String path) {\n\t\tString[] strs = path.split(\"/\");\n\t\tLinkedList<String> l = new LinkedList<String>();\n\n\t\tfor (String s : strs) {\n\t\t\tif (s.equals(\"..\")) {\n\t\t\t\tif (!l.isEmpty())\n\t\t\t\t\tl.removeLast();\n\t\t\t} else if (s.equals(\"\") || s.equals(\".\"))\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\tl.addLast(s);\n\n\t\t}\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String s : l) {\n\t\t\tsb.append('/');\n\t\t\tsb.append(s);\n\t\t}\n\t\tif (l.size() == 0)\n\t\t\tsb.append('/');\n\t\treturn sb.toString();\n\t}", "public String jsonPathBuilder(String path){\n\t\tString validJsonPath=\"$\";\n\t\tString[] pathArray = path.split(\"/\");\n\t\tfor(int i=0; i<pathArray.length; i++){\n\t\t\tvalidJsonPath = validJsonPath + \".\" + pathArray[i];\n\t\t}\n\t\treturn validJsonPath;\n\t}", "private String encode(String value) {\n String encoded = \"\";\n try {\n encoded = URLEncoder.encode(value, \"UTF-8\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n String sb = \"\";\n char focus;\n for (int i = 0; i < encoded.length(); i++) {\n focus = encoded.charAt(i);\n if (focus == '*') {\n sb += \"%2A\";\n } else if (focus == '+') {\n sb += \"%20\";\n } else if (focus == '%' && i + 1 < encoded.length() && encoded.charAt(i + 1) == '7' && encoded.charAt(i + 2) == 'E') {\n sb += '~';\n i += 2;\n } else {\n sb += focus;\n }\n }\n return sb.toString();\n }", "Path createPath();", "public String toIdent(int pos) {\n StringBuilder buffer = new StringBuilder();\n for (int i = pos; i < parts.length; i++) {\n if (i > pos) {\n buffer.append(\"/\");\n }\n buffer.append(parts[i]);\n }\n if (index) {\n buffer.append(\"/\");\n }\n return buffer.toString();\n }", "@Override\r\n public void dirToPath(String[] arr) {\n\r\n }", "public static String formatPath(ServletContext context, Document dom, String application, Hashtable hash, String pathSrc, char separator) throws IOException {\n String ret = null;\r\n try\r\n {\r\n String listPathSrc[] = UtilString.split(pathSrc, separator);\r\n int len = UtilSafe.safeListSize(listPathSrc);\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath listPathSrc:\")).append(listPathSrc).append(\" len:\").append(len).toString());\r\n if(len > 0)\r\n {\r\n File filePath = null;\r\n String path = null;\r\n int iDeb = 0;\r\n int iFin = 0;\r\n int iPos = 0;\r\n StringBuffer stb = new StringBuffer();\r\n for(int i = 0; i < len; i++)\r\n {\r\n path = (String)UtilSafe.safeListGetElementAt(listPathSrc, i);\r\n for(iPos = 0; iPos >= 0; iPos = iFin)\r\n {\r\n iDeb = path.indexOf('[', 0);\r\n iFin = path.indexOf(']', iDeb);\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath path:\")).append(path).append(\" iPos:\").append(iPos).append(\" iDeb:\").append(iDeb).append(\" iFin:\").append(iFin).toString());\r\n if(iDeb >= 0 && iFin >= 0)\r\n {\r\n String szApplication = path.substring(iDeb + 1, iFin);\r\n String filePathMain = (String)hash.get(szApplication);\r\n if(filePathMain == null)\r\n if(context == null)\r\n filePathMain = AdpXmlApplication.getPathMain(dom, szApplication);\r\n else\r\n filePathMain = AdpXmlApplication.getFormatedPathMain(context, dom, szApplication);\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath szApplication:\")).append(szApplication).append(\" filePathMain:\").append(filePathMain).toString());\r\n if(UtilString.isNotEmpty(filePathMain))\r\n {\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath filePathMain isNotEmpty:\")).append(filePathMain).toString());\r\n hash.put(szApplication, filePathMain);\r\n if(!filePathMain.toUpperCase().startsWith(\"FTP://\"))\r\n {\r\n path = (new StringBuffer(path)).replace(iDeb, iFin + 1, filePathMain).toString();\r\n path = path.replace(File.separatorChar != '\\\\' ? '\\\\' : '/', File.separatorChar);\r\n } else\r\n {\r\n path = filePath.getCanonicalPath();\r\n }\r\n }\r\n } else\r\n if(UtilString.isNotEmpty(application) && !UtilFile.isPathAbsolute(path))\r\n {\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath application isNotEmpty:\")).append(application).toString());\r\n String filePathApp = null;\r\n if(context == null)\r\n filePathApp = AdpXmlApplication.getPathMain(dom, application);\r\n else\r\n filePathApp = AdpXmlApplication.getFormatedPathMain(context, dom, application);\r\n path = (new File(filePathApp, path)).getCanonicalPath();\r\n }\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath path:\")).append(path).toString());\r\n }\r\n\r\n if(stb.length() > 0)\r\n stb.append(\";\");\r\n stb.append(path);\r\n }\r\n\r\n ret = stb.toString();\r\n }\r\n }\r\n catch(Exception ex)\r\n {\r\n Trace.ERROR(ex);\r\n }\r\n return ret;\r\n }", "public String simplifyPath(String path) {\n String[] s = path.split(\"/\");\n StringBuilder sb = new StringBuilder(\"/\");\n for(String S:s){\n if(S.equals(\"\")||S.equals(\".\")){\n continue;\n }\n else if(S.equals(\"..\")){\n if(sb.charAt(sb.length()-1) != '/')\n {\n sb.deleteCharAt(sb.length()-1);\n }\n else{\n sb.delete(sb.length()-2, sb.length()-1);\n }\n\n }\n else{\n sb.append(S);\n sb.append('/');\n }\n }\n sb.deleteCharAt(sb.length()-1);\n return sb.toString();\n }", "public Path getPath(String path,String nombreArchivo);", "private static void createPath(Path path) {\r\n\t\tString tempStr = \"\";\r\n\t\tint finished = 1;\r\n\t\tint tempId = -1;\r\n\t\tList<GeoCoordinate> polyline = new ArrayList<GeoCoordinate>();\r\n\t\tList<Place> placeList = new ArrayList<Place>();\r\n\t\tContainerNII pathNii = new ContainerNII();\r\n\t\tPlace place;\r\n\t\t\r\n\t\twhile (finished == 1){\r\n\t\t\t\r\n\t\t\tplace = new Place();\r\n\t\t\tcreatePlace(place);\r\n\t\t\tplaceList.add(place);\r\n\t\t\tfinished = checkContinue(\"place\");\r\n\t\t}\r\n\t\tpath.setPlaces(placeList);\r\n\t\t\r\n\t\tif ((tempId = insertInteger(\"path id: \")) != -1)\r\n\t\t\tpath.setId(tempId);\t\r\n\t\t\r\n\t\tinsertNIIValues(pathNii, \"path\");\r\n\t\tpath.setNii(pathNii);\r\n\t\t\r\n\t\tif ((tempStr = insertString(\"path length: \")) != null)\r\n\t\t\tpath.setLength(tempStr);\r\n\t\t\r\n\t\tinsertPolyline(polyline, strPath);\r\n\t\tpath.setPolyline(polyline);\r\n\t\t\r\n\t\tif ((tempStr = insertString(\"path duration: \")) != null)\r\n\t\t\tpath.setDuration(tempStr);\r\n\t\t\r\n\t}", "private static void appendPathPart(Appendable buffer, String path, Boolean appendDirSep, String prefix) throws IOException {\n // Test if adding a slash between (buffer+prefix) and (path) is needed\n if ((appendDirSep == null && path != null) || Boolean.TRUE.equals(appendDirSep)\n || (UtilValidate.isNotEmpty(path) && !RequestLinkUtil.isUrlDelimNonDir(path.charAt(0)))) {\n // Slash required or requested\n if (path == null) {\n path = \"\";\n }\n buffer.append(prefix);\n if (!StringUtil.endsWith(buffer, '/') && !(path != null && StringUtil.startsWith(path, '/'))) {\n buffer.append('/');\n }\n buffer.append(path);\n } else {\n // No slash required or requested\n // NOTE: If (appendDirSep==false), path never starts with \"/\" here (due to isUrlDelimNonDir)\n StringUtil.appendWithoutSuffix(buffer, prefix, '/');\n if (path != null) {\n buffer.append(path);\n }\n }\n }", "@Override\n\t\t\tprotected URI toUriImpl(String path) throws URISyntaxException {\n\t\t\t\treturn toFileToURI(path);\n\t\t\t}", "private char[] getPath() {\n\t\treturn null;\n\t}", "protected String buildVersionedPath(final String path, final AbstractResourceVersion version) {\n\t\tif (!version.isValid()) {\n\t\t\treturn path;\n\t\t}\n\t\tfinal int idx = path.lastIndexOf('.');\n\t\tif (idx > 0) {\n\t\t\treturn path.substring(0, idx) + \"-\" + version.getVersion() + path.substring(idx);\n\t\t} else {\n\t\t\treturn path + \"-\" + version.getVersion();\n\t\t}\n\t}", "PathKeys getPathKeys();", "public void buildPathPartWithWebappPathPrefix(Appendable buffer, String uri, Boolean appendDirSep) throws WebAppConfigurationException, IOException {\n appendPathPart(buffer, uri, appendDirSep,\n webSiteProps.isWebappPathPrefixUrlBuild() ? webSiteProps.getWebappPathPrefix() : \"\"); // SCIPIO\n }", "public String getPath()\n {\n StringBuilder buff = new StringBuilder();\n Resource r = this;\n while(r != null)\n {\n if(r.getId() != 1)\n {\n buff.insert(0, r.getName());\n }\n r = r.getParent();\n if(r != null || this.getId() == 1)\n {\n buff.insert(0, '/');\n }\n }\n return buff.toString();\n }", "public void testUptoSegment() {\n \tIPath anyPath = new Path(\"/first/second/third\");\r\n \r\n \tassertEquals(\"1.0\", Path.EMPTY, anyPath.uptoSegment(0));\r\n \tassertEquals(\"1.1\", new Path(\"/first\"), anyPath.uptoSegment(1));\r\n \tassertEquals(\"1.2\", new Path(\"/first/second\"), anyPath.uptoSegment(2));\r\n \tassertEquals(\"1.3\", new Path(\"/first/second/third\"), anyPath.uptoSegment(3));\r\n \tassertEquals(\"1.4\", new Path(\"/first/second/third\"), anyPath.uptoSegment(4));\r\n \r\n \t//Case 2, absolute path with trailing separator\r\n \tanyPath = new Path(\"/first/second/third/\");\r\n \r\n \tassertEquals(\"2.0\", Path.EMPTY, anyPath.uptoSegment(0));\r\n \tassertEquals(\"2.1\", new Path(\"/first/\"), anyPath.uptoSegment(1));\r\n \tassertEquals(\"2.2\", new Path(\"/first/second/\"), anyPath.uptoSegment(2));\r\n \tassertEquals(\"2.3\", new Path(\"/first/second/third/\"), anyPath.uptoSegment(3));\r\n \tassertEquals(\"2.4\", new Path(\"/first/second/third/\"), anyPath.uptoSegment(4));\r\n }", "@Override\r\n public String getPath() {\r\n if (VFS.isUriStyle()) {\r\n return absPath + getUriTrailer();\r\n }\r\n return absPath;\r\n }", "public static CharSequence joinSegments(List<String> segments, int startIndex, int endIndex) {\r\n StringBuilder sb = new StringBuilder();\r\n appendSegments(sb, segments, startIndex, endIndex);\r\n return sb;\r\n }", "public static String pathToString(Graph<String,String> graph, String char1, String char2) {\n\t\tNode<String> charOne = new Node<String>(char1);\n\t\tNode<String> charTwo = new Node<String>(char2);\n\t\tString result = \"\";\n\t\t\n\t\t// Case for unknown characters\n\t if(!graph.containsNode(charOne) || !graph.containsNode(charTwo)) {\n\t \tif(!graph.containsNode(charOne)) {\n\t \t\tresult += \"unknown character \" + char1;\n\t \t}\n\t \tif(!graph.containsNode(charOne) && !graph.containsNode(charTwo)) {\n\t \t\tresult += System.lineSeparator() + \"unknown character \" + char2;\n\t \t} else if(!graph.containsNode(charTwo)) {\n\t \t\tresult += \"unknown character \" + char2;\n\t \t}\n\t \treturn result;\n\t } else {\n\t \t// If these characters exist\n\t\t\tresult = \"path from \" + char1 + \" to \" + char2 + \":\";\n\t\t\tList<Edge<String,String>> path = findPath(graph, char1, char2);\n\t\t\tif(path == null) {\n\t\t\t\treturn result + System.lineSeparator() + \"no path found\";\n\t\t\t} else if(char1.equals(char2)) {\n\t\t\t\treturn result + System.lineSeparator();// + \"Same character\";\n\t\t\t} else {\n\t\t\t\tString prev = char1;\n\t\t\t\tString current;\n\t\t\t\tfor(int i = 1; i < path.size(); i++) {\n\t\t\t\t\tcurrent = path.get(i).getParent().getData();\n\t\t\t\t\tresult += System.lineSeparator() + prev + \" to \" + current + \" via \"\n\t\t\t\t\t\t\t+ path.get(i-1).getValue();\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t\tString edge = path.get(path.size() - 1).getValue().toString();\n\t\t\t\tresult += System.lineSeparator() + prev + \" to \" + char2 + \" via \" + edge;\n\t\t\t}\n\t }\n\t\treturn result;\n\t}", "public String getPathName()\n \t{\n \t\tif ( arcname!=null )\n \t\t\treturn arcname + ARC_SEPARATOR + pathname;\n \t\treturn pathname;\n \t}", "public String encode() {\n\t\tString encoded_string;\n\t\tencoded_string = MEDIA_FIELD;\n\t\tif (media != null)\n\t\t\tencoded_string += media + Separators.SP + port;\n\t\t// Workaround for Microsoft Messenger contributed by Emil Ivov\n\t\t// Leave out the nports parameter as this confuses the messenger.\n\t\tif (nports > 1)\n\t\t\tencoded_string += Separators.SLASH + nports;\n\n\t\tif (proto != null)\n\t\t\tencoded_string += Separators.SP + proto;\n\n\t\tif (formats != null)\n\t\t\tencoded_string += Separators.SP + encodeFormats();\n\n\t\tencoded_string += Separators.NEWLINE;\n\t\treturn encoded_string;\n\t}", "public String getPathName();", "public String encode(String uri) {\n return uri;\n }", "public static String encodeIdentifier(final RandomPrefix prefixes, final YangInstanceIdentifier id) {\n StringBuilder textContent = new StringBuilder();\n for (PathArgument pathArgument : id.getPathArguments()) {\n textContent.append('/');\n textContent.append(prefixes.encodeQName(pathArgument.getNodeType()));\n if (pathArgument instanceof NodeIdentifierWithPredicates) {\n Map<QName, Object> predicates = ((NodeIdentifierWithPredicates) pathArgument).getKeyValues();\n\n for (QName keyValue : predicates.keySet()) {\n Object value = predicates.get(keyValue);\n String type = value.getClass().getName();\n String predicateValue = String.valueOf(value);\n textContent.append('[');\n textContent.append(prefixes.encodeQName(keyValue));\n textContent.append(\"='\");\n textContent.append(predicateValue);\n textContent.append(\"@\");\n textContent.append(type);\n textContent.append(\"']\");\n }\n } else if (pathArgument instanceof NodeWithValue) {\n textContent.append(\"[.='\");\n textContent.append(((NodeWithValue) pathArgument).getValue());\n textContent.append(\"']\");\n }\n }\n\n return textContent.toString();\n }", "public static String convertToWindowsPath(String path) {\n\t\treturn \"E:\" + path;\n\t}", "Path getPath();", "private String addSlashes(String in) {\n StringBuffer sb = new StringBuffer();\n int index = 0;\n int i = in.indexOf(\"\\\\\");\n int ii = in.indexOf(\"\\\\\\\\\");\n\n if (i == -1) {\n return in;\n }\n\n if (i != ii) {\n sb.append(in.substring(index,i+1)+\"\\\\\");\n }\n index = i+1;\n boolean done = false;\n while (!done) {\n i = in.indexOf(\"\\\\\", index);\n ii = in.indexOf(\"\\\\\\\\\", index);\n if (i == -1) {\n sb.append(in.substring(index));\n done = true;\n }\n else if (i != ii) {\n sb.append(in.substring(index,i+1)+\"\\\\\");\n index = i+1;\n }\n }\n return sb.toString();\n }", "public String getPath();", "public String getPath();", "public String getPath();", "public void buildPathPartWithServletPath(Appendable buffer) throws WebAppConfigurationException, IOException {\n buildPathPart(buffer, null, false);\n }", "@Override\n public String toString()\n {\n StringBuffer buffer = new StringBuffer();\n Enumeration<String> hosts;\n\n buffer.append('<');\n\n hosts = _path.elements();\n\n if (hosts.hasMoreElements())\n {\n buffer.append('@');\n buffer.append(hosts.nextElement());\n\n while (hosts.hasMoreElements())\n {\n buffer.append(\",@\");\n buffer.append(hosts.nextElement());\n }\n buffer.append(':');\n }\n\n buffer.append(_emailAddress);\n buffer.append('>');\n\n return buffer.toString();\n }", "private void setRequestPath(final HttpServerExchange exchange, final String encodedPath, final String charset, final boolean allowEncodedSlash, StringBuilder decodeBuffer) {\n boolean requiresDecode = false;\n for (int i = 0; i < encodedPath.length(); ++i) {\n char c = encodedPath.charAt(i);\n if (c == '?') {\n String part;\n String encodedPart = encodedPath.substring(0, i);\n if (requiresDecode) {\n part = URLUtils.decode(encodedPart, charset, allowEncodedSlash, decodeBuffer);\n } else {\n part = encodedPart;\n }\n exchange.setRequestPath(part);\n exchange.setRelativePath(part);\n exchange.setRequestURI(encodedPart);\n final String qs = encodedPath.substring(i + 1);\n exchange.setQueryString(qs);\n URLUtils.parseQueryString(qs, exchange, encoding, decode);\n return;\n } else if(c == ';') {\n String part;\n String encodedPart = encodedPath.substring(0, i);\n if (requiresDecode) {\n part = URLUtils.decode(encodedPart, charset, allowEncodedSlash, decodeBuffer);\n } else {\n part = encodedPart;\n }\n exchange.setRequestPath(part);\n exchange.setRelativePath(part);\n exchange.setRequestURI(encodedPart);\n for(int j = i; j < encodedPath.length(); ++j) {\n if (encodedPath.charAt(j) == '?') {\n String pathParams = encodedPath.substring(i + 1, j);\n URLUtils.parsePathParms(pathParams, exchange, encoding, decode);\n String qs = encodedPath.substring(j + 1);\n exchange.setQueryString(qs);\n URLUtils.parseQueryString(qs, exchange, encoding, decode);\n return;\n }\n }\n URLUtils.parsePathParms(encodedPath.substring(i + 1), exchange, encoding, decode);\n return;\n } else if(c == '%' || c == '+') {\n requiresDecode = true;\n }\n }\n\n String part;\n if (requiresDecode) {\n part = URLUtils.decode(encodedPath, charset, allowEncodedSlash, decodeBuffer);\n } else {\n part = encodedPath;\n }\n exchange.setRequestPath(part);\n exchange.setRelativePath(part);\n exchange.setRequestURI(encodedPath);\n }", "public void buildPathPartWithContextPath(Appendable buffer) throws WebAppConfigurationException, IOException {\n buildPathPartWithContextPath(buffer, null, false);\n }", "public abstract List<String> path();", "public static String localizePath(String path)\r\n {\r\n StringBuilder result = new StringBuilder();\r\n char nextChar;\r\n for(int i = 0; i < path.length(); i++)\r\n {\r\n nextChar = path.charAt(i);\r\n if((nextChar == '/') || (nextChar == '\\\\'))\r\n {\r\n // Convert the URI separator to the system dependent path separator\r\n result.append(File.separatorChar);\r\n }\r\n else\r\n {\r\n result.append(nextChar);\r\n }\r\n }\r\n \r\n return result.toString();\r\n }", "public String simplifyPath(String path) {\n String resString=\"\";\n String[] steRes=path.split(\"/|\\\\.\");\n if (steRes.length==0)\n return \"/\";\n return '/'+steRes[steRes.length-1];\n }", "public abstract String getPath();", "public abstract String getPath();" ]
[ "0.6874245", "0.6234454", "0.61291814", "0.59175706", "0.5892942", "0.58780795", "0.5731367", "0.56402904", "0.5592618", "0.5564757", "0.54915744", "0.54705244", "0.5464945", "0.54534477", "0.53953403", "0.5393836", "0.53448784", "0.52830124", "0.5253351", "0.5213516", "0.52086705", "0.5103197", "0.5102096", "0.5046721", "0.50365096", "0.49815544", "0.49674866", "0.4950359", "0.49476612", "0.49201074", "0.49110198", "0.48993838", "0.489649", "0.4888618", "0.48867652", "0.48769084", "0.4859339", "0.48536336", "0.4847474", "0.481228", "0.481228", "0.481228", "0.481228", "0.481228", "0.48107037", "0.47873133", "0.477752", "0.4773483", "0.47707048", "0.4769735", "0.47582507", "0.47227672", "0.47191507", "0.47149566", "0.4712332", "0.46956098", "0.46706852", "0.4661227", "0.4661227", "0.4635173", "0.46188897", "0.46090603", "0.45722988", "0.45710045", "0.4568293", "0.4549445", "0.45462197", "0.45457608", "0.45399615", "0.45172295", "0.45038283", "0.44978788", "0.44937992", "0.44930482", "0.44862735", "0.44817668", "0.44758907", "0.44744024", "0.4472216", "0.44717926", "0.44638762", "0.44620857", "0.4455517", "0.4451786", "0.44460818", "0.44413853", "0.4440639", "0.44386858", "0.44341722", "0.44341722", "0.44341722", "0.44312596", "0.44299808", "0.4429275", "0.4423599", "0.44229564", "0.4420936", "0.4417141", "0.4402147", "0.4402147" ]
0.538605
16
Tests if the specified segments contains a wildcard (ANY_KEY or ANY_INDEX)
public static boolean containsWildcard(final Object[] segments) { return containsWildcard(segments, 0, segments.length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean containsWildcard(final Object[] segments, final int startIndex, final int length) {\r\n\t\tfor (int index = startIndex; index < startIndex + length; index++) {\r\n\t\t\tfinal Object segment = segments[index];\r\n\t\t\tif (isWildcard(segment)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean containsWildcard(final String min) {\n return min.contains(\"*\")\r\n || min.contains(\"+\")\r\n || min.contains(\"%\")\r\n || min.contains(\"_\");\r\n }", "boolean matches(final HTTPContext http) {\n // check if number of segments match\n if(segments.length != http.depth()) return false;\n\n // check single segments\n for(int s = 0; s < segments.length; s++) {\n final String seg = segments[s];\n if(!seg.equals(http.segment(s)) && !seg.startsWith(\"{\")) return false;\n }\n return true;\n }", "public static boolean isWildcard(String format) {\n String routerUrl = cleanUrl(format);\n String[] routerParts = routerUrl.split(\"/\");\n\n for (String routerPart : routerParts) {\n if (routerPart.length() > 2\n && routerPart.charAt(0) == ':'\n && routerPart.charAt(routerPart.length() - 1) == ':') {\n return true;\n }\n }\n return false;\n }", "private boolean matchString(String s, String key)\n {\n if (s.equals(key)) return true;\n int min = s.length()<key.length()?s.length():key.length();\n for (int i=0;i<min; ++i)\n {\n \n if(key.charAt(i) == '*')\n return true;\n if(s.charAt(i) != key.charAt(i) && key.charAt(i) != '?')\n return false;\n }\n for (int i=s.length();i<key.length();i++)\n {\n if (key.charAt(i)!='*') \n return false;\n }\n return true;\n }", "private static boolean censorWildcard(boolean wildcard, String value, String prefix) {\r\n return wildcard \r\n &&!(value.toLowerCase().startsWith(prefix) && (value.length() < prefix.length() + 1));\r\n }", "boolean hasSegments();", "public boolean contains(String matchingString){\r\n\t\tfor(String wildcardRegularExpression: wildcardRegularExpressionList){\r\n\t\t\tif(Pattern.matches(wildcardRegularExpression, matchingString)) return true;\r\n\t\t}\r\n\t\treturn false;\t\r\n\t}", "protected boolean testWildcard(char c)\n {\n if(!acceptWildCards)\n return false;\n if(c != '.')\n return false;\n char ch2 = charAhead(1);\n if(ch2 == '?' || ch2 == '+' || ch2 == '*')\n ptr += 2; // ptr is on occ indicator\n else if(ch2 == '{') {\n int cp = ptr + 1;\n for(; cp < txtLength && txt[cp] != '}'; )\n ++ cp;\n// if(cp < txtLength)\n// ++ cp;\n if(cp >= txtLength || txt[cp] != '}') {\n ptr = cp;\n throw new PatternSyntaxException(\"missing closing '}'\",\n new String(txt), txtLength);\n }\n if(rangePattern == null)\n // \n rangePattern = new RegexMatchPattern(Pattern.compile(\"\\\\d+,\\\\d+?\"));\n String rex = new String(txt, ptr + 2, cp - ptr - 2);\n if (!rangePattern.matches(rex))\n throw new PatternSyntaxException(\"invalid wildcard repeat range\",\n rex, 0);\n ptr = cp;\n }\n else ++ptr;\n gotWildCard = true;\n return true;\n }", "public boolean contains(String key);", "private boolean testPartialMatch(final String[] record,\n\t final String[] criteria) {\n\tfor (int i = 0; i < criteria.length; ++i) {\n\t if (criteria[i] != null\n\t\t && (record.length <= i || record[i] == null || record[i]\n\t\t\t .startsWith(criteria[i]) == false)) {\n\t\treturn false;\n\t }\n\t}\n\treturn true;\n }", "private static boolean checkGenericPatternAll(String paramSaInput) {\r\n\t\tString saInput = paramSaInput;\r\n\t\tif (null != saInput) {\r\n\t\t\ttry {\r\n\t\t\t\tsaInput = URLDecoder.decode(saInput);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// LOGGER.error(\"Problem in URLDecode saInput is \" + saInput);\r\n\t\t\t\t// LOGGER.error(e);\r\n\t\t\t\tLOGGER.info(\"Exception:\" + e);\r\n\t\t\t}\r\n\r\n\t\t\tRegularExpression regex = null;\r\n\t\t\tint genLen = genSqlFilters.length;\r\n\t\t\ttry {\r\n\t\t\t\tfor (int ilCounter = 0; ilCounter < genLen; ilCounter++) {\r\n\t\t\t\t\tregex = new RegularExpression(genSqlFilters[ilCounter], \"i\");\r\n\r\n\t\t\t\t\tif (regex.matches(saInput)) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// if\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// for\r\n\t\t\tcatch (Exception e) {\r\n\t\t\t\tLOGGER.info(\"Exception\" + e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// if not null\r\n\r\n\t\treturn true;\r\n\t}", "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 }", "boolean hasSegment();", "boolean contains(String key);", "boolean contains(String key);", "public boolean isDataStartSegment(List<String> segments, int index) {\n return false;\n }", "int containsMatchingPattern(Set<String> values, String pattern, boolean matchPrefix) {\n return memoizer.matches(values, pattern, matchPrefix, () -> {\n int match = -1;\n for(String val : values) {\n String replaced = val.replaceAll(\"\\\\.\", \"\\\\\\\\.\").replaceAll(\"\\\\*\", \".*\");\n if(Pattern.compile(replaced).matcher(pattern).matches() || (matchPrefix && val.startsWith(pattern + \".\"))) {\n match = replaced.contains(\"*\") ? 0 : 1;\n break;\n }\n }\n return match;\n });\n }", "public TypeFilterHonSearch(String key) {\r\n\t\temptyKey = StringUtils.isEmpty(key);\r\n\t\tif (emptyKey == false) {\r\n\t\t\tkey = key.trim().toLowerCase();\r\n\t\t\tif (key.length() > 0) {\r\n\t\t\t\tif (key.charAt(key.length() - 1) != '*') {\r\n\t\t\t\t\tkey += '*';\r\n\t\t\t\t}\r\n\t\t\t\tpattern = Pattern.compile(StringUtils.replace(key, \"*\", \".*\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean containsKey(String s){\r\n return this.get(s) != 0;\r\n }", "public boolean containsKey(String key);", "public boolean isFooterStartSegment(List<String> segments, int index) {\n return false;\n }", "private boolean containsSubString(String str, String subStr)\r\n {\r\n if (str == null)\r\n return false;\r\n\r\n return (str.indexOf(subStr) != -1);\r\n }", "private static boolean isContained(String text, String pattern)\n {\n if (pattern.length() == 0)\n return true;\n else if (pattern.length() > text.length())\n return false;\n else if (isPrefix(text, pattern))\n return true;\n else\n return isContained(text.substring(1), pattern);\n }", "private boolean containsAny(final NullnessAnnotation... search) {\n boolean result = false;\n if (!annotations.isEmpty()) {\n for (final NullnessAnnotation obj : search) {\n if (annotations.contains(obj)) {\n result = true;\n break;\n }\n }\n }\n return result;\n }", "public static boolean isWildcard(String glob) {\n\t\treturn GLOB_META.matcher(glob).find();\n\t}", "public static boolean Wildcard(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Wildcard\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, WILDCARD, \"<wildcard>\");\n r = Wildcard_0(b, l + 1);\n if (!r) r = Wildcard_1(b, l + 1);\n if (!r) r = consumeToken(b, STAR_SIGN);\n if (!r) r = Wildcard_3(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "boolean matches(String key) {\n int keyLength = key.length();\n int patternLength = pattern.length();\n boolean[][] state = new boolean[keyLength + 1][patternLength + 1];\n state[0][0] = true; // empty key matches empty pattern\n for (int i = 0; i < patternLength; i++) {\n if (pattern.charAt(i) == '*') state[0][i + 1] = state[0][i]; // whether first empty matches pattern\n }\n for (int i = 0; i < keyLength; i++) {\n for (int j = 0; j < patternLength; j++) {\n char ch = pattern.charAt(j);\n if (ch == '?' || key.charAt(i) == ch) {\n state[i + 1][j + 1] = state[i][j];\n } else if (ch == '*') {\n state[i + 1][j + 1] = state[i][j + 1] || state[i + 1][j];\n }\n }\n }\n return state[keyLength][patternLength];\n }", "public boolean matchAnyString() { return false; }", "Condition like(QueryParameter parameter, String pattern);", "public Hashtable<K, V> getWildcard(String wildcard);", "public void containsAnyOf(@Nullable Object first, @Nullable Object second, Object... rest) {\n containsAny(\"contains any of\", accumulate(first, second, rest));\n }", "private boolean pruneSegment(BrokerRequest brokerRequest) {\n if (!_tableName.equals(brokerRequest.getQuerySource().getTableName())) {\n LOGGER.debug(\"Skipping segment {} from different table {}\", _segmentName, _tableName);\n return true;\n }\n\n // Check if any column in the query does not exist in the segment.\n Set<String> allColumns = _metadata.getAllColumns();\n if (brokerRequest.isSetAggregationsInfo()) {\n for (AggregationInfo aggregationInfo : brokerRequest.getAggregationsInfo()) {\n Map<String, String> aggregationParams = aggregationInfo.getAggregationParams();\n\n for (String column : aggregationParams.values()) {\n if (column != null && !column.isEmpty() && !column.equals(\"*\") && !allColumns.contains(column)) {\n LOGGER.debug(\"Skipping segment '{}', as it does not have column '{}'\", _metadata.getName(), column);\n return true;\n }\n }\n\n GroupBy groupBy = brokerRequest.getGroupBy();\n if (groupBy != null) {\n for (String column : groupBy.getColumns()) {\n if (!allColumns.contains(column)) {\n LOGGER.debug(\"Skipping segment '{}', as it does not have column '{}'\", _metadata.getName(), column);\n return true;\n }\n }\n }\n }\n } else {\n if (brokerRequest.isSetSelections()) {\n for (String column : brokerRequest.getSelections().getSelectionColumns()) {\n if (!allColumns.contains(column)) {\n LOGGER.debug(\"Skipping segment '{}', as it does not have column '{}'\", _metadata.getName(), column);\n return true;\n }\n }\n }\n }\n return false;\n }", "private static boolean matchesAny(String searchString, String... possibleValues) {\n\t\tfor (int i = 0; i < possibleValues.length; i++) {\n\t\t\tString attributeValue = possibleValues[i];\n\t\t\tif (StringUtils.isNotBlank(attributeValue) && (attributeValue.equals(searchString))) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static boolean isFullyQualified(String key, boolean literal) {\n return !literal && key != null && (key.contains(SEPARATOR) || INDEX_PATTERN.matcher(key).find());\n }", "public boolean contains( AnyType x )\n {\n int currentPos = findPos( x );\n if (array[currentPos] != null && array[currentPos].key.equals(x))\n \treturn true;\t\t//TODO : Test this method\n else\n \treturn false;\n \n }", "boolean any(String collection);", "protected boolean normalizeContains(String str, String substring) {\n\t\tif (str == null || substring == null) {\n\t\t\treturn false;\n\t\t}\n\t\tint index = normalizeAndLowercase(str).indexOf(normalizeAndLowercase(substring));\n\t\treturn index >= 0;\n\t}", "boolean isPartOf(String genomeName);", "public static boolean isPatternMatch(String name, String pattern) {\n \n // check special match cases first\n if (pattern.length() == 0) {\n return name.length() == 0;\n } else if (pattern.charAt(0) == '*') {\n \n // check if the wildcard is all that's left of pattern\n if (pattern.length() == 1) {\n return true;\n } else {\n \n // check if another wildcard follows next segment of text\n pattern = pattern.substring(1);\n int split = pattern.indexOf('*');\n if (split > 0) {\n \n // recurse on each match to text segment\n String piece = pattern.substring(0, split);\n pattern = pattern.substring(split);\n int offset = -1;\n while ((offset = name.indexOf(piece, ++offset)) > 0) {\n int end = offset + piece.length();\n if (isPatternMatch(name.substring(end), pattern)) {\n return true;\n }\n }\n \n } else {\n \n // no more wildcards, need exact match to end of name\n return name.endsWith(pattern);\n \n }\n }\n } else {\n \n // check for leading text before first wildcard\n int split = pattern.indexOf('*');\n if (split > 0) {\n \n // match leading text to start of name\n String piece = pattern.substring(0, split);\n if (name.startsWith(piece)) {\n return isPatternMatch(name.substring(split), pattern.substring(split));\n } else {\n return false;\n }\n \n } else {\n \n // no wildcards, need exact match\n return name.equals(pattern);\n \n }\n }\n return false;\n }", "boolean containsKey(String keyLabel);", "protected boolean matchesPattern(String signatureString)\n/* */ {\n/* 143 */ for (int i = 0; i < this.patterns.length; i++) {\n/* 144 */ boolean matched = matches(signatureString, i);\n/* 145 */ if (matched) {\n/* 146 */ for (int j = 0; j < this.excludedPatterns.length; j++) {\n/* 147 */ boolean excluded = matchesExclusion(signatureString, j);\n/* 148 */ if (excluded) {\n/* 149 */ return false;\n/* */ }\n/* */ }\n/* 152 */ return true;\n/* */ }\n/* */ }\n/* 155 */ return false;\n/* */ }", "@Override\r\n\tpublic boolean matches(String first, String last) {\n\t\treturn false;\r\n\t}", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> containsAny(String field, String... values);", "boolean contains(String pattern) {\n String str = buffer.toString();\n return str.contains(pattern);\n }", "@Override\n\t\t\tpublic boolean contains(String key) {\n\t\t\t\treturn false;\n\t\t\t}", "QueryElement addLikeWithWildcardSetting(String property, String value);", "public static boolean wildcardMatch(String text, String pattern) {\n if (pattern.length() > 0 && pattern.charAt(0) == Symbol.C_CARET) {\n return !wildcardMatch(text, pattern.substring(1));\n }\n return text.matches(pattern.replace(Symbol.QUESTION_MARK, Symbol.DOT + Symbol.QUESTION_MARK).replace(Symbol.STAR, Symbol.DOT + Symbol.STAR + Symbol.QUESTION_MARK));\n }", "boolean containsKey(CoreLabel key);", "public boolean containsKey(String tokens[]) {\n\t\tNDLMapEntryNode<T> node = traverse(tokens);\n\t\tif(node != null && node.end) {\n\t\t\t// found and end\n\t\t\treturn true;\n\t\t} else {\t\t\n\t\t\t// not a valid case\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean matches(String pattern, String str,\r\n boolean isCaseSensitive) {\r\n char[] patArr = pattern.toCharArray();\r\n char[] strArr = str.toCharArray();\r\n int patIdxStart = 0;\r\n int patIdxEnd = patArr.length - 1;\r\n int strIdxStart = 0;\r\n int strIdxEnd = strArr.length - 1;\r\n char ch;\r\n\r\n boolean containsStar = false;\r\n\r\n for (int i = 0; i < patArr.length; i++) {\r\n if (patArr[i] == '*') {\r\n containsStar = true;\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (!containsStar) {\r\n // No '*'s, so we make a shortcut\r\n if (patIdxEnd != strIdxEnd) {\r\n return false; // Pattern and string do not have the same size\r\n }\r\n\r\n for (int i = 0; i <= patIdxEnd; i++) {\r\n ch = patArr[i];\r\n\r\n if (ch != '?') {\r\n if (isCaseSensitive && ch != strArr[i]) {\r\n return false; // Character mismatch\r\n }\r\n\r\n if (!isCaseSensitive\r\n && Character.toUpperCase(ch) != Character.toUpperCase(strArr[i])) {\r\n return false; // Character mismatch\r\n }\r\n }\r\n }\r\n\r\n return true; // String matches against pattern\r\n }\r\n\r\n if (patIdxEnd == 0) {\r\n return true; // Pattern contains only '*', which matches anything\r\n }\r\n\r\n // Process characters before first star\r\n while ((ch = patArr[patIdxStart]) != '*' && strIdxStart <= strIdxEnd) {\r\n if (ch != '?') {\r\n if (isCaseSensitive && ch != strArr[strIdxStart]) {\r\n return false; // Character mismatch\r\n }\r\n\r\n if (!isCaseSensitive\r\n && Character.toUpperCase(ch)\r\n != Character.toUpperCase(strArr[strIdxStart])) {\r\n return false; // Character mismatch\r\n }\r\n }\r\n\r\n patIdxStart++;\r\n strIdxStart++;\r\n }\r\n\r\n if (strIdxStart > strIdxEnd) {\r\n // All characters in the string are used. Check if only '*'s are\r\n // left in the pattern. If so, we succeeded. Otherwise failure.\r\n for (int i = patIdxStart; i <= patIdxEnd; i++) {\r\n if (patArr[i] != '*') {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n // Process characters after last star\r\n while ((ch = patArr[patIdxEnd]) != '*' && strIdxStart <= strIdxEnd) {\r\n if (ch != '?') {\r\n if (isCaseSensitive && ch != strArr[strIdxEnd]) {\r\n return false; // Character mismatch\r\n }\r\n\r\n if (!isCaseSensitive\r\n && Character.toUpperCase(ch)\r\n != Character.toUpperCase(strArr[strIdxEnd])) {\r\n return false; // Character mismatch\r\n }\r\n }\r\n\r\n patIdxEnd--;\r\n strIdxEnd--;\r\n }\r\n\r\n if (strIdxStart > strIdxEnd) {\r\n // All characters in the string are used. Check if only '*'s are\r\n // left in the pattern. If so, we succeeded. Otherwise failure.\r\n for (int i = patIdxStart; i <= patIdxEnd; i++) {\r\n if (patArr[i] != '*') {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n // process pattern between stars. padIdxStart and patIdxEnd point\r\n // always to a '*'.\r\n while (patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd) {\r\n int patIdxTmp = -1;\r\n\r\n for (int i = patIdxStart + 1; i <= patIdxEnd; i++) {\r\n if (patArr[i] == '*') {\r\n patIdxTmp = i;\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (patIdxTmp == patIdxStart + 1) {\r\n // Two stars next to each other, skip the first one.\r\n patIdxStart++;\r\n\r\n continue;\r\n }\r\n\r\n // Find the pattern between padIdxStart & padIdxTmp in str between\r\n // strIdxStart & strIdxEnd\r\n int patLength = (patIdxTmp - patIdxStart - 1);\r\n int strLength = (strIdxEnd - strIdxStart + 1);\r\n int foundIdx = -1;\r\n strLoop:\r\n for (int i = 0; i <= strLength - patLength; i++) {\r\n for (int j = 0; j < patLength; j++) {\r\n ch = patArr[patIdxStart + j + 1];\r\n\r\n if (ch != '?') {\r\n if (isCaseSensitive && ch != strArr[strIdxStart + i + j]) {\r\n continue strLoop;\r\n }\r\n\r\n if (!isCaseSensitive\r\n && Character.toUpperCase(ch)\r\n != Character.toUpperCase(strArr[strIdxStart\r\n + i\r\n + j])) {\r\n continue strLoop;\r\n }\r\n }\r\n }\r\n\r\n foundIdx = strIdxStart + i;\r\n\r\n break;\r\n }\r\n\r\n if (foundIdx == -1) {\r\n return false;\r\n }\r\n\r\n patIdxStart = patIdxTmp;\r\n strIdxStart = foundIdx + patLength;\r\n }\r\n\r\n // All characters in the string are used. Check if only '*'s are left\r\n // in the pattern. If so, we succeeded. Otherwise failure.\r\n for (int i = patIdxStart; i <= patIdxEnd; i++) {\r\n if (patArr[i] != '*') {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "protected boolean isSubstring(String substring, String word) {\r\n//\t\tboolean isSub = true;\r\n\t\treturn word.contains(substring);\r\n//\t\treturn isSub;\r\n\t}", "protected static boolean match( String pattern, String str, boolean isCaseSensitive )\n {\n char[] patArr = pattern.toCharArray();\n char[] strArr = str.toCharArray();\n int patIdxStart = 0;\n int patIdxEnd = patArr.length - 1;\n int strIdxStart = 0;\n int strIdxEnd = strArr.length - 1;\n char ch;\n\n boolean containsStar = false;\n for( int i = 0; i < patArr.length; i++ )\n {\n if( patArr[ i ] == '*' )\n {\n containsStar = true;\n break;\n }\n }\n\n if( !containsStar )\n {\n // No '*'s, so we make a shortcut\n if( patIdxEnd != strIdxEnd )\n {\n return false;// Pattern and string do not have the same size\n }\n for( int i = 0; i <= patIdxEnd; i++ )\n {\n ch = patArr[ i ];\n if( ch != '?' )\n {\n if( isCaseSensitive && ch != strArr[ i ] )\n {\n return false;// Character mismatch\n }\n if( !isCaseSensitive && Character.toUpperCase( ch ) !=\n Character.toUpperCase( strArr[ i ] ) )\n {\n return false;// Character mismatch\n }\n }\n }\n return true;// String matches against pattern\n }\n\n if( patIdxEnd == 0 )\n {\n return true;// Pattern contains only '*', which matches anything\n }\n\n // Process characters before first star\n while( ( ch = patArr[ patIdxStart ] ) != '*' && strIdxStart <= strIdxEnd )\n {\n if( ch != '?' )\n {\n if( isCaseSensitive && ch != strArr[ strIdxStart ] )\n {\n return false;// Character mismatch\n }\n if( !isCaseSensitive && Character.toUpperCase( ch ) !=\n Character.toUpperCase( strArr[ strIdxStart ] ) )\n {\n return false;// Character mismatch\n }\n }\n patIdxStart++;\n strIdxStart++;\n }\n if( strIdxStart > strIdxEnd )\n {\n // All characters in the string are used. Check if only '*'s are\n // left in the pattern. If so, we succeeded. Otherwise failure.\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( patArr[ i ] != '*' )\n {\n return false;\n }\n }\n return true;\n }\n\n // Process characters after last star\n while( ( ch = patArr[ patIdxEnd ] ) != '*' && strIdxStart <= strIdxEnd )\n {\n if( ch != '?' )\n {\n if( isCaseSensitive && ch != strArr[ strIdxEnd ] )\n {\n return false;// Character mismatch\n }\n if( !isCaseSensitive && Character.toUpperCase( ch ) !=\n Character.toUpperCase( strArr[ strIdxEnd ] ) )\n {\n return false;// Character mismatch\n }\n }\n patIdxEnd--;\n strIdxEnd--;\n }\n if( strIdxStart > strIdxEnd )\n {\n // All characters in the string are used. Check if only '*'s are\n // left in the pattern. If so, we succeeded. Otherwise failure.\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( patArr[ i ] != '*' )\n {\n return false;\n }\n }\n return true;\n }\n\n // process pattern between stars. padIdxStart and patIdxEnd point\n // always to a '*'.\n while( patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd )\n {\n int patIdxTmp = -1;\n for( int i = patIdxStart + 1; i <= patIdxEnd; i++ )\n {\n if( patArr[ i ] == '*' )\n {\n patIdxTmp = i;\n break;\n }\n }\n if( patIdxTmp == patIdxStart + 1 )\n {\n // Two stars next to each other, skip the first one.\n patIdxStart++;\n continue;\n }\n // Find the pattern between padIdxStart & padIdxTmp in str between\n // strIdxStart & strIdxEnd\n int patLength = ( patIdxTmp - patIdxStart - 1 );\n int strLength = ( strIdxEnd - strIdxStart + 1 );\n int foundIdx = -1;\n strLoop :\n for( int i = 0; i <= strLength - patLength; i++ )\n {\n for( int j = 0; j < patLength; j++ )\n {\n ch = patArr[ patIdxStart + j + 1 ];\n if( ch != '?' )\n {\n if( isCaseSensitive && ch != strArr[ strIdxStart + i + j ] )\n {\n continue strLoop;\n }\n if( !isCaseSensitive && Character.toUpperCase( ch ) !=\n Character.toUpperCase( strArr[ strIdxStart + i + j ] ) )\n {\n continue strLoop;\n }\n }\n }\n\n foundIdx = strIdxStart + i;\n break;\n }\n\n if( foundIdx == -1 )\n {\n return false;\n }\n\n patIdxStart = patIdxTmp;\n strIdxStart = foundIdx + patLength;\n }\n\n // All characters in the string are used. Check if only '*'s are left\n // in the pattern. If so, we succeeded. Otherwise failure.\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( patArr[ i ] != '*' )\n {\n return false;\n }\n }\n return true;\n }", "private boolean contains(String key, String word, boolean caseSensitive) {\n\t\tint keyLen = key.length();\n\n\t\tif (caseSensitive) {\n\t\t\tfor (int i = 0; i <= word.length() - keyLen; i++) {\n\t\t\t\tif (word.substring(i, i + keyLen).equals(key)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (int i = 0; i <= word.length() - keyLen; i++) {\n\t\t\t\tif (word.substring(i, i + keyLen).equalsIgnoreCase(key)) {\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 static boolean checkGenericPattern(String paramSaInput) {\r\n\t\tString saInput = paramSaInput;\r\n\t\tif (null != saInput) {\r\n\t\t\ttry {\r\n\t\t\t\tsaInput = URLDecoder.decode(saInput);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// LOGGER.error(\"Problem in URLDecode saInput is \" + saInput);\r\n\t\t\t\t// LOGGER.error(e);\r\n\t\t\t\tLOGGER.info(\"Exception:\" + e);\r\n\t\t\t}\r\n\r\n\t\t\tRegularExpression regex = null;\r\n\t\t\ttry {\r\n\t\t\t\tfor (int ilCounter = 0; ilCounter < lSqlFilters.length; ilCounter++) {\r\n\t\t\t\t\tregex = new RegularExpression(lSqlFilters[ilCounter], \"i\");\r\n\r\n\t\t\t\t\tif (regex.matches(saInput)) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// if\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// for\r\n\t\t\tcatch (Exception e) {\r\n\t\t\t\tLOGGER.info(\"Exception\" + e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// if not null\r\n\r\n\t\treturn true;\r\n\t}", "protected boolean containsName(String full, String prefixes) {\n String[] prefixArray = StringUtils.split(prefixes, \",\");\n for (String prefix : prefixArray) {\n if (StringUtils.startsWith(full, StringUtils.trimToEmpty(prefix))) {\n return true;\n }\n }\n return false;\n }", "public boolean isSkippingEmptySegments() {\n return Boolean.valueOf(getOptional(\"kylin.query.skip-empty-segments\", \"true\"));\n }", "private DataSegment findMatchingSegment(ArrayList<DataSegment> segments, int[] cachePos) {\n for (DataSegment segment:segments) {\n boolean match=((segment.getSegmentStart()>=cachePos[0] && segment.getSegmentEnd()<=cachePos[1]) || (segment.getSegmentEnd()==cachePos[1] && segment.getSegmentStart()>=cachePos[0]));\n if (match) return segment;\n }\n return null;\n }", "boolean contains(String value);", "private boolean containsAll(final NullnessAnnotation... search) {\n boolean result = true;\n if (annotations.isEmpty()) {\n // an empty list of annotations can never contain all\n result = false;\n }\n else {\n for (final NullnessAnnotation obj : search) {\n if (!annotations.contains(obj)) {\n result = false;\n break;\n }\n }\n }\n return result;\n }", "public boolean search(String s, String p) {\n int i,j,start=0;\n for(i=0,j=0;i<s.length()&&j<p.length();i++) {\n if(p.charAt(j)=='*') {\n start = ++j;\n i--;\n } else if(match(p.charAt(j),s.charAt(i))) {\n j++;\n } else {\n i-=j-start;\n j=start;\n }\n }\n while(j<p.length() && p.charAt(j)=='*') {\n j++;\n }\n return j>=p.length();\n }", "boolean contains(String name);", "public static boolean wildPathMatch(String wildpath, String path) {\n\t\t// System.out.println(\"Matching: \"+wildpath+\" to \"+path);\n\t\twildpath = wildpath.trim();\n\t\tpath = path.trim();\n\t\tboolean match = true;\n\t\tboolean in_dots = false;\n\t\tint i, j, plen = path.length(), wplen = wildpath.length();\n\t\tchar wc, pc;\n\t\tfor(j = 0, i = 0; i < wplen && j < plen; i++) {\n\t\t\tif('%' == (wc = wildpath.charAt(i))) {\n\t\t\t\twc = wildpath.charAt(++i);\n\t\t\t\tif('0' > wc || '9' < wc) {\n\t\t\t\t\tmatch = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\twhile('/' != path.charAt(j) && j < plen) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t} else if('*' == wc) {\n\t\t\t\twhile('/' != path.charAt(j) && j < plen) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif('.' == wc && wildpath.regionMatches(i, \"...\", 0, 3)) {\n\t\t\t\ti += 2;\n\t\t\t\tin_dots = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(path.charAt(j++) != wc) {\n\t\t\t\tif(!in_dots) {\n\t\t\t\t\tmatch = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t} else if(in_dots) {\n\t\t\t\tString wpath2 = wildpath.substring(i);\n\t\t\t\tString path2 = path.substring(j - 1);\n\t\t\t\tif(wildPathMatch(wpath2, path2)) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(j < plen)\n\t\t\treturn in_dots;\n\t\tif(i < wplen)\n\t\t\treturn false;\n\t\treturn match;\n\t}", "public boolean isWildCard() {\n return (m_bWildCard);\n }", "public static void main(String[] args) {\n\t\tString s = \"abc\";\r\n\t\tString p = \".*\";\r\n\t\tSystem.out.println(isMatch(s, p));\r\n\t}", "public boolean contains(final byte[] string, final byte[] sub, final InputInfo info)\n throws QueryException {\n return indexOf(string(string), string(sub), false, false, info) != -1;\n }", "public boolean containsSearchKey(String key) {\n if (this.name.toLowerCase().contains(key) || this.name.toLowerCase().contains(Dictionary.parseKey(key))) {\n return true;\n }\n if (this.address.toLowerCase().contains(key) || this.address.toLowerCase().contains(Dictionary.parseKey(key))) {\n return true;\n }\n return this.faculty.toLowerCase().contains((key))\n || this.faculty.toLowerCase().contains(Dictionary.parseKey(key));\n }", "public boolean offsetsContainAnnotation (String offsets, HashSet<String> anno){\n\t\tfor (String offsetAnno : anno) {\n\t\t if (containsOffsets(offsets, offsetAnno)){\n\t\t\t return true;\n\t\t }\n\t\t}\n\t\t return false;\n\t}", "public boolean containsKey(Key key) ;", "private boolean isMatchingUsage(final PGPSignature sig, final int keyUsage) {\n if (sig.hasSubpackets()) {\n PGPSignatureSubpacketVector sv = sig.getHashedSubPackets();\n\n if (sv.hasSubpacket(KEY_FLAGS)) {\n // code fix suggested by kzt (see comments)\n return (sv.getKeyFlags() != 0) || (keyUsage != 0);\n }\n }\n\n return true;\n }", "public static boolean hasExplicitExtendsBound(final AnnotatedTypeMirror wildcard) {\n final Type.WildcardType wildcardType = (Type.WildcardType) wildcard.getUnderlyingType();\n return wildcardType.isExtendsBound() && !((WildcardType) wildcard.getUnderlyingType()).isUnbound();\n }", "public static final boolean isAny(String value) {\r\n return value != null && value.equals(ANY_VALUE);\r\n }", "public boolean matchesAny() {\n return value == ANY;\n }", "public boolean contains(String key)\r\n { return get(key) != null; }", "private boolean startsWithAny(List<String> packagesToTreatAsOpaque, String qualifiedTypeName) {\n for (String packageName : packagesToTreatAsOpaque) {\n if (!Strings.isNullOrEmpty(packageName) && qualifiedTypeName.startsWith(packageName)) {\n return true;\n }\n }\n return false;\n }", "protected boolean couldHoldIncluded( String name )\n {\n for( int i = 0; i < includes.length; i++ )\n {\n if( matchPatternStart( includes[ i ], name, isCaseSensitive ) )\n {\n return true;\n }\n }\n return false;\n }", "Builder addIsPartOf(String value);", "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 }", "boolean hasIsPartOf();", "boolean isPattern(String path);", "boolean contains(KeyType key);", "public static boolean hasExplicitSuperBound(final AnnotatedTypeMirror wildcard) {\n final Type.WildcardType wildcardType = (Type.WildcardType) wildcard.getUnderlyingType();\n return wildcardType.isSuperBound() && !((WildcardType) wildcard.getUnderlyingType()).isUnbound();\n }", "public boolean contains(String str);", "private static boolean isLike(String value1, String value2) {\n\t\t\n\t\tif(value2.indexOf('*') == -1) {\n\t\t\treturn EQUALS.satisfied(value1, value2);\n\t\t}\n\t\t\n\t\tif(value2.indexOf('*') != value2.lastIndexOf('*')) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t\n\t\treturn beforeStar(value1, value2) && afterStar(value1, value2);\t\t\n\t\t\t\t\n\t}", "public boolean contains(java.lang.String searchVal) {\n return (indexValue(searchVal) != -1);\n }", "@Override\n\tpublic boolean contains(Object value) {\n\t\tif (indexOf(value) != -1) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean containsKey(String key) {\n if (!index.containsKey(key)) return false;\n else if (index.get(key).isEmpty()) return false;\n else return true;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(isMatch(\"daa\", \"d*ada*\"));\n\t\tSystem.out.println(isMatch(\"daa\", \"d*aa\"));\n\t}", "protected abstract boolean matches(String paramString, int paramInt);", "@Override\n public boolean contains(String key) {\n if (key == null) {\n throw new IllegalArgumentException(\"argument to contains() is null\");\n }\n return get(root, key, 0) != null;\n }", "public boolean contains(Key key);", "public boolean contains(String prefix) {\n\t\tSet<String> prefixes = prefixToURIMap.keySet();\n\t\treturn prefixes.contains(prefix);\n\t}", "@Override\n\tpublic boolean contains(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public NodeKey parseSegments(String[] segments);", "public boolean contains(short el)\n\t{\n\t\tint n = indexOf(el); //DEBUG\n\t\tif (-1==indexOf(el)) \n\t\t\treturn false;\n\t\telse \n\t\t\treturn true;\n\t}", "private boolean hasEscalatingSubresources(List<String> verbs, List<String> resources) {\n if (Collections.disjoint(verbs, EscalatingResources.ESCALATING_VERBS)) {\n return false;\n }\n\n for (String apiResource : resources) {\n int idx = apiResource.lastIndexOf(\"/\");\n if (idx == -1) {\n continue;\n }\n String subResource = apiResource.substring(idx + 1);\n if (EscalatingResources.ESCALATING_SUBRESOURCES.contains(subResource)) {\n return true;\n }\n }\n return false;\n }", "private static boolean matches(String matchHeader, String toMatch) {\n String[] matchValues = matchHeader.split(\"\\\\s*,\\\\s*\");\n Arrays.sort(matchValues);\n return Arrays.binarySearch(matchValues, toMatch) > -1\n || Arrays.binarySearch(matchValues, \"*\") > -1;\n }", "public boolean contains(String key){\r\n\t\treturn get(key) != null;\r\n\t}", "boolean matchStart(String pattern, String path);", "public static boolean hasNoExplicitBound(final AnnotatedTypeMirror wildcard) {\n return ((Type.WildcardType) wildcard.getUnderlyingType()).isUnbound();\n }" ]
[ "0.7620412", "0.6299548", "0.5678907", "0.55680096", "0.54081535", "0.53962076", "0.53494793", "0.5256893", "0.51781994", "0.51361346", "0.51275635", "0.51202977", "0.5107727", "0.51053786", "0.50956506", "0.50956506", "0.5075832", "0.50285757", "0.49666718", "0.49585173", "0.49480337", "0.49323362", "0.4931605", "0.49283475", "0.49252245", "0.49247372", "0.49015146", "0.489926", "0.48923457", "0.4884381", "0.48717025", "0.48616755", "0.48600712", "0.4846966", "0.48468983", "0.48445436", "0.4843607", "0.48256016", "0.4814615", "0.4806487", "0.4799298", "0.47977412", "0.47976348", "0.47907344", "0.47859898", "0.47790614", "0.47678536", "0.47513968", "0.47443393", "0.47342965", "0.47225046", "0.47115824", "0.4709157", "0.47011942", "0.4700742", "0.4692174", "0.46899563", "0.46852478", "0.46682206", "0.4667692", "0.46501252", "0.46452248", "0.4643129", "0.46379182", "0.46304572", "0.4629789", "0.46277887", "0.46221447", "0.4622055", "0.46162575", "0.46158594", "0.46119437", "0.46025428", "0.4592563", "0.45891306", "0.45826304", "0.45696005", "0.4561848", "0.45617384", "0.4546326", "0.45448405", "0.45401162", "0.45374638", "0.45364168", "0.45316708", "0.45313343", "0.45288953", "0.45246994", "0.45223933", "0.45193267", "0.45173526", "0.45127052", "0.45124957", "0.45112905", "0.4499635", "0.44874486", "0.44869518", "0.44815794", "0.4480827", "0.44770026" ]
0.73642
1
Tests if the specified segments contains a wildcard (ANY_KEY or ANY_INDEX)
private static boolean containsWildcard(final Object[] segments, final int startIndex, final int length) { for (int index = startIndex; index < startIndex + length; index++) { final Object segment = segments[index]; if (isWildcard(segment)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean containsWildcard(final Object[] segments) {\r\n\t\treturn containsWildcard(segments, 0, segments.length);\r\n\t}", "private boolean containsWildcard(final String min) {\n return min.contains(\"*\")\r\n || min.contains(\"+\")\r\n || min.contains(\"%\")\r\n || min.contains(\"_\");\r\n }", "boolean matches(final HTTPContext http) {\n // check if number of segments match\n if(segments.length != http.depth()) return false;\n\n // check single segments\n for(int s = 0; s < segments.length; s++) {\n final String seg = segments[s];\n if(!seg.equals(http.segment(s)) && !seg.startsWith(\"{\")) return false;\n }\n return true;\n }", "public static boolean isWildcard(String format) {\n String routerUrl = cleanUrl(format);\n String[] routerParts = routerUrl.split(\"/\");\n\n for (String routerPart : routerParts) {\n if (routerPart.length() > 2\n && routerPart.charAt(0) == ':'\n && routerPart.charAt(routerPart.length() - 1) == ':') {\n return true;\n }\n }\n return false;\n }", "private boolean matchString(String s, String key)\n {\n if (s.equals(key)) return true;\n int min = s.length()<key.length()?s.length():key.length();\n for (int i=0;i<min; ++i)\n {\n \n if(key.charAt(i) == '*')\n return true;\n if(s.charAt(i) != key.charAt(i) && key.charAt(i) != '?')\n return false;\n }\n for (int i=s.length();i<key.length();i++)\n {\n if (key.charAt(i)!='*') \n return false;\n }\n return true;\n }", "private static boolean censorWildcard(boolean wildcard, String value, String prefix) {\r\n return wildcard \r\n &&!(value.toLowerCase().startsWith(prefix) && (value.length() < prefix.length() + 1));\r\n }", "boolean hasSegments();", "public boolean contains(String matchingString){\r\n\t\tfor(String wildcardRegularExpression: wildcardRegularExpressionList){\r\n\t\t\tif(Pattern.matches(wildcardRegularExpression, matchingString)) return true;\r\n\t\t}\r\n\t\treturn false;\t\r\n\t}", "protected boolean testWildcard(char c)\n {\n if(!acceptWildCards)\n return false;\n if(c != '.')\n return false;\n char ch2 = charAhead(1);\n if(ch2 == '?' || ch2 == '+' || ch2 == '*')\n ptr += 2; // ptr is on occ indicator\n else if(ch2 == '{') {\n int cp = ptr + 1;\n for(; cp < txtLength && txt[cp] != '}'; )\n ++ cp;\n// if(cp < txtLength)\n// ++ cp;\n if(cp >= txtLength || txt[cp] != '}') {\n ptr = cp;\n throw new PatternSyntaxException(\"missing closing '}'\",\n new String(txt), txtLength);\n }\n if(rangePattern == null)\n // \n rangePattern = new RegexMatchPattern(Pattern.compile(\"\\\\d+,\\\\d+?\"));\n String rex = new String(txt, ptr + 2, cp - ptr - 2);\n if (!rangePattern.matches(rex))\n throw new PatternSyntaxException(\"invalid wildcard repeat range\",\n rex, 0);\n ptr = cp;\n }\n else ++ptr;\n gotWildCard = true;\n return true;\n }", "public boolean contains(String key);", "private boolean testPartialMatch(final String[] record,\n\t final String[] criteria) {\n\tfor (int i = 0; i < criteria.length; ++i) {\n\t if (criteria[i] != null\n\t\t && (record.length <= i || record[i] == null || record[i]\n\t\t\t .startsWith(criteria[i]) == false)) {\n\t\treturn false;\n\t }\n\t}\n\treturn true;\n }", "private static boolean checkGenericPatternAll(String paramSaInput) {\r\n\t\tString saInput = paramSaInput;\r\n\t\tif (null != saInput) {\r\n\t\t\ttry {\r\n\t\t\t\tsaInput = URLDecoder.decode(saInput);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// LOGGER.error(\"Problem in URLDecode saInput is \" + saInput);\r\n\t\t\t\t// LOGGER.error(e);\r\n\t\t\t\tLOGGER.info(\"Exception:\" + e);\r\n\t\t\t}\r\n\r\n\t\t\tRegularExpression regex = null;\r\n\t\t\tint genLen = genSqlFilters.length;\r\n\t\t\ttry {\r\n\t\t\t\tfor (int ilCounter = 0; ilCounter < genLen; ilCounter++) {\r\n\t\t\t\t\tregex = new RegularExpression(genSqlFilters[ilCounter], \"i\");\r\n\r\n\t\t\t\t\tif (regex.matches(saInput)) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// if\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// for\r\n\t\t\tcatch (Exception e) {\r\n\t\t\t\tLOGGER.info(\"Exception\" + e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// if not null\r\n\r\n\t\treturn true;\r\n\t}", "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 }", "boolean hasSegment();", "boolean contains(String key);", "boolean contains(String key);", "public boolean isDataStartSegment(List<String> segments, int index) {\n return false;\n }", "int containsMatchingPattern(Set<String> values, String pattern, boolean matchPrefix) {\n return memoizer.matches(values, pattern, matchPrefix, () -> {\n int match = -1;\n for(String val : values) {\n String replaced = val.replaceAll(\"\\\\.\", \"\\\\\\\\.\").replaceAll(\"\\\\*\", \".*\");\n if(Pattern.compile(replaced).matcher(pattern).matches() || (matchPrefix && val.startsWith(pattern + \".\"))) {\n match = replaced.contains(\"*\") ? 0 : 1;\n break;\n }\n }\n return match;\n });\n }", "public TypeFilterHonSearch(String key) {\r\n\t\temptyKey = StringUtils.isEmpty(key);\r\n\t\tif (emptyKey == false) {\r\n\t\t\tkey = key.trim().toLowerCase();\r\n\t\t\tif (key.length() > 0) {\r\n\t\t\t\tif (key.charAt(key.length() - 1) != '*') {\r\n\t\t\t\t\tkey += '*';\r\n\t\t\t\t}\r\n\t\t\t\tpattern = Pattern.compile(StringUtils.replace(key, \"*\", \".*\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean containsKey(String s){\r\n return this.get(s) != 0;\r\n }", "public boolean containsKey(String key);", "public boolean isFooterStartSegment(List<String> segments, int index) {\n return false;\n }", "private boolean containsSubString(String str, String subStr)\r\n {\r\n if (str == null)\r\n return false;\r\n\r\n return (str.indexOf(subStr) != -1);\r\n }", "private static boolean isContained(String text, String pattern)\n {\n if (pattern.length() == 0)\n return true;\n else if (pattern.length() > text.length())\n return false;\n else if (isPrefix(text, pattern))\n return true;\n else\n return isContained(text.substring(1), pattern);\n }", "public static boolean isWildcard(String glob) {\n\t\treturn GLOB_META.matcher(glob).find();\n\t}", "private boolean containsAny(final NullnessAnnotation... search) {\n boolean result = false;\n if (!annotations.isEmpty()) {\n for (final NullnessAnnotation obj : search) {\n if (annotations.contains(obj)) {\n result = true;\n break;\n }\n }\n }\n return result;\n }", "public static boolean Wildcard(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Wildcard\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, WILDCARD, \"<wildcard>\");\n r = Wildcard_0(b, l + 1);\n if (!r) r = Wildcard_1(b, l + 1);\n if (!r) r = consumeToken(b, STAR_SIGN);\n if (!r) r = Wildcard_3(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "boolean matches(String key) {\n int keyLength = key.length();\n int patternLength = pattern.length();\n boolean[][] state = new boolean[keyLength + 1][patternLength + 1];\n state[0][0] = true; // empty key matches empty pattern\n for (int i = 0; i < patternLength; i++) {\n if (pattern.charAt(i) == '*') state[0][i + 1] = state[0][i]; // whether first empty matches pattern\n }\n for (int i = 0; i < keyLength; i++) {\n for (int j = 0; j < patternLength; j++) {\n char ch = pattern.charAt(j);\n if (ch == '?' || key.charAt(i) == ch) {\n state[i + 1][j + 1] = state[i][j];\n } else if (ch == '*') {\n state[i + 1][j + 1] = state[i][j + 1] || state[i + 1][j];\n }\n }\n }\n return state[keyLength][patternLength];\n }", "public boolean matchAnyString() { return false; }", "Condition like(QueryParameter parameter, String pattern);", "public Hashtable<K, V> getWildcard(String wildcard);", "public void containsAnyOf(@Nullable Object first, @Nullable Object second, Object... rest) {\n containsAny(\"contains any of\", accumulate(first, second, rest));\n }", "private boolean pruneSegment(BrokerRequest brokerRequest) {\n if (!_tableName.equals(brokerRequest.getQuerySource().getTableName())) {\n LOGGER.debug(\"Skipping segment {} from different table {}\", _segmentName, _tableName);\n return true;\n }\n\n // Check if any column in the query does not exist in the segment.\n Set<String> allColumns = _metadata.getAllColumns();\n if (brokerRequest.isSetAggregationsInfo()) {\n for (AggregationInfo aggregationInfo : brokerRequest.getAggregationsInfo()) {\n Map<String, String> aggregationParams = aggregationInfo.getAggregationParams();\n\n for (String column : aggregationParams.values()) {\n if (column != null && !column.isEmpty() && !column.equals(\"*\") && !allColumns.contains(column)) {\n LOGGER.debug(\"Skipping segment '{}', as it does not have column '{}'\", _metadata.getName(), column);\n return true;\n }\n }\n\n GroupBy groupBy = brokerRequest.getGroupBy();\n if (groupBy != null) {\n for (String column : groupBy.getColumns()) {\n if (!allColumns.contains(column)) {\n LOGGER.debug(\"Skipping segment '{}', as it does not have column '{}'\", _metadata.getName(), column);\n return true;\n }\n }\n }\n }\n } else {\n if (brokerRequest.isSetSelections()) {\n for (String column : brokerRequest.getSelections().getSelectionColumns()) {\n if (!allColumns.contains(column)) {\n LOGGER.debug(\"Skipping segment '{}', as it does not have column '{}'\", _metadata.getName(), column);\n return true;\n }\n }\n }\n }\n return false;\n }", "public static boolean isFullyQualified(String key, boolean literal) {\n return !literal && key != null && (key.contains(SEPARATOR) || INDEX_PATTERN.matcher(key).find());\n }", "private static boolean matchesAny(String searchString, String... possibleValues) {\n\t\tfor (int i = 0; i < possibleValues.length; i++) {\n\t\t\tString attributeValue = possibleValues[i];\n\t\t\tif (StringUtils.isNotBlank(attributeValue) && (attributeValue.equals(searchString))) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains( AnyType x )\n {\n int currentPos = findPos( x );\n if (array[currentPos] != null && array[currentPos].key.equals(x))\n \treturn true;\t\t//TODO : Test this method\n else\n \treturn false;\n \n }", "boolean any(String collection);", "protected boolean normalizeContains(String str, String substring) {\n\t\tif (str == null || substring == null) {\n\t\t\treturn false;\n\t\t}\n\t\tint index = normalizeAndLowercase(str).indexOf(normalizeAndLowercase(substring));\n\t\treturn index >= 0;\n\t}", "boolean isPartOf(String genomeName);", "public static boolean isPatternMatch(String name, String pattern) {\n \n // check special match cases first\n if (pattern.length() == 0) {\n return name.length() == 0;\n } else if (pattern.charAt(0) == '*') {\n \n // check if the wildcard is all that's left of pattern\n if (pattern.length() == 1) {\n return true;\n } else {\n \n // check if another wildcard follows next segment of text\n pattern = pattern.substring(1);\n int split = pattern.indexOf('*');\n if (split > 0) {\n \n // recurse on each match to text segment\n String piece = pattern.substring(0, split);\n pattern = pattern.substring(split);\n int offset = -1;\n while ((offset = name.indexOf(piece, ++offset)) > 0) {\n int end = offset + piece.length();\n if (isPatternMatch(name.substring(end), pattern)) {\n return true;\n }\n }\n \n } else {\n \n // no more wildcards, need exact match to end of name\n return name.endsWith(pattern);\n \n }\n }\n } else {\n \n // check for leading text before first wildcard\n int split = pattern.indexOf('*');\n if (split > 0) {\n \n // match leading text to start of name\n String piece = pattern.substring(0, split);\n if (name.startsWith(piece)) {\n return isPatternMatch(name.substring(split), pattern.substring(split));\n } else {\n return false;\n }\n \n } else {\n \n // no wildcards, need exact match\n return name.equals(pattern);\n \n }\n }\n return false;\n }", "boolean containsKey(String keyLabel);", "protected boolean matchesPattern(String signatureString)\n/* */ {\n/* 143 */ for (int i = 0; i < this.patterns.length; i++) {\n/* 144 */ boolean matched = matches(signatureString, i);\n/* 145 */ if (matched) {\n/* 146 */ for (int j = 0; j < this.excludedPatterns.length; j++) {\n/* 147 */ boolean excluded = matchesExclusion(signatureString, j);\n/* 148 */ if (excluded) {\n/* 149 */ return false;\n/* */ }\n/* */ }\n/* 152 */ return true;\n/* */ }\n/* */ }\n/* 155 */ return false;\n/* */ }", "@Override\r\n\tpublic boolean matches(String first, String last) {\n\t\treturn false;\r\n\t}", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> containsAny(String field, String... values);", "boolean contains(String pattern) {\n String str = buffer.toString();\n return str.contains(pattern);\n }", "@Override\n\t\t\tpublic boolean contains(String key) {\n\t\t\t\treturn false;\n\t\t\t}", "QueryElement addLikeWithWildcardSetting(String property, String value);", "public static boolean wildcardMatch(String text, String pattern) {\n if (pattern.length() > 0 && pattern.charAt(0) == Symbol.C_CARET) {\n return !wildcardMatch(text, pattern.substring(1));\n }\n return text.matches(pattern.replace(Symbol.QUESTION_MARK, Symbol.DOT + Symbol.QUESTION_MARK).replace(Symbol.STAR, Symbol.DOT + Symbol.STAR + Symbol.QUESTION_MARK));\n }", "boolean containsKey(CoreLabel key);", "public boolean containsKey(String tokens[]) {\n\t\tNDLMapEntryNode<T> node = traverse(tokens);\n\t\tif(node != null && node.end) {\n\t\t\t// found and end\n\t\t\treturn true;\n\t\t} else {\t\t\n\t\t\t// not a valid case\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean matches(String pattern, String str,\r\n boolean isCaseSensitive) {\r\n char[] patArr = pattern.toCharArray();\r\n char[] strArr = str.toCharArray();\r\n int patIdxStart = 0;\r\n int patIdxEnd = patArr.length - 1;\r\n int strIdxStart = 0;\r\n int strIdxEnd = strArr.length - 1;\r\n char ch;\r\n\r\n boolean containsStar = false;\r\n\r\n for (int i = 0; i < patArr.length; i++) {\r\n if (patArr[i] == '*') {\r\n containsStar = true;\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (!containsStar) {\r\n // No '*'s, so we make a shortcut\r\n if (patIdxEnd != strIdxEnd) {\r\n return false; // Pattern and string do not have the same size\r\n }\r\n\r\n for (int i = 0; i <= patIdxEnd; i++) {\r\n ch = patArr[i];\r\n\r\n if (ch != '?') {\r\n if (isCaseSensitive && ch != strArr[i]) {\r\n return false; // Character mismatch\r\n }\r\n\r\n if (!isCaseSensitive\r\n && Character.toUpperCase(ch) != Character.toUpperCase(strArr[i])) {\r\n return false; // Character mismatch\r\n }\r\n }\r\n }\r\n\r\n return true; // String matches against pattern\r\n }\r\n\r\n if (patIdxEnd == 0) {\r\n return true; // Pattern contains only '*', which matches anything\r\n }\r\n\r\n // Process characters before first star\r\n while ((ch = patArr[patIdxStart]) != '*' && strIdxStart <= strIdxEnd) {\r\n if (ch != '?') {\r\n if (isCaseSensitive && ch != strArr[strIdxStart]) {\r\n return false; // Character mismatch\r\n }\r\n\r\n if (!isCaseSensitive\r\n && Character.toUpperCase(ch)\r\n != Character.toUpperCase(strArr[strIdxStart])) {\r\n return false; // Character mismatch\r\n }\r\n }\r\n\r\n patIdxStart++;\r\n strIdxStart++;\r\n }\r\n\r\n if (strIdxStart > strIdxEnd) {\r\n // All characters in the string are used. Check if only '*'s are\r\n // left in the pattern. If so, we succeeded. Otherwise failure.\r\n for (int i = patIdxStart; i <= patIdxEnd; i++) {\r\n if (patArr[i] != '*') {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n // Process characters after last star\r\n while ((ch = patArr[patIdxEnd]) != '*' && strIdxStart <= strIdxEnd) {\r\n if (ch != '?') {\r\n if (isCaseSensitive && ch != strArr[strIdxEnd]) {\r\n return false; // Character mismatch\r\n }\r\n\r\n if (!isCaseSensitive\r\n && Character.toUpperCase(ch)\r\n != Character.toUpperCase(strArr[strIdxEnd])) {\r\n return false; // Character mismatch\r\n }\r\n }\r\n\r\n patIdxEnd--;\r\n strIdxEnd--;\r\n }\r\n\r\n if (strIdxStart > strIdxEnd) {\r\n // All characters in the string are used. Check if only '*'s are\r\n // left in the pattern. If so, we succeeded. Otherwise failure.\r\n for (int i = patIdxStart; i <= patIdxEnd; i++) {\r\n if (patArr[i] != '*') {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n // process pattern between stars. padIdxStart and patIdxEnd point\r\n // always to a '*'.\r\n while (patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd) {\r\n int patIdxTmp = -1;\r\n\r\n for (int i = patIdxStart + 1; i <= patIdxEnd; i++) {\r\n if (patArr[i] == '*') {\r\n patIdxTmp = i;\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (patIdxTmp == patIdxStart + 1) {\r\n // Two stars next to each other, skip the first one.\r\n patIdxStart++;\r\n\r\n continue;\r\n }\r\n\r\n // Find the pattern between padIdxStart & padIdxTmp in str between\r\n // strIdxStart & strIdxEnd\r\n int patLength = (patIdxTmp - patIdxStart - 1);\r\n int strLength = (strIdxEnd - strIdxStart + 1);\r\n int foundIdx = -1;\r\n strLoop:\r\n for (int i = 0; i <= strLength - patLength; i++) {\r\n for (int j = 0; j < patLength; j++) {\r\n ch = patArr[patIdxStart + j + 1];\r\n\r\n if (ch != '?') {\r\n if (isCaseSensitive && ch != strArr[strIdxStart + i + j]) {\r\n continue strLoop;\r\n }\r\n\r\n if (!isCaseSensitive\r\n && Character.toUpperCase(ch)\r\n != Character.toUpperCase(strArr[strIdxStart\r\n + i\r\n + j])) {\r\n continue strLoop;\r\n }\r\n }\r\n }\r\n\r\n foundIdx = strIdxStart + i;\r\n\r\n break;\r\n }\r\n\r\n if (foundIdx == -1) {\r\n return false;\r\n }\r\n\r\n patIdxStart = patIdxTmp;\r\n strIdxStart = foundIdx + patLength;\r\n }\r\n\r\n // All characters in the string are used. Check if only '*'s are left\r\n // in the pattern. If so, we succeeded. Otherwise failure.\r\n for (int i = patIdxStart; i <= patIdxEnd; i++) {\r\n if (patArr[i] != '*') {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "protected boolean isSubstring(String substring, String word) {\r\n//\t\tboolean isSub = true;\r\n\t\treturn word.contains(substring);\r\n//\t\treturn isSub;\r\n\t}", "protected static boolean match( String pattern, String str, boolean isCaseSensitive )\n {\n char[] patArr = pattern.toCharArray();\n char[] strArr = str.toCharArray();\n int patIdxStart = 0;\n int patIdxEnd = patArr.length - 1;\n int strIdxStart = 0;\n int strIdxEnd = strArr.length - 1;\n char ch;\n\n boolean containsStar = false;\n for( int i = 0; i < patArr.length; i++ )\n {\n if( patArr[ i ] == '*' )\n {\n containsStar = true;\n break;\n }\n }\n\n if( !containsStar )\n {\n // No '*'s, so we make a shortcut\n if( patIdxEnd != strIdxEnd )\n {\n return false;// Pattern and string do not have the same size\n }\n for( int i = 0; i <= patIdxEnd; i++ )\n {\n ch = patArr[ i ];\n if( ch != '?' )\n {\n if( isCaseSensitive && ch != strArr[ i ] )\n {\n return false;// Character mismatch\n }\n if( !isCaseSensitive && Character.toUpperCase( ch ) !=\n Character.toUpperCase( strArr[ i ] ) )\n {\n return false;// Character mismatch\n }\n }\n }\n return true;// String matches against pattern\n }\n\n if( patIdxEnd == 0 )\n {\n return true;// Pattern contains only '*', which matches anything\n }\n\n // Process characters before first star\n while( ( ch = patArr[ patIdxStart ] ) != '*' && strIdxStart <= strIdxEnd )\n {\n if( ch != '?' )\n {\n if( isCaseSensitive && ch != strArr[ strIdxStart ] )\n {\n return false;// Character mismatch\n }\n if( !isCaseSensitive && Character.toUpperCase( ch ) !=\n Character.toUpperCase( strArr[ strIdxStart ] ) )\n {\n return false;// Character mismatch\n }\n }\n patIdxStart++;\n strIdxStart++;\n }\n if( strIdxStart > strIdxEnd )\n {\n // All characters in the string are used. Check if only '*'s are\n // left in the pattern. If so, we succeeded. Otherwise failure.\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( patArr[ i ] != '*' )\n {\n return false;\n }\n }\n return true;\n }\n\n // Process characters after last star\n while( ( ch = patArr[ patIdxEnd ] ) != '*' && strIdxStart <= strIdxEnd )\n {\n if( ch != '?' )\n {\n if( isCaseSensitive && ch != strArr[ strIdxEnd ] )\n {\n return false;// Character mismatch\n }\n if( !isCaseSensitive && Character.toUpperCase( ch ) !=\n Character.toUpperCase( strArr[ strIdxEnd ] ) )\n {\n return false;// Character mismatch\n }\n }\n patIdxEnd--;\n strIdxEnd--;\n }\n if( strIdxStart > strIdxEnd )\n {\n // All characters in the string are used. Check if only '*'s are\n // left in the pattern. If so, we succeeded. Otherwise failure.\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( patArr[ i ] != '*' )\n {\n return false;\n }\n }\n return true;\n }\n\n // process pattern between stars. padIdxStart and patIdxEnd point\n // always to a '*'.\n while( patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd )\n {\n int patIdxTmp = -1;\n for( int i = patIdxStart + 1; i <= patIdxEnd; i++ )\n {\n if( patArr[ i ] == '*' )\n {\n patIdxTmp = i;\n break;\n }\n }\n if( patIdxTmp == patIdxStart + 1 )\n {\n // Two stars next to each other, skip the first one.\n patIdxStart++;\n continue;\n }\n // Find the pattern between padIdxStart & padIdxTmp in str between\n // strIdxStart & strIdxEnd\n int patLength = ( patIdxTmp - patIdxStart - 1 );\n int strLength = ( strIdxEnd - strIdxStart + 1 );\n int foundIdx = -1;\n strLoop :\n for( int i = 0; i <= strLength - patLength; i++ )\n {\n for( int j = 0; j < patLength; j++ )\n {\n ch = patArr[ patIdxStart + j + 1 ];\n if( ch != '?' )\n {\n if( isCaseSensitive && ch != strArr[ strIdxStart + i + j ] )\n {\n continue strLoop;\n }\n if( !isCaseSensitive && Character.toUpperCase( ch ) !=\n Character.toUpperCase( strArr[ strIdxStart + i + j ] ) )\n {\n continue strLoop;\n }\n }\n }\n\n foundIdx = strIdxStart + i;\n break;\n }\n\n if( foundIdx == -1 )\n {\n return false;\n }\n\n patIdxStart = patIdxTmp;\n strIdxStart = foundIdx + patLength;\n }\n\n // All characters in the string are used. Check if only '*'s are left\n // in the pattern. If so, we succeeded. Otherwise failure.\n for( int i = patIdxStart; i <= patIdxEnd; i++ )\n {\n if( patArr[ i ] != '*' )\n {\n return false;\n }\n }\n return true;\n }", "private boolean contains(String key, String word, boolean caseSensitive) {\n\t\tint keyLen = key.length();\n\n\t\tif (caseSensitive) {\n\t\t\tfor (int i = 0; i <= word.length() - keyLen; i++) {\n\t\t\t\tif (word.substring(i, i + keyLen).equals(key)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (int i = 0; i <= word.length() - keyLen; i++) {\n\t\t\t\tif (word.substring(i, i + keyLen).equalsIgnoreCase(key)) {\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 static boolean checkGenericPattern(String paramSaInput) {\r\n\t\tString saInput = paramSaInput;\r\n\t\tif (null != saInput) {\r\n\t\t\ttry {\r\n\t\t\t\tsaInput = URLDecoder.decode(saInput);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// LOGGER.error(\"Problem in URLDecode saInput is \" + saInput);\r\n\t\t\t\t// LOGGER.error(e);\r\n\t\t\t\tLOGGER.info(\"Exception:\" + e);\r\n\t\t\t}\r\n\r\n\t\t\tRegularExpression regex = null;\r\n\t\t\ttry {\r\n\t\t\t\tfor (int ilCounter = 0; ilCounter < lSqlFilters.length; ilCounter++) {\r\n\t\t\t\t\tregex = new RegularExpression(lSqlFilters[ilCounter], \"i\");\r\n\r\n\t\t\t\t\tif (regex.matches(saInput)) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// if\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// for\r\n\t\t\tcatch (Exception e) {\r\n\t\t\t\tLOGGER.info(\"Exception\" + e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// if not null\r\n\r\n\t\treturn true;\r\n\t}", "protected boolean containsName(String full, String prefixes) {\n String[] prefixArray = StringUtils.split(prefixes, \",\");\n for (String prefix : prefixArray) {\n if (StringUtils.startsWith(full, StringUtils.trimToEmpty(prefix))) {\n return true;\n }\n }\n return false;\n }", "public boolean isSkippingEmptySegments() {\n return Boolean.valueOf(getOptional(\"kylin.query.skip-empty-segments\", \"true\"));\n }", "private DataSegment findMatchingSegment(ArrayList<DataSegment> segments, int[] cachePos) {\n for (DataSegment segment:segments) {\n boolean match=((segment.getSegmentStart()>=cachePos[0] && segment.getSegmentEnd()<=cachePos[1]) || (segment.getSegmentEnd()==cachePos[1] && segment.getSegmentStart()>=cachePos[0]));\n if (match) return segment;\n }\n return null;\n }", "boolean contains(String value);", "private boolean containsAll(final NullnessAnnotation... search) {\n boolean result = true;\n if (annotations.isEmpty()) {\n // an empty list of annotations can never contain all\n result = false;\n }\n else {\n for (final NullnessAnnotation obj : search) {\n if (!annotations.contains(obj)) {\n result = false;\n break;\n }\n }\n }\n return result;\n }", "public boolean search(String s, String p) {\n int i,j,start=0;\n for(i=0,j=0;i<s.length()&&j<p.length();i++) {\n if(p.charAt(j)=='*') {\n start = ++j;\n i--;\n } else if(match(p.charAt(j),s.charAt(i))) {\n j++;\n } else {\n i-=j-start;\n j=start;\n }\n }\n while(j<p.length() && p.charAt(j)=='*') {\n j++;\n }\n return j>=p.length();\n }", "boolean contains(String name);", "public static boolean wildPathMatch(String wildpath, String path) {\n\t\t// System.out.println(\"Matching: \"+wildpath+\" to \"+path);\n\t\twildpath = wildpath.trim();\n\t\tpath = path.trim();\n\t\tboolean match = true;\n\t\tboolean in_dots = false;\n\t\tint i, j, plen = path.length(), wplen = wildpath.length();\n\t\tchar wc, pc;\n\t\tfor(j = 0, i = 0; i < wplen && j < plen; i++) {\n\t\t\tif('%' == (wc = wildpath.charAt(i))) {\n\t\t\t\twc = wildpath.charAt(++i);\n\t\t\t\tif('0' > wc || '9' < wc) {\n\t\t\t\t\tmatch = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\twhile('/' != path.charAt(j) && j < plen) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t} else if('*' == wc) {\n\t\t\t\twhile('/' != path.charAt(j) && j < plen) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif('.' == wc && wildpath.regionMatches(i, \"...\", 0, 3)) {\n\t\t\t\ti += 2;\n\t\t\t\tin_dots = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(path.charAt(j++) != wc) {\n\t\t\t\tif(!in_dots) {\n\t\t\t\t\tmatch = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t} else if(in_dots) {\n\t\t\t\tString wpath2 = wildpath.substring(i);\n\t\t\t\tString path2 = path.substring(j - 1);\n\t\t\t\tif(wildPathMatch(wpath2, path2)) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(j < plen)\n\t\t\treturn in_dots;\n\t\tif(i < wplen)\n\t\t\treturn false;\n\t\treturn match;\n\t}", "public boolean isWildCard() {\n return (m_bWildCard);\n }", "public static void main(String[] args) {\n\t\tString s = \"abc\";\r\n\t\tString p = \".*\";\r\n\t\tSystem.out.println(isMatch(s, p));\r\n\t}", "public boolean contains(final byte[] string, final byte[] sub, final InputInfo info)\n throws QueryException {\n return indexOf(string(string), string(sub), false, false, info) != -1;\n }", "public boolean containsSearchKey(String key) {\n if (this.name.toLowerCase().contains(key) || this.name.toLowerCase().contains(Dictionary.parseKey(key))) {\n return true;\n }\n if (this.address.toLowerCase().contains(key) || this.address.toLowerCase().contains(Dictionary.parseKey(key))) {\n return true;\n }\n return this.faculty.toLowerCase().contains((key))\n || this.faculty.toLowerCase().contains(Dictionary.parseKey(key));\n }", "public boolean containsKey(Key key) ;", "public boolean offsetsContainAnnotation (String offsets, HashSet<String> anno){\n\t\tfor (String offsetAnno : anno) {\n\t\t if (containsOffsets(offsets, offsetAnno)){\n\t\t\t return true;\n\t\t }\n\t\t}\n\t\t return false;\n\t}", "private boolean isMatchingUsage(final PGPSignature sig, final int keyUsage) {\n if (sig.hasSubpackets()) {\n PGPSignatureSubpacketVector sv = sig.getHashedSubPackets();\n\n if (sv.hasSubpacket(KEY_FLAGS)) {\n // code fix suggested by kzt (see comments)\n return (sv.getKeyFlags() != 0) || (keyUsage != 0);\n }\n }\n\n return true;\n }", "public static boolean hasExplicitExtendsBound(final AnnotatedTypeMirror wildcard) {\n final Type.WildcardType wildcardType = (Type.WildcardType) wildcard.getUnderlyingType();\n return wildcardType.isExtendsBound() && !((WildcardType) wildcard.getUnderlyingType()).isUnbound();\n }", "public static final boolean isAny(String value) {\r\n return value != null && value.equals(ANY_VALUE);\r\n }", "public boolean matchesAny() {\n return value == ANY;\n }", "public boolean contains(String key)\r\n { return get(key) != null; }", "private boolean startsWithAny(List<String> packagesToTreatAsOpaque, String qualifiedTypeName) {\n for (String packageName : packagesToTreatAsOpaque) {\n if (!Strings.isNullOrEmpty(packageName) && qualifiedTypeName.startsWith(packageName)) {\n return true;\n }\n }\n return false;\n }", "protected boolean couldHoldIncluded( String name )\n {\n for( int i = 0; i < includes.length; i++ )\n {\n if( matchPatternStart( includes[ i ], name, isCaseSensitive ) )\n {\n return true;\n }\n }\n return false;\n }", "Builder addIsPartOf(String value);", "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 }", "boolean hasIsPartOf();", "boolean contains(KeyType key);", "boolean isPattern(String path);", "public static boolean hasExplicitSuperBound(final AnnotatedTypeMirror wildcard) {\n final Type.WildcardType wildcardType = (Type.WildcardType) wildcard.getUnderlyingType();\n return wildcardType.isSuperBound() && !((WildcardType) wildcard.getUnderlyingType()).isUnbound();\n }", "public boolean contains(String str);", "private static boolean isLike(String value1, String value2) {\n\t\t\n\t\tif(value2.indexOf('*') == -1) {\n\t\t\treturn EQUALS.satisfied(value1, value2);\n\t\t}\n\t\t\n\t\tif(value2.indexOf('*') != value2.lastIndexOf('*')) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t\n\t\treturn beforeStar(value1, value2) && afterStar(value1, value2);\t\t\n\t\t\t\t\n\t}", "public boolean contains(java.lang.String searchVal) {\n return (indexValue(searchVal) != -1);\n }", "@Override\n\tpublic boolean contains(Object value) {\n\t\tif (indexOf(value) != -1) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean containsKey(String key) {\n if (!index.containsKey(key)) return false;\n else if (index.get(key).isEmpty()) return false;\n else return true;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(isMatch(\"daa\", \"d*ada*\"));\n\t\tSystem.out.println(isMatch(\"daa\", \"d*aa\"));\n\t}", "protected abstract boolean matches(String paramString, int paramInt);", "@Override\n public boolean contains(String key) {\n if (key == null) {\n throw new IllegalArgumentException(\"argument to contains() is null\");\n }\n return get(root, key, 0) != null;\n }", "public boolean contains(Key key);", "public NodeKey parseSegments(String[] segments);", "public boolean contains(String prefix) {\n\t\tSet<String> prefixes = prefixToURIMap.keySet();\n\t\treturn prefixes.contains(prefix);\n\t}", "@Override\n\tpublic boolean contains(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains(short el)\n\t{\n\t\tint n = indexOf(el); //DEBUG\n\t\tif (-1==indexOf(el)) \n\t\t\treturn false;\n\t\telse \n\t\t\treturn true;\n\t}", "private boolean hasEscalatingSubresources(List<String> verbs, List<String> resources) {\n if (Collections.disjoint(verbs, EscalatingResources.ESCALATING_VERBS)) {\n return false;\n }\n\n for (String apiResource : resources) {\n int idx = apiResource.lastIndexOf(\"/\");\n if (idx == -1) {\n continue;\n }\n String subResource = apiResource.substring(idx + 1);\n if (EscalatingResources.ESCALATING_SUBRESOURCES.contains(subResource)) {\n return true;\n }\n }\n return false;\n }", "private static boolean matches(String matchHeader, String toMatch) {\n String[] matchValues = matchHeader.split(\"\\\\s*,\\\\s*\");\n Arrays.sort(matchValues);\n return Arrays.binarySearch(matchValues, toMatch) > -1\n || Arrays.binarySearch(matchValues, \"*\") > -1;\n }", "public boolean contains(String key){\r\n\t\treturn get(key) != null;\r\n\t}", "boolean matchStart(String pattern, String path);", "public static boolean hasNoExplicitBound(final AnnotatedTypeMirror wildcard) {\n return ((Type.WildcardType) wildcard.getUnderlyingType()).isUnbound();\n }" ]
[ "0.73637915", "0.6299532", "0.5677498", "0.5566645", "0.5409565", "0.5396304", "0.5347541", "0.52564985", "0.51782286", "0.51365244", "0.5127244", "0.5118705", "0.51051986", "0.51039267", "0.5096437", "0.5096437", "0.5075797", "0.502852", "0.49675328", "0.49595454", "0.4948225", "0.49317646", "0.4931637", "0.49269933", "0.49236023", "0.4922158", "0.49006286", "0.48985112", "0.48909312", "0.4885455", "0.48738447", "0.48597273", "0.48592874", "0.48464665", "0.48449248", "0.4844004", "0.484277", "0.48258168", "0.48128006", "0.48054475", "0.47992387", "0.47973955", "0.47971204", "0.47892606", "0.4785432", "0.477884", "0.47688466", "0.47508916", "0.47437537", "0.4733259", "0.47225082", "0.47120732", "0.47092617", "0.47019655", "0.4700302", "0.46910754", "0.46882185", "0.46861124", "0.4668024", "0.4664131", "0.46512502", "0.46450347", "0.4641883", "0.46368808", "0.4630764", "0.46303827", "0.46267822", "0.46223363", "0.46207923", "0.4616316", "0.46155906", "0.46092793", "0.45999286", "0.4592284", "0.45870164", "0.45810202", "0.45682898", "0.45619336", "0.45600444", "0.4545498", "0.45446664", "0.4539791", "0.4537586", "0.45360553", "0.45313492", "0.45301408", "0.45283675", "0.45245492", "0.45218325", "0.45178565", "0.45175648", "0.4513948", "0.4511882", "0.45115718", "0.45014206", "0.44870114", "0.44855005", "0.44805673", "0.44795907", "0.44764066" ]
0.7620405
0
Recursively finds selected key/value pairs and adds them to the results map The results map is 'partially flattened' i.e. the key values are encoded paths, however selected values may have nested maps/lists (determined by the structure of the incoming data)
private static <T> void findAndAddSelected(final Class<T> type, final List<Entry<Object[], T>> results, final List<Object> prefix, final Object value, final Object[] segments, final int index) { if (value == null) { return; } else if (index >= segments.length) { // Found a potential match if (type.isInstance(value)) { results.add(SimpleEntry.valueOf(prefix.toArray(), type.cast(value))); } return; } final Object segment = segments[index]; final int prefixLength = prefix.size(); if (segment == PropertyPath.ANY_KEY) { // Loop all elements in map if (value instanceof Map) { @SuppressWarnings("unchecked") final Map<String, Object> map = (Map<String, Object>)value; for (final Entry<String, Object> entry: map.entrySet()) { prefix.add(entry.getKey()); findAndAddSelected(type, results, prefix, entry.getValue(), segments, index + 1); while (prefix.size() > prefixLength) { prefix.remove(prefixLength); } } } } else if (segment == PropertyPath.ANY_INDEX) { // Loop all elements in list if (value instanceof List) { int listIndex = 0; for (final Object next:(List<?>)value) { prefix.add(listIndex); findAndAddSelected(type, results, prefix, next, segments, index + 1); while (prefix.size() > prefixLength) { prefix.remove(prefixLength); } listIndex++; } } } else if (segment instanceof Integer) { // Match index in list final int targetIndex = (Integer)segment; if (value instanceof List && targetIndex < ((List<?>)value).size()) { final Object next = ((List<?>)value).get(targetIndex); prefix.add(targetIndex); findAndAddSelected(type, results, prefix, next, segments, index + 1); while (prefix.size() > prefixLength) { prefix.remove(prefixLength); } } } else { // String // Match named key in map final String targetKey = (String)segment; if (value instanceof Map) { @SuppressWarnings("unchecked") final Map<String, Object> map = (Map<String, Object>)value; final Object next = map.get(targetKey); prefix.add(targetKey); findAndAddSelected(type, results, prefix, next, segments, index + 1); while (prefix.size() > prefixLength) { prefix.remove(prefixLength); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Map<String, Object> getValues(boolean deep);", "public abstract boolean apply( String inputKey, Object input, WalkedPath walkedPath, Map<String,Object> output );", "public static Map<String, String> expand(Map<String, String> props){\r\n\t\tMap<String, String> result = new HashMap<String, String>();\r\n\t\tSet<String> entriesNeedingSubstitution = new HashSet<String>();\r\n\t\t// First pass: put all properties into result and identify properties which need expanding\r\n\t\tfor (Entry<String, String> entry: props.entrySet()) {\r\n\t\t\tString key = entry.getKey();\r\n\t\t\tString value = entry.getValue();\r\n\t\t\tMatcher m = SUBST_REGEXP.matcher(value);\r\n\t\t\tif (m.find()) entriesNeedingSubstitution.add(key);\r\n\t\t\tresult.put(key, value);\r\n\t\t}\r\n\r\n\t\t// Substitution passes\r\n\t\tfor (int nestingDepth = 1; nestingDepth < MAX_SUBSTITUTION_PASSES && entriesNeedingSubstitution.size() > 0; nestingDepth++) {\r\n\t\t\tlogger.trace(\"Starting substitution pass #{}\",nestingDepth);\r\n\t\t\tIterator<String> iter = entriesNeedingSubstitution.iterator();\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tString expKey = iter.next();\r\n\t\t\t\tString value = result.get(expKey);\r\n\t\t\t\tvalue = expand(value, result);\r\n\t\t\t\tresult.put(expKey, value);\r\n\t\t\t\tif (!SUBST_REGEXP.matcher(value).find()) {\r\n\t\t\t\t\titer.remove();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public static Map<Integer, List<Integer>> displayResult( Map<Integer, List<Integer>> result) {\n Map<Integer, List<Integer>> desiredResult = new HashMap<Integer, List<Integer>>();\n List<Integer> oneParents = new ArrayList<Integer>();\n List<Integer> noParents = new ArrayList<Integer>();\n\n if(result != null) {\n for( int key : result.keySet() ) {\n List<Integer> parents = result.get( key);\n if( parents.size() == 0) {\n noParents.add(key);\n } else if ( parents.size() == 1 ) {\n oneParents.add( key);\n }\n }\n desiredResult.put(0, noParents);\n desiredResult.put(1, oneParents);\n }\n return desiredResult;\n }", "public static void asSearchResult(Map<String, List<Search>> results,\n\t\t\tWriter writer, int level) throws IOException {\n\n\t\twriter.write(\"[\" + System.lineSeparator());\n\n\t\tIterator<String> itr = results.keySet().iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tString next = itr.next().toString();\n\t\t\tindent(level + 1, writer);\n\t\t\twriter.write(\"{\" + System.lineSeparator());\n\t\t\tindent(level + 2, writer);\n\t\t\tquote(\"queries\", writer);\n\t\t\twriter.write(\": \");\n\t\t\tquote(next, writer);\n\t\t\twriter.write(\",\" + System.lineSeparator());\n\t\t\tindent(level + 2, writer);\n\t\t\tquote(\"results\", writer);\n\t\t\twriter.write(\": [\" + System.lineSeparator());\n\n\t\t\tasNestedSearch(next, results, writer, level + 3);\n\n\t\t\tindent(level + 2, writer);\n\t\t\twriter.write(\"]\" + System.lineSeparator());\n\n\t\t\tif (itr.hasNext()) {\n\t\t\t\tindent(level + 1, writer);\n\t\t\t\twriter.write(\"},\" + System.lineSeparator());\n\t\t\t} else {\n\t\t\t\tindent(level + 1, writer);\n\t\t\t\twriter.write(\"}\" + System.lineSeparator());\n\t\t\t}\n\t\t}\n\t\twriter.write(\"]\");\n\t}", "@Override\n\tpublic List<Map<String, Object>> selectToTreeNocheckMap(Map param) {\n\t\treturn codeRegorgMapper.selectToTreeNocheckMap(param);\n\t}", "private Map mergeResults(Map first, Map second) {\n/* 216 */ Iterator verb_enum = second.keySet().iterator();\n/* 217 */ Map clonedHash = new HashMap(first);\n/* */ \n/* */ \n/* 220 */ while (verb_enum.hasNext()) {\n/* 221 */ String verb = verb_enum.next();\n/* 222 */ List cmdVector = (List)clonedHash.get(verb);\n/* 223 */ if (cmdVector == null) {\n/* 224 */ clonedHash.put(verb, second.get(verb));\n/* */ continue;\n/* */ } \n/* 227 */ List oldV = (List)second.get(verb);\n/* 228 */ cmdVector = new ArrayList(cmdVector);\n/* 229 */ cmdVector.addAll(oldV);\n/* 230 */ clonedHash.put(verb, cmdVector);\n/* */ } \n/* */ \n/* 233 */ return clonedHash;\n/* */ }", "public Map<String, Object> getResult(String key, Object value) throws Exception {\n return getResult(Collections.singletonList(key), Collections.singletonList(value));\n }", "Builder values(Map<Path<?>, TypedExpression<?>> values);", "public ResultMap<BaseNode> findNodes(ObjectNode query, String searchTerm, ObjectNode traverse);", "public abstract Map<String, ? extends FilesystemEntry> getChildren();", "public static void asNestedSearch(String next, Map<String, List<Search>> results, Writer writer, \n\t\t\tint level) throws IOException {\n\n\t\tIterator<Search> itr = results.get(next).iterator();\n\t\tint size = results.get(next).size();\n\t\tint count = 0;\n\n\t\twhile (itr.hasNext()) {\n\t\t\tcount++;\n\t\t\tSearch temp = itr.next();\n\n\t\t\tindent(level, writer);\n\t\t\twriter.write(\"{\" + System.lineSeparator());\n\t\t\tindent(level + 1, writer);\n\t\t\tquote(\"where\", writer);\n\t\t\twriter.write(\": \");\n\t\t\tquote(temp.getLocation(), writer);\n\t\t\twriter.write(\",\" + System.lineSeparator());\n\t\t\tindent(level + 1, writer);\n\t\t\tquote(\"count\", writer);\n\t\t\twriter.write(\": \" + (int) temp.getMatches() + \",\" + System.lineSeparator());\n\t\t\tindent(level + 1, writer);\n\t\t\tquote(\"score\", writer);\n\t\t\twriter.write(\": \" + String.valueOf(temp.getScore()) + System.lineSeparator());\n\t\t\tindent(level, writer);\n\n\t\t\tif (count != size) {\n\t\t\t\twriter.write(\"},\" + System.lineSeparator());\n\t\t\t} else {\n\t\t\t\twriter.write(\"}\" + System.lineSeparator());\n\t\t\t}\n\t\t}\n\t}", "protected Map<String, BaseAttribute> processCollectionResult(DBObject result) throws AttributeResolutionException {\n Map<String, BaseAttribute> attributes = new HashMap<String, BaseAttribute>();\n try {\n MongoDbKeyAttributeMapper keyAttributeMapper;\n BaseAttribute attribute;\n\n if (result != null) {\n for (String keyName : result.keySet()) {\n log.debug(\"Processing mongodb key: {} class: {}\", keyName, result.get(keyName).getClass());\n\n List<MongoDbKeyAttributeMapper> keyChildMap = null;\n keyAttributeMapper = keyAttributeMap.get(keyName);\n attribute = getAttribute(attributes, keyAttributeMapper, keyName);\n if (keyAttributeMapper != null) {\n keyChildMap = keyAttributeMapper.getChildKeyAttributeMaps();\n }\n\n if (keyChildMap != null && keyChildMap.size() > 0) {\n BasicDBObject dataMap = (BasicDBObject) result.get(keyName);\n for (MongoDbKeyAttributeMapper map : keyChildMap) {\n attribute = getAttribute(attributes, map, map.getAttributeName());\n attribute.getValues().add(dataMap.get(map.getMongoKey()));\n attributes.put(attribute.getId(), attribute);\n }\n } else if (result.get(keyName) instanceof com.mongodb.BasicDBList) {\n log.debug(\"Processing BasicDBList for {}.\", keyName);\n BasicDBList res = (BasicDBList) result.get(keyName);\n List<String> resultList = new ArrayList<String>();\n for (Object s : res) {\n if (s instanceof BasicDBObject) {\n log.error(\"BasicDBObjects in embedded lists not supported\");\n continue;\n }\n resultList.add((String) s);\n }\n attribute.getValues().addAll(resultList);\n attributes.put(attribute.getId(), attribute);\n } else {\n attribute.getValues().add(result.get(keyName));\n attributes.put(attribute.getId(), attribute);\n }\n }\n }\n } catch (MongoException e) {\n log.error(\"Problem processing result {}:\", getId(), e);\n throw new AttributeResolutionException(\"Problem processing result \" + getId() + \":\", e);\n }\n log.debug(\"MongoDb data connector {} attribute result: {}\", getId(), attributes.keySet());\n return attributes;\n }", "public void iterate() {\n\t\t// iterator\n\t\tQueue<NDLMapEntryNode<T>> nodes = new LinkedList<NDLMapEntryNode<T>>();\n\t\tnodes.add(rootNode);\n\t\twhile(!nodes.isEmpty()) {\n\t\t\t// iterate BFSwise\n\t\t\tNDLMapEntryNode<T> node = nodes.poll();\n\t\t\tif(node.end) {\n\t\t\t\t// end of entry, call processor\n\t\t\t\tif(keyProcessor != null) {\n\t\t\t\t\tkeyProcessor.process(node.data);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(node.keys != null) {\n\t\t\t\t// if available\n\t\t\t\tnodes.addAll(node.keys.values()); // next nodes to traverse\n\t\t\t}\n\t\t}\n\t}", "public static void asSearchResult(Map<String, List<Search>> results, Path path) {\n\t\ttry (BufferedWriter writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) {\n\t\t\tasSearchResult(results, writer, 0);\n\t\t} catch (IOException | NullPointerException e) {\n\t\t\tSystem.out.println(\"There was an issue finding the direcotry or file: \" + path);\n\t\t}\n\t}", "private Map deepMerge(Map original, Map newMap) {\r\n for (Object key : newMap.keySet()) {\r\n if (newMap.get(key) instanceof Map && original.get(key) instanceof Map) {\r\n Map originalChild = (Map) original.get(key);\r\n Map newChild = (Map) newMap.get(key);\r\n original.put(key, deepMerge(originalChild, newChild));\r\n } else if (newMap.get(key) instanceof List && original.get(key) instanceof List) {\r\n List originalChild = (List) original.get(key);\r\n List newChild = (List) newMap.get(key);\r\n for (Object each : newChild) {\r\n if (!originalChild.contains(each)) {\r\n originalChild.add(each);\r\n }\r\n }\r\n } else {\r\n original.put(key, newMap.get(key));\r\n }\r\n }\r\n return original;\r\n }", "static void flatten(Value value, Collection<Value> result) {\r\n if (value instanceof ContainerValue) {\r\n ContainerValue cont = (ContainerValue) value;\r\n for (int i = 0, size = cont.getElementSize(); i < size; i++) {\r\n flatten(cont.getElement(i), result);\r\n } \r\n } else {\r\n result.add(value);\r\n }\r\n }", "@Override\n\t\t\tpublic void putAll(Map<? extends PathwayImpl, ? extends AnalysisResult> m) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n public NavigableMap<K, V> subMap(final K fromKey, final boolean inclusive) {\n return null;\r\n }", "Map<String, String> findAllInMap();", "Map<String, PathItem> getPathItems();", "private Map<String, String> getContinueValues(String keyword) {\n return defaultKvStore.getJson(\"query_continue_\" + keyword, mapType);\n }", "private PropertyValues handleMapType(String path,MutablePropertyValues values,Object data,Method method,int level){\n\t\tClass<?> eleType=GenericCollectionTypeResolver.getMapValueReturnType(method,level);\t\n\t\t\n\t\tif(null==eleType){\n\t\t\treturn values;\n\t\t}\n\t\tif(data instanceof Map<?, ?>){\n\t\t\tMap<?,?> dataMap=(Map<?, ?>) data;\n\t\t\tfor(Map.Entry<?, ?> entry:dataMap.entrySet()){\n\t\t\t\tString key=entry.getKey().toString();\n\t\t\t\tObject value=entry.getValue();\n\t\t\t\tString subPath=path+PropertyAccessor.PROPERTY_KEY_PREFIX+key+PropertyAccessor.PROPERTY_KEY_SUFFIX; \n\t\t\t\tvalues.addPropertyValues(resolve(subPath,value,eleType,method,level+1));\n\t\t\t}\n\t\t}\n\t\treturn values;\n\t}", "Object visitMapOfValues(MapOfValuesNode node, Object state);", "static HashMap<String, String> flattenDictionary(HashMap<String, Object> dict) {\n HashMap<String,String> ans = new HashMap<>();\n\n if(dict == null){\n return ans;\n }\n flatten(dict,\"\",ans);\n return ans;\n }", "private Map<String, Object> flatten(Map<String, Object> map) {\n\t\tMap<String, Object> result = new LinkedHashMap<>();\n\t\tflatten(null, result, map);\n\t\treturn result;\n\t}", "@Test\n public void testGetValuesByResult() throws Exception {\n map.set(\"key-1\", \"value-1\", 10);\n map.set(\"key-2\", \"value-2\", 10);\n map.set(\"key-3\", \"value-3\", 10);\n \n List<TpMapResult> results = map.getValuesByResult(Arrays.asList(\"key-1\", \"key-2\", \"key-3\"));\n {\n TpMapResult result = results.get(0);\n Assert.assertEquals(result.getKey(), MemcachedMap.DEFAULT_ROOT_KEY_PREFIX + TpMap.KEY_SEPARATOR + \"key-1\");\n Assert.assertEquals(result.getValue(), \"value-1\");\n }\n {\n TpMapResult result = results.get(1);\n Assert.assertEquals(result.getKey(), MemcachedMap.DEFAULT_ROOT_KEY_PREFIX + TpMap.KEY_SEPARATOR + \"key-2\");\n Assert.assertEquals(result.getValue(), \"value-2\");\n }\n {\n TpMapResult result = results.get(2);\n Assert.assertEquals(result.getKey(), MemcachedMap.DEFAULT_ROOT_KEY_PREFIX + TpMap.KEY_SEPARATOR + \"key-3\");\n Assert.assertEquals(result.getValue(), \"value-3\");\n }\n }", "@Override\n\tpublic void printFilteredMap() {\n\t\tthis.result.forEach((k, v )-> v.forEach((ke,ve) -> ve.forEach((s) -> System.out.println(k + \" : \"+ ke + \" : \"+ s))));\n\n\t}", "private void populateOutputsInTree() {\n\t\tfor (ServiceNode s: serviceMap.values()) {\n\t\t\tfor (String outputVal : s.getOutputs())\n\t\t\t\ttaxonomyMap.get(outputVal).services.add(s);\n\t\t}\n\n\t\t// Now add the outputs of the input node\n\t\tfor (String outputVal : inputNode.getOutputs())\n\t\t\ttaxonomyMap.get(outputVal).services.add(inputNode);\n\t}", "protected static void addArgToResultsMap(String sArg, Object oValue, Map map)\n {\n Object oValuePrev = map.get(sArg);\n if (oValuePrev == null)\n {\n map.put(sArg, oValue);\n return;\n }\n\n List listVals;\n if (oValuePrev instanceof List)\n {\n listVals = (List) oValuePrev;\n }\n else\n {\n map.put(sArg, listVals = new LinkedList());\n listVals.add(oValuePrev);\n }\n listVals.add(oValue);\n }", "private void work(QuadTree current, QuadTree target, Map<String, Object> results, double tar_LonDPP) {\n LinkedList<QuadTree> grid = new LinkedList<>();\n LinkedList<QuadTree> Linked = new LinkedList<>();\n grid.addLast(current);\n while (grid.size() != 0) {\n QuadTree cur = grid.removeFirst();\n if (cur.checkResolution(tar_LonDPP) && cur.checkOverlap(target) || cur.checkOverlap(target) && cur.depth == 7) {\n Linked.addLast(cur);\n } else if (cur.checkOverlap(target) && cur.depth < cur.maxDepth) {\n QuadTree[] children = cur.findChild(cur);\n for (QuadTree c : children) {\n grid.addLast(c);\n }\n }\n }\n String[][] childrenNames = childrenNames(Linked);\n\n results.put(\"render_grid\", childrenNames);\n double[] fourPoints = findFourPoints(Linked);\n results.put(\"raster_ul_lon\", fourPoints[0]);\n results.put(\"raster_lr_lon\", fourPoints[1]);\n results.put(\"raster_lr_lat\", fourPoints[2]);\n results.put(\"raster_ul_lat\", fourPoints[3]);\n results.put(\"depth\", Linked.getFirst().depth);\n results.put(\"query_success\", true);\n }", "private Map<String, Set<String>> flattenDependencyTree() {\n final Map<String, Set<String>> newDeps = new HashMap<String, Set<String>>();\n for (Iterator<String> it = dependencies.keySet().iterator(); it.hasNext();) {\n String targetName = it.next();\n Set<String> flattenDeps = new HashSet<String>();\n flattenDependencyTree(targetName, new Stack<String>(), flattenDeps);\n newDeps.put(targetName, flattenDeps);\n }\n return newDeps;\n }", "@Override\r\n public Map<K, ICacheElement<K, V>> processGetMatching(final String pattern)\r\n {\r\n final Map<K, ICacheElement<K, V>> elements = new HashMap<>();\r\n Set<K> keyArray = null;\r\n storageLock.readLock().lock();\r\n try\r\n {\r\n keyArray = new HashSet<>(keyHash.keySet());\r\n }\r\n finally\r\n {\r\n storageLock.readLock().unlock();\r\n }\r\n\r\n final Set<K> matchingKeys = getKeyMatcher().getMatchingKeysFromArray(pattern, keyArray);\r\n\r\n for (final K key : matchingKeys)\r\n {\r\n final ICacheElement<K, V> element = processGet(key);\r\n if (element != null)\r\n {\r\n elements.put(key, element);\r\n }\r\n }\r\n return elements;\r\n }", "private void allCodesHelper(TrieNode root, String path, List<String> answer) {\r\n if (root.isLeaf()) {\r\n answer.add(root.getSymbol() + \":\" + path);\r\n }\r\n if (root.getChildrenMap() != null && root.getChildrenMap().size() != 0) {\r\n for (Map.Entry<Character, TrieNode> entries : root.getChildrenMap().entrySet()) {\r\n allCodesHelper(entries.getValue(), path + entries.getKey(), answer);\r\n }\r\n }\r\n }", "public static List<String> findAndAppendkeyWithValue(Map<String, String> with_key_and_values, Map<String, String> with_values) {\n logger.info(\"Streaming two different maps to find and append key with value\");\n return with_values.entrySet().stream().filter(valueSet -> isContainskeyInMap(valueSet.getKey(), with_key_and_values))\n .map(valueSet -> compareValueWithKeyValMap(valueSet,with_key_and_values))\n .flatMap(list -> list.stream()).collect(Collectors.toList());\n }", "public static void main(String[] args)\n throws Exception\n {\n PrintWriter pen = new PrintWriter(System.out, true);\n BST<String, String> dict =\n new BST<String, String>((left, right) -> left.compareTo(right));\n\n String[] values =\n new String[] { \"gorilla\", \"dingo\", \"chimp\", \"emu\", \"elephant\", \"beta\",\n \"aardvark\", \"chinchilla\", \"yeti\", \"gibbon\", \"horse\",\n \"elephant\", \"duck\", \"emu\" };\n String[] moreValues =\n new String[] { \"gnu\", \"dingo\", \"flying squirrel\", \"iguana\", \"squirrel\",\n \"red squirrel\", \"moose\" };\n\n // Add each element and make sure that it's there.\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n\n // A quick printout for fun\n pen.println(\"After setting the first set of values\");\n iterate(pen, dict.iterator());\n\n // Another quick printout for fun\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n pen.println(\"After setting the second set of values\");\n iterate(pen, dict.iterator());\n\n // Build iterators that traverse in different ways\n Iterable<String> df_pre_lr =\n dict.values(Traversal.DEPTH_FIRST_PREORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_lr =\n dict.values(Traversal.DEPTH_FIRST_INORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_rl =\n dict.values(Traversal.DEPTH_FIRST_INORDER_RIGHT_TO_LEFT);\n Iterable<String> bf_pre_rl =\n dict.values(Traversal.BREADTH_FIRST_PREORDER_RIGHT_TO_LEFT);\n\n // Iterate!\n pen.println(\"Iterating depth-first, preorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_pre_lr);\n \n pen.println(\"Iterating depth-first, inorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_in_lr);\n \n pen.println(\"Iterating depth-first, inorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, df_in_rl);\n \n pen.println(\"Iterating breadth-first, preorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, bf_pre_rl);\n\n // And we're done\n pen.close();\n }", "private static void traverse(ItemInfo rootItem, List<ItemInfo> results, int depth, String extraAttributes) throws Exception {\n Objects.requireNonNull(extraAttributes);\n\n final Collection<ItemInfo> children = new ArrayList<>();\n\n// final URL itemURL\n// = UriBuilder\n// .fromUri(rootItem.href.replace(\" \", \"%20\"))\n// .queryParam(\"attributes\", extraAttributes)\n// .build()\n// .toURL();\n\n final HttpURLConnection getItemConnection = (HttpURLConnection) rootItem.href.openConnection();\n getItemConnection.setConnectTimeout(PlatformTools.getDefaultConnectionTimeoutms());\n getItemConnection.setReadTimeout(PlatformTools.getDefaultReadTimeoutms());\n getItemConnection.setRequestProperty(\"Accept\", \"application/hal+json\");\n\n final int itemStatus = getItemConnection.getResponseCode();\n if (HttpURLConnection.HTTP_OK == itemStatus) {\n final String rawItemPageResults = PlatformTools.getContent(getItemConnection);\n final JSONObject itemResult = JSONObject.fromObject(rawItemPageResults);\n results.add(new ItemInfo(itemResult, depth));\n\n final JSONObject embedded = (JSONObject) itemResult.get(\"_embedded\");\n JSONObject collection = null;\n if (null != embedded) {\n collection = (JSONObject) embedded.get(\"loc:collection\");\n }\n // The item to traverse is a folder:\n if (null != collection) {\n // Get the items of the folder pagewise:\n JSONObject embeddedItems = (JSONObject) collection.get(\"_embedded\");\n if (null != embeddedItems) {\n do {\n final Object itemsObject = embeddedItems.get(\"loc:item\");\n if (null != itemsObject) {\n if (itemsObject instanceof JSONArray) {\n final JSONArray items = (JSONArray) itemsObject;\n\n final Collection<ItemInfo> itemPage = new ArrayList<>(items.size());\n for (final Object item : items) {\n final JSONObject folderItem = (JSONObject) item;\n itemPage.add(new ItemInfo(folderItem, depth + 1));\n }\n children.addAll(itemPage);\n } else {\n children.add(new ItemInfo((JSONObject) itemsObject, depth + 1));\n }\n }\n\n final JSONObject linkToNextPage = (JSONObject) collection.getJSONObject(\"_links\").get(\"next\");\n if (null != linkToNextPage) {\n final HttpURLConnection itemNextPageConnection = (HttpURLConnection) new URL(linkToNextPage.getString(\"href\").replace(\" \", \"%20\")).openConnection();\n itemNextPageConnection.setConnectTimeout(PlatformTools.getDefaultConnectionTimeoutms());\n itemNextPageConnection.setReadTimeout(PlatformTools.getDefaultReadTimeoutms());\n itemNextPageConnection.setRequestProperty(\"Accept\", \"application/hal+json\");\n\n final int itemNextPageStatus = itemNextPageConnection.getResponseCode();\n if (HttpURLConnection.HTTP_OK == itemNextPageStatus) {\n final String rawNextItemPageResults = PlatformTools.getContent(itemNextPageConnection);\n collection = JSONObject.fromObject(rawNextItemPageResults);\n embeddedItems = (JSONObject) collection.get(\"_embedded\");\n } else {\n collection = null;\n }\n } else {\n collection = null;\n }\n } while (null != collection && null != embeddedItems);\n }\n }\n\n for (final ItemInfo item : children) {\n if (item.hasChildren) {\n traverse(item, results, depth + 1, extraAttributes);\n }\n }\n\n for (final ItemInfo item : children) {\n if (!item.hasChildren) {\n results.add(item);\n }\n }\n } else {\n LOG.log(Level.INFO, \"Get item failed for item <{0}>. -> {1}\", new Object[] {rootItem.href, PlatformTools.getContent(getItemConnection)});\n }\n }", "public ResultMap<BaseNode> findNodes(ObjectNode query, String searchTerm, ObjectNode traverse, Pagination pagination);", "@Override\n\tpublic List<Map<String, Object>> selectDataListMap(Map<String, String> search) {\n\t\treturn null;\n\t}", "private static Set<Character> findDeepDependencies(Map<Character, Set<Character>> map, Set<Character> values) {\n\t\tif (values.isEmpty())\n\t\t\treturn Collections.emptySet();\n\n\t\tSet<Character> valuesCollected = new HashSet<>();\n\t\tfor (Character character : values) {\n\t\t\tif (map.containsKey(character))\n\t\t\t\tvaluesCollected.addAll(map.get(character));\n\t\t}\n\t\tSet<Character> newValues = findDeepDependencies(map, valuesCollected);\n\t\tvaluesCollected.addAll(newValues);\n\t\treturn valuesCollected;\n\t}", "protected abstract Map<String, Object> _getMulti(Set<String> keys);", "public Map<String, Map<String, Set<String>>> getLocationMap();", "private LinkedList<Node> reconstructPath(Map<Node, Node> cameFrom, Node current){\n LinkedList<Node> bestPath = new LinkedList<>();\n bestPath.add(current);\n\n while(cameFrom.containsKey(current)){\n current = cameFrom.get(current);\n bestPath.add(current);\n }\n return bestPath;\n }", "public HashMap<String, String> flattenDictionary(HashMap<String, Object> dict) {\n \n \n \n \n HashMap<String, String> flat_dict = new HashMap<String, String>();\n helper(\"\",dict,flat_dict);\n return flat_dict;\n }", "@Override\r\n public NavigableMap<K, V> subMap(final K fromKey, final boolean fromInclusive, final K toKey, final boolean toInclusive) {\n return null;\r\n }", "@Override\n\t@TimeComplexity(\"O(s + log n)\")\n\tpublic Iterable<Entry<K, V>> subMap(K fromKey, K toKey){\n\t/* TCJ\n\t * Performs a binary search: log n\n\t * Scans through each index within binarysearch range: s \n\t */\n\t\treturn snapShot(findIndex(fromKey), toKey);\n\t}", "@Override\r\n public List<File> getValues(final String term) throws IOException {\n {\r\n File file = new File(term);\r\n // is a directory -> get all children\r\n if (file.exists() && file.isDirectory()) {\r\n return children(file, fileFilter);\r\n }\r\n File parent = file.getParentFile();\r\n // is not a directory but has parent -> get siblings\r\n if (parent != null && parent.exists()) {\r\n return children(parent, normalizedFilter(term));\r\n }\r\n }\r\n // case 2: relative path\r\n {\r\n for (File path : paths) {\r\n File file = new File(path, term);\r\n // is a directory -> get all children\r\n if (file.exists() && file.isDirectory()) {\r\n return toRelativeFiles(children(file, fileFilter), path);\r\n }\r\n File parent = file.getParentFile();\r\n // is not a directory but has parent -> get siblings\r\n if (parent != null && parent.exists()) {\r\n return toRelativeFiles(children(parent, normalizedFilter(file.getAbsolutePath())), path);\r\n }\r\n }\r\n }\r\n return Collections.emptyList();\r\n }", "abstract protected Map<String, T> lookup(List<String> values);", "private static void resolveChildren(Map<String, Boolean> accumulator, Map<String, Boolean> children, boolean invert) {\n for (Map.Entry<String, Boolean> e : children.entrySet()) {\n if (accumulator.containsKey(e.getKey())) {\n continue; // Prevent infinite loops\n }\n\n // xor the value using the parent (bukkit logic, not mine)\n boolean value = e.getValue() ^ invert;\n accumulator.put(e.getKey().toLowerCase(), value);\n\n // lookup any deeper children & resolve if present\n Permission perm = Bukkit.getServer().getPluginManager().getPermission(e.getKey());\n if (perm != null) {\n resolveChildren(accumulator, perm.getChildren(), !value);\n }\n }\n }", "public Map<String,Value> collect(TaskRuntimeContext runtimeContext);", "JsonObject search(JsonObject params, ConcurrentMap<String, String> precisionMap);", "private HashMap<String, Integer> getAllPaths(Node start, Node end, Selection selection, int value) {\n //cleanup paths\n paths.clear();\n temp=0;\n\n //reset start and end node\n startNode = start;\n endNode = end;\n\n switch (selection) {\n case MAX_LATENCY:\n getPathsForSameNodeAndMaxLatency(end, value, end.getName());\n break;\n case MAX_HOOPS:\n getPathsForSameNodeAndMaxNumberOfSteps(end, value, start.getName());\n break;\n case EXACT_HOOPS:\n getPathsWithExactNumberOfSteps(start, end, value, start.getName());\n break;\n }\n\n //if no paths found throw message\n if(paths.size()==0){\n logger.warn(\"NO SUCH TRACE: \" + start.getName() + \"-\" + end.getName());\n }\n\n return paths;\n }", "@SuppressWarnings(\"unchecked\")\n public Map<String, Object> toNestedMap() {\n Map<String, Object> map = new HashMap<>();\n for (ObjectLongCursor<String> counter : counters) {\n if (counter.key.contains(\".\")) {\n String[] parts = counter.key.split(\"\\\\.\");\n Map<String, Object> curr = map;\n for (int i = 0; i < parts.length; i++) {\n String part = parts[i];\n boolean isLast = i == parts.length - 1;\n if (isLast == false) {\n if (curr.containsKey(part) == false) {\n curr.put(part, new HashMap<String, Object>());\n curr = (Map<String, Object>) curr.get(part);\n } else {\n curr = (Map<String, Object>) curr.get(part);\n }\n } else {\n curr.put(part, counter.value);\n }\n }\n } else {\n map.put(counter.key, counter.value);\n }\n }\n\n return map;\n }", "private Map<String,Map<String,List<String>>> buildDictionary(Document doc){\n\t\t\n\t\tElement root = doc.getDocumentElement();\n\t\t\n\t\t\n\t\tMap<String,Map<String,List<String>>> dictionary = new HashMap<String,Map<String,List<String>>>();\n\t\tthis.termSet = new TreeSet<String>();\n\t\t\n\t\tNodeList termList = doc.getElementsByTagName(\"term\");\n\t\tfor(int i = 0; i < termList.getLength(); i++){\n\t\t\tElement termElement = (Element) termList.item(i);\n\t\t\tElement nameElement = (Element) termElement.getElementsByTagName(\"name\").item(0);\n\t\t\tString name = nameElement.getTextContent();\n\t\t\tthis.termSet.add(name);\n\n\t\t\tMap<String,List<String>> synonymGroup = new HashMap<String,List<String>>();\n\t\t\tsynonymGroup.put(\"exact\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"related\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"broad\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"narrow\", new ArrayList<String>());\n\t\t\t\n\t\t\tNodeList synonyms = termElement.getElementsByTagName(\"synonym\");\n\t\t\tfor(int j=0; j<synonyms.getLength(); j++){\n\t\t\t\tElement synonymElement = (Element) synonyms.item(j);\n\t\t\t\tString synonym = synonymElement.getTextContent();\n\t\t\t\tString scope = synonymElement.getAttribute(\"scope\");\n\t\t\t\t//System.out.println(scope);\n\t\t\t\tList<String> synonymList = (List<String>) synonymGroup.get(scope);\n\t\t\t\t\n\t\t\t\t//System.out.println(synonym);\n\t\t\t\t\n\t\t\t\tsynonymList.add(synonym);\n\t\t\t}\n\t\t\t\n\t\t\tdictionary.put(name,synonymGroup);\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\treturn dictionary;\n\t}", "void dumpTree(Map<Object, String> tree, List<Object> e, String name, Value result, String member) throws NotSuspendedException, NoResponseException, NotConnectedException\n\t{\n\t\t// name for this variable\n\t\tif (name == null)\n\t\t\tname = \"\"; //$NON-NLS-1$\n\n\t\t// have we seen it already\n\t\tif (tree.containsKey(result))\n\t\t\treturn;\n\n\t\ttree.put(result, name); // place it\n\n\t\t// first iterate over our members looking for 'member'\n\t\tValue proto = result;\n\t\tboolean done = false;\n\t\twhile(!done && proto != null)\n\t\t{\n\t\t\tVariable[] members = proto.getMembers(m_session);\n\t\t\tproto = null;\n\n\t\t\t// see if we find one called 'member'\n\t\t\tfor(int i=0; i<members.length; i++)\n\t\t\t{\n\t\t\t\tVariable m = members[i];\n\t\t\t\tString memName = m.getName();\n\t\t\t\tif (memName.equals(member) && !tree.containsKey(m))\n\t\t\t\t{\n\t\t\t\t\te.add(name);\n\t\t\t\t\te.add(result);\n\t\t\t\t\te.add(m);\n\t\t\t\t\ttree.put(m, name+\".\"+memName); //$NON-NLS-1$\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t\telse if (memName.equals(\"__proto__\")) //$NON-NLS-1$\n\t\t\t\t\tproto = members[i].getValue();\n\t\t\t}\n\t\t}\n\n\t\t// now traverse other mcs recursively\n\t\tdone = false;\n\t\tproto = result;\n\t\twhile(!done && proto != null)\n\t\t{\n\t\t\tVariable[] members = proto.getMembers(m_session);\n\t\t\tproto = null;\n\n\t\t\t// see if we find an mc\n\t\t\tfor(int i=0; i<members.length; i++)\n\t\t\t{\n\t\t\t\tVariable m = members[i];\n\t\t\t\tString memName = m.getName();\n\n\t\t\t\t// if our type is NOT object or movieclip then we are done\n\t\t\t\tif (m.getValue().getType() != VariableType.OBJECT && m.getValue().getType() != VariableType.MOVIECLIP)\n\t\t\t\t\t;\n\t\t\t\telse if (m.getValue().getId() != Value.UNKNOWN_ID)\n\t\t\t\t\tdumpTree(tree, e, name, m.getValue(), member);\n\t\t\t\telse if (memName.equals(\"__proto__\")) //$NON-NLS-1$\n\t\t\t\t{\n\t\t\t\t\tproto = m.getValue();\n//\t\t\t\t\tname = name + \".__proto__\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private RecursiveFilesystemTraversalValue traverseAndAssertFiles(\n TraversalRequest params, ResolvedFile... expectedFilesIgnoringMetadata) throws Exception {\n RecursiveFilesystemTraversalValue result = evalTraversalRequest(params);\n Map<PathFragment, ResolvedFile> nameToActualResolvedFiles = new HashMap<>();\n for (ResolvedFile act : result.getTransitiveFiles().toList()) {\n // We can't compare directly, since metadata would be different, so we compare\n // by comparing the results of public method calls..\n nameToActualResolvedFiles.put(act.getNameInSymlinkTree(), act);\n }\n assertExpectedResolvedFilesPresent(nameToActualResolvedFiles, expectedFilesIgnoringMetadata);\n return result;\n }", "private static HashMap<String, String[]> buildUpdateMap(File remainderFile)\n throws ParserConfigurationException, IOException, SAXException {\n DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\n Document document = documentBuilder.parse(remainderFile);\n Node head = document.getDocumentElement();\n NodeList updatedOffers = head.getChildNodes();\n HashMap<String, String[]> result = new HashMap<>();\n // Build update map\n for (int i = 0; i < updatedOffers.getLength(); i++) {\n Node rfOffer = updatedOffers.item(i);\n if (rfOffer.getNodeName().equals(\"offer\")) {\n NodeList rfOfferChilds = rfOffer.getChildNodes();\n String[] values = new String[5];\n String id = null;\n for (int j = 0; j < rfOfferChilds.getLength(); j++) {\n Node rfOfferChild = rfOfferChilds.item(j);\n switch (rfOfferChild.getNodeName()) {\n case \"id\":\n id = rfOfferChild.getTextContent();\n break;\n case \"price\":\n values[0] = rfOfferChild.getTextContent();\n break;\n case \"quantity\":\n values[1] = rfOfferChild.getTextContent();\n break;\n case \"status\":\n values[2] = rfOfferChild.getTextContent();\n break;\n case \"novelty\":\n values[3] = rfOfferChild.getTextContent();\n break;\n case \"priority\":\n values[4] = rfOfferChild.getTextContent();\n break;\n default:\n break;\n }\n }\n if (id != null) result.put(id, values);\n }\n }\n return result;\n }", "public void getNodesThatCall(PassedParameter pp, Set result) {\n if (USE_PARAMETER_MAP) {\n Set s = (Set)passedParamToNodes.get(pp);\n if (s == null) return;\n result.addAll(s);\n return;\n }\n for (Iterator i = this.nodeIterator(); i.hasNext(); ) {\n Node n = (Node)i.next();\n if ((n.passedParameters != null) && n.passedParameters.contains(pp))\n result.add(n);\n }\n }", "@Override\n\tpublic JsonElement serialize(Map<Integer,Location> src, Type typeOfSrc, JsonSerializationContext context) {\n\t\tJsonObject locations = new JsonObject();\n\t\t//locations.add(property, value);\n\t\tJsonArray locationArray = new JsonArray();\n\t\tfor (Entry<Integer,Location> e: src.entrySet()) {\n\t\t\tJsonObject location = new JsonObject();\n\t\t\t\n\t\t\tlocation.addProperty(\"uniqueId\", e.getValue().getUniqueId());\n\t\t\tlocation.addProperty(\"locationId\", e.getValue().getLocationId());\n\t\t\tlocation.addProperty(\"locationName\", e.getValue().getLocationName());\n\t\t\tlocation.addProperty(\"description\", e.getValue().getDescription());\n\t\t\tlocation.addProperty(\"latitude\", e.getValue().getLatitude());\n\t\t\tlocation.addProperty(\"longitude\", e.getValue().getLongitude());\n\t\t\tlocation.addProperty(\"altitude\", e.getValue().getAltitude());\n\t\t\tlocation.addProperty(\"area\", e.getValue().getArea());\n\t\t\t\n\t\t\tJsonArray jsonArray = new JsonArray();\n\t\t\tfor (Modifier a : e.getValue().getEnvironmentModifiers()) {\n\t\t\t\tJsonObject listElement = new JsonObject();\n\t\t\t\tString modClassName = a.getClass().getName();\n\t\t\t\t//\t\t\tSystem.out.println(className + \":\" + a.toString());\n\t\t\t\tlistElement.addProperty(CLASSNAME, modClassName);\n\t\t\t\tJsonElement elem = context.serialize(a);\n\t\t\t\tlistElement.add(INSTANCE, elem);\n\t\t\t\tjsonArray.add(listElement);\n\t\t\t}\n\t\t\tlocation.add(\"environmentModifiers\", jsonArray);\n\t\t\tlocationArray.add(location);\n\t\t\t//JsonElement elem = context.serialize(e.getValue().getLocations(), typeOfSrc);\n\t\t\t//retValue.add(\"locations\", elem);\n\t\t\t//.getLocationName());\n\t\t\t//\n\t\t\t//retValueArray.add(retValue);\n\t\t}\n\t\tlocations.add(\"locations\", locationArray);\n//\t\tfor (int j = retValueArray.size() - 1 ; j>1; j--) {\n//\t\t\tretValueArray.get(j-1).add(\"location\", retValueArray.get(j).getAsJsonObject());\n//\t\t\tSystem.out.format(\"added %d to %d\\n\", j, j-1 );\n//\t\t}\n\t\t//return retValueArray.get(1).getAsJsonObject();\n\t\t\n\t\treturn locations;\n\t}", "private static HashSet<String> addElement(Map m, String key,int count) {\n\t\tIterator it = m.entrySet().iterator();\n\t\tHashSet<String> allParents=new HashSet<String>();\n\t\tHashSet<String> newNodeHS=new HashSet<String>();\n\t\tHashSet<String> receive=new HashSet<String>();\n\t\tString parent=\"\";\n\t\tif(readNodes.get(key)==null)\n\t\t{\n\t\t\tif(!(key.equals(root)))\n\t\t\t{\n\t\t\tallParents=(HashSet)m.get(key);\n\t\t\tIterator iter = allParents.iterator();\n\t\t\twhile(iter.hasNext())\n\t\t\t{\n\t\t\t\tparent=(String)iter.next();\n\t\t\t\tcount++;\n\t\t\t\treceive=addElement(m,parent,count);\n\t\t\t\tString str=key+\"-\"+parent;\n\t\t\t\tIterator toRecieve = receive.iterator();\n\t\t\t\twhile(toRecieve.hasNext())\n\t\t\t\t{\n\t\t\t\t\tnewNodeHS.add((String)toRecieve.next());\n\t\t\t\t}\n\t\t\t\tnewNodeHS.add(str);\n\t\t\t\tcount--;\n\t\t\t}\n\t\t\t\tif(count==0)\n\t\t\t\t{\n\t\t\t\t\tIterator<HashSet> iternew = totalDAG.iterator();\n\t\t\t\t\tHashSet<HashSet> inProgressDAG=new HashSet<HashSet>(totalDAG); \n\t\t\t\t\twhile (iternew.hasNext()) {\n\t\t\t\t\t HashSet<String> tillCreatedDAG=iternew.next();\n\t\t\t\t\t HashSet<String> union=new HashSet<String>(newNodeHS);\n\t\t\t\t\t union.addAll(tillCreatedDAG);\n\t\t\t\t\t inProgressDAG.add(union);\n\t\t\t\t\t}\n\t\t\t\t\ttotalDAG.clear();\n\t\t\t\t\ttotalDAG=inProgressDAG;\n\t\t\t\t\ttotalDAG.add(newNodeHS);\n\t\t\t\t\treadNodes.put(key, newNodeHS);\n\t\t\t\t\tSystem.out.println(\"Size: \" +totalDAG.size()+\" Nodes: \"+(++totalCount));\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t\t\tcount--;\n\t\t\t\treturn newNodeHS;\t\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString str=root;\n\t\t\t\t\tnewNodeHS.add(str);\n\t\t\t\t\tcount--;\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (HashSet)readNodes.get(key);\n\t\t}\n\t}", "@Override\n public Map<K, V> getMatching( final String pattern )\n {\n final Map<K, V> unwrappedResults;\n\n final Map<K, ICacheElement<K, V>> wrappedResults = this.getCacheControl().getMatching( pattern );\n\n if ( wrappedResults == null )\n {\n unwrappedResults = new HashMap<>();\n }\n else\n {\n unwrappedResults = wrappedResults.entrySet()\n .stream()\n .filter(entry -> entry.getValue() != null)\n .collect(Collectors.toMap(\n Entry::getKey,\n entry -> entry.getValue().getVal()));\n }\n\n return unwrappedResults;\n }", "@Override\n public List<Map<String, Serializable>> getResult() {\n Preconditions.checkState(_finish, \"GetResult cannot be called before finish.\");\n List<Map<String, Serializable>> result = new ArrayList<Map<String, Serializable>>(_aggrFuncContextList.size());\n\n for (int i = 0; i < _aggrFuncContextList.size(); i++) {\n result.add(new HashMap<String, Serializable>());\n }\n\n Iterator<Pair<Long, String>> groupKeys = _groupKeyGenerator.getUniqueGroupKeys();\n while (groupKeys.hasNext()) {\n Pair<Long, String> idKeyPair = groupKeys.next();\n String stringGroupKey = idKeyPair.getSecond();\n\n for (int i = 0; i < _aggrFuncContextList.size(); i++) {\n double resultForGroupKey = _resultHolderArray[i].getResultForGroupKey(idKeyPair.getFirst());\n result.get(i).put(stringGroupKey, resultForGroupKey);\n }\n }\n return result;\n }", "private static JSONObject addAllKeyValuePairs(JSONObject source, JSONObject destination) {\n Iterator<?> keys = source.keys();\n while (keys.hasNext()) {\n try {\n String key = (String) keys.next();\n String value = source.get(key).toString();\n destination.put(key, value);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n return destination;\n }", "public Map<String,Map<String,String>> getChildren(Map<String,String> map) {\n Map<String,Map<String,String>> children = new LinkedHashMap<String,Map<String,String>>();\n String kidsString = map.get(\"children\");\n \n if(ok(kidsString)) {\n String[] kids = kidsString.split(\";\");\n\n for(String kid : kids) {\n // kid is the name of the Attributes\n Map<String,String> kidMap = allRaw.get(kid);\n if(kidMap != null)\n children.put(kid, kidMap);\n }\n }\n if(children.isEmpty())\n return null;\n else\n return children;\n }", "private void putContinueValues(String keyword, Map<String, String> values) {\n defaultKvStore.putJson(\"query_continue_\" + keyword, values);\n }", "protected void fillMapFromProperties(Properties props)\n {\n Enumeration<?> en = props.propertyNames();\n\n while (en.hasMoreElements())\n {\n String propName = (String) en.nextElement();\n\n // ignore map, pattern_map; they are handled separately\n if (!propName.startsWith(\"map\") &&\n !propName.startsWith(\"pattern_map\"))\n {\n String propValue = props.getProperty(propName);\n String fieldDef[] = new String[4];\n fieldDef[0] = propName;\n fieldDef[3] = null;\n if (propValue.startsWith(\"\\\"\"))\n {\n // value is a constant if it starts with a quote\n fieldDef[1] = \"constant\";\n fieldDef[2] = propValue.trim().replaceAll(\"\\\"\", \"\");\n }\n else\n // not a constant\n {\n // split it into two pieces at first comma or space\n String values[] = propValue.split(\"[, ]+\", 2);\n if (values[0].startsWith(\"custom\") || values[0].equals(\"customDeleteRecordIfFieldEmpty\") ||\n values[0].startsWith(\"script\"))\n {\n fieldDef[1] = values[0];\n\n // parse sections of custom value assignment line in\n // _index.properties file\n String lastValues[];\n // get rid of empty parens\n if (values[1].indexOf(\"()\") != -1)\n values[1] = values[1].replace(\"()\", \"\");\n\n // index of first open paren after custom method name\n int parenIx = values[1].indexOf('(');\n\n // index of first unescaped comma after method name\n int commaIx = Utils.getIxUnescapedComma(values[1]);\n\n if (parenIx != -1 && commaIx != -1 && parenIx < commaIx) {\n // remainder should be split after close paren\n // followed by comma (optional spaces in between)\n lastValues = values[1].trim().split(\"\\\\) *,\", 2);\n\n // Reattach the closing parenthesis:\n if (lastValues.length == 2) lastValues[0] += \")\";\n }\n else\n // no parens - split comma preceded by optional spaces\n lastValues = values[1].trim().split(\" *,\", 2);\n\n fieldDef[2] = lastValues[0].trim();\n\n fieldDef[3] = lastValues.length > 1 ? lastValues[1].trim() : null;\n // is this a translation map?\n if (fieldDef[3] != null && fieldDef[3].contains(\"map\"))\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n } // end custom\n else if (values[0].equals(\"xml\") ||\n values[0].equals(\"raw\") ||\n values[0].equals(\"date\") ||\n values[0].equals(\"json\") ||\n values[0].equals(\"json2\") ||\n values[0].equals(\"index_date\") ||\n values[0].equals(\"era\"))\n {\n fieldDef[1] = \"std\";\n fieldDef[2] = values[0];\n fieldDef[3] = values.length > 1 ? values[1].trim() : null;\n // NOTE: assuming no translation map here\n if (fieldDef[2].equals(\"era\") && fieldDef[3] != null)\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n }\n else if (values[0].equalsIgnoreCase(\"FullRecordAsXML\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsMARC\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsJson\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsJson2\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsText\") ||\n values[0].equalsIgnoreCase(\"DateOfPublication\") ||\n values[0].equalsIgnoreCase(\"DateRecordIndexed\"))\n {\n fieldDef[1] = \"std\";\n fieldDef[2] = values[0];\n fieldDef[3] = values.length > 1 ? values[1].trim() : null;\n // NOTE: assuming no translation map here\n }\n else if (values.length == 1)\n {\n fieldDef[1] = \"all\";\n fieldDef[2] = values[0];\n fieldDef[3] = null;\n }\n else\n // other cases of field definitions\n {\n String values2[] = values[1].trim().split(\"[ ]*,[ ]*\", 2);\n fieldDef[1] = \"all\";\n if (values2[0].equals(\"first\") ||\n (values2.length > 1 && values2[1].equals(\"first\")))\n fieldDef[1] = \"first\";\n\n if (values2[0].startsWith(\"join\"))\n fieldDef[1] = values2[0];\n\n if ((values2.length > 1 && values2[1].startsWith(\"join\")))\n fieldDef[1] = values2[1];\n\n if (values2[0].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\") ||\n (values2.length > 1 && values2[1].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\")))\n fieldDef[1] = \"DeleteRecordIfFieldEmpty\";\n\n fieldDef[2] = values[0];\n fieldDef[3] = null;\n\n // might we have a translation map?\n if (!values2[0].equals(\"all\") &&\n !values2[0].equals(\"first\") &&\n !values2[0].startsWith(\"join\") &&\n !values2[0].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\"))\n {\n fieldDef[3] = values2[0].trim();\n if (fieldDef[3] != null)\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n }\n } // other cases of field definitions\n\n } // not a constant\n\n fieldMap.put(propName, fieldDef);\n\n } // if not map or pattern_map\n\n } // while enumerating through property names\n\n // verify that fieldMap is valid\n verifyCustomMethodsAndTransMaps();\n }", "HashMap<String,Object> processQueryResultRow(Map<String,Object> rawRow, String collectionName) {\n HashMap<String,Object> resultRow = new HashMap<>();\n for (String key: rawRow.keySet()) {\n Object value = rawRow.get(key);\n if (collectionName != null)\n value = formatFieldValue(collectionName,key,value);\n if (value != null) resultRow.put(key,value);\n }\n return resultRow;\n }", "private void writeToFiles(Context resultContext) throws IOException {\n\t\tMap<String, Map<Object, ArrayList<Object>>> keyValMappingByBaseOutputPath = resultContext.getKeyValMappingsByBaseOutputPath(); \n\t\t//Write key & value to each baseOutputPath's \n\t\tPath targetOutputDir = null;\n\t\tMap<Object, ArrayList<Object>> keyValMapping = null;\n\t\tPath finalOutputBaseDir = this.config.getFinalOutputDir();\n\t\tfor (String baseOutputPath: keyValMappingByBaseOutputPath.keySet()) {\n\t\t\tif (baseOutputPath.equals(\"\")) {\n\t\t\t\t//Regular output goes into the mapper output buffer directory.\n\t\t\t\ttargetOutputDir = this.config.getMapOutputBufferDir();\n\t\t\t}else {\n\t\t\t\t//Multiple output to a particular outputPath which was \n\t\t\t\t//specified by user goes into the final output directory. \n\t\t\t\ttargetOutputDir = Paths.get(finalOutputBaseDir.toString(), baseOutputPath);\n\t\t\t}\n\t\t\tkeyValMapping = keyValMappingByBaseOutputPath.get(baseOutputPath);\n\t\t\tthis.writeEachMapping(targetOutputDir, keyValMapping);\n\t\t};\n\t}", "public abstract void processResult(\n Operation operation, Object resultObj, Map<String, Object> keyMap)\n throws BaseCollectionException;", "private void setAllLocalResults() {\n TreeMap<FlworKey, List<FlworTuple>> keyValuePairs = mapExpressionsToOrderedPairs();\n // get only the values(ordered tuples) and save them in a list for next() calls\n keyValuePairs.forEach((key, valueList) -> valueList.forEach((value) -> _localTupleResults.add(value)));\n\n _child.close();\n if (_localTupleResults.size() == 0) {\n this._hasNext = false;\n } else {\n this._hasNext = true;\n }\n }", "public static String expand(String value, Map<String, String> props) {\r\n\t\tMatcher m = SUBST_REGEXP.matcher(value);\r\n\t\tint matchPos = 0;\r\n\t\twhile (matchPos < value.length() && m.find(matchPos)) {\r\n\t\t\tString subKey = m.group(1);\r\n\t\t\tString subValue = props.get(subKey);\r\n\t\t\tint subPosStart = m.start();\r\n\t\t\tmatchPos = subPosStart; // need to keep it here in case there is nested replacement\r\n\r\n\t\t\tif (subValue == null) {\r\n\t\t\t\t// We cannot complete expansion as this property is not defined. \r\n\t\t\t\t// SKIP this replacement and continue making best effort attempt.\r\n\t\t\t\tmatchPos++; // need to move the matching past the first match after the matchPos\r\n\t\t\t} else {\r\n\t\t\t\t// Do replacement\r\n\t\t\t\tint subPosEnd = m.end();\r\n\t\t\t\tvalue = value.substring(0, subPosStart) + subValue + value.substring(subPosEnd);\r\n\t\t\t\tm = SUBST_REGEXP.matcher(value); // matcher must be reset\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "private void getAllDescendants(DodlesActor root, HashMap<String, DodlesActor> result) {\n result.put(root.getName(), root);\n\n if (root instanceof BaseDodlesViewGroup) {\n BaseDodlesViewGroup group = (BaseDodlesViewGroup) root;\n\n for (Actor child : (SnapshotArray<Actor>) group.getChildren()) {\n getAllDescendants((DodlesActor) child, result);\n }\n }\n }", "private PropertyValues resolve(String path,Object data,Class<?> type,Method method,int level){\n\n\t\tif(null==data||null==type){\n\t\t\treturn null;\n\t\t}\n\t\tMutablePropertyValues values=new MutablePropertyValues();\n\t\tif(BeanUtils.isSimpleProperty(type)){\n\t\t\tvalues.add(path, data);\n\t\t\treturn values;\n\t\t}else if(List.class.isAssignableFrom(type)){\n\t\t\thandleListType(path,values,data,method,level);\n\t\t}else if(Map.class.isAssignableFrom(type)){\n\t\t\thandleMapType(path, values, data, method, level);\n\t\t}else{\n\t\t\tPropertyValues pvs=resolve(data,type);\n\t\t\tif(null!=pvs){\n\t\t\t\tPropertyValue[] pvArray=pvs.getPropertyValues();\n\t\t\t\tif(null!=pvArray){\n\t\t\t\t for(PropertyValue pv:pvArray){\n\t\t\t\t\t values.add(path+PropertyAccessor.NESTED_PROPERTY_SEPARATOR+pv.getName(), pv.getValue());\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn values;\n\t}", "private static void resolve(ImmutableMap.Builder<Map.Entry<String, Boolean>, ImmutableMap<String, Boolean>> accumulator, Permission permission, boolean value) {\n Map<String, Boolean> children = new HashMap<>();\n\n // resolve children for the permission, so pass a map containing just the permission being looked up.\n resolveChildren(children, Collections.singletonMap(permission.getName(), value), false);\n\n // remove self\n children.remove(permission.getName(), value);\n\n // only register the children if there are any.\n if (!children.isEmpty()) {\n accumulator.put(Maps.immutableEntry(permission.getName().toLowerCase(), value), ImmutableMap.copyOf(children));\n }\n }", "private void valueSearch(int key, Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) {\n queueNodeSelectAnimation(null, \"Current Node null, desired Node not found\",\n AnimationParameters.ANIM_TIME);\n return;\n\n }\n\n // Finishes the traversal if the key has been found.\n if (currNode.key == key) {\n queueNodeSelectAnimation(currNode, key + \" == \"\n + currNode.key + \", desired Node found\",\n AnimationParameters.ANIM_TIME);\n\n }\n // Explores the left subtree.\n else if (key < currNode.key) {\n for (int i = 0; i < numChildren / 2; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" < \" + currNode.key +\n \", exploring left subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n // Explores the right subtree.\n else {\n for (int i = numChildren / 2; i < numChildren; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" > \" + currNode.key +\n \", exploring right subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n }", "public Map<String, Map<String, List<String>>> dbMatch (Map<String, Map<String, List<String>>> outputVal) {\n\t\tfinal String DB_URL = \"jdbc:mysql://localhost/extractor\";\n\t\t\n\t\t// Database credentials\n\t\tfinal String USER = \"\";\n\t\tfinal String PASS = \"\";\n\t\t\n\t\tConnection conn = null;\n\t\tStatement stmt = null;\n\t\t\n\t\tArrayList<String> auditorResultsFromDB = new ArrayList<String>();\n\t\tMap<String, Map<String, List<String>>> dbMatchofAuditor = new HashMap<String, Map<String,List<String>>>();\n\t\tMap<String, List<String>> filteredValForSynonymMatchingInDB = new HashMap<String, List<String>>();\n\t\tList<String> filteredValues = new ArrayList<String>();\n\t\t\n\t\tfor (Map.Entry<String, Map<String, List<String>>> entry : outputVal.entrySet()) {\n\t\t\tString dataPoint = entry.getKey();\n\t\t\tMap<String, List<String>> InnerMap = entry.getValue();\n\t\t\tfor (Map.Entry<String, List<String>> innerMapEntry : InnerMap.entrySet()) {\n\t\t\t\tString keyword = innerMapEntry.getKey();\n\t\t\t\tfor (String value : innerMapEntry.getValue()) {\n\t\t\t\t\tif (auditorResultsFromDB.contains(value)) {\n\t\t\t\t\t\tfilteredValues.add(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfilteredValForSynonymMatchingInDB.put(keyword, filteredValues);\n\t\t\t}\n\t\t\tdbMatchofAuditor.put(dataPoint, filteredValForSynonymMatchingInDB);\n\t\t }\n\t\t\n\t\ttry {\n\t\t\t// STEP 2: Register JDBC driver\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\n\t\t\t// STEP 3: Open a connection\n\t\t\tSystem.out.println(\"Connecting to database...\");\n\t\t\tconn = DriverManager.getConnection(DB_URL, USER, PASS);\n\n\t\t\t// STEP 4: Execute a query\n\t\t\tSystem.out.println(\"Creating statement...\");\n\t\t\tstmt = conn.createStatement();\n\t\t\tString sql;\n\t\t\tsql = \"select name from auditors\";\n\t\t\tResultSet rs = stmt.executeQuery(sql);\n\n\t\t\t// STEP 5: Extract data from result set\n\t\t\twhile (rs.next()) {\n\t\t\t\tauditorResultsFromDB.add(rs.getString(\"name\"));\n\t\t\t}\n\t\t\t// STEP 6: Clean-up environment\n\t\t\trs.close();\n\t\t\tstmt.close();\n\t\t\tconn.close();\n\t\t} catch (SQLException se) {\n\t\t\t// Handle errors for JDBC\n\t\t\tse.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\t// Handle errors for Class.forName\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// finally block used to close resources\n\t\t\ttry {\n\t\t\t\tif (stmt != null)\n\t\t\t\t\tstmt.close();\n\t\t\t} catch (SQLException se2) {\n\t\t\t} // nothing we can do\n\t\t\ttry {\n\t\t\t\tif (conn != null)\n\t\t\t\t\tconn.close();\n\t\t\t} catch (SQLException se) {\n\t\t\t\tse.printStackTrace();\n\t\t\t} // end finally try\n\t\t} // end try\n\t\t\n\t\treturn dbMatchofAuditor;\n\t}", "Enumeration<URL> findEntries(String path, String pattern, boolean recurse) throws IOException;", "@Override\n public boolean visit(String key, String value) {\n String[] parts = key.split(\"/\"); //$NON-NLS-1$\n StringBuilder f = new StringBuilder();\n for (int i = 0; i < parts.length; i++) {\n f.append(parts[i]);\n visitor.folder(f.toString());\n f.append(\"/\"); //$NON-NLS-1$\n }\n return true;\n }", "static Map<ParserRuleAlternativeContext, AlternativeKeyWithOffsets> toKeys(Map<ParserRuleAlternativeContext, AlternativeStub> m) {\n Map<String, Set<AlternativeStub>> map = CollectionUtils.supplierMap(TreeSet::new);\n Map<AlternativeStub, ParserRuleAlternativeContext> inverse = new HashMap<>();\n for (Map.Entry<ParserRuleAlternativeContext, AlternativeStub> e : m.entrySet()) {\n map.get(e.getValue().ruleName).add(e.getValue());\n inverse.put(e.getValue(), e.getKey());\n }\n Map<ParserRuleAlternativeContext, AlternativeKeyWithOffsets> result = new HashMap<>(m.size());\n for (Map.Entry<String, Set<AlternativeStub>> e : map.entrySet()) {\n int cursor = 1;\n for (AlternativeStub stub : e.getValue()) {\n ParserRuleAlternativeContext ctx = inverse.get(stub);\n AlternativeKey key = stub.toKey(cursor++);\n AlternativeKeyWithOffsets withOffsets = new AlternativeKeyWithOffsets(key, stub.startTokenIndex, stub.stopTokenIndex);\n result.put(ctx, withOffsets);\n }\n }\n return result;\n }", "private void getItemPaths(NodeList nl, String path, Map<String,Node> map){\n if(nl!=null) {\n\n\n for (int i = 0; i < nl.getLength(); i++) {\n Node n;\n if (( n = nl.item(i)) != null) {\n if(n.getNodeType() == Node.ELEMENT_NODE || n.getNodeType() == Node.TEXT_NODE) {\n if(n.hasChildNodes()){\n if(n.getNodeType() == Node.ELEMENT_NODE) {\n getItemPaths(n.getChildNodes(), path + \":\" + n.getNodeName(), map);\n }\n }\n if(!n.hasChildNodes()) {\n map.put(path + \":\" + n.getNodeName().trim()+\":\"+n.getNodeValue(), n);\n }\n\n if (n.hasAttributes()) {\n NamedNodeMap na = n.getAttributes();\n for (int j = 0; j < na.getLength(); j++) {\n map.put(path + \":\" + n.getNodeName() + \":\" + na.item(j).getNodeName().trim()+\":\"+na.item(j).getNodeValue(), n);\n }\n }\n }\n }\n }\n }\n\n }", "public HashMap<K,V> listAll();", "private void pushToMap(Method method, Map executeResultMap) {\n List<ResourceField> resourceFields = ResourceFieldTools.getResourceFields(method);\n executeResultMap.keySet().stream().forEach(o -> push(method, resourceFields, executeResultMap.get(o)));\n }", "void aggregatePaths(Multimap<JBurgPatternMatcher,JBurgPatternMatcher> aggregated_matchers)\n {\n aggregated_matchers.addToSet(this,this);\n if ( this.subPatterns != null )\n for (JBurgPatternMatcher kid: this.subPatterns)\n kid.aggregatePaths(aggregated_matchers);\n }", "@Override\n\tpublic Map<File, List<String>> grep(File directory, String fileSelectionPattern, String substringSelectionPattern,\n\t\t\tboolean recursive) {\n\t\tFile[] fileList=directory(directory,recursive,fileSelectionPattern);\n\t\t//Map<File, List<String>> grepped=new HashMap<File, List<String>>();\n\t\treturn PatternMatcher(fileList,Pattern.compile(substringSelectionPattern));\n\t}", "private Map getAccountStructure(String xmlResponse) {\r\n\t\t\r\n\t\tMap accountStructure = new LinkedHashMap();\r\n\t\tElement root;\r\n\t\t\r\n\t\ttry {\r\n\t\t\troot = DOMUtils.openDocument(new ByteArrayInputStream(xmlResponse.getBytes()));\r\n\t\t\t\r\n\t\t\t//second level variables\r\n\t\t\tNodeList secondLevelNodeList;\t\r\n\t\t\tNodeList secondLevelParamNodeList;\r\n\t\t\tElement secondLevelElement;\r\n\t\t\tElement secondLevelParamElement;\r\n\t\t\t//third level variables\r\n\t\t\tNodeList thirdLevelNodeList;\r\n\t\t\tNodeList thirdLevelParamNodeList;\r\n\t\t\tElement thirdLevelElement;\r\n\t\t\tElement thirdLevelParamElement;\r\n\t\t\t//fourth level variables\r\n\t\t\tNodeList fourthLevelNodeList;\r\n\t\t\tNodeList fourthLevelParamNodeList;\r\n\t\t\tElement fourthLevelElement;\r\n\t\t\tElement fourthLevelParamElement;\r\n\t\t\t\r\n\t\t\t//strings to help on hierarchy map filling\r\n\t\t\tString firstLevelCustCode = \"\";\r\n\t\t\tString secondLevelCustCode = \"\";\t\t\t\r\n\t\t\tString thirdLevelCustCode = \"\";\r\n\t\t\tString fourthLevelCustCode = \"\";\r\n\t\t\t\r\n\t\t\t//first level\r\n\t\t\tElement firsLevelElement = DOMUtils.getElement(root, \"RECORD\", true);\r\n\t\t\tElement firsLevelParamElement;\r\n\t\t\tNodeList firsLevelParamNodeList = DOMUtils.getElements(firsLevelElement, \"PARAM\");\r\n\t\t\tfor (int i = 0; i < firsLevelParamNodeList.getLength(); i++) {\r\n\t\t\t\tfirsLevelParamElement = (Element) firsLevelParamNodeList.item(i);\r\n\t\t\t\tif(DOMUtils.getAttribute(firsLevelParamElement, \"name\", true).equalsIgnoreCase(\"CS_CODE\")) {\r\n\t\t\t\t\tfirstLevelCustCode = DOMUtils.getAttribute(firsLevelParamElement, \"value\", true);\r\n\t\t\t\t\taccountStructure.put(firstLevelCustCode, \"\");\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\t//second, third and fourth levels\r\n\t\t\tsecondLevelNodeList = DOMUtils.getElements(firsLevelElement, \"RECORD\");\t\r\n\t\t\tfor (int i = 0; i < secondLevelNodeList.getLength(); i++) {\r\n\t\t\t\tsecondLevelElement = (Element) secondLevelNodeList.item(i);\r\n\t\t\t\tsecondLevelParamNodeList = DOMUtils.getElements(secondLevelElement, \"PARAM\");\r\n\t\t\t\tfor (int j = 0; j < secondLevelParamNodeList.getLength(); j++) {\r\n\t\t\t\t\tsecondLevelParamElement = (Element) secondLevelParamNodeList.item(j);\r\n\t\t\t\t\tif(DOMUtils.getAttribute(secondLevelParamElement, \"name\", true).equalsIgnoreCase(\"CS_CODE\")) {\r\n\t\t\t\t\t\tsecondLevelCustCode = DOMUtils.getAttribute(secondLevelParamElement, \"value\", true);\r\n\t\t\t\t\t\taccountStructure.put(secondLevelCustCode, firstLevelCustCode);\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\tthirdLevelNodeList = DOMUtils.getElements(secondLevelElement, \"RECORD\");\t\r\n\t\t\t\tfor (int k = 0; k < thirdLevelNodeList.getLength(); k++) {\r\n\t\t\t\t\tthirdLevelElement = (Element) thirdLevelNodeList.item(k);\r\n\t\t\t\t\tthirdLevelParamNodeList = DOMUtils.getElements(thirdLevelElement, \"PARAM\");\r\n\t\t\t\t\tfor (int l = 0; l < thirdLevelParamNodeList.getLength(); l++) {\r\n\t\t\t\t\t\tthirdLevelParamElement = (Element) thirdLevelParamNodeList.item(l);\r\n\t\t\t\t\t\tif(DOMUtils.getAttribute(thirdLevelParamElement, \"name\", true).equalsIgnoreCase(\"CS_CODE\")) {\r\n\t\t\t\t\t\t\tthirdLevelCustCode = DOMUtils.getAttribute(thirdLevelParamElement, \"value\", true);\r\n\t\t\t\t\t\t\taccountStructure.put(thirdLevelCustCode, secondLevelCustCode);\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\tfourthLevelNodeList = DOMUtils.getElements(thirdLevelElement, \"RECORD\");\r\n\t\t\t\t\tfor (int m = 0; m < fourthLevelNodeList.getLength(); m++) {\r\n\t\t\t\t\t\tfourthLevelElement = (Element) fourthLevelNodeList.item(m);\r\n\t\t\t\t\t\tfourthLevelParamNodeList = DOMUtils.getElements(fourthLevelElement, \"PARAM\");\r\n\t\t\t\t\t\tfor (int l = 0; l < fourthLevelParamNodeList.getLength(); l++) {\r\n\t\t\t\t\t\t\tfourthLevelParamElement = (Element) fourthLevelParamNodeList.item(l);\r\n\t\t\t\t\t\t\tif(DOMUtils.getAttribute(fourthLevelParamElement, \"name\", true).equalsIgnoreCase(\"CS_CODE\")) {\r\n\t\t\t\t\t\t\t\tfourthLevelCustCode = DOMUtils.getAttribute(fourthLevelParamElement, \"value\", true);\r\n\t\t\t\t\t\t\t\taccountStructure.put(fourthLevelCustCode, thirdLevelCustCode);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n\t\t\tlog.error(\"Error parsing xml response from Infobus\", e);\r\n\t\t\tthrow new ErrorMessageException(e);\r\n\t\t}\t\r\n\t\t\r\n\t\treturn accountStructure;\r\n\t}", "private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }", "private void generateSearchReport(final Map<String, String> request,\r\n\t\t\tfinal List<Map<String, String>> resultMap) {\r\n\t\tMap<String, String> reportMap = null;\r\n\r\n\t\tfor (final Map<String, String> map : resultMap) {\r\n\t\t\tif (map.containsKey(CommonConstants.TOTAL_PRODUCTS)) {\r\n\t\t\t\treportMap = this.getReportMap(request);\r\n\t\t\t\tfinal StringBuilder attributes = new StringBuilder();\r\n\t\t\t\tif (request.containsKey(RequestAttributeConstant.COLOR)) {\r\n\t\t\t\t\tattributes.append(CommonConstants.COLOR);\r\n\t\t\t\t\tattributes.append(CommonConstants.FIELD_PAIR_SEPARATOR);\r\n\t\t\t\t\tattributes.append(request\r\n\t\t\t\t\t\t\t.get(RequestAttributeConstant.COLOR));\r\n\t\t\t\t\tattributes.append(CommonConstants.PIPE_SEPERATOR);\r\n\t\t\t\t}\r\n\t\t\t\tif (request.containsKey(RequestAttributeConstant.SIZE)) {\r\n\t\t\t\t\tattributes.append(CommonConstants.SIZE);\r\n\t\t\t\t\tattributes.append(CommonConstants.FIELD_PAIR_SEPARATOR);\r\n\t\t\t\t\tattributes.append(request\r\n\t\t\t\t\t\t\t.get(RequestAttributeConstant.SIZE));\r\n\t\t\t\t\tattributes.append(CommonConstants.PIPE_SEPERATOR);\r\n\t\t\t\t}\r\n\t\t\t\tif (request.containsKey(RequestAttributeConstant.BRAND)) {\r\n\t\t\t\t\tattributes.append(CommonConstants.BRAND);\r\n\t\t\t\t\tattributes.append(CommonConstants.FIELD_PAIR_SEPARATOR);\r\n\t\t\t\t\tattributes.append(request\r\n\t\t\t\t\t\t\t.get(RequestAttributeConstant.BRAND));\r\n\t\t\t\t\tattributes.append(CommonConstants.PIPE_SEPERATOR);\r\n\t\t\t\t}\r\n\t\t\t\tthis.requestAttributePrice(request, attributes);\r\n\t\t\t\tif (attributes.length() != 0) {\r\n\t\t\t\t\treportMap.put(DomainConstants.ATTRIBUTES, attributes\r\n\t\t\t\t\t\t\t.toString().substring(0, attributes.length() - 1));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tString sortFields = \"\";\r\n\t\t\t\tif (request.containsKey(RequestAttributeConstant.SORT)) {\r\n\t\t\t\t\tsortFields = request.get(RequestAttributeConstant.SORT);\r\n\t\t\t\t}\r\n\t\t\t\tif (!\"\".equals(sortFields)) {\r\n\t\t\t\t\treportMap.put(DomainConstants.SORT_FIELDS, sortFields\r\n\t\t\t\t\t\t\t.replace(CommonConstants.EMPTY_VALUE,\r\n\t\t\t\t\t\t\t\t\tCommonConstants.COMMA_SEPERATOR));\r\n\t\t\t\t}\r\n\t\t\t\tmap.putAll(reportMap);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "private Map getAccountStructure(String xmlResponse) {\r\n\t\t\r\n\t\tMap accountStructure = new LinkedHashMap();\r\n\t\tElement root;\r\n\t\t\r\n\t\ttry {\r\n\t\t\troot = DOMUtils.openDocument(new ByteArrayInputStream(xmlResponse.getBytes()));\r\n\t\t\t\r\n\t\t\t//second level variables\r\n\t\t\tNodeList secondLevelNodeList;\t\r\n\t\t\tNodeList secondLevelParamNodeList;\r\n\t\t\tElement secondLevelElement;\r\n\t\t\tElement secondLevelParamElement;\r\n\t\t\t//third level variables\r\n\t\t\tNodeList thirdLevelNodeList;\r\n\t\t\tNodeList thirdLevelParamNodeList;\r\n\t\t\tElement thirdLevelElement;\r\n\t\t\tElement thirdLevelParamElement;\r\n\t\t\t//fourth level variables\r\n\t\t\tNodeList fourthLevelNodeList;\r\n\t\t\tNodeList fourthLevelParamNodeList;\r\n\t\t\tElement fourthLevelElement;\r\n\t\t\tElement fourthLevelParamElement;\r\n\t\t\t\r\n\t\t\t//strings to help on hierarchy map filling\r\n\t\t\tString firstLevelCustCode = \"\";\r\n\t\t\tString secondLevelCustCode = \"\";\t\t\t\r\n\t\t\tString thirdLevelCustCode = \"\";\r\n\t\t\tString fourthLevelCustCode = \"\";\r\n\t\t\t\r\n\t\t\t//First verify if there are nodes in the tree\r\n\t\t\tElement recordGroup = DOMUtils.getElement(root, \"RECORD_GROUP\", true);\r\n\t\t\tString recordGroupStr = DOMUtils.getAttribute(recordGroup, \"size\", true);\r\n\t\t\tif (recordGroupStr != null && Integer.parseInt(recordGroupStr) > 0) {\r\n\t\t\t\r\n\t\t\t\t//first level\r\n\t\t\t\tElement firsLevelElement = DOMUtils.getElement(root, \"RECORD\", true);\r\n\t\t\t\tElement firsLevelParamElement;\r\n\t\t\t\tNodeList firsLevelParamNodeList = DOMUtils.getElements(firsLevelElement, \"PARAM\");\r\n\t\t\t\tfor (int i = 0; i < firsLevelParamNodeList.getLength(); i++) {\r\n\t\t\t\t\tfirsLevelParamElement = (Element) firsLevelParamNodeList.item(i);\r\n\t\t\t\t\tif(DOMUtils.getAttribute(firsLevelParamElement, \"name\", true).equalsIgnoreCase(\"CS_CODE\")) {\r\n\t\t\t\t\t\tfirstLevelCustCode = DOMUtils.getAttribute(firsLevelParamElement, \"value\", true);\r\n\t\t\t\t\t\taccountStructure.put(firstLevelCustCode, \"\");\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\r\n\t\t\t\t//second, third and fourth levels\r\n\t\t\t\tsecondLevelNodeList = DOMUtils.getElements(firsLevelElement, \"RECORD\");\t\r\n\t\t\t\tfor (int i = 0; i < secondLevelNodeList.getLength(); i++) {\r\n\t\t\t\t\tsecondLevelElement = (Element) secondLevelNodeList.item(i);\r\n\t\t\t\t\tsecondLevelParamNodeList = DOMUtils.getElements(secondLevelElement, \"PARAM\");\r\n\t\t\t\t\tfor (int j = 0; j < secondLevelParamNodeList.getLength(); j++) {\r\n\t\t\t\t\t\tsecondLevelParamElement = (Element) secondLevelParamNodeList.item(j);\r\n\t\t\t\t\t\tif(DOMUtils.getAttribute(secondLevelParamElement, \"name\", true).equalsIgnoreCase(\"CS_CODE\")) {\r\n\t\t\t\t\t\t\tsecondLevelCustCode = DOMUtils.getAttribute(secondLevelParamElement, \"value\", true);\r\n\t\t\t\t\t\t\taccountStructure.put(secondLevelCustCode, firstLevelCustCode);\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\tthirdLevelNodeList = DOMUtils.getElements(secondLevelElement, \"RECORD\");\t\r\n\t\t\t\t\tfor (int k = 0; k < thirdLevelNodeList.getLength(); k++) {\r\n\t\t\t\t\t\tthirdLevelElement = (Element) thirdLevelNodeList.item(k);\r\n\t\t\t\t\t\tthirdLevelParamNodeList = DOMUtils.getElements(thirdLevelElement, \"PARAM\");\r\n\t\t\t\t\t\tfor (int l = 0; l < thirdLevelParamNodeList.getLength(); l++) {\r\n\t\t\t\t\t\t\tthirdLevelParamElement = (Element) thirdLevelParamNodeList.item(l);\r\n\t\t\t\t\t\t\tif(DOMUtils.getAttribute(thirdLevelParamElement, \"name\", true).equalsIgnoreCase(\"CS_CODE\")) {\r\n\t\t\t\t\t\t\t\tthirdLevelCustCode = DOMUtils.getAttribute(thirdLevelParamElement, \"value\", true);\r\n\t\t\t\t\t\t\t\taccountStructure.put(thirdLevelCustCode, secondLevelCustCode);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfourthLevelNodeList = DOMUtils.getElements(thirdLevelElement, \"RECORD\");\r\n\t\t\t\t\t\tfor (int m = 0; m < fourthLevelNodeList.getLength(); m++) {\r\n\t\t\t\t\t\t\tfourthLevelElement = (Element) fourthLevelNodeList.item(m);\r\n\t\t\t\t\t\t\tfourthLevelParamNodeList = DOMUtils.getElements(fourthLevelElement, \"PARAM\");\r\n\t\t\t\t\t\t\tfor (int l = 0; l < fourthLevelParamNodeList.getLength(); l++) {\r\n\t\t\t\t\t\t\t\tfourthLevelParamElement = (Element) fourthLevelParamNodeList.item(l);\r\n\t\t\t\t\t\t\t\tif(DOMUtils.getAttribute(fourthLevelParamElement, \"name\", true).equalsIgnoreCase(\"CS_CODE\")) {\r\n\t\t\t\t\t\t\t\t\tfourthLevelCustCode = DOMUtils.getAttribute(fourthLevelParamElement, \"value\", true);\r\n\t\t\t\t\t\t\t\t\taccountStructure.put(fourthLevelCustCode, thirdLevelCustCode);\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}\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tlog.error(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t\tthrow new ErrorMessageException(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t}\t\r\n\t\t\r\n\t\treturn accountStructure;\r\n\t}", "private void searchHashMap(String[] searchKey, String callNumber,int startYear, int endYear) {\n\t\t/* Temporarily stores next 'values' for a title keyword */\n\t\tArrayList<Integer> tempStore = new ArrayList<Integer>();\n\t\t/* Stores only the intersection 'values' of title keywords */\n\t\tCollection<Integer> intersection = new ArrayList<Integer>();\n\t\t/* Counts number of keywords found */\n\t\tint foundKeys = 0;\n\n\t\t/* Loop to iterate through title keywords and get key-value pair intersection */\n\t\tfor (String key : searchKey) {\n\t\t\tif (titleHashMap.containsKey(key)) {\n\t\t\t\tfoundKeys = foundKeys + 1;\n\t\t\t\ttempStore.addAll((titleHashMap.get(key))); /* Stores all found values */\n\t\t\t\tif (intersection.size() == 0) {\n\t\t\t\t\tintersection.addAll(titleHashMap.get(key));\n\t\t\t\t}\n\t\t\t\tintersection.retainAll(tempStore); /* Stores only common 'values' */\n\t\t\t\ttempStore.clear(); /* Clears temporary array*/\n\t\t\t}\n\t\t}\n\n\t\t/* Checks if all keywords were found */\n\t\tif(searchKey.length == foundKeys){\n\t\t/* Performs search of other fields via the reduced list of 'values' for matched record */\n\t\tfor (Integer i : intersection) {\n\t\t\tif ((callNumber.equals(\"\") || items.get(i.intValue()).getCallNumber().equalsIgnoreCase(callNumber))\n\t\t\t\t\t&& (items.get(i.intValue()).getYear() >= startYear && items.get(i.intValue()).getYear() <= endYear)) {\n\t\t\t\tSystem.out.println(\"--------------------------------------------\");\n\t\t\t\tSystem.out.println(items.get(i.intValue())); /* Prints found records from master list 'Reference' */\n\t\t\t\tSystem.out.println(\"--------------------------------------------\");\n\t\t\t}\n\t\t}\n\t\t}\n\t}", "public ResultMap<BaseNode> listChildren();", "@Override\r\n\tpublic void addToMap(Vector<String> categories, String resultCategory) {\r\n\t\tif (categories.isEmpty())\r\n\t\t\treturn;\r\n\t\t\r\n\t\tString actualCategory = categories.remove(0).trim();\r\n\t\tAbsSyntaxTrieNode node = nodeMap.get(actualCategory);\r\n\t\tif (node == null){\r\n\t\t\tif (categories.size() == 0){\r\n\t\t\t\tnode = new SyntaxTrieNodeInter(actualCategory, resultCategory);\r\n\t\t\t}else{\r\n\t\t\t\tnode = new SyntaxTrieNodeInter(actualCategory);\r\n\t\t\t}\r\n\t\t\tnodeMap.put(actualCategory, node);\r\n\t\t}\r\n\t\tnode.addToMap( new Vector<String>(categories), resultCategory);\r\n\r\n\t}", "public interface DataContext extends Map<String, Map<String, String>>, Mergable<DataContext> {\n Map<String,Map<String,String>> getData();\n\n default Converter<String, String> replaceDataReferencesConverter() {\n return DataContextUtils.replaceDataReferencesConverter(getData());\n }\n\n /**\n * Create a deep copy\n *\n * @return a new object\n */\n DataContext copy();\n\n\n /**\n * Return a converter that can expand the property references within a string\n *\n * @param converter secondary converter to apply to property values before replacing in a string\n * @param failOnUnexpanded if true, fail if a property value cannot be expanded\n *\n * @return a Converter to expand property values within a string\n */\n default Converter<String, String> replaceDataReferencesConverter(\n final Converter<String, String> converter,\n final boolean failOnUnexpanded\n )\n {\n return DataContextUtils.replaceDataReferencesConverter(getData(), converter, failOnUnexpanded);\n }\n\n\n default String[] replaceDataReferences(\n final String[] args,\n final Converter<String, String> converter,\n boolean failIfUnexpanded\n )\n {\n return replaceDataReferences(args, converter, failIfUnexpanded, false);\n }\n\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param args argument string array\n * @param converter converter\n * @param failIfUnexpanded true to fail if property is not found\n * @param blankIfUnexpanded true to use blank if property is not found\n *\n * @return string array with replaced embedded properties\n */\n default String[] replaceDataReferences(\n final String[] args,\n Converter<String, String> converter,\n boolean failIfUnexpanded,\n boolean blankIfUnexpanded\n )\n {\n return DataContextUtils.replaceDataReferencesInArray(args, getData(), converter, failIfUnexpanded, blankIfUnexpanded);\n }\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param args argument string array\n *\n * @return string array with replaced embedded properties\n */\n default String[] replaceDataReferences(final String[] args) {\n return replaceDataReferences(args, null, false);\n }\n\n /**\n * Recursively replace data references in the values in a map which contains either string, collection or Map\n * values.\n *\n * @param input input map\n *\n * @return Map with all string values having references replaced\n */\n default Map<String, Object> replaceDataReferences(final Map<String, Object> input) {\n return DataContextUtils.replaceDataReferences(input, getData());\n }\n\n default String resolve(\n final String group,\n final String key\n )\n {\n return resolve(group, key, null);\n }\n\n /**\n * Return the resolved value from the context\n *\n * @param group group name\n * @param key key name\n * @param defaultValue default if the value is not resolvable\n *\n * @return resolved value or default\n */\n default String resolve(\n final String group,\n final String key,\n final String defaultValue\n )\n {\n Map<String, Map<String, String>> data = getData();\n return null != data && null != data.get(group) && null != data.get(group).get(key)\n ? data.get(group).get(key)\n : defaultValue;\n }\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param input input string\n *\n * @return string with values substituted, or original string\n */\n default String replaceDataReferences(final String input) {\n return DataContextUtils.replaceDataReferencesInString(input, getData());\n }\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param input input string\n * @param converter converter to encode/convert the expanded values\n * @param failOnUnexpanded true to fail if a reference is not found\n *\n * @return string with values substituted, or original string\n */\n default String replaceDataReferences(\n final String input,\n final Converter<String, String> converter,\n boolean failOnUnexpanded\n )\n {\n return replaceDataReferences(input, converter, failOnUnexpanded, false);\n }\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param input input string\n * @param converter converter to encode/convert the expanded values\n * @param failOnUnexpanded true to fail if a reference is not found\n * @param blankIfUnexpanded true to use blank if a reference is not found\n *\n * @return string with values substituted, or original string\n */\n default String replaceDataReferences(\n final String input,\n final Converter<String, String> converter,\n boolean failOnUnexpanded,\n boolean blankIfUnexpanded\n )\n {\n return DataContextUtils.replaceDataReferencesInString(input, getData(), converter, failOnUnexpanded, blankIfUnexpanded);\n\n }\n\n /**\n *\n * @param other\n * @return new data context of this context merged with the other context\n */\n default DataContext merged(DataContext other) {\n return new BaseDataContext(DataContextUtils.merge(this, other));\n }\n}", "public static Map<String, Path> getTableStoreFilePathMap(Map<String, Path> resultMap,\n final FileSystem fs, final Path hbaseRootDir, TableName tableName, final PathFilter sfFilter,\n ExecutorService executor, final ProgressReporter progressReporter)\n throws IOException, InterruptedException {\n\n final Map<String, Path> finalResultMap =\n resultMap == null ? new ConcurrentHashMap<>(128, 0.75f, 32) : resultMap;\n\n // only include the directory paths to tables\n Path tableDir = CommonFSUtils.getTableDir(hbaseRootDir, tableName);\n // Inside a table, there are compaction.dir directories to skip. Otherwise, all else\n // should be regions.\n final FamilyDirFilter familyFilter = new FamilyDirFilter(fs);\n final Vector<Exception> exceptions = new Vector<>();\n\n try {\n List<FileStatus> regionDirs =\n FSUtils.listStatusWithStatusFilter(fs, tableDir, new RegionDirFilter(fs));\n if (regionDirs == null) {\n return finalResultMap;\n }\n\n final List<Future<?>> futures = new ArrayList<>(regionDirs.size());\n\n for (FileStatus regionDir : regionDirs) {\n if (null != progressReporter) {\n progressReporter.progress(regionDir);\n }\n final Path dd = regionDir.getPath();\n\n if (!exceptions.isEmpty()) {\n break;\n }\n\n Runnable getRegionStoreFileMapCall = new Runnable() {\n @Override\n public void run() {\n try {\n HashMap<String, Path> regionStoreFileMap = new HashMap<>();\n List<FileStatus> familyDirs =\n FSUtils.listStatusWithStatusFilter(fs, dd, familyFilter);\n if (familyDirs == null) {\n if (!fs.exists(dd)) {\n LOG.warn(\"Skipping region because it no longer exists: \" + dd);\n } else {\n LOG.warn(\"Skipping region because it has no family dirs: \" + dd);\n }\n return;\n }\n for (FileStatus familyDir : familyDirs) {\n if (null != progressReporter) {\n progressReporter.progress(familyDir);\n }\n Path family = familyDir.getPath();\n if (family.getName().equals(HConstants.RECOVERED_EDITS_DIR)) {\n continue;\n }\n // now in family, iterate over the StoreFiles and\n // put in map\n FileStatus[] familyStatus = fs.listStatus(family);\n for (FileStatus sfStatus : familyStatus) {\n if (null != progressReporter) {\n progressReporter.progress(sfStatus);\n }\n Path sf = sfStatus.getPath();\n if (sfFilter == null || sfFilter.accept(sf)) {\n regionStoreFileMap.put(sf.getName(), sf);\n }\n }\n }\n finalResultMap.putAll(regionStoreFileMap);\n } catch (Exception e) {\n LOG.error(\"Could not get region store file map for region: \" + dd, e);\n exceptions.add(e);\n }\n }\n };\n\n // If executor is available, submit async tasks to exec concurrently, otherwise\n // just do serial sync execution\n if (executor != null) {\n Future<?> future = executor.submit(getRegionStoreFileMapCall);\n futures.add(future);\n } else {\n FutureTask<?> future = new FutureTask<>(getRegionStoreFileMapCall, null);\n future.run();\n futures.add(future);\n }\n }\n\n // Ensure all pending tasks are complete (or that we run into an exception)\n for (Future<?> f : futures) {\n if (!exceptions.isEmpty()) {\n break;\n }\n try {\n f.get();\n } catch (ExecutionException e) {\n LOG.error(\"Unexpected exec exception! Should've been caught already. (Bug?)\", e);\n // Shouldn't happen, we already logged/caught any exceptions in the Runnable\n }\n }\n } catch (IOException e) {\n LOG.error(\"Cannot execute getTableStoreFilePathMap for \" + tableName, e);\n exceptions.add(e);\n } finally {\n if (!exceptions.isEmpty()) {\n // Just throw the first exception as an indication something bad happened\n // Don't need to propagate all the exceptions, we already logged them all anyway\n Throwables.propagateIfPossible(exceptions.firstElement(), IOException.class);\n throw new IOException(exceptions.firstElement());\n }\n }\n\n return finalResultMap;\n }", "HashMap<String, ?> getOutputFiles();", "public static void main(String[] args) {\n HashMap<String, String> dict1 = new HashMap<>();\n dict1.put(\"a\", \"x\");\n System.out.println(resolve(\"<%a%>\", dict1)); // x\n\n /* test case 2 */\n HashMap<String, String> dict2 = new HashMap<>();\n dict2.put(\"a\", \"x\");\n System.out.println(resolve(\"<%%>\", dict2)); // <%%>\n\n /* test case 3 */\n HashMap<String, String> dict3 = new HashMap<>();\n dict3.put(\"a\", \"x\");\n System.out.println(resolve(\"x<%a%>x\", dict3)); // xxx\n\n /* test case 4 */\n HashMap<String, String> dict4 = new HashMap<>();\n dict4.put(\"b\", \"y\");\n dict4.put(\"c\", \"z\");\n System.out.println(resolve(\"aaaaa<%%>bbbbb<%b%>ccccc<%c%>\", dict4)); // aaaaa<%%>bbbbbycccccz\n\n /* test case 5 */\n HashMap<String, String> dict5 = new HashMap<>();\n dict5.put(\"a\", \"x\");\n dict5.put(\"b\", \"y\");\n dict5.put(\"c\", \"z\");\n System.out.println(resolve(\"aaaaa<%a%>bbbbb<%b%>ccccc<%c%>\", dict5)); // aaaaaxbbbbbycccccz\n\n /* test case 6 */\n HashMap<String, String> dict6 = new HashMap<>();\n dict6.put(\"aa\", \"x\");\n dict6.put(\"b\", \"y\");\n dict6.put(\"c\", \"z\");\n System.out.println(resolve(\"aaaaa<%aa%>bbbbb<%b%>ccccc<%c%>\", dict6)); // aaaaaxbbbbbycccccz\n\n /* test case 7 */\n HashMap<String, String> dict7 = new HashMap<>();\n dict7.put(\"a\", \"x\");\n System.out.println(resolve(\"aaaaa<%a%>bbbbb<%a%>ccccc<%a%>\", dict7)); // aaaaaxbbbbbxcccccx\n\n /* test case 8 */\n HashMap<String, String> dict8 = new HashMap<>();\n dict8.put(\"a\", \"x\");\n dict8.put(\"b\", \"y\");\n dict8.put(\"c\", \"z\");\n System.out.println(resolve(\"aaaaa<%dd%>bbbbb<%b%>ccccc<%c%>\", dict8)); // aaaaa<%dd%>bbbbbycccccz\n }", "InfiniteMap<K,V> build();", "void getValues(long id, Map<String,Object> record);", "private HashMap<String, MyFolder> validateChooser(\n\t\t\tHashMap<String, MyFolder> input) {\n\t\tBoolean needed = null;\n\t\tHashMap<String, MyFolder> finalChooserResult = new HashMap<String, MyFolder>();\n\t\tfor (MyFolder item : input.values()) {\n\t\t\tneeded = true;\n\t\t\tfor (MyFolder item2 : input.values()) {\n\t\t\t\tif (item.getAbsPath().equals(item2.getAbsPath())) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (item.isSubFolderOf(item2)) {\n\t\t\t\t\tneeded = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (needed) {\n\t\t\t\tfinalChooserResult.put(item.getAbsPath(), item);\n\t\t\t}\n\t\t}\n\t\treturn finalChooserResult;\n\t}", "private void parseJSON(Map<String,Object> map, String baseName, JSONObject toParse) {\n\t\ttoParse.keys().forEachRemaining(key -> {\n\t\t\tObject value = parseJSONVal(toParse.get(key));\n\t\t\t\n\t\t\tif(value instanceof JSONObject)\n\t\t\t\tparseJSON(map, baseName+key+StringParser.DELIMITER, (JSONObject) value);\n\t\t\telse if(value instanceof JSONArray) \n\t\t\t\tparseJSON(map, baseName+key+StringParser.DELIMITER, (JSONArray) value);\n\t\t\telse\n\t\t\t\tmap.put(baseName+key, value);\n\t\t});\n\t}", "public Map<String, FieldType> flatten() {\n if (fields == null || fields.length == 0) {\n return Collections.<String, FieldType> emptyMap();\n }\n\n Map<String, FieldType> map = new LinkedHashMap<String, FieldType>();\n\n for (Field nestedField : fields) {\n addSubFieldToMap(map, nestedField, null);\n }\n\n return map;\n }" ]
[ "0.5776276", "0.5510767", "0.53244495", "0.496922", "0.49438757", "0.4886112", "0.48518214", "0.4831373", "0.4823634", "0.47575748", "0.47391683", "0.4735033", "0.4665696", "0.46571004", "0.46533594", "0.46306527", "0.46117473", "0.46106938", "0.460681", "0.46067378", "0.45995846", "0.45993498", "0.45880517", "0.4583695", "0.45403844", "0.45342687", "0.4525375", "0.44979182", "0.44704896", "0.44681165", "0.44661412", "0.44647792", "0.44545457", "0.44465813", "0.44453877", "0.44373998", "0.44348463", "0.4426994", "0.44165206", "0.44135955", "0.4398617", "0.4397832", "0.43918803", "0.43870816", "0.43850744", "0.43688437", "0.43671745", "0.43659583", "0.43634635", "0.43615204", "0.43568796", "0.4349744", "0.4333236", "0.43297756", "0.43263307", "0.43169728", "0.4298613", "0.4296067", "0.4293243", "0.42884836", "0.4284971", "0.42739478", "0.4256787", "0.42533332", "0.42442867", "0.42437154", "0.4237413", "0.42350945", "0.42289987", "0.42264712", "0.4224043", "0.4222931", "0.42144218", "0.42119396", "0.42100725", "0.42081326", "0.42007592", "0.41976988", "0.41925567", "0.4180474", "0.41803774", "0.41728395", "0.41719702", "0.41666192", "0.41652492", "0.41647467", "0.41575933", "0.41541022", "0.4153344", "0.41453326", "0.41443348", "0.4138404", "0.41345793", "0.41331604", "0.41313398", "0.41241094", "0.41189048", "0.41167158", "0.41140464", "0.4113668" ]
0.5747332
1
regex to replace all special characters . [ ] \ with \. \[ \] \\
private static String encodeSegment(final String segment) { final Matcher matcher = SPECIAL_CHARACTERS_PATTERN.matcher(segment); return matcher.replaceAll("\\\\$1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String replaceEscapeChars(final String input) {\n if (input == null) return null;\n\n String retValue = LEFT_SQUARE_BRACKET_PATTERN.matcher(input).replaceAll(\"[\");\n retValue = RIGHT_SQUARE_BRACKET_PATTERN.matcher(retValue).replaceAll(\"]\");\n retValue = LEFT_BRACKET_PATTERN.matcher(retValue).replaceAll(\"(\");\n retValue = RIGHT_BRACKET_PATTERN.matcher(retValue).replaceAll(\")\");\n retValue = COLON_PATTERN.matcher(retValue).replaceAll(\":\");\n retValue = COMMA_PATTERN.matcher(retValue).replaceAll(\",\");\n retValue = EQUALS_PATTERN.matcher(retValue).replaceAll(\"=\");\n retValue = PLUS_PATTERN.matcher(retValue).replaceAll(\"+\");\n return MINUS_PATTERN.matcher(retValue).replaceAll(\"-\");\n }", "private String removeSpecialCharacters(String word)\n\t{\n\t\tString newString = \"\";\n\n\t\tfor (int i = 0; i < word.length(); i++)\n\t\t{\n\t\t\tif (word.charAt(i) != '?' && word.charAt(i) != '!' && word.charAt(i) != '\"' && word.charAt(i) != '\\''\n\t\t\t\t\t&& word.charAt(i) != '#' && word.charAt(i) != '(' && word.charAt(i) != ')' && word.charAt(i) != '$'\n\t\t\t\t\t&& word.charAt(i) != '%' && word.charAt(i) != ',' && word.charAt(i) != '&')\n\t\t\t{\n\t\t\t\tnewString += word.charAt(i);\n\t\t\t}\n\t\t}\n\n\t\treturn newString;\n\t}", "private String sanitizeSpecialChars(String value) {\n return value.replaceAll(\"[^a-zA-Z0-9_]\", \"_\");\n }", "private static String addEscapes(String text, char[] escapedChars, String escapeDelimiter) {\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tif (inArray(text.charAt(i), escapedChars)) {\n\t\t\t\ttext = text.substring(0, i) + escapeDelimiter + text.charAt(i) + text.substring(i + 1, text.length());\n\t\t\t\ti += escapeDelimiter.length();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn text;\n\t}", "private String escape(String name) {\n return name.replaceAll(\"[^a-zA-Z0-9.-]\", \"_\");\n }", "public static String escapeSpecialChars(String value) {\r\n if (value != null) {\r\n for (int c = 0; c < SPECIAL_CHARS.length; c++) {\r\n value = value.replaceAll(\"\" + SPECIAL_CHARS[c], SPECIAL_CHAR_NAME[c]);\r\n }\r\n }\r\n return value;\r\n }", "protected String escape( String text )\n {\n return text.replaceAll( \"([`\\\\|*_])\", \"\\\\\\\\$1\" );\n }", "protected String escapeBrackets(String input) {\n\t\tString replacement = \"\\\\\\\\[{group1}\\\\\\\\]\";\n\t\treturn RegexUtil.loopRegex(input, doubleBrackets, replacement);\n\t}", "private static String convertPattern(String pattern) {\n if (Strings.isNullOrEmpty(pattern)) {\n return pattern;\n }\n\n return \"^\" + pattern\n .replaceAll(\"\\\\[\", \"\\\\[\")\n .replaceAll(\"]\", \"\\\\]\")\n .replaceAll(\"\\\\.\", \"\\\\.\")\n .replaceAll(\"\\\\*\", \"\\\\*\")\n .replaceAll(\"(?<!\\\\\\\\)_\", \".\")\n .replaceAll(\"\\\\\\\\_\", \"_\")\n .replaceAll(\"(?<!\\\\\\\\)%\", \".*\")\n .replaceAll(\"\\\\\\\\%\", \"%\") +\n \"$\";\n }", "public static String removeSpecialCharacters(String text) {\r\n\t\tif (null == text) {\r\n\t\t\treturn text;\r\n\t\t}\r\n\t\tPattern pattern = Pattern.compile(\"[^A-Z a-z0-9]\");\r\n\t\tMatcher matcher = pattern.matcher(text);\r\n\t\ttext = matcher.replaceAll(\"\");\r\n\t\treturn text;\r\n\t}", "private String editString(String s) {\n s = s.replace(\"[31m\", \"\");\n s = s.replace(\"[0m\", \"\");\n s = s.replace(\"[33m\", \"\");\n s = s.replace(\"[36m\", \"\");\n s = s.replace(\"[34m\", \"\");\n s = s.replace(\"*\", \"\");\n s = s.replace(\"|\", \"\");\n //s = s.replace(\"]\", \"]\\n\");\n s = s.replace(\"\\t\", \"\\n\");\n\n\n return s;\n }", "private static String escape(String in) {\n // After regexp escaping \\\\\\\\ = 1 slash, \\\\\\\\\\\\\\\\ = 2 slashes.\n\n // Also, the second args of replaceAll are neither strings nor regexps, and\n // are instead a special DSL used by Matcher. Therefore, we need to double\n // escape slashes (4 slashes) and quotes (3 slashes + \") in those strings.\n // Since we need to write \\\\ and \\\", we end up with 8 and 7 slashes,\n // respectively.\n return in.replaceAll(\"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\").replaceAll(\"\\\"\", \"\\\\\\\\\\\\\\\"\");\n }", "public static String removeInvalidCharacteres(String string) {\n\t\tString corretString = string;\n\t\tif (containsInvalidCharacterInLogin(string)) {\n\t\t\tString regex = \"[|\\\"&*=+'@#$%\\\\/?{}?:;~<>,\\u00C0\\u00C1\\u00C2\\u00C3\\u00C4\\u00C5\\u00C6\\u00C7\\u00C8\\u00C9\\u00CA\\u00CB\\u00CC\\u00CD\\u00CE\\u00CF\\u00D0\\u00D1\\u00D2\\u00D3\\u00D4\\u00D5\\u00D6\\u00D8\\u0152\\u00DE\\u00D9\\u00DA\\u00DB\\u00DC\\u00DD\\u0178\\u00E0\\u00E1\\u00E2\\u00E3\\u00E4\\u00E5\\u00E6\\u00E7\\u00E8\\u00E9\\u00EA\\u00EB\\u00EC\\u00ED\\u00EE\\u00EF\\u00F0\\u00F1\\u00F2\\u00F3\\u00F4\\u00F5\\u00F6\\u00F8\\u0153\\u00DF\\u00FE\\u00F9\\u00FA\\u00FB\\u00FC\\u00FD\\u00FF]\";\n\t\t\tPattern p = Pattern.compile(regex);\n\t\t\tMatcher m = p.matcher(string);\n\t\t\tcorretString = m.replaceAll(\"\");\n\t\t\t//System.out.println(corretString);\n\t\t}\n\t\t\n\t\tcorretString = corretString.replace(\"\\\\\", \"\");\n\t\t\n\t\treturn corretString;\n\t}", "public static String alter(String saInput) {\r\n\t\tif (null == saInput) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tString slInputTmp = saInput;\r\n\t\t\tint specialLen = specialChars.length;\r\n\t\t\tfor (int ilCounter = 0; ilCounter < specialLen; ilCounter++) {\r\n\t\t\t\tslInputTmp = replaceAllOccurrences(slInputTmp, specialChars[ilCounter], replacement[ilCounter]);\r\n\t\t\t}\r\n\r\n\t\t\treturn slInputTmp;\r\n\t\t} catch (Exception e) {\r\n\t\t\t// LOGGER.error(e);\r\n\t\t\tLOGGER.info(\"Exception:\" + e);\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}", "public String escapeSpetialCharecters(String string)\r\n {\r\n return string.replaceAll(\"(?=[]\\\\[+&|!(){}^\\\"~*?:\\\\\\\\-])\", \"\\\\\\\\\");\r\n }", "private static String rep(String input) {\n\t\tchar[] ca = input.toCharArray();\n\t\tint c = 0;\n\t\tfor (int i = 0, n = ca.length; i < n; i++) {\n\t\t\tif (ca[i] == '\\'')\n\t\t\t\tc++;\n\t\t\telse if (ca[i] == ',' && ((c % 2) != 0))\n\t\t\t\tca[i] = '~';\n\t\t}\n\t\treturn String.valueOf(ca);\n\t}", "public static String ungroupify(String text){\r\n return text.replaceAll(\"[\\\\sx]\", \"\");\r\n}", "private static String formatRegEx(String regex) {\n String res = new String();\n List<Character> allOperators = Arrays.asList('|', '?', '+', '*', '^');\n List<Character> binaryOperators = Arrays.asList('^', '|');\n\n for (int i = 0; i < regex.length(); i++) {\n Character c1 = regex.charAt(i);\n\n if (i + 1 < regex.length()) {\n Character c2 = regex.charAt(i + 1);\n\n res += c1;\n\n if (!c1.equals('(') && !c2.equals(')') && !allOperators.contains(c2) && !binaryOperators.contains(c1)) {\n res += '.';\n }\n }\n }\n res += regex.charAt(regex.length() - 1);\n\n return res;\n }", "final protected String translateSpecialChars(String title)\r\n {\r\n int start;\r\n\tint i;\r\n\t// HTML representation of selected extended chars\r\n\tString rawString[]={\r\n\t\t\t\t\t\t \"&aacute;\",\"&acirc;\",\"&aelig;\",\r\n\t\t\t\t\t\t \"&agrave;\",\"&auml;\",\"&ccedil;\",\r\n\t\t\t\t\t\t \"&eacute;\",\"&ecirc;\",\"&egrave;\",\r\n\t\t\t\t \"&euml;\",\"&icirc;\",\"&iuml;\",\r\n\t\t\t\t \"&ocirc;\",\"&ouml;\",\"&szlig;\",\r\n\t\t\t\t \"&uuml;\",\"&yuml;\",\"&copy;\",\r\n\t\t\t\t \"&pound;\",\"&reg;\",\"&lt;\",\r\n\t\t\t\t \"&gt;\",\"&amp;\",\"&quot;\",\r\n \t\t\t\t\t \"&atilde;\",\"&aring;\",\"&igrave;\",\r\n\t\t\t\t\t \"&iacute;\",\"&eth;\",\"&ntilde;\",\r\n\t\t\t\t\t \"&ograve;\",\"&oacute;\",\"&otilde;\",\r\n\t\t\t\t\t \"&divide;\",\"&oslash;\",\"&ugrave;\",\r\n\t\t\t\t\t \"&uacute;\",\"&ucirc;\",\"&yacute;\",\r\n\t\t\t\t\t \"&thorn;\",\"&times;\",\"&nbsp;\",\r\n\t\t\t\t\t \"&sect;\",\"&cent;\",\"&deg;\"\r\n\t\t\t\t\t };\r\n // Unicode representation of above\r\n\tchar translatedChar[]={\r\n\t\t\t\t\t\t\t'\\u00e1','\\u00e2','\\u00e6',\r\n\t\t\t\t\t\t\t'\\u00e0','\\u00e4','\\u00e7',\r\n\t\t\t\t\t\t\t'\\u00e9','\\u00ea','\\u00e8',\r\n\t\t\t\t\t\t\t'\\u00eb','\\u00ee','\\u00ef',\r\n\t\t\t\t\t\t\t'\\u00f4','\\u00f6','\\u00df',\r\n\t\t\t\t\t\t\t'\\u00fc','\\u00ff','\\u00a9',\r\n\t\t\t\t\t\t\t'\\u00a3','\\u00ae','\\u003c',\r\n\t\t\t\t\t\t\t'\\u003e','\\u0026','\\u0022',\r\n\t\t\t\t\t\t\t'\\u00e3','\\u00e5','\\u00ec',\r\n\t\t\t\t\t\t\t'\\u00ed','\\u00f0','\\u00f1',\r\n\t\t\t\t\t\t\t'\\u00f2','\\u00f3','\\u00f5',\r\n\t\t\t\t\t\t\t'\\u00f7','\\u00f8','\\u00f9',\r\n\t\t\t\t\t\t\t'\\u00fa','\\u00fb','\\u00fd',\r\n\t\t\t\t\t\t\t'\\u00fe','\\u00d7','\\u00a0',\r\n\t\t\t\t\t\t\t'\\u00a7','\\u00a2','\\u00b0'\r\n\t\t\t\t\t\t };\r\n StringBuffer translated=new StringBuffer(\"\");\r\n\tString titleString=title;\r\n\r\n\t//Check the title for each of the above HTML special chars\r\n\tfor(int loop=0;loop<NUMBER_SPECIAL_CHARS;loop++)\r\n\t{\r\n\t if(translated.length()>0)\r\n\t {\r\n\t titleString=translated.toString();\r\n\t\ttranslated=new StringBuffer(\"\");\r\n\t }\r\n\t start=titleString.indexOf(rawString[loop]);\r\n\t if(start!=-1)\r\n\t {\r\n\t //HTML special character found so replace it \r\n\t\t// with the unicode equalent for display.\r\n\t\tfor(i=0;i<start;i++)\r\n\t\t translated.insert(i,titleString.charAt(i));\r\n translated.append(translatedChar[loop]);\r\n\t\tfor(i=start+rawString[loop].length();i<titleString.length();i++)\r\n\t\t translated.append(titleString.charAt(i));\r\n\t }\r\n\t}\r\n\treturn (translated.length()==0) ? titleString : translated.toString();\r\n }", "private static String stripRegexCharacters(String text) {\r\n if (StringUtils.isBlank(text)) {\r\n return \"\";\r\n }\r\n return text.replaceAll(\"\\\\*\", \".*\").replaceAll(\"\\\\(\", \"\").replaceAll(\"\\\\)\", \"\").replaceAll(\"\\\\?\", \"\")\r\n .replaceAll(\"\\\\{\", \"\").replaceAll(\"\\\\}\", \"\").replaceAll(\"\\\\[\", \"\").replaceAll(\"\\\\]\", \"\")\r\n .replaceAll(\"\\\\+\", \"\").toLowerCase();\r\n }", "protected static String sanitise(final String name) {\n // Replace illegal chars with\n return name.replaceAll(\"[^\\\\w\\\\.\\\\s\\\\-#&_]\", \"_\");\n }", "private boolean hasSpecialCharacters(String s) {\r\n\t\t\tif (s != s.replaceAll(\"([^A-Za-z0-9.,!?~`'\\\"% _-]+)\", \"\")) return true;\r\n\t\t\treturn false;\r\n\t}", "public static String RemoveCharacters(String sentence){\n\t\tString keyCharacters[] = {\"<\",\">\",\"SERVICE\",\"{\",\"}\",\"(\",\")\",\"-\"};\n\t\tString resturnString = sentence;\n\t\tfor(int i=0;i<keyCharacters.length;i++) {\n\t\t\tresturnString = resturnString.replace(keyCharacters[i],\"\");\n\t\t}\n\t\t\n\t\treturn resturnString;\n\t}", "static String re_screen(String str) {\n String screened = str.replaceAll(\"([\\\\\\\\\\\\^\\\\$\\\\.\\\\[\\\\]\\\\|\\\\(\\\\)\\\\?\\\\*\\\\+\\\\{\\\\}])\", \"\\\\\\\\$1\");\n //System.err.println(\"screened: \"+screened);\n return screened;\n }", "protected String cleanQuery(String query,ArrayList<String> specialCharacters){ \r\n //convert qiery to a bag of keywords\r\n for(int i = 0 ; i < specialCharacters.size() ; i++){\r\n query = query.replace(specialCharacters.get(i), \" \");\r\n }\r\n //replace all sequences os spaces tabs etc with just one space\r\n query = query.replaceAll(\"\\\\s+\", \" \");\r\n \r\n return query; \r\n }", "public static String replaceNonAlphanumeric(String str, char subst) {\n StringBuffer ret = new StringBuffer(str.length());\n char[] testChars = str.toCharArray();\n for (int i = 0; i < testChars.length; i++) {\n if (Character.isLetterOrDigit(testChars[i])) {\n ret.append(testChars[i]);\n } else {\n ret.append( subst );\n }\n }\n return ret.toString();\n }", "private static String escape(String value, String chars, String escapeSequence) {\n\t\tString escaped = value;\n\t\t\n\t\tif (escaped == null) {\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\tfor (char ch : chars.toCharArray()) {\n\t\t\tescaped = escaped.replaceAll(String.valueOf(ch), escapeSequence + ch);\n\t\t}\n\t\n\t\treturn escaped;\n\t}", "public static String escapeRegexReservedCharacters(String stringWithReservedCharacters) {\n String reservedSymbols = \"{([*+^?<>$.|])}\";\n StringBuilder escapedStringBuilder = new StringBuilder();\n\n for (char character : stringWithReservedCharacters.toCharArray()) {\n if (reservedSymbols.contains(String.valueOf(character)))\n escapedStringBuilder.append(\"\\\\\");\n\n escapedStringBuilder.append(character);\n }\n\n return escapedStringBuilder.toString();\n }", "public static String replaceURLEscapeChars(String value) {\n\t\tvalue = replace(value, \"#\", \"%23\");\n\t\tvalue = replace(value, \"$\", \"%24\");\n\t\tvalue = replace(value, \"%\", \"%25\");\n\t\tvalue = replace(value, \"&\", \"%26\");\n\t\tvalue = replace(value, \"@\", \"%40\");\n\t\tvalue = replace(value, \"'\", \"%60\");\n\t\tvalue = replace(value, \"/\", \"%2F\");\n\t\tvalue = replace(value, \":\", \"%3A\");\n\t\tvalue = replace(value, \";\", \"%3B\");\n\t\tvalue = replace(value, \"<\", \"%3C\");\n\t\tvalue = replace(value, \"=\", \"%3D\");\n\t\tvalue = replace(value, \">\", \"%3E\");\n\t\tvalue = replace(value, \"?\", \"%3F\");\n\t\tvalue = replace(value, \"[\", \"%5B\");\n\t\tvalue = replace(value, \"\\\\\", \"%5C\");\n\t\tvalue = replace(value, \"]\", \"%5D\");\n\t\tvalue = replace(value, \"^\", \"%5E\");\n\t\tvalue = replace(value, \"{\", \"%7B\");\n\t\tvalue = replace(value, \"|\", \"%7C\");\n\t\tvalue = replace(value, \"}\", \"%7D\");\n\t\tvalue = replace(value, \"~\", \"%7E\");\n\t\treturn value;\n\t}", "public String replaceAllCharacter(String string, String regex, String replacement) {\n return string.replaceAll(regex, replacement);\n }", "public static String replaceSymbols(String text) {\n\t\tif (text.isEmpty()) {\n\t\t\treturn \"\\u03B5\";\n\t\t}\n\n\t\treturn text.replaceAll(\"\\n\", \"\\u21B5\") // ↵\n\t\t\t\t.replaceAll(\"\\t\", \"\\u00BB\") // »\n\t\t\t\t.replaceAll(\" \", \"\\u00B7\"); // ·\n\t}", "public static void main(String[] args) {\n\n \tString str = \"123abc你好efc\";\n\n \tString reg = \"[\\u4e00-\\u9fa5]\";\n\n \tPattern pat = Pattern.compile(reg); \n\n \tMatcher mat=pat.matcher(str); \n\n \tString repickStr = mat.replaceAll(\"\");\n\n \tSystem.out.println(\"去中文后:\"+repickStr);\n\n}", "public void removeJunkOrUnwantedCharFromString() {\n\t\tString str = \"hello@#4kjk122\";\n\t\tstr = str.replaceAll(\"[^a-zA-z0-9]\", \"\");\n\t\t// if we don't put ^ in above statement it will remove a to z charac and numbers\n\t\tSystem.out.println(str);\n\t}", "protected String escape(String replacement) {\n return replacement.replace(\"\\\\\", \"\\\\\\\\\").replace(\"$\", \"\\\\$\");\n }", "public void unescapedCharacters(char[] chars, int start, int length);", "public String stripInput(String input) {\n return input.replaceAll(\"[.#$\\\\[\\\\]]\", \"\").replaceAll(\"/\", \" \");\n }", "@Test\n public void testCrazyPatterns() {\n assertEquals(\"java\\\\.\\\\{.*\\\\}\\\\.Array\", glob2Pattern(\"java.{**}.Array\").pattern());\n assertEquals(\"java\\\\./.*<>\\\\.Array\\\\$1\", glob2Pattern(\"java./**<>.Array$1\").pattern());\n assertEquals(\"\\\\+\\\\^\\\\$\", glob2Pattern(\"+^$\").pattern());\n }", "private String cleanText(String str) {\r\n\t\tString clean = str.replace(\" \", \"\");\r\n\t\tclean = clean.replace(\":\", \"\");\r\n\t\tclean = clean.replace(\"$\", \"\");\r\n\t\tclean = clean.replace(\".\", \"\");\r\n\t\tclean = clean.replace(\"\\\"\", \"\");\r\n\t\tclean = clean.replace(\"'\", \"\");\r\n\t\tclean = clean.replace(\"&\", \"\");\r\n\t\treturn clean;\r\n\t}", "public void specialCharacters(String s)\n\t{\n\t\tString[] array = s.split(\"\\\\s+\");\n\t\tSystem.out.println(Arrays.toString(array));\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor(int i=0; i< array.length; i++)\n\t\t{\n\t\t\tif(array[i].isEmpty())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Entered\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tSystem.out.println(\"String under consideration \"+ array[i]);\n\t\t\tif(array[i].charAt(0) < 'Z' && array[i].charAt(0) > 'A' || array[i].charAt(0) < 'z' && array[i].charAt(0) > 'a')\n\t\t\t{\n\t\t\t\tsb.append(\" \");\n\t\t\t\tsb.append(array[i]);\n\t\t\t\tSystem.out.println(\"StringBuffer is \"+sb.toString());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsb.append(array[i]);\n\t\t\t}\n\t\t}\n\t\t//System.out.println(sb.toString());\n\t}", "public static String unalter(String saInput) {\r\n\t\tif (null == saInput) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tString slInputTmp = saInput;\r\n\t\t\tint specialLen = specialChars.length;\r\n\t\t\tfor (int ilCounter = 0; ilCounter < specialLen; ilCounter++) {\r\n\t\t\t\tslInputTmp = replaceAllOccurrences(slInputTmp, replacement[ilCounter], specialChars[ilCounter]);\r\n\t\t\t}\r\n\r\n\t\t\treturn slInputTmp;\r\n\t\t} catch (Exception e) {\r\n\t\t\tLOGGER.info(\"Exception:\" + e);\r\n\t\t\t// LOGGER.error(e);\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}", "public static String escapeRegexChar(char c) {\n return (META_CHARS.contains(c) ? \"\\\\\" : \"\") + c;\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}", "private static String replaceAll(Matcher matcher, String rep) {\n try {\n StringBuffer sb = null ; // Delay until needed\n while(matcher.find()) {\n if ( sb == null )\n sb = new StringBuffer() ;\n else {\n // Do one match of zerolength string otherwise filter out.\n if (matcher.start() == matcher.end() )\n continue ;\n }\n matcher.appendReplacement(sb, rep);\n }\n if ( sb == null )\n return null ;\n matcher.appendTail(sb);\n return sb.toString();\n } catch (IndexOutOfBoundsException ex) {\n throw new ExprEvalException(\"IndexOutOfBounds\", ex) ;\n }\n }", "@BeforeEach\n\tvoid setUpToFormatRE() {\n\t\ttoFormatRE = new String[lengthToFormatRE];\n\t\ttoFormatRE[0] = \"a*****\";\n\t\ttoFormatRE[1] = \"a?????\";\n\t\ttoFormatRE[2] = \"a+++++\";\n\t\ttoFormatRE[3] = \"a?*?*?***???*\";\n\t\ttoFormatRE[4] = \"a?+?+?+++???+\";\n\t\ttoFormatRE[5] = \"a*+*+*++++***+*\";\n\t\ttoFormatRE[6] = \"a?+*?+?***???+++***?+?*+*\";\n\t}", "public static String escapeRegex(String str) {\n return str.chars().boxed()\n .map(i -> escapeRegexChar((char) i.intValue()))\n .collect(Collectors.joining());\n }", "public static void preProcessWordsSpecialCharacters(String line, StringBuilder newLine){\n\n\t\t//System.out.println(\"Preprocess words with special characaters ...\");\n\t\tList<String> newLineList = new ArrayList<String>();\n\t\tString eachWord;\n\t\tString[] hyphenWordArray;\n\t\t//replace all forward slash in the string with whitespace\n\t\t//line = line.replaceAll(\"[/|:|?|..|adverb|noun]\", \" \");\n\t\t//System.out.println(\"Line before modification: \"+ line);\n\t\tline = line.replaceAll(\"(\\\\?)|(\\\\()|(\\\\))|(\\\\,)|(\\\\.)|(\\\\!)|(\\\\/)|(\\\\:)|(\\\\?)|(\\\\')|(\\\\])|(\\\\[)\", \" \");\n\t\t//System.out.println(\"Line after first modification: \"+ line);\n\t\tline = line.replaceAll(\"\\\\s+\", \" \");\n\n\t\tnewLineList = Arrays.asList(line.split(\"\\\\s+\"));\n\t\tIterator<String> iter = newLineList.iterator();\n\n\t\t//replace the hyphen words like aaa-bb-ccc with aaabbccc, aaa, bb, cc\n\t\twhile(iter.hasNext()){\n\t\t\teachWord = (String)iter.next();\n\t\t\tnewLine.append(\" \").append(eachWord);\n\t\t\tif(eachWord.contains(\"-\")){ //if the word contains a hyphen\n\t\t\t\t//System.out.println(\"Word containing hyphen: \"+ eachWord);\n\t\t\t\thyphenWordArray = eachWord.split(\"\\\\-\");\n\t\t\t\t//adding aaabbccc for aaa-bb-ccc \n\t\t\t\tnewLine.append(\" \").append(eachWord.replaceAll(\"\\\\-\", \"\"));\n\t\t\t\tfor(int i = 0; i < hyphenWordArray.length; i++ )\n\t\t\t\t\t//adding aaa, bb, cc for aaa-bb-ccc \n\t\t\t\t\tnewLine.append(\" \").append(hyphenWordArray[i]);\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"Line after modification: \"+ newLine.toString());\n\t}", "public String sanitizeChars(String chars) {\n String cleanchars = chars.replaceAll(\"\\\\s+\", \"\");\n if (checkDuplicates(chars)) {\n throw new EnigmaException(\"Alpha.sanitizeChars: Duplicate chars.\");\n }\n return cleanchars;\n }", "public static String preProcessWordsSpecialCharacters(String line){\n\n\t\tStringBuilder newLine = new StringBuilder();\n\t\t//System.out.println(\"Preprocess words with special characaters ...\");\n\t\tList<String> newLineList = new ArrayList<String>();\n\t\tString eachWord;\n\t\tString[] hyphenWordArray;\n\t\t//replace all forward slash in the string with whitespace\n\t\t//line = line.replaceAll(\"[/|:|?|..|adverb|noun]\", \" \");\n\t\t//System.out.println(\"Line before modification: \"+ line);\n\t\tline = line.replaceAll(\"(\\\\?)|(\\\\()|(\\\\))|(\\\\,)|(\\\\.)|(\\\\!)|(\\\\/)|(\\\\:)|(\\\\?)|(\\\\')|(\\\\])|(\\\\[)\", \" \");\n\t\t//System.out.println(\"Line after first modification: \"+ line);\n\t\tline = line.replaceAll(\"\\\\s+\", \" \");\n\n\t\tnewLineList = Arrays.asList(line.split(\"\\\\s+\"));\n\t\tIterator<String> iter = newLineList.iterator();\n\n\t\twhile(iter.hasNext()){\n\t\t\teachWord = (String)iter.next();\n\t\t\tnewLine.append(\" \").append(eachWord);\n\t\t\tif(eachWord.contains(\"-\")){ //if the word contains a hyphen\n\t\t\t\t//System.out.println(\"Word containing hyphen: \"+ eachWord);\n\t\t\t\thyphenWordArray = eachWord.split(\"\\\\-\");\n\t\t\t\t//adding aaabbccc for aaa-bb-ccc \n\t\t\t\tnewLine.append(\" \").append(eachWord.replaceAll(\"\\\\-\", \"\"));\n\t\t\t\tfor(int i = 0; i < hyphenWordArray.length; i++ )\n\t\t\t\t\t//adding aaa, bb, cc for aaa-bb-ccc \n\t\t\t\t\tnewLine.append(\" \").append(hyphenWordArray[i]);\n\t\t\t}/*else{ //if the word does not contain hyphen, add it as it is\n\t\t\t\tnewLine.append(\" \").append(eachWord);\n\t\t\t}*/\n\t\t}\n\t\t//System.out.println(\"Line after modification: \"+ newLine.toString());\n\t\treturn newLine.toString();\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\tString s = \"平仮�??stringabc片仮�??numbers 123漢字gh%^&*#$1@):\";\n\t\t\n\t\t//Regular Expression: [^a-zA-Z0-9]\n\t\t\n\t\ts = s.replaceAll(\"[^a-zA-Z0-9]\", \"-\"); // ^ symbol is used for not/except\n\t\tSystem.out.println(s);\n\t}", "static String escapeLiteral(LiteralRule rule) {\n String specialChars = \".[]{}()*+-?^$|\";\n StringBuilder sb = new StringBuilder();\n\n for (int i = 0; i < rule.value.length(); ++i) {\n char c = rule.value.charAt(i);\n if (specialChars.indexOf(c) != -1) {\n sb.append(\"\\\\\");\n }\n\n sb.append(c);\n }\n\n return sb.toString();\n }", "private String replaceSpecialCharactersFromNumber(String number) {\n\t\tnumber = number.replaceAll(\"[^a-zA-Z0-9]\", \"\");\n\t\treturn number;\n\t}", "public String escapeForVideoFilter(String input) {\n\t\t//return input.replace(\"\\\\\", \"\\\\\\\\\").replace(\",\", \"\\\\,\").replace(\";\", \"\\\\;\").replace(\":\", \"\\\\:\")\n\t\t//\t\t.replace(\"'\", \"\\\\'\").replace(\"[\", \"\\\\[\").replace(\"]\", \"\\\\]\").replace(\"=\", \"\\\\=\");\n\t\treturn \"'\" + input.replace(\"'\", \"'\\\\''\") + \"'\";\n\t}", "public String rep(String str, String reg_ex, String rep) {\n Pattern p;\n Matcher m;\n StringBuffer sb;\n\n str = repNull(str);\n p = Pattern.compile(reg_ex);\n m = p.matcher(str);\n sb = new StringBuffer();\n\n while (m.find()) {\n m.appendReplacement(sb, rep);\n }\n\n m.appendTail(sb);\n\n str = sb.toString();\n\n return str;\n }", "private String removePunctuation(String word) {\t\t\r\n\t\t\t//removes all punctuation and special characters\r\n\t\t\t// adds a space so we can deal with words such as pre-req\r\n\t\treturn word.replaceAll(\"[&@#$%^*()\\\\\\\"\\\\\\\\/$\\\\-\\\\!\\\\+\\\\=|(){},.;:!?\\\\%]+\", \" \");\t\t\r\n\t\t\r\n\t}", "public static String escape(String value, String escape) {\n String result = value.replace(\"_\", \"_\" + escape);\n result = result.replace(\"%\", \"%\" + escape);\n result = result.replace(escape, escape + escape);\n return result;\n }", "private static String fixBrackets(String reg) {\n while (reg.contains(\"()*\"))\n reg = removeChars(reg, reg.indexOf(\"()*\"), \"()*\".length());\n\n int i = reg.indexOf(\"(\");\n do {\n if (reg.charAt(i) == '(') {\n int j = 1;\n boolean leave = false;\n boolean removeBracket = true;\n do {\n if (reg.charAt(i + j) == '(') {\n bracketStack.push(i);\n bracketRemove.push(removeBracket);\n i = i + j;\n j = 1;\n removeBracket = true;\n } else if (reg.charAt(i + j) == ')') {\n if (removeBracket) {\n if (j == 2 && reg.contains(String.valueOf(QUOTE)))\n leave = false;\n else if (j > 2 && i + j + 1 < reg.length()\n && reg.charAt(i + j + 1) == '*') {\n i = i + j + 1;\n leave = true;\n }\n if (!leave) {\n reg = removeChars(reg, i + j, 1);\n reg = removeChars(reg, i, 1);\n if (bracketStack.size() > 0) {\n i = bracketStack.pop();\n removeBracket = bracketRemove.pop();\n j = 1;\n } else\n leave = true;\n }\n } else {\n if (bracketStack.size() > 0) {\n j = i + j + 1;\n i = bracketStack.pop();\n j = j - i;\n removeBracket = bracketRemove.pop();\n } else {\n i = i + j;\n leave = true;\n }\n }\n } else if (reg.charAt(i + j) == '|' && reg.charAt(i + j - 1) != QUOTE) {\n removeBracket = false;\n j++;\n } else\n j++;\n } while (!leave);\n }\n i++;\n } while (i < reg.length());\n\n return reg;\n }", "private char[] preprocess(String text) {\n char[] t = new char[text.length() * 2 + 3];\n t[0] = '$';\n t[text.length() * 2 + 2] = '@';\n for (int i = 0; i < text.length(); i++) {\n t[2 * i + 1] = '#';\n t[2 * i + 2] = text.charAt(i);\n }\n t[text.length() * 2 + 1] = '#';\n return t;\n }", "private String regex() {\n final List<String> keys = new LinkedList<>();\n for (final String key : this.template.split(\"\\\\.\")) {\n if (key.equals(\"*\")) {\n keys.add(\"\\\\w+\");\n } else {\n keys.add(key);\n }\n }\n return String.join(\"\\\\.\", keys);\n }", "private static String fixLeadingBracketSugar( String dotNotaton ) {\n\n if ( dotNotaton == null || dotNotaton.length() == 0 ) {\n return \"\";\n }\n\n char prev = dotNotaton.charAt( 0 );\n StringBuilder sb = new StringBuilder();\n sb.append( prev );\n\n for ( int index = 1; index < dotNotaton.length(); index++ ) {\n char curr = dotNotaton.charAt( index );\n\n if ( curr == '[' && prev != '\\\\') {\n if ( prev == '@' || prev == '.' ) {\n // no need to add an extra '.'\n }\n else {\n sb.append( '.' );\n }\n }\n\n sb.append( curr );\n prev = curr;\n }\n\n return sb.toString();\n }", "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}", "public String replace(String input);", "public static String processSpecialCharacter(String owl) {\r\n\t\towl = Normalizer.normalize(owl, Normalizer.Form.NFD);\r\n\t\towl = owl.replaceAll(\"[^\\\\p{ASCII}]\", \"\");\r\n\t\treturn owl;\r\n\t}", "public String htmlSpecialChar(String string){\n String res = string.replaceAll(\"&\",\"&amp;\");\n res = res.replace(\"'\",\"&#039;\");\n res = res.replace(\"\\\"\",\"&qout;\");\n res = res.replace(\"$\",\"&#036;\");\n res = res.replace(\"%\",\"&#037;\");\n res = res.replace(\"<\",\"&lt;\");\n res = res.replace(\">\",\"&gt;\");\n res = res.replace(\"\\n\",\"\\\\n\");\n return res;\n }", "public static void main(String[] args) {\r\n String str = \"Filesystem 1K-blocks Used Available Use% Mounted on\\n\";\r\n str += \"/dev/sda1 7850996 1511468 5940716 21% /\\n\";\r\n str += \"tmpfs 258432 0 258432 0% /lib/init/rw\\n\";\r\n str += \"udev 10240 52 10188 1% /dev\\n\";\r\n str += \"tmpfs 258432 0 258432 0% /dev/shm\\n\";\r\n \r\n System.out.println(str);\r\n \r\n System.out.println(\"StringEscapeUtils.unescapeHtml(str):\");\r\n System.out.println(StringEscapeUtils.unescapeHtml(str));\r\n \r\n System.out.println(\"StringEscapeUtils.escapeHtml(str):\");\r\n System.out.println(StringEscapeUtils.escapeHtml(str));\r\n \r\n System.out.println(\"StringEscapeUtils.unescapeJava(str):\");\r\n System.out.println(StringEscapeUtils.unescapeJava(str));\r\n \r\n System.out.println(\"StringEscapeUtils.escapeJava(str):\");\r\n System.out.println(StringEscapeUtils.escapeJava(str));\r\n \r\n System.out.println(\"StringUtils.replace(str, \\\"\\n\\\", \\\"<br>\\\"):\");\r\n System.out.println(StringUtils.replace(str, \"\\n\", \"<br>\"));\r\n \r\n System.out.println(\"StringUtils.replace(str, \\\" \\\", \\\"&nbsp;\\\"):\");\r\n System.out.println(StringUtils.replace(str, \" \", \"&nbsp;\"));\r\n }", "private static char[] replaceSpaceInString(char[] array, int length) {\n\tint spaceCount = 0;\n\tfor(int i =0;i<length;i++)\n\t\tif(array[i]==' ')\n\t\t\tspaceCount++;\n\tchar newArr[] = new char[length + 2*spaceCount+1];\n\tint newLength = 0;\n\tnewArr[length + 2*spaceCount] = '\\0';\n\tfor(int i =0;i<length;i++){\n\t\tif(array[i]==' '){\n\t\t\tnewArr[newLength] = '%';\n\t\t\tnewArr[newLength+1] = '2';\n\t\t\tnewArr[newLength+2] = '0';\n\t\t\tnewLength+=3;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnewArr[newLength] = array[i];\n\t\t\tnewLength++;\n\t\t}\n\t}\n\t\n\treturn newArr;\n}", "public static String sanitize(String input){\n\t\tinput.replaceAll(\"&\", \"&amp;\");\n\t\tinput.replaceAll(\"<\", \"&lt;\");\n\t\tinput.replaceAll(\">\", \"&gt;\");\n\t\tinput.replaceAll(\"/\", \"&frasl;\");\n\t\treturn input;\n\t}", "private static String removeChars(String reg, int ind, int count) {\n reg = reg.substring(0, ind) + reg.substring(ind + count);\n return reg;\n }", "private String formatLatex(String text){\r\n\r\n String output=text.replaceAll(\"_\",\"-\");\r\n\r\n return output;\r\n }", "public static void main(String[] args) {\n// System.out.println(alphanumeric.replaceAll(\"[aei]\", \"x\"));\n\n\n String regex = \"^[A-Z]|[a-z]\";\n String username = \"kaaviya\";\n\n System.out.println(username.replaceAll( \"^[A-Za-z][A-Za-z0-9_]{7,29}$\", \"x\"));\n System.out.println(username.matches(regex));\n\n }", "public boolean isLegalReplacement(byte[] repl) {\n return true;\n }", "private static String translateToOriginPatternString(String originExpAbsolute) {\n\t\tString retVal = originExpAbsolute.replace(\".\", \"\\\\.\"); \n\t\tretVal = retVal.replace(ANY, \"(.*)\");\n\t\tretVal = retVal.replace(REGEX_ALLCHARS, \".\"); \n\t\tretVal = retVal.replace(\"{\", \"\\\\{\"); //this is for {ROOT}\n\t\tretVal = retVal.replace(\"}\", \"\\\\}\"); //this also is for {ROOT}\n\t\tretVal = retVal.replace(\"[\", \"\\\\[\"); //this is for [<className>]\n\t\tretVal = retVal.replace(\"]\", \"\\\\]\"); //this also is for [<className>]\n\t\tretVal = retVal.replace(\"$\", \"\\\\$\"); //this is for names of inner classes\n\t\tretVal = retVal.replace(REGEX_ENDLINE, \"$\"); \n\t\treturn retVal;\n\t}", "public static void main(String[] args) {\n\t String str = \"Fred F. Flintstone\";\n\t str.replace(\" \", \"%20\");\n\t System.out.println(str.replace(\" \", \"%20\"));\n\t System.out.println(replaceSpace(str.toCharArray()));\n\t }", "private static String translateReplaceString(String replaceStr) {\n int pos = 0;\n while (0 <= (pos = replaceStr.indexOf(\"\\\\\", pos))) {\n if (replaceStr.charAt(pos + 1) == '$') {\n replaceStr = replaceStr.substring(0, pos) + \"$\" + replaceStr.substring(++pos);\n } else {\n replaceStr = replaceStr.substring(0, pos) + replaceStr.substring(++pos);\n }\n }\n return replaceStr;\n }", "public static char[] replaceSpace(char[] str){\n\t\t // TODO\n\t\t return str;\n\t }", "void replaceRegex() {\n int index = -1;\n for (int i = 0; i < regex.elist.size(); i++) {\n if (regex.elist.get(i).isShareableUnit) {\n ElementShareableUnit share = (ElementShareableUnit) regex.elist.get(i);\n if (share.share == this) {\n index = i;\n }\n }\n }\n //replace in parenthesis\n for (int i = 0; i < regex.elist.size(); i++) {\n Element e = regex.elist.get(i);\n if (e.isParentheis) {\n e.replaceRegex(this);\n }\n\n }\n if (index == -1) {\n System.out.println(\"there is error \" + this.getString());\n } else {\n regex.elist.remove(index);\n for (int i = 0; i < this.lelement.size(); i++) {\n regex.elist.add(index + i, this.lelement.get(i));\n }\n }\n //System.out.println(\"After: \" + this.regex.getString());\n }", "private void doublequote( String[] valeurs) {\n\t\t// TODO Auto-generated method stub\n\t\tint i = -1;\n\t\ttry{\n\t\t\tfor(i = 0; i < valeurs.length; i++)\n\t\t\t\tvaleurs[i] = valeurs[i].replaceAll(\"'\", \"''\");\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"IMPOSSIBLE D'ACCEDER A VALEURS \" + i);\n\t\t}\n\t}", "private static String escape(String value, String chars) {\n\t\treturn escape(value, chars, \"\\\\\\\\\");\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}", "private static String fixKleene(String reg) {\n int ind, beg, len;\n String expr;\n\n do {\n ind = reg.indexOf('*');\n if (ind != -1 && reg.charAt(ind - 1) == QUOTE)\n ind = 0;\n } while(ind == 0);\n\n while (ind >= 1) {\n char character = reg.charAt(ind - 1);\n if (character == ')') {\n beg = reg.substring(0, ind).lastIndexOf(\"(\");\n expr = reg.substring(beg + 1, ind - 1);\n len = expr.length();\n if (expr.contains(\"|\")) {\n if (ind + len + 2 < reg.length()\n && reg.substring(ind + 1, ind + 1 + len + 2).equals(\"(\" + expr + \")\")) {\n replace(reg, ind, '+');\n removeChars(reg, ind + 1, len + 2);\n }\n if (ind - (2 + len) * 2 >= 0\n && reg.substring(ind - (2 + len) * 2, ind - 2 - len).equals(\n \"(\" + expr + \")\")) {\n replace(reg, ind, '+');\n removeChars(reg, ind - (2 + len) * 2, len + 2);\n }\n } else {\n if (ind + len < reg.length()\n && reg.substring(ind + 1, ind + 1 + len).equals(expr)) {\n replace(reg, ind, '+');\n removeChars(reg, ind + 1, len);\n }\n if (ind - 2 - len * 2 >= 0\n && reg.substring(ind - 2 - len * 2, ind - 2 - len).equals(expr)) {\n replace(reg, ind, '+');\n removeChars(reg, ind - 2 - len * 2, len);\n }\n }\n } else if (reg.charAt(ind - 1) == QUOTE) {\n if (ind + 2 < reg.length() && reg.charAt(ind + 2) == character\n && reg.charAt(ind + 1) == QUOTE) {\n reg = replace(reg, ind, '+');\n reg = removeChars(reg, ind + 1, 2);\n }\n if (ind - 2 * 2 >= 0 && reg.charAt(ind - 2 - 1) == character\n && reg.charAt(ind - 2 * 2) == QUOTE) {\n reg = replace(reg, ind, '+');\n reg = removeChars(reg, ind - 2, 2);\n }\n } else {\n if (ind + 1 < reg.length() && reg.charAt(ind + 1) == character) {\n reg = replace(reg, ind, '+');\n reg = removeChars(reg, ind + 1, 1);\n }\n if (ind - 2 >= 0 && reg.charAt(ind - 2) == character) {\n reg = replace(reg, ind, '+');\n reg = removeChars(reg, ind - 2, 1);\n }\n }\n ind = reg.indexOf('*', ind + 1);\n }\n return reg;\n }", "@Test\n public void testEscapeCurlyBraces() {\n assertEquals(\"\\\\{\", HtmlUnitRegExpProxy.escapeJSCurly(\"{\"));\n assertEquals(\"\\\\{\", HtmlUnitRegExpProxy.escapeJSCurly(\"\\\\{\"));\n assertEquals(\"\\\\}\", HtmlUnitRegExpProxy.escapeJSCurly(\"}\"));\n assertEquals(\"\\\\}\", HtmlUnitRegExpProxy.escapeJSCurly(\"\\\\}\"));\n assertEquals(\"(^|\\\\{)#([^\\\\}]+)(\\\\}|$)\", HtmlUnitRegExpProxy.escapeJSCurly(\"(^|{)#([^}]+)(}|$)\"));\n\n assertEquals(\"a{5}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5}\"));\n assertEquals(\"a{5,}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5,}\"));\n assertEquals(\"a{5,10}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5,10}\"));\n }", "@Test\n public void testReplacingSuccess()\n {\n String expectedValue=\"fatly fry\",actualValue;\n actualValue=replaceingchar.replaceChar(inputString);\n assertEquals(expectedValue,actualValue);\n }", "private static String wildcardAsRegex( String wildcard ) {\n\t\tStringBuilder sb = new StringBuilder( wildcard.length() * 110 / 100 );\n\t\tfor ( int i = 0; i < wildcard.length(); i++ ) {\n\t\t\tfinal char c = wildcard.charAt( i );\n\t\t\tswitch (c) {\n\t\t\tcase '*':\n\t\t\t\tsb.append( \".*?\" );\n\t\t\t\tbreak;\n\n\t\t\tcase '?':\n\t\t\t\tsb.append( \".\" );\n\t\t\t\tbreak;\n\n\t\t\t// chars that have magic regex meaning. They need quoting to be taken\n\t\t\t// literally\n\t\t\tcase '$':\n\t\t\tcase '(':\n\t\t\tcase ')':\n\t\t\tcase '+':\n\t\t\tcase '-':\n\t\t\tcase '.':\n\t\t\tcase '[':\n\t\t\tcase '\\\\':\n\t\t\tcase ']':\n\t\t\tcase '^':\n\t\t\tcase '{':\n\t\t\tcase '|':\n\t\t\tcase '}':\n\t\t\t\tsb.append( '\\\\' );\n\t\t\t\tsb.append( c );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tsb.append( c );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}", "private CharSequence replacewithZawgyi(String zawgyi, String myString1) {\n\t\ttry {\n JSONArray rule_array = new JSONArray(zawgyi);\n int max_loop = rule_array.length();\n \n myString1 = myString1.replace(\"null\", \"\\uFFFF\\uFFFF\");\n for (int i = 0; i < max_loop; i++) {\n JSONObject obj = rule_array.getJSONObject(i);\n String from = obj.getString(\"from\");\n String to = obj.getString(\"to\");\n myString1 = myString1.replaceAll(from, to);\n myString1 = myString1.replace(\"null\", \"\");\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\t\tmyString1 = myString1.replace(\"\\uFFFF\\uFFFF\", \"null\");\n return myString1;\n \n\t}", "@Test //TEST FIVE\n void testSpecialCharactersRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"Pot!at!*\"); //potat or potato w/out an o\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }", "private String replaceVars(String s, String replacement)\n {\n while(getVar(s)!=null)\n {\n s = s.replace(getVar(s),\"%\");\n }\n s = s.replaceAll(\"%\",replacement);\n return s;\n }", "@Test\n public void testReplacingFailure()\n {\n String expectedValue=\"datly fry\",actualValue;\n actualValue=replaceingchar.replaceChar(inputString);\n assertNotEquals(expectedValue,actualValue);\n }", "private String escape(String token) {\n return token.replace(\",\" , \"\");\n }", "public String replaceNonPrintableCharacters(String dataValueToTranslate) {\n\t\tSystem.out.println(\"Replacing non-printable characters in [\" + dataValueToTranslate + \"] with [\" + replaceNonPrintableCharactersWith + \"]\");\n\t\tString dataValue = dataValueToTranslate;\n\t\tif (!dataValueToTranslate.isEmpty()) {\n\t\t\t//dataValueToTranslate.replaceAll(\"\\\\p{C}\", replaceNonPrintableCharactersWith);\n\t\t\tString nonBreakingSpace = \"\\u00A0\";\n\t\t\tdataValueToTranslate.replaceAll(nonBreakingSpace, replaceNonPrintableCharactersWith);\n\t\t}\n\t\treturn dataValue;\n\t}", "private String encodeXSS(String s) { \n if (s == null || \"\".equals(s)) { \n return s; \n } \n StringBuilder sb = new StringBuilder(s.length() + 16); \n for (int i = 0; i < s.length(); i++) { \n char c = s.charAt(i); \n switch (c) { \n \n //handle the '<' and '>' which can be used for constructing <script> and </script> \n case '>': \n sb.append('>'); \n break; \n case '<': \n sb.append('<'); \n break; \n \n //since the html can support the characters using $#number format \n //so here also need to escape '#','&' and quote symbol \n case '\\'': \n sb.append('‘'); \n break; \n case '\\\"': \n sb.append('“'); \n break; \n case '&': \n sb.append('&'); \n break; \n case '\\\\': \n sb.append('\'); \n break; \n case '#': \n sb.append('#'); \n break; \n //if not the special characters ,then output it directly \n default: \n sb.append(c); \n break; \n } \n } \n return sb.toString(); \n }", "private String cleanXSS(String unsafe) {\n String safe = Jsoup.clean(unsafe, Whitelist.basic());\n return safe;\n }", "@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}", "public final static void setInvalidFileChars(String invalidFileCharacters, String replacementCharacter) {\n\t\tinvalidFileChars = invalidFileCharacters;\n\n\t\tif (replacementChar != null) {\n\t\t\treplacementChar = replacementCharacter;\n\t\t}\n\t}", "public static String cleanPath(String path) {\n \tString clean = path;\n\t\tclean.replaceAll(\"(\\\\$|\\\\+|\\\\#|\\\\%|\\\\&|\\\\{|\\\\}|\\\\\\\\|\\\\<|\\\\>|\\\\*|\\\\?|\\\\/|\\\\$|\\\\!|\\\\'|\\\\\\\"|\\\\:|\\\\@|\\\\+|\\\\`|\\\\||\\\\=)*\", \"\");\n\t\tclean.replaceAll(\"( )*\", \"\");\n\t\tclean.replace(\"\\\\\", \"/\");\n\t\treturn clean;\n\t}", "static private String removeSpesificationPart(String S) {\n if (S.endsWith(\"]\")) {\n int pos = S.lastIndexOf(\"[\");\n if (pos != -1) {\n return S.substring(0, pos);\n }\n }\n return S;\n }", "String replaceInString(String s) {\n\t\tString newS = s.replaceAll(\"[a-zA-Z]+\", \"WORT\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}", "public static void main(String[] args) {\n\t\n\tString str=\"Hello Deannochka, How are you? How have you been?\";\n\tSystem.out.println(str.replace(\" y\", \" th\"));\n\tSystem.out.println(str.replace(\"Hello\", \"Hey\"));\n//\tSystem.out.println(str.replaceAll(regex, replacement));\n\t\n}", "private String avoidErrorChar (String original) {\n\t\tStringBuffer modSB = new StringBuffer();\n\t\tfor (int j=0; j < original.length(); j++) {\n\t\t\tchar c = original.charAt(j);\n\t\t\tif (c == '\\n') {\n\t\t\t\tmodSB.append(\"\\\\n\"); // rimpiazzo il ritorno a capo con il simbolo \\n\n\t\t\t} else if (c == '\"') {\n\t\t\t\tmodSB.append(\"''\"); // rimpiazzo le doppie virgolette (\") con due apostofi ('')\n\t\t\t} else if ((int)c > 31 || (int)c !=127){ // non stampo i primi 32 caratteri di controllo\n\t\t\t\tmodSB.append(c);\n\t\t\t}\n\t\t}\n\t\treturn modSB.toString();\n\t}", "public static char[] replaceSpace(char[] array, int trueLength) {\n\t\tSystem.out.println(array.length);\n\t\tint newIndex = trueLength-1 + charCount(array, trueLength, ' ')*2;\n\t\tSystem.out.println(newIndex);\n\t\tfor(int i=trueLength-1; i>=0; i--) {\n\t\t\tif(array[i]==' ') {\n\t\t\t\tarray[newIndex--] = '0';\n\t\t\t\tarray[newIndex--] ='2';\n\t\t\t\tarray[newIndex--] = '%';\n\t\t\t} else {\n\t\t\t\tarray[newIndex--] = array[i];\n\t\t\t}\n\t\t}\n\t\treturn array;\n\t}", "public List<String> splitWordList(final String text) {\n\t\tList<String> result = new ArrayList<>();\n\t\tif (text == null)\n\t\t\treturn result;\n\n\t\tString t = text + \"⁋\";\n\t\tt = t.replace('\\n', '⁋');\n\t\tt = REFERENCE_PATTERN.matcher(t).replaceAll(\"\");\n\t\tt = SUPERSCRIPT_PATTERN.matcher(t).replaceAll(\"\"); //TODO: Extract sense!\n\t\tt = HTML_REMOVER.matcher(t).replaceAll(\"\");\n\t\tt = t.replace(\"&quot;\", \"\\\"\");\n\t\tt = t.replace(\",\", \"⁋,\");\n\t\tt = t.replace(\";\", \"⁋;\");\n\t\t//System.out.println(t);\n\t\t//t = BRACKETED_DELIMITER.matcher(t).replaceAll(\"$1$2$3$4$5$6\");\n\t\t//t = ESCAPE_DELIMITER1.matcher(t).replaceAll(\"$1$2\");\n\t\t//t = ESCAPE_DELIMITER2.matcher(t).replaceAll(\"$1$2\");\n\t\t//t = ESCAPE_DELIMITER3.matcher(t).replaceAll(\"$1$2\");\n\t\tt = escapeDelimiters(t);\t\t\t\n\t\t//System.out.println(t);\n\t\tt = t.replace(\"⁋;\", \"⁋\");\n\t\tt = t.replace(\"⁋,\", \"⁋\");\n\t\tt = t.replace(\"]] or [[\", \"]]⁋[[\");\n\t\tt = t.replace(\"]] and [[\", \"]]⁋[[\");\n\t\tt = t.replace(\" - \", \"⁋\");\n\t\t//t = t.replace(\" / \", \"⁋\");\n\t\tint j = t.indexOf(\" / \"); // Use ' / ' only as a delimiter if there are at least two of them!\n\t\tif (j >= 0) {\n\t\t\tj = t.indexOf(\" / \", j);\n\t\t\tif (j >= 0) {\n\t\t\t\tt = t.replace(\" / \", \"⁋\");\n\t\t\t\t//System.out.println(t);\n\t\t\t}\n\t\t}\n\t\t//System.out.println(t);\n\t\tint delim;\n\t\tdo {\n\t\t\tdelim = t.indexOf('⁋');\n\t\t\tif (delim >= 0) {\n\t\t\t\tString word = t.substring(0, delim);\n\t\t\t\tif (word.length() > 0) {\n\t\t\t\t\t// Normalize the word.\n\t\t\t\t\tword = word.trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see also\"))\n\t\t\t\t\t\tword = word.substring(8).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see\"))\n\t\t\t\t\t\tword = word.substring(3).trim();\n\t\t\t\t\tif (word.startsWith(\":\"))\n\t\t\t\t\t\tword = word.substring(1).trim();\n\t\t\t\t\tword = deWikify(word).trim();\n\t\t\t\t\tword = removeBrackets(word).trim();\n\t\t\t\t\tword = removeTemplates(word).trim();\n\t\t\t\t\tword = removeComments(word).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see also\"))\n\t\t\t\t\t\tword = word.substring(8).trim();\n\t\t\t\t\tif (word.toLowerCase().startsWith(\"see\"))\n\t\t\t\t\t\tword = word.substring(3).trim();\n\t\t\t\t\tif (word.startsWith(\":\"))\n\t\t\t\t\t\tword = word.substring(1).trim();\n\t\t\t\t\tif (word.endsWith(\".\"))\n\t\t\t\t\t\tword = word.substring(0, word.length() - 1).trim();\n\t\t\t\t\tif (word.endsWith(\",\"))\n\t\t\t\t\t\tword = word.substring(0, word.length() - 1).trim();\n\t\t\t\t\t\n\t\t\t\t\t// Check for slashes.\n\t\t\t\t\tword = word.replace(\" / \", \"/\");\n\t\t\t\t\tword = word.replace(\"/ \", \"/\");\n\t\t\t\t\tint i = word.indexOf('/');\n\t\t\t\t\tif (word.length() > 0) {\n\t\t\t\t\t\tif (i >= 0 && word.indexOf(' ') < 0) {\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tresult.add(word.substring(0, i));\n\t\t\t\t\t\t\t\tword = word.substring(i + 1);\n\t\t\t\t\t\t\t\ti = word.indexOf('/');\n\t\t\t\t\t\t\t} while (i >= 0);\n\t\t\t\t\t\t\tresult.add(word);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tresult.add(word);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tt = t.substring(delim + 1);\n\t\t\t}\n\t\t} while (delim >= 0);\n\t\treturn result;\n\t}", "private String substitution(String s) {\r\n\t\t// System.out.println(\"ExPar.substitution() Substitution for: \" + s);\r\n\t\tint i = s.indexOf(substitutionChar);\r\n\t\tif (i < 0) {\r\n\t\t\treturn (s);\r\n\t\t} else {\r\n\t\t\tStringBuffer t = new StringBuffer();\r\n\t\t\tint i0 = 0;\r\n\t\t\tboolean finished = false;\r\n\t\t\twhile (!finished) {\r\n\t\t\t\t// System.out.println(\" Buffer = \" + t);\r\n\t\t\t\tint i1 = s.indexOf(substitutionChar, i0);\r\n\t\t\t\tif (i1 < 0) {\r\n\t\t\t\t\tt.append(s.substring(i0));\r\n\t\t\t\t\t// System.out.println(\" i1 = \" + i1 + \" Buffer = \" + t);\r\n\t\t\t\t\tfinished = true;\r\n\t\t\t\t} else if ((i1 > i0) && (s.charAt(i1 - 1) == escapeChar)) {\r\n\t\t\t\t\tt.append(s.substring(i0, i1 - 1));\r\n\t\t\t\t\tt.append(substitutionChar);\r\n\t\t\t\t\ti0 = i1 + 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// found first substitution character\r\n\t\t\t\t\tint i2 = s.indexOf(substitutionChar, i1 + 2);\r\n\t\t\t\t\tif (i2 < 0) {\r\n\t\t\t\t\t\tt.append(s.substring(i0));\r\n\t\t\t\t\t\t// System.out.println(\" i2 = \" + i2 + \" Buffer = \" +\r\n\t\t\t\t\t\t// t);\r\n\t\t\t\t\t\tfinished = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// found second substitution character\r\n\t\t\t\t\t\tif (i0 < i1) {\r\n\t\t\t\t\t\t\tt.append(s.substring(i0, i1));\r\n\t\t\t\t\t\t\t// System.out.println(\" Buffer = \" + t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Check for trailing format character\r\n\t\t\t\t\t\tString name = s.substring(i1 + 1, i2);\r\n\t\t\t\t\t\tint n = name.length();\r\n\t\t\t\t\t\tchar fmt = '0';\r\n\t\t\t\t\t\tif ((n > 2) && (name.charAt(n - 2) == formatChar)) {\r\n\t\t\t\t\t\t\tfmt = name.charAt(n - 1);\r\n\t\t\t\t\t\t\tname = name.substring(0, n - 2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t// System.out.println(\"ExPar.substitution() Parameter = \"\r\n\t\t\t\t\t\t// + name);\r\n\t\t\t\t\t\tExPar sx = get(name);\r\n\t\t\t\t\t\tif (sx != null) {\r\n\t\t\t\t\t\t\t// Force parameter evaluation\r\n\t\t\t\t\t\t\tExParValue sxv = sx.getValue().getValue();\r\n\t\t\t\t\t\t\t// t.append(sx.getString());\r\n\t\t\t\t\t\t\t// If this is a string then remove the quotes\r\n\t\t\t\t\t\t\tString ss = sxv.toFormattedString(fmt);\r\n\t\t\t\t\t\t\t// System.out.println(\"ExPar.substitution() Value = \"\r\n\t\t\t\t\t\t\t// + ss);\r\n\t\t\t\t\t\t\tif (ss.startsWith(\"\\\"\") && (ss.endsWith(\"\\\"\")))\r\n\t\t\t\t\t\t\t\tss = StringExt.unquote(ss);\r\n\t\t\t\t\t\t\tt.append(ss);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tt.append(s.substring(i1, i2 + 1));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// System.out.println(\" Buffer = \" + t);\r\n\t\t\t\t\t\ti0 = i2 + 1;\r\n\t\t\t\t\t\tfinished = (i0 >= s.length());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn (t.toString());\r\n\t\t}\r\n\t}" ]
[ "0.56431186", "0.5615086", "0.5552592", "0.5236536", "0.5214548", "0.5195243", "0.51925915", "0.51713455", "0.51446813", "0.5139351", "0.5072082", "0.5000332", "0.49827546", "0.49814546", "0.49484882", "0.4937315", "0.4930446", "0.4919704", "0.4909636", "0.4902856", "0.49007583", "0.48881748", "0.48863626", "0.48677045", "0.48676345", "0.48612913", "0.4857751", "0.48575425", "0.47983968", "0.47932857", "0.47896025", "0.4773244", "0.47533557", "0.47521558", "0.47414932", "0.47269052", "0.4717724", "0.470237", "0.46961063", "0.46894115", "0.4670379", "0.46684343", "0.46563327", "0.46460485", "0.46454135", "0.46391875", "0.46277806", "0.46250385", "0.46214482", "0.46211672", "0.46190134", "0.4609094", "0.45906565", "0.4579551", "0.45683336", "0.455105", "0.45450118", "0.45384434", "0.45207095", "0.45158148", "0.45121434", "0.45091066", "0.4502643", "0.4495069", "0.44916487", "0.44858995", "0.44836888", "0.44724968", "0.44722182", "0.44663957", "0.44633168", "0.44543597", "0.4450265", "0.4445944", "0.4443006", "0.4440591", "0.44088984", "0.44075376", "0.44050834", "0.4399735", "0.43760967", "0.4367842", "0.43479", "0.43391755", "0.43376952", "0.43357033", "0.4334348", "0.43296662", "0.4318664", "0.4312891", "0.43115845", "0.430719", "0.43065923", "0.43046993", "0.428652", "0.42860362", "0.4285942", "0.42803475", "0.42789266", "0.4272746" ]
0.43379956
84
Show the RPC error message to the user
public void onFailure(Throwable caught) { System.out.println("XMLStreamTracer: Failed to start a new trace."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showError(String error);", "void showError(String message);", "void showError(String message);", "@Override\n public void showError() {\n }", "public void showError(String errorMessage);", "void showError(String errorMessage);", "void errorResponse( String error );", "void showErrorMsg(String string);", "public void error();", "public String error();", "@Override\r\n\t\tpublic void error(ResponseError error) {\n\t\t\tTools.toastShow(error.getMessage());\r\n\t\t}", "@Override\r\n\t\tpublic void error(ResponseError error) {\n\t\t\tTools.toastShow(error.getMessage());\r\n\t\t}", "void showResultMoError(String e);", "@Override\n\tpublic void showError(String message) {\n\t\t\n\t}", "public void error(String message);", "java.lang.String getError();", "java.lang.String getError();", "java.lang.String getError();", "public abstract void showErrorBox(Throwable error);", "@Override\r\n\t\t\t\t\tpublic void error(ResponseError error) {\n\t\t\t\t\t\tTools.toastShow(error.getMessage());\r\n\t\t\t\t\t}", "@Override\r\n\tpublic final void showCommandError(String command, String message) {\n\t}", "void showSyncFailMessage();", "public void sendError()\n {\n \tString resultText = Integer.toString(stdID);\n \tresultText += \": \";\n\t\tfor(int i = 0; i<registeredCourses.size();i++)\n\t\t{\n\t\t\tresultText += registeredCourses.get(i);\n\t\t\tresultText += \" \";\n\t\t}\n\t\tresultText += \"--\";\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(semesterNum);\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(0); \n\t\tresultText += \" \";\n\t\tprintResults.writeResult(resultText);\n \tSystem.exit(1);\n }", "String errorMessage();", "void errorBox(String title, String message);", "@Override\r\n\tpublic void displayError(EntityPropertyCode code, String message) {\n\t}", "@Override\r\n\tpublic void showErrReq() {\n\t\tdialog.cancel();\r\n\t\tshowNetView(true);\r\n\t}", "public void show(Object errorMessage){\n\t\tSystem.out.println(\"Woops, something bad happened\");\n\t\tSystem.out.println(errorMessage);\n\t}", "void err( Object msg );", "public void Error(String error) throws RemoteException;", "@Override\n\tpublic void onRequestError(String reqID, Exception error) {\n\t\temptyView.showException((ZcdhException)error, this);\n\t}", "void displayErrorMessage(String message);", "void printError(String errorMsg, boolean displayHelp);", "private void showConnectionError() {\n String couldNotConnect = Localization.lang(\"Could not connect to the update server.\");\n String tryLater = Localization.lang(\"Please try again later and/or check your network connection.\");\n if (manualExecution) {\n JOptionPane.showMessageDialog(this.mainFrame, couldNotConnect + \"\\n\" + tryLater,\n couldNotConnect, JOptionPane.ERROR_MESSAGE);\n }\n this.mainFrame.output(couldNotConnect + \" \" + tryLater);\n }", "private void showErrorMessage(String msgRes)\r\n {\r\n applicationContext.getGUISynchronizer().asyncInvoke(\r\n createErrorRunnable(msgRes));\r\n }", "java.lang.String getErr();", "@Override\n\tprotected String showErrorMessage() {\n\t\treturn \"There has been an error. Payment cannot process at this time. Please check with your credit card compay.\";\n\t}", "public void showNetErrorMessage() {\n showMessage(R.string.ic_net_error_tipinfo);\n }", "protodef.b_error.info getError();", "protodef.b_error.info getError();", "private void showErrorDialog(int errorCode) {\n\t\t\n }", "void error (String msg) throws RootException;", "@Override\n\tpublic void getError() {\n System.err.println(\"8877挂掉了\");\n\t}", "protected abstract void error(String err);", "protected abstract void showConnectError();", "@Override\n\tpublic void error(Object message) {\n\n\t}", "private void displayErrorToast()\n {\n Toast.makeText(\n getApplicationContext(),\n \"Connection to the server failed, please try again!\",\n Toast.LENGTH_LONG ).show();\n }", "public static void showErrorPanel(String title, String msg) {\n final DialogBox dialogBox = new DialogBox();\r\n dialogBox.setText(\"Remote Procedure Call\");\r\n dialogBox.setAnimationEnabled(true);\r\n final Button closeButton = new Button(\"Close\");\r\n // We can set the id of a widget by accessing its Element\r\n closeButton.getElement().setId(\"closeButton\");\r\n final HTML serverResponseLabel = new HTML();\r\n VerticalPanel dialogVPanel = new VerticalPanel();\r\n dialogVPanel.addStyleName(\"dialogVPanel\");\r\n dialogVPanel.add(new HTML(\"<br><b>Server replies:</b>\"));\r\n dialogVPanel.add(serverResponseLabel);\r\n dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);\r\n dialogVPanel.add(closeButton);\r\n dialogBox.setWidget(dialogVPanel);\r\n\r\n // Add a handler to close the DialogBox\r\n closeButton.addClickHandler(new ClickHandler() {\r\n\r\n @Override\r\n public void onClick(ClickEvent event) {\r\n dialogBox.hide();\r\n }\r\n });\r\n\r\n // Show the error message to the user\r\n dialogBox.setText(title);\r\n serverResponseLabel.addStyleName(\"serverResponseLabelError\");\r\n serverResponseLabel.setHTML(msg);\r\n dialogBox.center();\r\n closeButton.setFocus(true);\r\n }", "java.lang.String getErrmsg();", "abstract void error(String error);", "private void err(Messenger replyTo, int encoderId, Bundle info) {\n\n // obtain new message\n Message message = obtainMessage(Geotracer.MESSAGE_TYPE_ERROR, encoderId, 0);\n message.setData(info);\n\n // send response\n send(replyTo, message);\n }", "private void showReplCommError(Throwable e) {\n FeedbackReporter.showErrorMessage(REPL_COMM_ERROR_MSG\n + \"<p>Detailed error: \" + e.getMessage() + \"</p>\",\n \"Trouble connecting to device\");\n if (DEBUG) {\n System.out.println (\"Communication with REPL failed: \" + e);\n }\n }", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "public static void exposeError(String errorMessage) {\r\n CmdUx.printHBars(errorMessage);\r\n }", "void drawError(String message);", "public void error(String message) {\n ui.say(\"ERROR: \" + message);\n }", "public String getMessage() {\n return super.getMessage()+\"\\n error code=\"+error_code+\" error value=\"+error_value; //$NON-NLS-1$ //$NON-NLS-2$\n }", "String getErrorMessage();", "String getErrorMessage();", "public void displayError(String e){\n\t\tJOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}", "@Override\n\tpublic void error(Message msg) {\n\n\t}", "@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}", "@Override\n public void errorLogin(String msg) {\n JOptionPane.showMessageDialog(this, msg);\n }", "@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2, Object p3, Object p4,\n\t\t\tObject p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}", "public String formInternalError() \r\n {\r\n return formError(\"500 Internal server error\",\"Server broke\");\r\n }", "public abstract void showErrorBox(String errorMessage, Runnable callback);", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "public void onFailure(Throwable caught) {\n\t\t\t\trpcResult = \"Remote Procedure Call - Failure\\n\" \n\t\t\t\t\t\t\t+ \"Error al obtener lista de items.\";\n\t\t\t\tmessagesLabel.setStyleName(\"messageErrorLabel\");\n\t\t\t\tmessagesLabel.setText(rpcResult);\n\t\t\t\tWindow.alert(rpcResult);\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tallPanel.unmask();\t\t\t\t\t\t\r\n\t\t\t\t\t\tabv30Panel.unmask();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tInfo.display(\"Error\", \"RPC Error\");\r\n\t\t\t\t\t}", "@Override\n\tpublic void error(Marker marker, Message msg) {\n\n\t}", "public void errorFromKernel (String error) {\n clientCommunicationManager.sendErrorToAll(\"NETWORK\", \"[ERROR JUPYTER] \" + error);\n }", "private String getGUIErrorMsg(long errorcode) {\n\t\tif (errorcode == 0) {\n\t\t\treturn \"This popup shouldn't have launched!\";\n\t\t} else if (errorcode == 9) {\n\t\t\treturn \"Latitude input format incorrect!\\nValid Latitude values are -90 to 90 with negative values being south Latitude.\";\n\t\t} else if (errorcode == 10) {\n\t\t\treturn \"Longitude input format incorrect!\\nValid Longitude values are -180 to 180 with negative values being west latitude.\";\n\t\t} else if (errorcode == 11) {\n\t\t\treturn \"Date input format incorrect!\\nValid dates go <year>-<month>-<day>\\nValid month values are 1- 12 and valid day values are 1 - 31.\";\n\t\t} else if (errorcode == 12) {\n\t\t\treturn \"Time input format incorrect!\\nValid times go <hour>-<minute>-<second>\\nValid hour values are 0 - 23 and valid minute and second values are 0 - 59\";\n\t\t} else if (errorcode == 1) {\n\t\t\treturn \"Invalid latitude!\\nValid Latitude values are -90 to 90 with negative values being south Latitude.\";\n\t\t} else if (errorcode == 2) {\n\t\t\treturn \"Invalid Longitude!\\nValid Longitude values are -180 to 180 with negative values being west latitude.\";\n\t\t} else if (errorcode == 3) {\n\t\t\treturn \"Invalid Year!\\nValid year values are \" + Integer.MIN_VALUE + \" - \" + Integer.MAX_VALUE + \".\";\n\t\t} else if (errorcode == 4) {\n\t\t\treturn \"Invalid Month!\\nValid month values are 1 - 12\";\n\t\t} else if (errorcode == 5) {\n\t\t\treturn \"Invalid Day!\\nValid day values are 1 - 31\";\n\t\t} else if (errorcode == 6) {\n\t\t\treturn \"Invalid Hour!\\nValid hour values are 0 - 23\";\n\t\t} else if (errorcode == 7) {\n\t\t\treturn \"Invalid Minute!\\nValid minute values are 0 - 59\";\n\t\t} else if (errorcode == 8) {\n\t\t\treturn \"Invalid Second!\\nValid second values are 0 - 59\";\n\t\t} \n\t\treturn \"Undefined Error Message!\";\n\t}", "@Override\n\tpublic String getMessage()\n\t{\n\t\treturn errMessage;\n\t}", "public void ErrorMessage(String error) {\n \tJOptionPane.showMessageDialog(parent, error);\n }", "@Override\n public final String toString() {\n return ErrorMessages.invalidOperation(getMessage());\n }", "public static String operationFailed() {\n return holder.format(\"operationFailed\");\n }", "@Override\n\tpublic void error(Marker marker, String message, Object p0) {\n\n\t}", "private void showError(String message){\n\t\tsetupErrorState();\n\t\tsynapseAlert.showError(message);\n\t}", "void notSupported(String errorcode);", "public boolean getSendErrorToClient();", "@Override\n\tpublic void error(Marker marker, Object message) {\n\n\t}", "@Override\n\tpublic void error(String message, Object p0) {\n\n\t}", "@Override\n\tpublic void error(Marker marker, String message, Object... params) {\n\n\t}", "@Override\n\tpublic void error(Marker marker, String message) {\n\n\t}", "public void getMessage() {\r\n // use JOptionPane to have a pop up box informing user of the invalid token\r\n JOptionPane.showMessageDialog(null, \"Invalid Token \" + invalidToken);\r\n }", "public void onFailure(Throwable caught) {\n\t\t\t\trpcResult = \"Remote Procedure Call - Failure\\n\" \n\t\t\t\t\t\t\t+ \"Error al guardar item.\";\n\t\t\t\tmessagesLabel.setStyleName(\"messageErrorLabel\");\n\t\t\t\tmessagesLabel.setText(rpcResult);\n\t\t\t\tWindow.alert(rpcResult);\n\t\t\t}", "@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2, Object p3, Object p4) {\n\n\t}" ]
[ "0.7293027", "0.718913", "0.718913", "0.7031218", "0.7026386", "0.7019833", "0.6972712", "0.6963187", "0.6954285", "0.6914848", "0.68660134", "0.68660134", "0.680891", "0.67909193", "0.6767904", "0.67615235", "0.67615235", "0.67615235", "0.6734825", "0.6732274", "0.6649559", "0.6637869", "0.6593692", "0.65781736", "0.6562397", "0.65279615", "0.65274525", "0.6514907", "0.65051323", "0.6503362", "0.6457814", "0.64563096", "0.6455576", "0.64297", "0.6424418", "0.6416096", "0.6414215", "0.64120185", "0.6406599", "0.6406599", "0.639539", "0.6392734", "0.63914937", "0.6391107", "0.6384506", "0.63666725", "0.6360719", "0.6356831", "0.6341579", "0.63338906", "0.6327485", "0.63240904", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.63197976", "0.631368", "0.63099146", "0.629784", "0.62975484", "0.6293081", "0.6293081", "0.6286557", "0.62827003", "0.6277531", "0.6277321", "0.62756777", "0.62736464", "0.6269285", "0.6266064", "0.6266064", "0.6266064", "0.6266064", "0.62518704", "0.6250317", "0.6244352", "0.62387466", "0.6238192", "0.62322754", "0.6220886", "0.6218477", "0.6211599", "0.61885107", "0.61838543", "0.61821765", "0.6178671", "0.61690515", "0.614194", "0.61390215", "0.61330885", "0.6132802", "0.6132317", "0.613059" ]
0.0
-1
Write the XML document to the file trace.xml from
@Override public boolean close() { // TODO Auto-generated method stub xmlStreamTracerService.postEndOfTrace(mURL, mTraceID, mCookie, new AsyncCallback<String>() { public void onFailure(Throwable caught) { // Show the RPC error message to the user System.out.println("XMLStreamTracer: Failed to end the trace."); } public void onSuccess(String result) { System.out.println("XMLStreamTracer: Trace ended."); } }); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void writeTrace()\r\n {\r\n TGCreator creator = new TGCreator();\r\n TGTrace trace = creator.createTrace(JVM.getVM(), this.stateGraph);\r\n TraceGraphWriter tgWriter = new TraceGraphWriter(trace);\r\n\r\n if (this.traceCompressed)\r\n {\r\n this.filename += ITraceConstants.ZIP_FILE_SUFFIX;\r\n tgWriter.saveCompressed(new File(this.filename));\r\n }\r\n else\r\n {\r\n this.filename += ITraceConstants.XML_FILE_SUFFIX;\r\n tgWriter.save(new File(this.filename));\r\n }\r\n\r\n SymbolicExecutionTracerPlugin.log(Status.INFO,\r\n \"Symbolic Execution Tracer wrote \" + this.numEndStates\r\n + \" traces to \" + this.filename);\r\n }", "public void writeXML() throws IOException {\n OutputFormat format = OutputFormat.createPrettyPrint();//th format of xml file\n XMLWriter xmlWriter =new XMLWriter( new FileOutputStream(file), format);\n xmlWriter.write(document);//write the new xml into the file\n xmlWriter.flush();\n }", "public static void write(File file, WorkflowTrace trace) throws FileNotFoundException, JAXBException, IOException {\n FileOutputStream fos = new FileOutputStream(file);\n WorkflowTraceSerializer.write(fos, trace);\n }", "public void writeXMLFinisher() {\n\t\tJavaIO.createXMLFile(getCurrentPath(), \"coveragePriorJ.xml\", \"</list>\", true);\n\t}", "public void printXmlPath(StackTraceElement l) throws IOException {\n\t\t String packageNameOnly = l.getClassName().substring(0, l.getClassName().lastIndexOf(\".\"));\n\t\t String classNameOnly = l.getClassName().substring(1 + l.getClassName().lastIndexOf(\".\"), l.getClassName().length());\n\t\t String xml = \"<class name=\\\"\" + packageNameOnly + \".\" + classNameOnly + \"\\\"><methods><include name=\\\"\" + l.getMethodName() + \"\\\"/></methods></class>\";\n\t\t\t fileWriterPrinter(\" XML Path: \" + xml);\n\t\t\t// Renew XML record:\n\t\t\t fileCleaner(\"xml.path\");\n\t\t\t fileWriter( \"xml.path\", xml);\n\t\t\t// Renew Stack Trace Element record:\n\t\t\t fileCleaner(\"stack.trace\");\n\t\t\t fileWriter( \"stack.trace\", l);\n\t\t\t// Append a New Log record:\n\t\t\t if (fileExist(\"run.log\", false)) { fileWriter(\"run.log\", \" XML Path: \" + xml); } \n\t\t}", "private void write(){\n\t\ttry {\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(doc);\n\t\t\t\n\t\t\tString pathSub = ManipXML.class.getResource(path).toString();\n\t\t\tpathSub = pathSub.substring(5, pathSub.length());\n\t\t\tStreamResult result = new StreamResult(pathSub);\n\t\t\t\n\t\t\ttransformer.transform(source, result);\n\t\t} catch (TransformerConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (TransformerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void writeXmlFile( Document doc, String file_path ) {\r\n\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tTransformerFactory tf = TransformerFactory.newInstance();\r\n\t\t\tTransformer transformer = tf.newTransformer();\r\n\t\t\tDOMSource source \t\t= new DOMSource( doc );\r\n\t\t\tStreamResult result \t= new StreamResult( new File( file_path ));\r\n\t\t\t\r\n\t\t\t// Output to console for testing\r\n\t\t\t// StreamResult result = new StreamResult(System.out);\r\n\r\n\t\t\ttransformer.transform( source, result );\r\n\t\t\tSystem.out.println( \"File saved!\" );\r\n\r\n\r\n\t\t} catch ( TransformerException e ) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "void write(TraceList traceList,File file) throws IOException;", "public void writeDocumentToOutput() {\n log.debug(\"Statemend of XML document...\");\r\n // writeDocumentToOutput(root,0);\r\n log.debug(\"... end of statement\");\r\n }", "public void writeToXML() throws IOException, XMLStreamException {\n FileOutputStream outPC = new FileOutputStream(\"C:\\\\Users\\\\Ruben Joosen\\\\Documents\\\\AntwerpenU\\\\Semester 5\\\\Distributed Systems\\\\ProjectY\\\\DS\\\\ProjectY\\\\map.xml\");\n FileOutputStream out = new FileOutputStream(\"/home/pi/Documents/DS/ProjectY/map.xml\"); // \"/home/pi/Documents/DS/ProjectY/map.xml\"\n\n XMLStreamWriter xsw = null;\n try {\n try {\n XMLOutputFactory xof = XMLOutputFactory.newInstance();\n xsw = xof.createXMLStreamWriter(out, \"UTF-8\");\n xsw.writeStartDocument(\"utf-8\", \"1.0\");\n xsw.writeStartElement(\"entries\");\n\n // Do the Collection\n for (Map.Entry<Integer, String> e : this.IPmap.entrySet()) {\n xsw.writeStartElement(\"entry\");\n xsw.writeAttribute(\"key\", e.getKey().toString());\n xsw.writeAttribute(\"value\", e.getValue().toString());\n xsw.writeEndElement();\n }\n xsw.writeEndElement();\n xsw.writeEndDocument();\n } finally {\n if (out != null) {\n try {\n out.close();\n } catch (IOException e) { /* ignore */ }\n }\n }// end inner finally\n } finally {\n if (xsw != null) {\n try {\n xsw.close();\n } catch (XMLStreamException e) { /* ignore */ }\n }\n }\n }", "private void rewriteXmlSource(){\n //Log.i(LOG_TAG, \"Updating radios.xml....\");\n String fileName = \"radios.xml\";\n String content = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\" +\n \"<playlist>\\n\";\n\n for (Radio radio : radioList) {\n content += \"<track>\\n\";\n content += \"<location>\" + radio.getUrl() + \"</location>\\n\";\n content += \"<title>\" + radio.getName() + \"</title>\\n\";\n content += \"</track>\\n\";\n }\n content += \"</playlist>\";\n\n FileOutputStream outputStream = null;\n try {\n //Log.i(LOG_TAG,\"write new radios.xml file\");\n outputStream = owner.openFileOutput(fileName, owner.getBaseContext().MODE_PRIVATE);\n outputStream.write(content.getBytes());\n outputStream.close();\n } catch (Exception e2) {\n e2.printStackTrace();\n }\n }", "static void writeGPXFile(Trail trail, Context context) {\r\n if(gpxParser == null)\r\n buildParser();\r\n\r\n GPX gpx = parseTrailtoGPX(trail);\r\n\r\n System.out.println(\"~~~~~~~~~~~~~~~\"+trail.getMetadata().getName());\r\n\r\n //create a new file with the given name\r\n File file = new File(context.getExternalFilesDir(null), trail.getMetadata().getName()+\".gpx\");\r\n FileOutputStream out;\r\n try {\r\n out = new FileOutputStream(file);\r\n gpxParser.writeGPX(gpx, out);\r\n } catch(FileNotFoundException e) {\r\n AlertUtils.showAlert(context,\"File not found\",\"Please notify the developers.\");\r\n } catch (TransformerException e) {\r\n AlertUtils.showAlert(context,\"Transformer Exception\",\"Please notify the developers.\");\r\n } catch (ParserConfigurationException e) {\r\n AlertUtils.showAlert(context,\"Parser Exception\",\"Please notify the developers.\");\r\n }\r\n }", "public final void toFile(final File xmlFile) throws IOException {\n if (xmlFile == null) throw new FileNotFoundException(\"file is null\");\n\n PrintWriter pw = new PrintWriter(new FileWriter(xmlFile));\n pw.print(toString());\n pw.close();\n }", "public void writeToXmlFile(String xmlFile, Constraint constraint) {\n\t\tDocument xmlDocument = XmlDocument.newDocument();\n\t\t\n\t\tElement rootElement = xmlDocument.createElement(XML_ROOT);\n\t\trootElement.setAttribute(XML_NUM_ATTRS, \"2\");\n\t\trootElement.setAttribute(XML_ATTR + \"1\", XML_INFO1);\n\t\trootElement.setAttribute(XML_ATTR + \"2\", XML_INFO2);\n\t\txmlDocument.appendChild(rootElement);\n\t\t\n\t\tCollections.sort(nameValuePairs, SortNameValuePairByName.inst);\n\t\t\n\t\tfor (NameValuePair pair : nameValuePairs) {\n\t\t\tElement element = createXmlElementForNameValuePair(pair.getName(), pair.getValue(), xmlDocument, constraint);\n\t\t\tif (element != null)\n\t\t\t\trootElement.appendChild(element);\n\t\t}\n\t\t\n\t\tXmlDocument.writeXmlDocumentToFile(xmlDocument, xmlFile);\n\t}", "public void saveConfigXml() {\n // Save the xml object to disk\n IPathManager pm = PathManagerFactory.getPathManager();\n LocalizationContext lc = pm.getContext(LocalizationType.COMMON_STATIC,\n LocalizationLevel.SITE);\n\n LocalizationFile newXmlFile = pm.getLocalizationFile(lc,\n CONFIG_FILE_NAME);\n\n if (newXmlFile.getFile().getParentFile().exists() == false) {\n // System.out.println(\"Creating new directory\");\n\n if (newXmlFile.getFile().getParentFile().mkdirs() == false) {\n // System.out.println(\"Could not create new directory...\");\n }\n }\n\n try {\n // System.out.println(\"Saving -- \"\n // + newXmlFile.getFile().getAbsolutePath());\n jaxb.marshalToXmlFile(configXml, newXmlFile.getFile()\n .getAbsolutePath());\n newXmlFile.save();\n\n lf = newXmlFile;\n } catch (Exception e) {\n statusHandler.handle(Priority.ERROR, \"Couldn't save config file.\",\n e);\n }\n }", "public void printToXML() {\n String fileString = \"outputDisposal.xml\";\n //Creating the path object of the file\n Path filePath = Paths.get(fileString);\n if (Files.notExists(filePath)) {\n try {\n Files.createFile(filePath);\n } catch (IOException e1) {\n\n e1.printStackTrace();\n }\n }\n //Converting the path object to file to use in the FileWriter constructor \n File newFile = filePath.toFile();\n\n /*\n Typical try-with-resources block that features three streams: FileWriter,BufferedWriter and PrintWriter.\n The FileWriter object connects the file tho the stream.\n The BufferedWriter object \n */\n try ( PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(newFile)))) {\n for (PickUp pck : pickups) {\n out.print(pck);\n }\n\n } catch (IOException e) {\n System.err.println(e);\n }\n\n }", "void saveXML(String path,\n SourceParameters parameters)\n throws SAXException, ProcessingException, IOException;", "public void writeXML(Vehicle vehicle_a, Vehicle vehicle_b){\n\n //writing encoding and xml file version\n\n XMLOutputFactory xmlof = null;\n XMLStreamWriter xmlw = null;\n\n try{\n\n xmlof = XMLOutputFactory.newInstance();\n xmlw = xmlof.createXMLStreamWriter(new FileOutputStream(FILE_NAME), \"utf-8\");\n xmlw.writeStartDocument(\"utf-8\", \"1.0\");\n\n } catch (Exception e){\n\n System.out.println(\"Error: \");\n System.out.println(e.getMessage());\n\n }\n\n //writing information\n\n try {\n xmlw.writeStartElement(\"routes\");\n\n\n xmlw.writeStartElement(\"route\");\n xmlw.writeAttribute(\"team\", vehicle_a.getTeam_name());\n xmlw.writeAttribute(\"cost\", String.valueOf(vehicle_a.getFuel()));\n xmlw.writeAttribute(\"cities\", String.valueOf(vehicle_a.getTouched_cities().size()));\n\n\n\n for(int i=0; i<vehicle_a.getTouched_cities().size(); i++){\n\n xmlw.writeStartElement(\"city\");\n xmlw.writeAttribute(\"id\", String.valueOf(vehicle_a.getTouched_cities().get(i).getId()));\n xmlw.writeAttribute(\"name\", vehicle_a.getTouched_cities().get(i).getName());\n\n //tag \"city\" close\n xmlw.writeEndElement();\n }\n\n //tag \"route\" close\n xmlw.writeEndElement();\n\n\n xmlw.writeStartElement(\"route\");\n xmlw.writeAttribute(\"team\", vehicle_b.getTeam_name());\n xmlw.writeAttribute(\"cost\", String.valueOf(vehicle_b.getFuel()));\n xmlw.writeAttribute(\"cities\", String.valueOf(vehicle_b.getTouched_cities().size()));\n\n for(int i=0; i<vehicle_b.getTouched_cities().size(); i++){\n\n xmlw.writeStartElement(\"city\");\n xmlw.writeAttribute(\"id\", String.valueOf(vehicle_b.getTouched_cities().get(i).getId()));\n xmlw.writeAttribute(\"name\", vehicle_b.getTouched_cities().get(i).getName());\n\n //tag \"city\" close\n xmlw.writeEndElement();\n }\n\n //tag \"route\" close\n xmlw.writeEndElement();\n\n //tag \"routes\" close\n xmlw.writeEndElement();\n\n //closing document\n xmlw.writeEndDocument();\n\n //eptying buffer and writing the document\n xmlw.flush();\n\n //closing document and resources used\n xmlw.close();\n\n //Creation of a clone-file but indented\n try {\n indentFile();\n }catch (Exception e){\n System.err.println(e);\n }\n\n }\n catch (Exception e){\n System.out.println(\"Writing error: \");\n System.out.println(e.getMessage());\n }\n }", "private void save() throws FileNotFoundException {\n\t\tm.write(new FileOutputStream(OUTPUT), \"RDF/XML\");\n\t}", "public void writeToXmlFile(String xmlFile) {\n\t\twriteToXmlFile(xmlFile, null);\n\t}", "public void savetoxml() throws FileNotFoundException, JAXBException {\n xml_methods.save(player);\n }", "@Override\n\tpublic void write() {\n\t\tSystem.out.println(\"使用xml方式存储\");\n\t}", "private void write( TypeItem type ) throws SAXException, IOException {\n\t\t\t\t\n\t\tDocumentHandler outHandler = new XMLSerializer(\n\t\t\tcontroller.getOutput(type),\n\t\t\tnew OutputFormat(\"xml\",null,true) );\n\t\tXMLWriter out = new XMLWriter(outHandler);\n\t\t\t\t\n\t\toutHandler.setDocumentLocator( new LocatorImpl() );\n\t\toutHandler.startDocument();\n\t\toutHandler.processingInstruction(\"xml-stylesheet\",\n\t\t\t\"type='text/xsl' href='classFileDebug.xsl'\");\n\t\twriteClass( type, out );\n\t\toutHandler.endDocument();\n\t}", "public void dumpAsXmlFile(String pFileName);", "@Override\n\tpublic void writeToDeviceReport(XmlSerializer serializer) throws IOException {\n\t\tthis.serializer = serializer;\n\t\t\n serializer.startTag(DeviceReportWriter.XMLNS, \"log_subreport\");\n \n try {\n\t\t\tif(storage != null) {\n\t\t\t\tif(Logger._() != null) {\n\t\t\t\t\tLogger._().serializeLogs(this);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tserializeLog(entry);\n\t\t\t}\n } finally {\n \tserializer.endTag(DeviceReportWriter.XMLNS, \"log_subreport\");\n }\n\t}", "protected abstract void toXml(PrintWriter result);", "private void xmlSave() {\r\n FileDialog fd = new FileDialog(new Frame(), \r\n \"Save as a jMusic XML file...\", \r\n FileDialog.SAVE);\r\n fd.show();\r\n if (fd.getFile() != null) {\r\n jm.util.Write.xml(score, fd.getDirectory() + fd.getFile());\r\n }\r\n }", "public void changeXMLFile() throws IOException {\n File orig = new File(RunnerClass.homedir + \"launch4j.xml\");\n File custom = new File(RunnerClass.homedir + \"launch4j2.xml\");\n BufferedReader br = new BufferedReader(new FileReader(orig));\n PrintWriter pw = new PrintWriter(new FileWriter(custom));\n int line = 0;\n String s;\n //Reads all lines, and replaces 5th line with new destination file\n while ((s = br.readLine()) != null) {\n line++;\n if (line == 5)\n pw.println(\" <outfile>\" + exeF.getCanonicalPath() + \"</outfile>\");\n else if(line == 18)\n pw.println(\" <minVersion>\"+ getFullVersion(RunnerClass.mf.generalOptionalPanel.javaVersion.getText().trim()) +\"</minVersion>\");\n else\n pw.println(s);\n }\n br.close();\n pw.close();\n //Deletes original file, renames temp to original\n RunnerClass.logger.info(\"del: \" + orig.delete());\n RunnerClass.logger.info(\"ren: \" + custom.renameTo(orig));\n }", "protected static void writeXML(String path, String ID, String abs,String cls) {\n\t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder dBuilder;\r\n try {\r\n dBuilder = dbFactory.newDocumentBuilder();\r\n Document doc = dBuilder.newDocument();\r\n //add elements to Document\r\n Element rootElement =doc.createElement(\"Data\");\r\n //append root element to document\r\n doc.appendChild(rootElement);\r\n\r\n rootElement.appendChild(getReviewsPositive(doc, ID, abs,cls));\r\n //for output to file, console\r\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\r\n Transformer transformer = transformerFactory.newTransformer();\r\n //for pretty print\r\n transformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\r\n DOMSource source = new DOMSource(doc);\r\n\r\n //write to console or file\r\n StreamResult console = new StreamResult(System.out);\r\n StreamResult file = new StreamResult(new File(path+\"\"+ID+\".xml\"));\r\n\r\n //write data\r\n transformer.transform(source, console);\r\n transformer.transform(source, file);\r\n //System.out.println(\"DONE\");\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\t}", "public void save() {\n int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\r\n int minute = Calendar.getInstance().get(Calendar.MINUTE);\r\n\r\n // Hierarchie: 2010/04/05/01_05042010_00002.xml\r\n File dir = getOutputDir();\r\n File f = new File(dir, getCode().replace(' ', '_') + \".xml\");\r\n Element topLevel = new Element(\"ticket\");\r\n topLevel.setAttribute(new Attribute(\"code\", this.getCode()));\r\n topLevel.setAttribute(\"hour\", String.valueOf(hour));\r\n topLevel.setAttribute(\"minute\", String.valueOf(minute));\r\n // Articles\r\n for (Pair<Article, Integer> item : this.items) {\r\n Element e = new Element(\"article\");\r\n e.setAttribute(\"qte\", String.valueOf(item.getSecond()));\r\n // Prix unitaire\r\n e.setAttribute(\"prix\", String.valueOf(item.getFirst().getPriceInCents()));\r\n e.setAttribute(\"prixHT\", String.valueOf(item.getFirst().getPriceHTInCents()));\r\n e.setAttribute(\"idTaxe\", String.valueOf(item.getFirst().getIdTaxe()));\r\n e.setAttribute(\"categorie\", item.getFirst().getCategorie().getName());\r\n e.setAttribute(\"codebarre\", item.getFirst().getCode());\r\n e.setText(item.getFirst().getName());\r\n topLevel.addContent(e);\r\n }\r\n // Paiements\r\n for (Paiement paiement : this.paiements) {\r\n final int montantInCents = paiement.getMontantInCents();\r\n if (montantInCents > 0) {\r\n final Element e = new Element(\"paiement\");\r\n String type = \"\";\r\n if (paiement.getType() == Paiement.CB) {\r\n type = \"CB\";\r\n } else if (paiement.getType() == Paiement.CHEQUE) {\r\n type = \"CHEQUE\";\r\n } else if (paiement.getType() == Paiement.ESPECES) {\r\n type = \"ESPECES\";\r\n }\r\n e.setAttribute(\"type\", type);\r\n e.setAttribute(\"montant\", String.valueOf(montantInCents));\r\n topLevel.addContent(e);\r\n }\r\n\r\n }\r\n try {\r\n final XMLOutputter out = new XMLOutputter(Format.getPrettyFormat());\r\n out.output(topLevel, new FileOutputStream(f));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "public void writeXML(OutputStream stream) throws IOException {\n\t\tPrintWriter out = new PrintWriter(stream);\n\t\tout.println(\"<?xml version=\\\"1.0\\\"?>\");\n\t\tout.println(\"<VLDocking version=\\\"2.1\\\">\");\n\t\tfor(int i = 0; i < desktops.size(); i++) {\n\t\t\tWSDesktop desktop = (WSDesktop) desktops.get(i);\n\t\t\tdesktop.writeDesktopNode(out);\n\t\t}\n\t\tout.println(\"</VLDocking>\");\n\n\t\tout.flush();\n\t}", "void save(XMLDocument document, XMLStreamWriter writer) throws XMLStreamException;", "public abstract void writeToXml(T o, XmlSerializer serializer, Context context)\n throws IOException;", "public void writeToGameFile(String fileName) {\n\n try {\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"Sifeb\");\n doc.appendChild(rootElement);\n Element game = doc.createElement(\"Game\");\n rootElement.appendChild(game);\n\n Element id = doc.createElement(\"Id\");\n id.appendChild(doc.createTextNode(\"001\"));\n game.appendChild(id);\n Element stories = doc.createElement(\"Stories\");\n game.appendChild(stories);\n\n for (int i = 1; i < 10; i++) {\n Element cap1 = doc.createElement(\"story\");\n Element image = doc.createElement(\"Image\");\n image.appendChild(doc.createTextNode(\"Mwheels\"));\n Element text = doc.createElement(\"Text\");\n text.appendChild(doc.createTextNode(\"STEP \" + i + \":\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eu.\"));\n cap1.appendChild(image);\n cap1.appendChild(text);\n stories.appendChild(cap1);\n }\n\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n DOMSource source = new DOMSource(doc);\n File file = new File(SifebUtil.GAME_FILE_DIR + fileName + \".xml\");\n StreamResult result = new StreamResult(file);\n transformer.transform(source, result);\n\n System.out.println(\"File saved!\");\n\n } catch (ParserConfigurationException | TransformerException pce) {\n pce.printStackTrace();\n }\n\n }", "public void writeXMLServer(String file_name)\n\t\t{\n\t\t\t\t \n\t\t\t\t//Attempt to write server to an XML file in current working directory\n\t\t\t\ttry {\n\t\t\t\t JAXBContext jaxbc = JAXBContext.newInstance(Server.class);\n\t\t\t\t Marshaller marshaller = jaxbc.createMarshaller();\n\t\t\t\t marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n\t\t\t\t OutputStream out = null;\n\t\t\t\t try \n\t\t\t\t {\n\t\t\t\t out = new FileOutputStream(file_name);\n\t\t\t\t marshaller.marshal(this, out);\n\t\t\t\t } \n\t\t\t\t catch (FileNotFoundException e) \n\t\t\t\t {\n\t\t\t\t e.printStackTrace();\n\t\t\t\t } \n\t\t\t\t finally \n\t\t\t\t {\n\t\t\t\t try \n\t\t\t\t {\n\t\t\t\t out.close();\n\t\t\t\t } \n\t\t\t\t catch (IOException e) \n\t\t\t\t {\n\t\t\t\t \t e.printStackTrace();\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t } catch (JAXBException e) {\n\t\t\t\t e.printStackTrace();\n\t\t\t\t }\n\t\t}", "public void writeXML(InvCatalogImpl catalog, String filename) throws IOException {\n BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(filename));\n writeXML(catalog, os, false);\n os.close();\n }", "public void saveToFile(Student entity) throws Exception{\n Document document = DocumentBuilderFactory\n .newInstance()\n .newDocumentBuilder()\n .parse(XMLfile);\n Element root = document.getDocumentElement();\n Element studentElement = document.createElement(\"student\");\n studentElement.setAttribute(\"serialNumber\",entity.getSerialNumber());\n root.appendChild(studentElement);\n\n appendChildWithText(document, studentElement, \"name\", entity.getName());\n appendChildWithText(document, studentElement, \"group\", String.valueOf(entity.getGroup()));\n appendChildWithText(document, studentElement, \"id\", entity.getId().toString());\n\n Transformer transformer =\n TransformerFactory.newInstance().newTransformer();\n transformer.transform(new DOMSource(root),\n new StreamResult(new FileOutputStream(\n XMLfile)));\n }", "public void write_as_xml ( File series_file, Reconstruct r ) {\n try {\n String new_path_name = series_file.getParentFile().getCanonicalPath();\n String ser_file_name = series_file.getName();\n String new_file_name = ser_file_name.substring(0,ser_file_name.length()-4) + file_name.substring(file_name.lastIndexOf(\".\"),file_name.length());\n // At this point, there should be no more exceptions, so change the actual member data for this object\n this.path_name = new_path_name;\n this.file_name = new_file_name;\n priority_println ( 100, \" Writing to Section file \" + this.path_name + \" / \" + this.file_name );\n\n File section_file = new File ( this.path_name + File.separator + this.file_name );\n\n PrintStream sf = new PrintStream ( section_file );\n sf.print ( \"<?xml version=\\\"1.0\\\"?>\\n\" );\n sf.print ( \"<!DOCTYPE Section SYSTEM \\\"section.dtd\\\">\\n\\n\" );\n\n if (this.section_doc != null) {\n Element section_element = this.section_doc.getDocumentElement();\n if ( section_element.getNodeName().equalsIgnoreCase ( \"Section\" ) ) {\n int seca = 0;\n sf.print ( \"<\" + section_element.getNodeName() );\n // Write section attributes in line\n for ( /*int seca=0 */; seca<section_attr_names.length; seca++) {\n sf.print ( \" \" + section_attr_names[seca] + \"=\\\"\" + section_element.getAttribute(section_attr_names[seca]) + \"\\\"\" );\n }\n sf.print ( \">\\n\" );\n\n // Handle the child nodes\n if (section_element.hasChildNodes()) {\n NodeList child_nodes = section_element.getChildNodes();\n for (int cn=0; cn<child_nodes.getLength(); cn++) {\n Node child = child_nodes.item(cn);\n if (child.getNodeName().equalsIgnoreCase ( \"Transform\")) {\n Element transform_element = (Element)child;\n int tfa = 0;\n sf.print ( \"<\" + child.getNodeName() );\n for ( /*int tfa=0 */; tfa<transform_attr_names.length; tfa++) {\n sf.print ( \" \" + transform_attr_names[tfa] + \"=\\\"\" + transform_element.getAttribute(transform_attr_names[tfa]) + \"\\\"\" );\n if (transform_attr_names[tfa].equals(\"dim\") || transform_attr_names[tfa].equals(\"xcoef\")) {\n sf.print ( \"\\n\" );\n }\n }\n sf.print ( \">\\n\" );\n if (transform_element.hasChildNodes()) {\n NodeList transform_child_nodes = transform_element.getChildNodes();\n for (int gcn=0; gcn<transform_child_nodes.getLength(); gcn++) {\n Node grandchild = transform_child_nodes.item(gcn);\n if (grandchild.getNodeName().equalsIgnoreCase ( \"Image\")) {\n Element image_element = (Element)grandchild;\n int ia = 0;\n sf.print ( \"<\" + image_element.getNodeName() );\n for ( /*int ia=0 */; ia<image_attr_names.length; ia++) {\n sf.print ( \" \" + image_attr_names[ia] + \"=\\\"\" + image_element.getAttribute(image_attr_names[ia]) + \"\\\"\" );\n if (image_attr_names[ia].equals(\"blue\")) {\n sf.print ( \"\\n\" );\n }\n }\n sf.print ( \" />\\n\" );\n } else if (grandchild.getNodeName().equalsIgnoreCase ( \"Contour\")) {\n Element contour_element = (Element)grandchild;\n int ca = 0;\n sf.print ( \"<\" + contour_element.getNodeName() );\n for ( /*int ca=0 */; ca<contour_attr_names.length; ca++) {\n // System.out.println ( \"Writing \" + contour_attr_names[ca] );\n if (contour_attr_names[ca].equals(\"points\")) {\n // Check to see if this contour element has been modified\n boolean modified = false; // This isn't being used, but should be!!\n ContourClass matching_contour = null;\n for (int cci=0; cci<contours.size(); cci++) {\n ContourClass contour = contours.get(cci);\n if (contour.contour_element == contour_element) {\n matching_contour = contour;\n break;\n }\n }\n if (matching_contour == null) {\n // Write out the data from the original XML\n sf.print ( \" \" + contour_attr_names[ca] + \"=\\\"\" + format_comma_sep(contour_element.getAttribute(contour_attr_names[ca]),\"\\t\", true) + \"\\\"\" );\n } else {\n // Write out the data from the stroke points\n sf.print ( \" \" + contour_attr_names[ca] + \"=\\\"\" + format_comma_sep(matching_contour.stroke_points,\"\\t\", true) + \"\\\"\" );\n }\n } else if (contour_attr_names[ca].equals(\"handles\")) {\n if (r.export_handles) {\n String handles_str = contour_element.getAttribute(contour_attr_names[ca]);\n if (handles_str != null) {\n handles_str = handles_str.trim();\n if (handles_str.length() > 0) {\n // System.out.println ( \"Writing a handles attribute = \" + contour_element.getAttribute(contour_attr_names[ca]) );\n sf.print ( \" \" + contour_attr_names[ca] + \"=\\\"\" + format_comma_sep(contour_element.getAttribute(contour_attr_names[ca]),\"\\t\", false) + \"\\\"\\n\" );\n }\n }\n }\n } else if (contour_attr_names[ca].equals(\"type\")) {\n if (r.export_handles) {\n sf.print ( \" \" + contour_attr_names[ca] + \"=\\\"\" + contour_element.getAttribute(contour_attr_names[ca]) + \"\\\"\" );\n } else {\n // Don't output the \"type\" attribute if not exporting handles (this makes the traces non-bezier)\n }\n } else {\n sf.print ( \" \" + contour_attr_names[ca] + \"=\\\"\" + contour_element.getAttribute(contour_attr_names[ca]) + \"\\\"\" );\n if (contour_attr_names[ca].equals(\"mode\")) {\n sf.print ( \"\\n\" );\n }\n }\n }\n sf.print ( \"/>\\n\" );\n }\n }\n }\n sf.print ( \"</\" + child.getNodeName() + \">\\n\\n\" );\n }\n }\n }\n\n // Also write out any new contours created by drawing\n\n for (int i=0; i<contours.size(); i++) {\n ContourClass contour = contours.get(i);\n ArrayList<double[]> s = contour.stroke_points;\n ArrayList<double[][]> h = contour.handle_points;\n if (s.size() > 0) {\n if (contour.modified) {\n if (contour.contour_name == null) {\n contour.contour_name = \"RGB_\";\n if (contour.r > 0.5) { contour.contour_name += \"1\"; } else { contour.contour_name += \"0\"; }\n if (contour.g > 0.5) { contour.contour_name += \"1\"; } else { contour.contour_name += \"0\"; }\n if (contour.b > 0.5) { contour.contour_name += \"1\"; } else { contour.contour_name += \"0\"; }\n }\n sf.print ( \"<Transform dim=\\\"0\\\"\\n\" );\n sf.print ( \" xcoef=\\\" 0 1 0 0 0 0\\\"\\n\" );\n sf.print ( \" ycoef=\\\" 0 0 1 0 0 0\\\">\\n\" );\n String contour_color = \"\\\"\" + contour.r + \" \" + contour.g + \" \" + contour.b + \"\\\"\";\n sf.print ( \"<Contour name=\\\"\" + contour.contour_name + \"\\\" \" );\n if (contour.is_bezier) {\n sf.print ( \"type=\\\"bezier\\\" \" );\n } else {\n // sf.print ( \"type=\\\"line\\\" \" );\n }\n sf.print ( \"hidden=\\\"false\\\" closed=\\\"true\\\" simplified=\\\"false\\\" border=\" + contour_color + \" fill=\" + contour_color + \" mode=\\\"13\\\"\\n\" );\n\n if (contour.is_bezier) {\n if (h.size() > 0) {\n sf.print ( \" handles=\\\"\" );\n System.out.println ( \"Saving handles inside Section.write_as_xml\" );\n for (int j=h.size()-1; j>=0; j+=-1) {\n // for (int j=0; j<h.size(); j++) {\n double p[][] = h.get(j);\n if (j != 0) {\n sf.print ( \" \" );\n }\n System.out.println ( \" \" + p[0][0] + \" \" + p[0][1] + \" \" + p[1][0] + \" \" + p[1][1] );\n sf.print ( p[0][0] + \" \" + p[0][1] + \" \" + p[1][0] + \" \" + p[1][1] + \",\\n\" );\n }\n sf.print ( \" \\\"\\n\" );\n }\n }\n\n sf.print ( \" points=\\\"\" );\n for (int j=s.size()-1; j>=0; j+=-1) {\n double p[] = s.get(j);\n if (j != s.size()-1) {\n sf.print ( \" \" );\n }\n sf.print ( p[0] + \" \" + p[1] + \",\\n\" );\n }\n sf.print ( \" \\\"/>\\n\" );\n sf.print ( \"</Transform>\\n\\n\" );\n }\n }\n }\n\n sf.print ( \"</\" + section_element.getNodeName() + \">\" );\n }\n }\n sf.close();\n\n } catch (Exception e) {\n }\n }", "public void save(XmlWriter w) throws Throwable {\n w.add(\"log\", new String[] { \"type\", type().toString(), \"time\",\n new SimpleDateFormat(DateTime.DATE_TIME_FORMAT).format(time()) }, message());\n }", "private static synchronized void changeXML(Path filepath, File conf, String name){\n try {\n // Строим объектную модель исходного XML файла\n DocumentBuilder db = DocumentBuilderFactory.newInstance()\n .newDocumentBuilder();\n Document doc = db.parse(conf);\n doc.normalize();\n \n NodeList appenders = doc.getElementsByTagName(\"appender\");\n for (int i = 0; i < appenders.getLength(); i++) {\n Node appender = appenders.item(i);\n //if this node is suitable appender, then change TextContext 'file'\n if (isMyRollingFileAppender(appender, name)) {\n NodeList childNodes = appender.getChildNodes();\n for (int j = 0; j < childNodes.getLength(); j++) {\n Node nextChild = childNodes.item(j);\n if (nextChild.getNodeName().equals(\"file\")) {\n nextChild.setTextContent(filepath.toString());\n break;\n }\n }\n break;\n }\n }\n // Write changes to XML-file\n Transformer transformer = TransformerFactory.newInstance()\n .newTransformer();\n DOMSource source = new DOMSource(doc);\n StreamResult result = new StreamResult(conf);\n transformer.transform(source, result);\n \n } catch (SAXException | IOException | ParserConfigurationException\n | TransformerConfigurationException ex) {\n System.out.println(\"Ошибка ввода-вывода при изменении XML-файла: \"+ex.getMessage());\n } catch (TransformerException ex) {\n System.out.println(\"Ошибка в траносформации XML \"+ex.getMessage());\n }\n }", "public String writeFile1() throws IOException {\n String sFileName = \"\\\\testfile1.xml\";\n FileWriter oOut = new FileWriter(sFileName);\n\n oOut.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?>\");\n oOut.write(\"<paramFile fileCode=\\\"07010101\\\">\"); \n oOut.write(\"<plot>\");\n oOut.write(\"<timesteps>4</timesteps>\");\n oOut.write(\"<yearsPerTimestep>1</yearsPerTimestep>\");\n oOut.write(\"<randomSeed>1</randomSeed>\");\n oOut.write(\"<plot_lenX>96</plot_lenX>\");\n oOut.write(\"<plot_lenY>96</plot_lenY>\");\n oOut.write(\"<plot_latitude>55.37</plot_latitude>\");\n oOut.write(\"</plot>\");\n oOut.write(\"<trees>\");\n oOut.write(\"<tr_speciesList>\");\n oOut.write(\"<tr_species speciesName=\\\"Species_1\\\"/>\");\n oOut.write(\"<tr_species speciesName=\\\"Species_2\\\"/>\");\n oOut.write(\"</tr_speciesList>\");\n oOut.write(\"<tr_seedDiam10Cm>0.1</tr_seedDiam10Cm>\");\n oOut.write(\"<tr_minAdultDBH>\");\n oOut.write(\"<tr_madVal species=\\\"Species_1\\\">10.0</tr_madVal>\");\n oOut.write(\"<tr_madVal species=\\\"Species_2\\\">10.0</tr_madVal>\");\n oOut.write(\"</tr_minAdultDBH>\");\n oOut.write(\"<tr_maxSeedlingHeight>\");\n oOut.write(\"<tr_mshVal species=\\\"Species_1\\\">1.35</tr_mshVal>\");\n oOut.write(\"<tr_mshVal species=\\\"Species_2\\\">1.35</tr_mshVal>\");\n oOut.write(\"</tr_maxSeedlingHeight>\");\n oOut.write(\"</trees>\");\n oOut.write(\"<allometry>\");\n oOut.write(\"<tr_canopyHeight>\");\n oOut.write(\"<tr_chVal species=\\\"Species_1\\\">39.48</tr_chVal>\");\n oOut.write(\"<tr_chVal species=\\\"Species_2\\\">39.54</tr_chVal>\");\n oOut.write(\"</tr_canopyHeight>\");\n oOut.write(\"<tr_stdAsympCrownRad>\");\n oOut.write(\"<tr_sacrVal species=\\\"Species_1\\\">0.0549</tr_sacrVal>\");\n oOut.write(\"<tr_sacrVal species=\\\"Species_2\\\">0.0614</tr_sacrVal>\");\n oOut.write(\"</tr_stdAsympCrownRad>\");\n oOut.write(\"<tr_stdCrownRadExp>\");\n oOut.write(\"<tr_screVal species=\\\"Species_1\\\">1.0</tr_screVal>\");\n oOut.write(\"<tr_screVal species=\\\"Species_2\\\">1.0</tr_screVal>\");\n oOut.write(\"</tr_stdCrownRadExp>\");\n oOut.write(\"<tr_conversionDiam10ToDBH>\");\n oOut.write(\"<tr_cdtdVal species=\\\"Species_1\\\">0.8008</tr_cdtdVal>\");\n oOut.write(\"<tr_cdtdVal species=\\\"Species_2\\\">0.5944</tr_cdtdVal>\");\n oOut.write(\"</tr_conversionDiam10ToDBH>\");\n oOut.write(\"<tr_interceptDiam10ToDBH>\");\n oOut.write(\"<tr_idtdVal species=\\\"Species_1\\\">0</tr_idtdVal>\");\n oOut.write(\"<tr_idtdVal species=\\\"Species_2\\\">0</tr_idtdVal>\");\n oOut.write(\"</tr_interceptDiam10ToDBH>\");\n oOut.write(\"<tr_stdAsympCrownHt>\");\n oOut.write(\"<tr_sachVal species=\\\"Species_1\\\">0.389</tr_sachVal>\");\n oOut.write(\"<tr_sachVal species=\\\"Species_2\\\">0.368</tr_sachVal>\");\n oOut.write(\"</tr_stdAsympCrownHt>\");\n oOut.write(\"<tr_stdCrownHtExp>\");\n oOut.write(\"<tr_scheVal species=\\\"Species_1\\\">1.0</tr_scheVal>\");\n oOut.write(\"<tr_scheVal species=\\\"Species_2\\\">1.0</tr_scheVal>\");\n oOut.write(\"</tr_stdCrownHtExp>\");\n oOut.write(\"<tr_slopeOfHeight-Diam10>\");\n oOut.write(\"<tr_sohdVal species=\\\"Species_1\\\">0.03418</tr_sohdVal>\");\n oOut.write(\"<tr_sohdVal species=\\\"Species_2\\\">0.0269</tr_sohdVal>\");\n oOut.write(\"</tr_slopeOfHeight-Diam10>\");\n oOut.write(\"<tr_slopeOfAsymHeight>\");\n oOut.write(\"<tr_soahVal species=\\\"Species_1\\\">0.0299</tr_soahVal>\");\n oOut.write(\"<tr_soahVal species=\\\"Species_2\\\">0.0241</tr_soahVal>\");\n oOut.write(\"</tr_slopeOfAsymHeight>\");\n oOut.write(\"<tr_whatSeedlingHeightDiam>\");\n oOut.write(\"<tr_wsehdVal species=\\\"Species_1\\\">0</tr_wsehdVal>\");\n oOut.write(\"<tr_wsehdVal species=\\\"Species_2\\\">0</tr_wsehdVal>\");\n oOut.write(\"</tr_whatSeedlingHeightDiam>\");\n oOut.write(\"<tr_whatSaplingHeightDiam>\");\n oOut.write(\"<tr_wsahdVal species=\\\"Species_1\\\">0</tr_wsahdVal>\");\n oOut.write(\"<tr_wsahdVal species=\\\"Species_2\\\">0</tr_wsahdVal>\");\n oOut.write(\"</tr_whatSaplingHeightDiam>\");\n oOut.write(\"<tr_whatAdultHeightDiam>\");\n oOut.write(\"<tr_wahdVal species=\\\"Species_1\\\">0</tr_wahdVal>\");\n oOut.write(\"<tr_wahdVal species=\\\"Species_2\\\">0</tr_wahdVal>\");\n oOut.write(\"</tr_whatAdultHeightDiam>\");\n oOut.write(\"<tr_whatAdultCrownRadDiam>\");\n oOut.write(\"<tr_wacrdVal species=\\\"Species_1\\\">0</tr_wacrdVal>\");\n oOut.write(\"<tr_wacrdVal species=\\\"Species_2\\\">0</tr_wacrdVal>\");\n oOut.write(\"</tr_whatAdultCrownRadDiam>\");\n oOut.write(\"<tr_whatAdultCrownHeightHeight>\");\n oOut.write(\"<tr_wachhVal species=\\\"Species_1\\\">0</tr_wachhVal>\");\n oOut.write(\"<tr_wachhVal species=\\\"Species_2\\\">0</tr_wachhVal>\");\n oOut.write(\"</tr_whatAdultCrownHeightHeight>\");\n oOut.write(\"<tr_whatSaplingCrownRadDiam>\");\n oOut.write(\"<tr_wscrdVal species=\\\"Species_1\\\">0</tr_wscrdVal>\");\n oOut.write(\"<tr_wscrdVal species=\\\"Species_2\\\">0</tr_wscrdVal>\");\n oOut.write(\"</tr_whatSaplingCrownRadDiam>\");\n oOut.write(\"<tr_whatSaplingCrownHeightHeight>\");\n oOut.write(\"<tr_wschhVal species=\\\"Species_1\\\">0</tr_wschhVal>\");\n oOut.write(\"<tr_wschhVal species=\\\"Species_2\\\">0</tr_wschhVal>\");\n oOut.write(\"</tr_whatSaplingCrownHeightHeight>\");\n oOut.write(\"</allometry>\");\n oOut.write(\"<behaviorList>\");\n oOut.write(\"<behavior>\");\n oOut.write(\"<behaviorName>NonSpatialDisperse</behaviorName>\");\n oOut.write(\"<version>1</version>\");\n oOut.write(\"<listPosition>1</listPosition>\");\n oOut.write(\"<applyTo species=\\\"Species_1\\\" type=\\\"Adult\\\"/>\");\n oOut.write(\"<applyTo species=\\\"Species_2\\\" type=\\\"Adult\\\"/>\");\n oOut.write(\"</behavior>\");\n oOut.write(\"<behavior>\");\n oOut.write(\"<behaviorName>MastingDisperseAutocorrelation</behaviorName>\");\n oOut.write(\"<version>1.0</version>\");\n oOut.write(\"<listPosition>2</listPosition>\");\n oOut.write(\"<applyTo species=\\\"Species_1\\\" type=\\\"Adult\\\"/>\");\n oOut.write(\"</behavior>\");\n oOut.write(\"<behavior>\");\n oOut.write(\"<behaviorName>MastingDisperseAutocorrelation</behaviorName>\");\n oOut.write(\"<version>1.0</version>\");\n oOut.write(\"<listPosition>3</listPosition>\");\n oOut.write(\"<applyTo species=\\\"Species_2\\\" type=\\\"Adult\\\"/>\");\n oOut.write(\"</behavior>\");\n oOut.write(\"<behavior>\");\n oOut.write(\"<behaviorName>DensDepRodentSeedPredation</behaviorName>\");\n oOut.write(\"<version>1.0</version>\");\n oOut.write(\"<listPosition>4</listPosition>\");\n oOut.write(\"<applyTo species=\\\"Species_1\\\" type=\\\"Seed\\\"/>\");\n oOut.write(\"<applyTo species=\\\"Species_2\\\" type=\\\"Seed\\\"/>\");\n oOut.write(\"</behavior>\");\n oOut.write(\"</behaviorList>\");\n oOut.write(\"<NonSpatialDisperse1>\");\n oOut.write(\"<di_minDbhForReproduction>\");\n oOut.write(\"<di_mdfrVal species=\\\"Species_1\\\">15.0</di_mdfrVal>\");\n oOut.write(\"<di_mdfrVal species=\\\"Species_2\\\">15.0</di_mdfrVal>\");\n oOut.write(\"</di_minDbhForReproduction>\");\n oOut.write(\"<di_nonSpatialSlopeOfLambda>\");\n oOut.write(\"<di_nssolVal species=\\\"Species_2\\\">0</di_nssolVal>\");\n oOut.write(\"<di_nssolVal species=\\\"Species_1\\\">0</di_nssolVal>\");\n oOut.write(\"</di_nonSpatialSlopeOfLambda>\");\n oOut.write(\"<di_nonSpatialInterceptOfLambda>\");\n oOut.write(\"<di_nsiolVal species=\\\"Species_1\\\">1</di_nsiolVal>\");\n oOut.write(\"<di_nsiolVal species=\\\"Species_2\\\">2</di_nsiolVal>\");\n oOut.write(\"</di_nonSpatialInterceptOfLambda>\");\n oOut.write(\"</NonSpatialDisperse1>\");\n oOut.write(\"<MastingDisperseAutocorrelation2>\");\n oOut.write(\"<di_minDbhForReproduction>\");\n oOut.write(\"<di_mdfrVal species=\\\"Species_1\\\">15.0</di_mdfrVal>\");\n oOut.write(\"</di_minDbhForReproduction>\");\n oOut.write(\"<di_mdaMastTS>\");\n oOut.write(\"<di_mdaMTS ts=\\\"1\\\">0.49</di_mdaMTS>\");\n oOut.write(\"<di_mdaMTS ts=\\\"2\\\">0.04</di_mdaMTS>\");\n oOut.write(\"<di_mdaMTS ts=\\\"3\\\">0.89</di_mdaMTS>\");\n oOut.write(\"<di_mdaMTS ts=\\\"4\\\">0.29</di_mdaMTS>\");\n oOut.write(\"</di_mdaMastTS>\");\n oOut.write(\"<di_maxDbhForSizeEffect>\");\n oOut.write(\"<di_mdfseVal species=\\\"Species_1\\\">100</di_mdfseVal>\");\n oOut.write(\"</di_maxDbhForSizeEffect>\");\n oOut.write(\"<di_weibullCanopyBeta>\");\n oOut.write(\"<di_wcbVal species=\\\"Species_1\\\">1</di_wcbVal>\");\n oOut.write(\"</di_weibullCanopyBeta>\");\n oOut.write(\"<di_weibullCanopySTR>\");\n oOut.write(\"<di_wcsVal species=\\\"Species_1\\\">1000</di_wcsVal>\");\n oOut.write(\"</di_weibullCanopySTR>\");\n oOut.write(\"<di_mdaReproFracA>\");\n oOut.write(\"<di_mdarfaVal species=\\\"Species_1\\\">1</di_mdarfaVal>\");\n oOut.write(\"</di_mdaReproFracA>\");\n oOut.write(\"<di_mdaReproFracB>\");\n oOut.write(\"<di_mdarfbVal species=\\\"Species_1\\\">1</di_mdarfbVal>\");\n oOut.write(\"</di_mdaReproFracB>\");\n oOut.write(\"<di_mdaReproFracC>\");\n oOut.write(\"<di_mdarfcVal species=\\\"Species_1\\\">0</di_mdarfcVal>\");\n oOut.write(\"</di_mdaReproFracC>\");\n oOut.write(\"<di_mdaRhoACF>\");\n oOut.write(\"<di_mdaraVal species=\\\"Species_1\\\">1</di_mdaraVal>\");\n oOut.write(\"</di_mdaRhoACF>\");\n oOut.write(\"<di_mdaRhoNoiseSD>\");\n oOut.write(\"<di_mdarnsdVal species=\\\"Species_1\\\">0</di_mdarnsdVal>\");\n oOut.write(\"</di_mdaRhoNoiseSD>\");\n oOut.write(\"<di_mdaPRA>\");\n oOut.write(\"<di_mdapraVal species=\\\"Species_1\\\">0.75</di_mdapraVal>\");\n oOut.write(\"</di_mdaPRA>\");\n oOut.write(\"<di_mdaPRB>\");\n oOut.write(\"<di_mdaprbVal species=\\\"Species_1\\\">0.004</di_mdaprbVal>\");\n oOut.write(\"</di_mdaPRB>\");\n oOut.write(\"<di_mdaSPSSD>\");\n oOut.write(\"<di_mdaspssdVal species=\\\"Species_1\\\">0.1</di_mdaspssdVal>\");\n oOut.write(\"</di_mdaSPSSD>\");\n oOut.write(\"<di_canopyFunction>\");\n oOut.write(\"<di_cfVal species=\\\"Species_1\\\">0</di_cfVal>\");\n oOut.write(\"</di_canopyFunction>\");\n oOut.write(\"<di_weibullCanopyDispersal>\");\n oOut.write(\"<di_wcdVal species=\\\"Species_1\\\">1.76E-04</di_wcdVal>\");\n oOut.write(\"</di_weibullCanopyDispersal>\");\n oOut.write(\"<di_weibullCanopyTheta>\");\n oOut.write(\"<di_wctVal species=\\\"Species_1\\\">3</di_wctVal>\");\n oOut.write(\"</di_weibullCanopyTheta>\");\n oOut.write(\"</MastingDisperseAutocorrelation2>\");\n oOut.write(\"<MastingDisperseAutocorrelation3>\");\n oOut.write(\"<di_minDbhForReproduction>\");\n oOut.write(\"<di_mdfrVal species=\\\"Species_2\\\">15.0</di_mdfrVal>\");\n oOut.write(\"</di_minDbhForReproduction>\");\n //Mast timeseries\n oOut.write(\"<di_mdaMastTS>\");\n oOut.write(\"<di_mdaMTS ts=\\\"1\\\">0.5</di_mdaMTS>\");\n oOut.write(\"<di_mdaMTS ts=\\\"2\\\">0.29</di_mdaMTS>\");\n oOut.write(\"<di_mdaMTS ts=\\\"3\\\">0.05</di_mdaMTS>\");\n oOut.write(\"<di_mdaMTS ts=\\\"4\\\">0.63</di_mdaMTS>\");\n oOut.write(\"</di_mdaMastTS>\");\n oOut.write(\"<di_maxDbhForSizeEffect>\");\n oOut.write(\"<di_mdfseVal species=\\\"Species_2\\\">100</di_mdfseVal>\");\n oOut.write(\"</di_maxDbhForSizeEffect>\");\n oOut.write(\"<di_weibullCanopyBeta>\");\n oOut.write(\"<di_wcbVal species=\\\"Species_2\\\">1</di_wcbVal>\");\n oOut.write(\"</di_weibullCanopyBeta>\");\n oOut.write(\"<di_weibullCanopySTR>\");\n oOut.write(\"<di_wcsVal species=\\\"Species_2\\\">1000</di_wcsVal>\");\n oOut.write(\"</di_weibullCanopySTR>\");\n oOut.write(\"<di_mdaReproFracA>\");\n oOut.write(\"<di_mdarfaVal species=\\\"Species_2\\\">10000</di_mdarfaVal>\");\n oOut.write(\"</di_mdaReproFracA>\");\n oOut.write(\"<di_mdaReproFracB>\");\n oOut.write(\"<di_mdarfbVal species=\\\"Species_2\\\">1</di_mdarfbVal>\");\n oOut.write(\"</di_mdaReproFracB>\");\n oOut.write(\"<di_mdaReproFracC>\");\n oOut.write(\"<di_mdarfcVal species=\\\"Species_2\\\">1</di_mdarfcVal>\");\n oOut.write(\"</di_mdaReproFracC>\");\n oOut.write(\"<di_mdaRhoACF>\");\n oOut.write(\"<di_mdaraVal species=\\\"Species_2\\\">1</di_mdaraVal>\");\n oOut.write(\"</di_mdaRhoACF>\");\n oOut.write(\"<di_mdaRhoNoiseSD>\");\n oOut.write(\"<di_mdarnsdVal species=\\\"Species_2\\\">0</di_mdarnsdVal>\");\n oOut.write(\"</di_mdaRhoNoiseSD>\");\n oOut.write(\"<di_mdaPRA>\");\n oOut.write(\"<di_mdapraVal species=\\\"Species_2\\\">100</di_mdapraVal>\");\n oOut.write(\"</di_mdaPRA>\");\n oOut.write(\"<di_mdaPRB>\");\n oOut.write(\"<di_mdaprbVal species=\\\"Species_2\\\">0.004</di_mdaprbVal>\");\n oOut.write(\"</di_mdaPRB>\");\n oOut.write(\"<di_mdaSPSSD>\");\n oOut.write(\"<di_mdaspssdVal species=\\\"Species_2\\\">0.1</di_mdaspssdVal>\");\n oOut.write(\"</di_mdaSPSSD>\");\n oOut.write(\"<di_canopyFunction>\");\n oOut.write(\"<di_cfVal species=\\\"Species_2\\\">0</di_cfVal>\");\n oOut.write(\"</di_canopyFunction>\");\n oOut.write(\"<di_weibullCanopyDispersal>\");\n oOut.write(\"<di_wcdVal species=\\\"Species_2\\\">1.82E-04</di_wcdVal>\");\n oOut.write(\"</di_weibullCanopyDispersal>\");\n oOut.write(\"<di_weibullCanopyTheta>\");\n oOut.write(\"<di_wctVal species=\\\"Species_2\\\">3</di_wctVal>\");\n oOut.write(\"</di_weibullCanopyTheta>\");\n oOut.write(\"</MastingDisperseAutocorrelation3>\");\n oOut.write(\"<DensDepRodentSeedPredation4>\");\n oOut.write(\"<pr_densDepFuncRespSlope>\");\n oOut.write(\"<pr_ddfrsVal species=\\\"Species_1\\\">0.9</pr_ddfrsVal>\");\n oOut.write(\"<pr_ddfrsVal species=\\\"Species_2\\\">0.05</pr_ddfrsVal>\");\n oOut.write(\"</pr_densDepFuncRespSlope>\");\n oOut.write(\"<pr_densDepFuncRespA>0.02</pr_densDepFuncRespA>\");\n oOut.write(\"<pr_densDepDensCoeff>0.07</pr_densDepDensCoeff>\");\n oOut.write(\"</DensDepRodentSeedPredation4>\");\n oOut.write(\"</paramFile>\");\n oOut.close();\n return sFileName;\n }", "public void saveXML(String path,\n SourceParameters parameters)\n throws SAXException, ProcessingException, IOException {\n if (this.saveResource == null) {\n throw new ProcessingException(\"The context \" + this.name + \" does not support saving.\");\n }\n DocumentFragment frag = this.getXML(path);\n if (frag == null) {\n // create empty fake document\n frag = DOMUtil.createDocument().createDocumentFragment();\n }\n\n XMLUtil.writeDOM(this.saveResource,\n null,\n parameters,\n frag,\n this.resolver,\n \"xml\");\n }", "void localOutputXml(IvyXmlWriter xw)\n{\n xw.field(\"KIND\",\"MUTEX\");\n for (TraceLockLocation ll : getLocations()) {\n ll.outputXml(xw,false);\n }\n}", "protected abstract void writeToXml(EwsServiceXmlWriter writer)\n\t\t\tthrows Exception;", "public void saveXmlTree(String fileName) {\n try {\n String tree = this.client.driver.getPageSource();\n PrintWriter out = new PrintWriter(this.settings.baseLogDir + File.separator + fileName);\n out.println(tree);\n out.close();\n } catch (Exception e) {\n this.error(\"Failed to get and save current visual tree.\");\n }\n }", "@Override\n public void writeXml(XmlWriter xmlWriter) {\n try {\n xmlWriter.element(\"debug\")\n .attribute(\"message\", message)\n .pop();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void close(){\r\n Transformer t = null;\r\n\t\ttry {\r\n\t\t\tt = TransformerFactory.newInstance().newTransformer();\r\n\t\t\tt.setOutputProperty(OutputKeys.METHOD, \"xml\");\r\n\t\t\tt.setOutputProperty(OutputKeys.INDENT, \"yes\"); \r\n\t\t\tt.transform(new DOMSource(document), new StreamResult(new FileOutputStream(XMLFileName))); \t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }", "public void writeXML(OutputStream stream) throws IOException {\n\t\tPrintWriter out = new PrintWriter(stream);\n\t\tout.println(\"<?xml version=\\\"1.0\\\"?>\");\n\t\tout.println(\"<VLToolBars version=\\\"1.0\\\">\");\n\t\txmlWriteContainer(out);\n\n\t\tout.println(\"</VLToolBars>\");\n\t\tout.flush();\n\t}", "public void saveMapping() {\n String userHome = System.getProperty(\"user.home\");\n String filePath = userHome + \"/\"+ System.currentTimeMillis() +\"-mapping.xml\";\n XMLExporter exporter = XMLExporter.getInstance();\n File file = new File(filePath);\n try {\n exporter.save(mappings, file);\n Logger.getLogger(MappingAppState.class.getName()).log(Level.INFO, \"Mapping saved as {0}\", filePath);\n } catch (IOException ex) {\n Logger.getLogger(MappingAppState.class.getName()).log(Level.SEVERE, \"Failed to save node!\", ex);\n }\n }", "public void createXMLFileForNOC(Report report) {\n\ttry{\n\t\tFile outDir = new File(report.getXmlFilePath()); \n\t\tboolean isDirCreated = outDir.mkdirs();\n\t\tif (isDirCreated)\n\t\t\tlogger.info(\"In FileUploadDownload class fileUpload() method: upload file folder location created.\");\n\t\telse\n\t\t\tlogger.info(\"In FileUploadDownload class fileUpload() method: upload file folder location already exist.\");\n\t\t\n\t\tDocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n\t\tDocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n\t\t\n\t\t// root elements\n\t\tDocument doc = docBuilder.newDocument();\n\t\tElement rootElement = doc.createElement(\"root\");\n\t\tdoc.appendChild(rootElement);\n\t\n\t\t\t//for(Student student : report.getStudentList()){\n\t\t\t\t\t\n\t\t\t\tElement studentList = doc.createElement(\"student\");\n\t\t\t\trootElement.appendChild(studentList);\n\t\t\t\t\n\t\t\t\t/*Element schoolname = doc.createElement(\"schoolname\");\n\t\t\t\tschoolname.appendChild(doc.createTextNode((report.getSchoolDetails().getSchoolDetailsName() != null ? report.getSchoolDetails().getSchoolDetailsName() : \"\" )));\n\t\t\t\tstudentList.appendChild(schoolname);*/\n\t\t\t\t\n\t\t\t\tElement academicYear = doc.createElement(\"academicYear\");\n\t\t\t\tacademicYear.appendChild(doc.createTextNode((String) (report.getAcademicYear().getAcademicYearName()!= null ? report.getAcademicYear().getAcademicYearName() : \"\" )));\n\t\t\t\tstudentList.appendChild(academicYear);\n\t\t\t\t\n\t\t\t\tElement roll = doc.createElement(\"roll\");\n\t\t\t\troll.appendChild(doc.createTextNode((report.getReportCode().toString()!=null?report.getReportCode().toString():\"---------\")));\n\t\t\t\tstudentList.appendChild(roll);\n\t\t\t\t\n\t\t\t\tElement studentname = doc.createElement(\"studentname\");\n\t\t\t\tstudentname.appendChild(doc.createTextNode((report.getUpdatedBy()!=null?report.getUpdatedBy():\"---------------\")));\n\t\t\t\tstudentList.appendChild(studentname);\n\t\t\t\n\t\t\t\t\n\t\t\t//}\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(doc);\t\t\n\t\t\tStreamResult result = new StreamResult(new File(report.getXmlFilePath()+report.getXmlFileName()));\n\t\t\t\n\t\t\t// Output to console for testing\n\t\t\t// StreamResult result = new StreamResult(System.out);\t\t\t\n\t\t\ttransformer.transform(source, result);\n\t\t}catch (ParserConfigurationException pce) {\n\t\t\tpce.printStackTrace();\n\t\t\tlogger.error(\"\",pce);\n\t\t} catch (TransformerException tfe) {\n\t\t\ttfe.printStackTrace();\n\t\t\tlogger.error(tfe);\n\t\t}\n\t}", "public void createXMLFileForGatePass(Report report) {\n\t\ttry{\n\t\t\tFile outDir = new File(report.getXmlFilePath()); \n\t\t\tboolean isDirCreated = outDir.mkdirs();\n\t\t\tif (isDirCreated)\n\t\t\t\tlogger.info(\"In FileUploadDownload class fileUpload() method: upload file folder location created.\");\n\t\t\telse\n\t\t\t\tlogger.info(\"In FileUploadDownload class fileUpload() method: upload file folder location already exist.\");\n\t\t\t\n\t\t\tDocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n\t\t\t\n\t\t\t// root elements\n\t\t\tDocument doc = docBuilder.newDocument();\n\t\t\tElement rootElement = doc.createElement(\"root\");\n\t\t\tdoc.appendChild(rootElement);\n\t\t\n\t\t\tElement studentList = doc.createElement(\"student\");\n\t\t\trootElement.appendChild(studentList);\n\t\t\t\n\t\t\tElement academicYear = doc.createElement(\"academicYear\");\n\t\t\tacademicYear.appendChild(doc.createTextNode((String) (report.getAcademicYear().getAcademicYearName()!= null ? report.getAcademicYear().getAcademicYearName() : \"\" )));\n\t\t\tstudentList.appendChild(academicYear);\n\t\t\t\t\n\t\t\tElement roll = doc.createElement(\"roll\");\n\t\t\troll.appendChild(doc.createTextNode((report.getReportCode().toString()!=null?report.getReportCode().toString():\"---------\")));\n\t\t\tstudentList.appendChild(roll);\n\t\t\t\n\t\t\tElement studentname = doc.createElement(\"studentname\");\n\t\t\tstudentname.appendChild(doc.createTextNode((report.getUpdatedBy()!=null?report.getUpdatedBy():\"---------------\")));\n\t\t\tstudentList.appendChild(studentname);\n\t\t\t\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(doc);\t\t\n\t\t\tStreamResult result = new StreamResult(new File(report.getXmlFilePath()+report.getXmlFileName()));\n\t\t\t\n\t\t\ttransformer.transform(source, result);\n\t\t}catch (ParserConfigurationException pce) {\n\t\t\tpce.printStackTrace();\n\t\t\tlogger.error(\"\",pce);\n\t\t} catch (TransformerException tfe) {\n\t\t\ttfe.printStackTrace();\n\t\t\tlogger.error(tfe);\n\t\t}\n\n\t}", "static void save(Schedules schedules, String filename) throws IOException, RBEConfigObjectException\n {\n\t\tFileWriter fw = new FileWriter(filename);\n\t\tschedules.toXML(fw);\n\t\tfw.close();\n }", "public void writeXML(String xml){\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\tDocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance(); \n\t\t\tDocumentBuilder documentBuilder = documentFactory.newDocumentBuilder(); \n\t\t\t// define root elements \n\t\t\tDocument document = documentBuilder.newDocument(); \n\t\t\tElement rootElement = document.createElement(\"graph\"); \n\t\t\tdocument.appendChild(rootElement);\n\t\t\t\n\t\t\tfor(int i=0;i<Rel.getChildCount();i++){\n\t\t\t\tif(Rel.getChildAt(i).getTag() != null){\n\t\t\t\t\tif(Rel.getChildAt(i).getTag().toString().compareTo(\"node\") == 0){\n\t\t\t\t\t\tArtifact artifact = (Artifact) Rel.getChildAt(i);\n\t\t\t\t\t\tElement node = addElement(rootElement, \"node\", document);\n\t\t\t\t\t\tElement id = addAttribute(\"id\",artifact.getId()+\"\", document); //we create an attribute for a node\n\t\t\t\t\t\tnode.appendChild(id);//and then we attach it to the node\n\t\t\t\t\t\t\n\t\t\t\t\t\tArrayList <Artifact> fathers = artifact.getFathers();\n\t\t\t\t\t\tif(fathers != null){\n\t\t\t\t\t\t\taddElement(node, \"fathers\", document);//for complex attribute like array of fathers we add an element to the node\n\t\t\t\t\t\t\tfor(int j=0;j<fathers.size();j++){\n\t\t\t\t\t\t\t\tElement father = addAttribute(\"father\",fathers.get(j).getId()+\"\", document);//inside this element created in the node we add all its fathers as attributes\n\t\t\t\t\t\t\t\tnode.appendChild(father);\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\tArrayList <Artifact> sons = artifact.getSons();\n\t\t\t\t\t\tif(sons != null){\n\t\t\t\t\t\t\taddElement(node, \"sons\", document);//for complex attribute like array of sons we add an element to the node\n\t\t\t\t\t\t\tfor(int j=0;j<sons.size();j++){\n\t\t\t\t\t\t\t\tElement son = addAttribute(\"son\",sons.get(j).getId()+\"\", document);//inside this element created in the node we add all its sons as attributes\n\t\t\t\t\t\t\t\tnode.appendChild(son);\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\tElement label = addAttribute(\"label\", artifact.getText()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(label);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement age = addAttribute(\"age\", artifact.getAge()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(age);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement type = addAttribute(\"type\", artifact.getType()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(type);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement information = addAttribute(\"information\", artifact.getInformation()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(information);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement position = addAttribute(\"position\", artifact.getPosition()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(position);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// creating and writing to xml file \n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance(); \n\t\t\tTransformer transformer = transformerFactory.newTransformer(); \n\t\t\tDOMSource domSource = new DOMSource(document); \n\t\t\tStreamResult streamResult = new StreamResult(new File(xml)); \n\t\t\ttransformer.transform(domSource, streamResult);\n \n \n }catch(Exception e){\n \tLog.v(\"error writing xml\",e.toString());\n }\n\t\t\n\t\t\n\t}", "public void saveAsXML(String fname) {\n\tXMLUtil.writeXML(saveAsXML(), fname);\n }", "public static void addEmployeeToXMLFile(Employee ee) {\n try {\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n Document doc = docBuilder.newDocument();\n\n Element rootElement;\n File xmlFile = new File(\"src/task2/employee.xml\");\n\n if (xmlFile.isFile()) {\n doc = docBuilder.parse(new FileInputStream(xmlFile));\n doc.getDocumentElement().normalize();\n rootElement = doc.getDocumentElement();\n } else {\n rootElement = doc.createElement(\"department\");\n doc.appendChild(rootElement);\n }\n\n Element employee = doc.createElement(\"employee\");\n rootElement.appendChild(employee);\n\n Element id = doc.createElement(\"id\");\n id.appendChild(doc.createTextNode(ee.getId()));\n employee.appendChild(id);\n\n Element name = doc.createElement(\"name\");\n name.appendChild(doc.createTextNode(ee.getName()));\n employee.appendChild(name);\n\n Element sex = doc.createElement(\"sex\");\n sex.appendChild(doc.createTextNode(Integer.toString(ee.sex)));\n employee.appendChild(sex);\n\n Element dateOfBirth = doc.createElement(\"dateOfBirth\");\n dateOfBirth.appendChild(doc.createTextNode(ee.dateOfBirth));\n employee.appendChild(dateOfBirth);\n\n Element salary = doc.createElement(\"salary\");\n salary.appendChild(doc.createTextNode(Double.toString(ee.salary)));\n employee.appendChild(salary);\n\n Element address = doc.createElement(\"address\");\n address.appendChild(doc.createTextNode(ee.address));\n employee.appendChild(address);\n\n Element idDepartment = doc.createElement(\"idDepartment\");\n idDepartment.appendChild(doc.createTextNode(ee.idDepartment));\n employee.appendChild(idDepartment);\n\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n DOMSource source = new DOMSource(doc);\n StreamResult result = new StreamResult(xmlFile);\n transformer.transform(source, result);\n System.out.println(\"File saved\");\n\n } catch (ParserConfigurationException | SAXException | IOException | DOMException | TransformerException e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public void persist() {\n\t\ttry {\n\t\t\tFileOutputStream fos = this._context.openFileOutput(\n\t\t\t\t\tConstants.CATALOG_XML_FILE_NAME, Context.MODE_PRIVATE);\n\t\t\tfos.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n\".getBytes());\n\t\t\tfos.write(\"<orders>\\n\".getBytes());\n\t\t\tfor (int i = 0; i < getOrderEntryCount(); i++) {\n\t\t\t\tOrderEntry oe = getOrderEntry(i);\n\t\t\t\tfos.write(oe.toXMLString().getBytes());\n\t\t\t}\n\t\t\tfos.write(\"</orders>\\n\".getBytes());\n\t\t\tfos.flush();\n\t\t\tfos.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tLog.d(Constants.LOGTAG, \" \" + OrderList.CLASSTAG\n\t\t\t\t\t+ \"Failed to write out file?\" + e.getMessage());\n\t\t}\n\t}", "public void saveRecordingData(SuiteEntry suite, File dirPath) throws Exception {\n // Fortify Mod: make sure that dirPath is a legal path\n if( dirPath != null ) {\n TEPath tpath = new TEPath(dirPath.getAbsolutePath());\n if( ! tpath.isValid() ) \n throw new IllegalArgumentException(\"Invalid argument to saveRecordingData: dirPath = \" + dirPath.getAbsolutePath());\n }\n if (dirPath != null && null != suite && SetupOptions.recordingInfo(suite.getLocalName()) == true) {\n\n try {\n //Create a Source for saving the data.\n DOMSource source = new DOMSource(TECore.doc);\n TransformerFactory xformFactory = TransformerFactory.newInstance();\n // Fortify Mod: prevent external entity injection \n xformFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\n Transformer idTransform = xformFactory.newTransformer();\n // Declare document is XML\n idTransform.setOutputProperty(OutputKeys.METHOD, XML);\n // Declare document standard UTF-8\n idTransform.setOutputProperty(OutputKeys.ENCODING, UT_F8);\n // Declare document is well indented\n idTransform.setOutputProperty(OutputKeys.INDENT, YES);\n OutputStream report_logs = new FileOutputStream(new File(dirPath.getAbsolutePath() + Constants.tmp_File));\n Result output = new StreamResult(report_logs);\n //transform the output in xml.\n idTransform.transform(source, output);\n // Fortify Mod: Flush and free up the OutputStream\n report_logs.close();\n BufferedReader bufferedReader = null;\n BufferedWriter bufferedWriter = null;\n // Read the xml data from file\n bufferedReader = new BufferedReader(new FileReader(dirPath.getAbsolutePath() + Constants.tmp_File));\n // Create a xml file for saving the data.\n bufferedWriter = new BufferedWriter(new FileWriter(dirPath.getAbsolutePath() + Constants.result_logxml));\n String dataString = \"\";\n //Read the data from file.\n while ((dataString = bufferedReader.readLine()) != null) {\n // Replace special symbol code to its symbol\n dataString = dataString.replaceAll(\"&lt;\", \"<\").replaceAll(\"&gt;\", \">\").replaceAll(\"&amp;\", \"&\");\n bufferedWriter.write(dataString);\n bufferedWriter.newLine();\n bufferedWriter.flush();\n }\n // Fortify Mod: Free up the Buffered Reader and Writer and their associated resources\n bufferedReader.close();\n bufferedWriter.close();\n TECore.methodCount=0;\n TECore.rootTestName.clear();\n // Check file exists\n File file = new File(dirPath.getAbsolutePath() + Constants.tmp_File);\n if (file.exists()) {\n // Delete file if exists\n file.delete();\n }\n } catch (Exception e) {\n System.out.println(ERROR_ON_SAVE_THE__RECORDING__ + e.toString());\n }\n }\n }", "public void createFile(){\r\n JFileChooser chooser = new JFileChooser();\r\n chooser.setAcceptAllFileFilterUsed(false);\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Only XML Files\", \"xml\");\r\n chooser.addChoosableFileFilter(filter);\r\n chooser.showSaveDialog(null);\r\n File f = chooser.getSelectedFile();\r\n if (!f.getName().endsWith(\".xml\")){\r\n f = new File(f.getAbsolutePath().concat(\".xml\"));\r\n }\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new FileWriter(f));\r\n try (PrintWriter pw = new PrintWriter(bw)) {\r\n pw.println(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\r\n pw.println(\"<osm>\");\r\n for (Node node : this.getListNodes()) {\r\n if(node.getType() == TypeNode.INCENDIE){\r\n pw.println(\" <node id=\\\"\"+node.getId()+\"\\\" x=\\\"\"+node.getX()+\"\\\" y=\\\"\"+node.getY()+\"\\\" type=\\\"\"+node.getType()+\"\\\" intensity=\\\"\"+node.getFire()+\"\\\" />\");\r\n } else {\r\n pw.println(\" <node id=\\\"\"+node.getId()+\"\\\" x=\\\"\"+node.getX()+\"\\\" y=\\\"\"+node.getY()+\"\\\" type=\\\"\"+node.getType()+\"\\\" />\");\r\n }\r\n }\r\n for (Edge edge : this.getListEdges()) {\r\n pw.println(\" <edge nd1=\\\"\"+edge.getNode1().getId()+\"\\\" nd2=\\\"\"+edge.getNode2().getId()+\"\\\" type=\\\"\"+edge.getType()+\"\\\" />\");\r\n }\r\n pw.println(\"</osm>\");\r\n }\r\n } catch (IOException e) {\r\n System.out.println(\"Writing Error : \" + e.getMessage());\r\n }\r\n }", "public void saveChanges() throws TransformerException {\n\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\r\n\t\tTransformer transformer = transformerFactory.newTransformer();\r\n\t\tDOMSource source = new DOMSource(document);\r\n\t\tStreamResult result = new StreamResult(new File(path));\r\n\t\ttransformer.transform(source, result);\r\n\t}", "public static String write(WorkflowTrace trace) throws JAXBException, IOException {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n WorkflowTraceSerializer.write(bos, trace);\n return new String(bos.toByteArray(), \"UTF-8\");\n }", "public void writeToFile(String fileName, String xml) {\n\t\ttry {\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(fileName));\n\t\t\tbw.write(xml);\n\t\t\tbw.close();\n\t\t} catch(IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static void appendToTraceFile(Integer runId, String traceString ) throws java.io.FileNotFoundException,UnsupportedEncodingException{\n\n\t\t// writing the trace report\n\t\t// <inputFilename>_<method>_<cutoff>_<runID>*.sol\n\t\tString fileName = String.format(\"%s_%s_%.0f\",Project.name,Project.method,Project.cutoffTimeSeconds);\n\t\t\t\n\t\tif ( runId != -1 ){\n\t\t\tfileName = fileName +\"_\"+runId+\".trace\";\n\t\t} else {\n\t\t\tfileName = fileName +\".trace\";\n\t\t}\n\n\t\tPrintWriter repWriter = new PrintWriter(new FileOutputStream(fileName,true));\n\n\t\trepWriter.printf(\"%s\\n\",traceString);\n\n\t repWriter.close();\n\n\t}", "public abstract void saveLocationXml(Location location);", "private String writeValidXMLFile() throws java.io.IOException {\n String sFileName = \"\\\\testfile1.xml\";\n FileWriter oOut = new FileWriter(sFileName);\n\n oOut.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?>\");\n oOut.write(\"<paramFile fileCode=\\\"06010101\\\">\");\n oOut.write(\"<plot>\");\n oOut.write(\"<timesteps>3</timesteps>\");\n oOut.write(\"<yearsPerTimestep>1</yearsPerTimestep>\");\n oOut.write(\"<randomSeed>1</randomSeed>\");\n oOut.write(\"<plot_lenX>200.0</plot_lenX>\");\n oOut.write(\"<plot_lenY>200.0</plot_lenY>\");\n oOut.write(\"<plot_precip_mm_yr>1150.645781</plot_precip_mm_yr>\");\n oOut.write(\"<plot_temp_C>12.88171785</plot_temp_C>\");\n oOut.write(\"<plot_latitude>55.37</plot_latitude>\");\n oOut.write(\"</plot>\");\n oOut.write(\"<trees>\");\n oOut.write(\"<tr_speciesList>\");\n oOut.write(\"<tr_species speciesName=\\\"Species_1\\\" />\");\n oOut.write(\"<tr_species speciesName=\\\"Species_2\\\" />\");\n oOut.write(\"<tr_species speciesName=\\\"Species_3\\\" />\");\n oOut.write(\"<tr_species speciesName=\\\"Species_4\\\" />\");\n oOut.write(\"<tr_species speciesName=\\\"Species_5\\\" />\");\n oOut.write(\"</tr_speciesList>\");\n oOut.write(\"<tr_seedDiam10Cm>0.1</tr_seedDiam10Cm>\");\n oOut.write(\"<tr_minAdultDBH>\");\n oOut.write(\"<tr_madVal species=\\\"Species_1\\\">10.0</tr_madVal>\");\n oOut.write(\"<tr_madVal species=\\\"Species_2\\\">10.0</tr_madVal>\");\n oOut.write(\"<tr_madVal species=\\\"Species_3\\\">10.0</tr_madVal>\");\n oOut.write(\"<tr_madVal species=\\\"Species_4\\\">10.0</tr_madVal>\");\n oOut.write(\"<tr_madVal species=\\\"Species_5\\\">10.0</tr_madVal>\");\n oOut.write(\"</tr_minAdultDBH>\");\n oOut.write(\"<tr_maxSeedlingHeight>\");\n oOut.write(\"<tr_mshVal species=\\\"Species_1\\\">1.35</tr_mshVal>\");\n oOut.write(\"<tr_mshVal species=\\\"Species_2\\\">1.35</tr_mshVal>\");\n oOut.write(\"<tr_mshVal species=\\\"Species_3\\\">1.35</tr_mshVal>\");\n oOut.write(\"<tr_mshVal species=\\\"Species_4\\\">1.35</tr_mshVal>\");\n oOut.write(\"<tr_mshVal species=\\\"Species_5\\\">1.35</tr_mshVal>\");\n oOut.write(\"</tr_maxSeedlingHeight>\");\n oOut.write(\"<tr_sizeClasses>\");\n oOut.write(\"<tr_sizeClass sizeKey=\\\"s1.0\\\"/>\");\n oOut.write(\"<tr_sizeClass sizeKey=\\\"s10.0\\\"/>\");\n oOut.write(\"<tr_sizeClass sizeKey=\\\"s20.0\\\"/>\");\n oOut.write(\"<tr_sizeClass sizeKey=\\\"s30.0\\\"/>\");\n oOut.write(\"<tr_sizeClass sizeKey=\\\"s40.0\\\"/>\");\n oOut.write(\"<tr_sizeClass sizeKey=\\\"s50.0\\\"/>\");\n oOut.write(\"</tr_sizeClasses>\");\n oOut.write(\"<tr_initialDensities>\");\n oOut.write(\"<tr_idVals whatSpecies=\\\"Species_1\\\">\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s20.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s30.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s40.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s50.0\\\">250</tr_initialDensity>\");\n oOut.write(\"</tr_idVals>\");\n oOut.write(\"<tr_idVals whatSpecies=\\\"Species_1\\\">\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s20.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s30.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s40.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s50.0\\\">250</tr_initialDensity>\");\n oOut.write(\"</tr_idVals>\");\n oOut.write(\"<tr_idVals whatSpecies=\\\"Species_2\\\">\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s20.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s30.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s40.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s50.0\\\">250</tr_initialDensity>\");\n oOut.write(\"</tr_idVals>\");\n oOut.write(\"<tr_idVals whatSpecies=\\\"Species_3\\\">\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s20.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s30.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s40.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s50.0\\\">250</tr_initialDensity>\");\n oOut.write(\"</tr_idVals>\");\n oOut.write(\"<tr_idVals whatSpecies=\\\"Species_4\\\">\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s20.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s30.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s40.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s50.0\\\">250</tr_initialDensity>\");\n oOut.write(\"</tr_idVals>\");\n oOut.write(\"<tr_idVals whatSpecies=\\\"Species_5\\\">\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s20.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s30.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s40.0\\\">250</tr_initialDensity>\");\n oOut.write(\"<tr_initialDensity sizeClass=\\\"s50.0\\\">250</tr_initialDensity>\");\n oOut.write(\"</tr_idVals>\");\n oOut.write(\"</tr_initialDensities>\");\n oOut.write(\"</trees>\");\n oOut.write(\"<allometry>\");\n oOut.write(\"<tr_canopyHeight>\");\n oOut.write(\"<tr_chVal species=\\\"Species_1\\\">39.48</tr_chVal>\");\n oOut.write(\"<tr_chVal species=\\\"Species_2\\\">39.48</tr_chVal>\");\n oOut.write(\"<tr_chVal species=\\\"Species_3\\\">39.48</tr_chVal>\");\n oOut.write(\"<tr_chVal species=\\\"Species_4\\\">39.48</tr_chVal>\");\n oOut.write(\"<tr_chVal species=\\\"Species_5\\\">39.48</tr_chVal>\");\n oOut.write(\"</tr_canopyHeight>\");\n oOut.write(\"<tr_stdAsympCrownRad>\");\n oOut.write(\"<tr_sacrVal species=\\\"Species_1\\\">0.0549</tr_sacrVal>\");\n oOut.write(\"<tr_sacrVal species=\\\"Species_2\\\">0.0549</tr_sacrVal>\");\n oOut.write(\"<tr_sacrVal species=\\\"Species_3\\\">0.0549</tr_sacrVal>\");\n oOut.write(\"<tr_sacrVal species=\\\"Species_4\\\">0.0549</tr_sacrVal>\");\n oOut.write(\"<tr_sacrVal species=\\\"Species_5\\\">0.0549</tr_sacrVal>\");\n oOut.write(\"</tr_stdAsympCrownRad>\");\n oOut.write(\"<tr_stdCrownRadExp>\");\n oOut.write(\"<tr_screVal species=\\\"Species_1\\\">1.0</tr_screVal>\");\n oOut.write(\"<tr_screVal species=\\\"Species_2\\\">1.0</tr_screVal>\");\n oOut.write(\"<tr_screVal species=\\\"Species_3\\\">1.0</tr_screVal>\");\n oOut.write(\"<tr_screVal species=\\\"Species_4\\\">1.0</tr_screVal>\");\n oOut.write(\"<tr_screVal species=\\\"Species_5\\\">1.0</tr_screVal>\");\n oOut.write(\"</tr_stdCrownRadExp>\");\n oOut.write(\"<tr_conversionDiam10ToDBH>\");\n oOut.write(\"<tr_cdtdVal species=\\\"Species_1\\\">0.8008</tr_cdtdVal>\");\n oOut.write(\"<tr_cdtdVal species=\\\"Species_2\\\">0.8008</tr_cdtdVal>\");\n oOut.write(\"<tr_cdtdVal species=\\\"Species_3\\\">0.8008</tr_cdtdVal>\");\n oOut.write(\"<tr_cdtdVal species=\\\"Species_4\\\">0.8008</tr_cdtdVal>\");\n oOut.write(\"<tr_cdtdVal species=\\\"Species_5\\\">0.8008</tr_cdtdVal>\");\n oOut.write(\"</tr_conversionDiam10ToDBH>\");\n oOut.write(\"<tr_interceptDiam10ToDBH>\");\n oOut.write(\"<tr_idtdVal species=\\\"Species_1\\\">0</tr_idtdVal>\");\n oOut.write(\"<tr_idtdVal species=\\\"Species_2\\\">0</tr_idtdVal>\");\n oOut.write(\"<tr_idtdVal species=\\\"Species_3\\\">0</tr_idtdVal>\");\n oOut.write(\"<tr_idtdVal species=\\\"Species_4\\\">0</tr_idtdVal>\");\n oOut.write(\"<tr_idtdVal species=\\\"Species_5\\\">0</tr_idtdVal>\");\n oOut.write(\"</tr_interceptDiam10ToDBH>\");\n oOut.write(\"<tr_stdAsympCrownHt>\");\n oOut.write(\"<tr_sachVal species=\\\"Species_1\\\">0.389</tr_sachVal>\");\n oOut.write(\"<tr_sachVal species=\\\"Species_2\\\">0.389</tr_sachVal>\");\n oOut.write(\"<tr_sachVal species=\\\"Species_3\\\">0.389</tr_sachVal>\");\n oOut.write(\"<tr_sachVal species=\\\"Species_4\\\">0.389</tr_sachVal>\");\n oOut.write(\"<tr_sachVal species=\\\"Species_5\\\">0.389</tr_sachVal>\");\n oOut.write(\"</tr_stdAsympCrownHt>\");\n oOut.write(\"<tr_stdCrownHtExp>\");\n oOut.write(\"<tr_scheVal species=\\\"Species_1\\\">1.0</tr_scheVal>\");\n oOut.write(\"<tr_scheVal species=\\\"Species_2\\\">1.0</tr_scheVal>\");\n oOut.write(\"<tr_scheVal species=\\\"Species_3\\\">1.0</tr_scheVal>\");\n oOut.write(\"<tr_scheVal species=\\\"Species_4\\\">1.0</tr_scheVal>\");\n oOut.write(\"<tr_scheVal species=\\\"Species_5\\\">1.0</tr_scheVal>\");\n oOut.write(\"</tr_stdCrownHtExp>\");\n oOut.write(\"<tr_slopeOfHeight-Diam10>\");\n oOut.write(\"<tr_sohdVal species=\\\"Species_1\\\">0.03418</tr_sohdVal>\");\n oOut.write(\"<tr_sohdVal species=\\\"Species_2\\\">0.03418</tr_sohdVal>\");\n oOut.write(\"<tr_sohdVal species=\\\"Species_3\\\">0.03418</tr_sohdVal>\");\n oOut.write(\"<tr_sohdVal species=\\\"Species_4\\\">0.03418</tr_sohdVal>\");\n oOut.write(\"<tr_sohdVal species=\\\"Species_5\\\">0.03418</tr_sohdVal>\");\n oOut.write(\"</tr_slopeOfHeight-Diam10>\");\n oOut.write(\"<tr_slopeOfAsymHeight>\");\n oOut.write(\"<tr_soahVal species=\\\"Species_1\\\">0.0299</tr_soahVal>\");\n oOut.write(\"<tr_soahVal species=\\\"Species_2\\\">0.0299</tr_soahVal>\");\n oOut.write(\"<tr_soahVal species=\\\"Species_3\\\">0.0299</tr_soahVal>\");\n oOut.write(\"<tr_soahVal species=\\\"Species_4\\\">0.0299</tr_soahVal>\");\n oOut.write(\"<tr_soahVal species=\\\"Species_5\\\">0.0299</tr_soahVal>\");\n oOut.write(\"</tr_slopeOfAsymHeight>\");\n oOut.write(\"<tr_whatSeedlingHeightDiam>\");\n oOut.write(\"<tr_wsehdVal species=\\\"Species_1\\\">0</tr_wsehdVal>\");\n oOut.write(\"<tr_wsehdVal species=\\\"Species_2\\\">0</tr_wsehdVal>\");\n oOut.write(\"<tr_wsehdVal species=\\\"Species_3\\\">0</tr_wsehdVal>\");\n oOut.write(\"<tr_wsehdVal species=\\\"Species_4\\\">0</tr_wsehdVal>\");\n oOut.write(\"<tr_wsehdVal species=\\\"Species_5\\\">0</tr_wsehdVal>\");\n oOut.write(\"</tr_whatSeedlingHeightDiam>\");\n oOut.write(\"<tr_whatSaplingHeightDiam>\");\n oOut.write(\"<tr_wsahdVal species=\\\"Species_1\\\">0</tr_wsahdVal>\");\n oOut.write(\"<tr_wsahdVal species=\\\"Species_2\\\">0</tr_wsahdVal>\");\n oOut.write(\"<tr_wsahdVal species=\\\"Species_3\\\">0</tr_wsahdVal>\");\n oOut.write(\"<tr_wsahdVal species=\\\"Species_4\\\">0</tr_wsahdVal>\");\n oOut.write(\"<tr_wsahdVal species=\\\"Species_5\\\">0</tr_wsahdVal>\");\n oOut.write(\"</tr_whatSaplingHeightDiam>\");\n oOut.write(\"<tr_whatAdultHeightDiam>\");\n oOut.write(\"<tr_wahdVal species=\\\"Species_1\\\">0</tr_wahdVal>\");\n oOut.write(\"<tr_wahdVal species=\\\"Species_2\\\">0</tr_wahdVal>\");\n oOut.write(\"<tr_wahdVal species=\\\"Species_3\\\">0</tr_wahdVal>\");\n oOut.write(\"<tr_wahdVal species=\\\"Species_4\\\">0</tr_wahdVal>\");\n oOut.write(\"<tr_wahdVal species=\\\"Species_5\\\">0</tr_wahdVal>\");\n oOut.write(\"</tr_whatAdultHeightDiam>\");\n oOut.write(\"<tr_whatAdultCrownRadDiam>\");\n oOut.write(\"<tr_wacrdVal species=\\\"Species_1\\\">0</tr_wacrdVal>\");\n oOut.write(\"<tr_wacrdVal species=\\\"Species_2\\\">0</tr_wacrdVal>\");\n oOut.write(\"<tr_wacrdVal species=\\\"Species_3\\\">0</tr_wacrdVal>\");\n oOut.write(\"<tr_wacrdVal species=\\\"Species_4\\\">0</tr_wacrdVal>\");\n oOut.write(\"<tr_wacrdVal species=\\\"Species_5\\\">0</tr_wacrdVal>\");\n oOut.write(\"</tr_whatAdultCrownRadDiam>\");\n oOut.write(\"<tr_whatAdultCrownHeightHeight>\");\n oOut.write(\"<tr_wachhVal species=\\\"Species_1\\\">0</tr_wachhVal>\");\n oOut.write(\"<tr_wachhVal species=\\\"Species_2\\\">0</tr_wachhVal>\");\n oOut.write(\"<tr_wachhVal species=\\\"Species_3\\\">0</tr_wachhVal>\");\n oOut.write(\"<tr_wachhVal species=\\\"Species_4\\\">0</tr_wachhVal>\");\n oOut.write(\"<tr_wachhVal species=\\\"Species_5\\\">0</tr_wachhVal>\");\n oOut.write(\"</tr_whatAdultCrownHeightHeight>\");\n oOut.write(\"<tr_whatSaplingCrownRadDiam>\");\n oOut.write(\"<tr_wscrdVal species=\\\"Species_1\\\">0</tr_wscrdVal>\");\n oOut.write(\"<tr_wscrdVal species=\\\"Species_2\\\">0</tr_wscrdVal>\");\n oOut.write(\"<tr_wscrdVal species=\\\"Species_3\\\">0</tr_wscrdVal>\");\n oOut.write(\"<tr_wscrdVal species=\\\"Species_4\\\">0</tr_wscrdVal>\");\n oOut.write(\"<tr_wscrdVal species=\\\"Species_5\\\">0</tr_wscrdVal>\");\n oOut.write(\"</tr_whatSaplingCrownRadDiam>\");\n oOut.write(\"<tr_whatSaplingCrownHeightHeight>\");\n oOut.write(\"<tr_wschhVal species=\\\"Species_1\\\">0</tr_wschhVal>\");\n oOut.write(\"<tr_wschhVal species=\\\"Species_2\\\">0</tr_wschhVal>\");\n oOut.write(\"<tr_wschhVal species=\\\"Species_3\\\">0</tr_wschhVal>\");\n oOut.write(\"<tr_wschhVal species=\\\"Species_4\\\">0</tr_wschhVal>\");\n oOut.write(\"<tr_wschhVal species=\\\"Species_5\\\">0</tr_wschhVal>\");\n oOut.write(\"</tr_whatSaplingCrownHeightHeight>\");\n oOut.write(\"</allometry>\");\n oOut.write(\"<behaviorList>\");\n oOut.write(\"<behavior>\");\n oOut.write(\"<behaviorName>QualityVigorClassifier</behaviorName>\");\n oOut.write(\"<version>1</version>\");\n oOut.write(\"<listPosition>1</listPosition>\");\n oOut.write(\"<applyTo species=\\\"Species_2\\\" type=\\\"Adult\\\"/>\");\n oOut.write(\"<applyTo species=\\\"Species_3\\\" type=\\\"Adult\\\"/>\");\n oOut.write(\"<applyTo species=\\\"Species_4\\\" type=\\\"Adult\\\"/>\");\n oOut.write(\"<applyTo species=\\\"Species_5\\\" type=\\\"Adult\\\"/>\");\n oOut.write(\"</behavior>\");\n oOut.write(\"</behaviorList>\");\n oOut.write(\"<QualityVigorClassifier1>\");\n oOut.write(\"<ma_classifierInitialConditions>\");\n oOut.write(\"<ma_classifierSizeClass>\");\n oOut.write(\"<ma_classifierBeginDBH>10</ma_classifierBeginDBH>\");\n oOut.write(\"<ma_classifierEndDBH>20</ma_classifierEndDBH>\");\n oOut.write(\"<ma_classifierProbVigorous>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_2\\\">0.78</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_3\\\">0.88</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_4\\\">0</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_5\\\">0.61</ma_cpvVal>\");\n oOut.write(\"</ma_classifierProbVigorous>\");\n oOut.write(\"<ma_classifierProbSawlog>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_2\\\">0.33</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_3\\\">0.64</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_4\\\">1</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_5\\\">0.55</ma_cpsVal>\");\n oOut.write(\"</ma_classifierProbSawlog>\");\n oOut.write(\"</ma_classifierSizeClass>\");\n oOut.write(\"<ma_classifierSizeClass>\");\n oOut.write(\"<ma_classifierBeginDBH>20</ma_classifierBeginDBH>\");\n oOut.write(\"<ma_classifierEndDBH>30</ma_classifierEndDBH>\");\n oOut.write(\"<ma_classifierProbVigorous>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_2\\\">0.33</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_3\\\">0.81</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_4\\\">0.64</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_5\\\">0.32</ma_cpvVal>\");\n oOut.write(\"</ma_classifierProbVigorous>\");\n oOut.write(\"<ma_classifierProbSawlog>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_2\\\">0.32</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_3\\\">0.69</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_4\\\">0.33</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_5\\\">0.58</ma_cpsVal>\");\n oOut.write(\"</ma_classifierProbSawlog>\");\n oOut.write(\"</ma_classifierSizeClass>\");\n oOut.write(\"<ma_classifierSizeClass>\");\n oOut.write(\"<ma_classifierBeginDBH>30</ma_classifierBeginDBH>\");\n oOut.write(\"<ma_classifierEndDBH>40</ma_classifierEndDBH>\");\n oOut.write(\"<ma_classifierProbVigorous>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_2\\\">0.34</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_3\\\">0.57</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_4\\\">0.26</ma_cpvVal>\");\n oOut.write(\"<ma_cpvVal species=\\\"Species_5\\\">0.46</ma_cpvVal>\");\n oOut.write(\"</ma_classifierProbVigorous>\");\n oOut.write(\"<ma_classifierProbSawlog>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_2\\\">0.13</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_3\\\">0.36</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_4\\\">0.66</ma_cpsVal>\");\n oOut.write(\"<ma_cpsVal species=\\\"Species_5\\\">0.45</ma_cpsVal>\");\n oOut.write(\"</ma_classifierProbSawlog>\");\n oOut.write(\"</ma_classifierSizeClass>\");\n oOut.write(\"</ma_classifierInitialConditions>\");\n oOut.write(\"<ma_classifierVigBeta0>\");\n oOut.write(\"<ma_cvb0Val species=\\\"Species_2\\\">0.1</ma_cvb0Val>\");\n oOut.write(\"<ma_cvb0Val species=\\\"Species_3\\\">0</ma_cvb0Val>\");\n oOut.write(\"<ma_cvb0Val species=\\\"Species_4\\\">0.3</ma_cvb0Val>\");\n oOut.write(\"<ma_cvb0Val species=\\\"Species_5\\\">0.4</ma_cvb0Val>\");\n oOut.write(\"</ma_classifierVigBeta0>\");\n oOut.write(\"<ma_classifierVigBeta11>\");\n oOut.write(\"<ma_cvb11Val species=\\\"Species_2\\\">0.2</ma_cvb11Val>\");\n oOut.write(\"<ma_cvb11Val species=\\\"Species_3\\\">2.35</ma_cvb11Val>\");\n oOut.write(\"<ma_cvb11Val species=\\\"Species_4\\\">0.1</ma_cvb11Val>\");\n oOut.write(\"<ma_cvb11Val species=\\\"Species_5\\\">2.43</ma_cvb11Val>\");\n oOut.write(\"</ma_classifierVigBeta11>\");\n oOut.write(\"<ma_classifierVigBeta12>\");\n oOut.write(\"<ma_cvb12Val species=\\\"Species_2\\\">-2.3</ma_cvb12Val>\");\n oOut.write(\"<ma_cvb12Val species=\\\"Species_3\\\">1.12</ma_cvb12Val>\");\n oOut.write(\"<ma_cvb12Val species=\\\"Species_4\\\">0.32</ma_cvb12Val>\");\n oOut.write(\"<ma_cvb12Val species=\\\"Species_5\\\">1.3</ma_cvb12Val>\");\n oOut.write(\"</ma_classifierVigBeta12>\");\n oOut.write(\"<ma_classifierVigBeta13>\");\n oOut.write(\"<ma_cvb13Val species=\\\"Species_2\\\">0.13</ma_cvb13Val>\");\n oOut.write(\"<ma_cvb13Val species=\\\"Species_3\\\">1</ma_cvb13Val>\");\n oOut.write(\"<ma_cvb13Val species=\\\"Species_4\\\">-0.2</ma_cvb13Val>\");\n oOut.write(\"<ma_cvb13Val species=\\\"Species_5\\\">1</ma_cvb13Val>\");\n oOut.write(\"</ma_classifierVigBeta13>\");\n oOut.write(\"<ma_classifierVigBeta14>\");\n oOut.write(\"<ma_cvb14Val species=\\\"Species_2\\\">0.9</ma_cvb14Val>\");\n oOut.write(\"<ma_cvb14Val species=\\\"Species_3\\\">0</ma_cvb14Val>\");\n oOut.write(\"<ma_cvb14Val species=\\\"Species_4\\\">-1</ma_cvb14Val>\");\n oOut.write(\"<ma_cvb14Val species=\\\"Species_5\\\">0</ma_cvb14Val>\");\n oOut.write(\"</ma_classifierVigBeta14>\");\n oOut.write(\"<ma_classifierVigBeta15>\");\n oOut.write(\"<ma_cvb15Val species=\\\"Species_2\\\">1</ma_cvb15Val>\");\n oOut.write(\"<ma_cvb15Val species=\\\"Species_3\\\">0.25</ma_cvb15Val>\");\n oOut.write(\"<ma_cvb15Val species=\\\"Species_4\\\">1</ma_cvb15Val>\");\n oOut.write(\"<ma_cvb15Val species=\\\"Species_5\\\">-0.45</ma_cvb15Val>\");\n oOut.write(\"</ma_classifierVigBeta15>\");\n oOut.write(\"<ma_classifierVigBeta16>\");\n oOut.write(\"<ma_cvb16Val species=\\\"Species_2\\\">1</ma_cvb16Val>\");\n oOut.write(\"<ma_cvb16Val species=\\\"Species_3\\\">0.36</ma_cvb16Val>\");\n oOut.write(\"<ma_cvb16Val species=\\\"Species_4\\\">0</ma_cvb16Val>\");\n oOut.write(\"<ma_cvb16Val species=\\\"Species_5\\\">0.46</ma_cvb16Val>\");\n oOut.write(\"</ma_classifierVigBeta16>\");\n oOut.write(\"<ma_classifierVigBeta2>\");\n oOut.write(\"<ma_cvb2Val species=\\\"Species_2\\\">0.01</ma_cvb2Val>\");\n oOut.write(\"<ma_cvb2Val species=\\\"Species_3\\\">0.02</ma_cvb2Val>\");\n oOut.write(\"<ma_cvb2Val species=\\\"Species_4\\\">0.04</ma_cvb2Val>\");\n oOut.write(\"<ma_cvb2Val species=\\\"Species_5\\\">0.1</ma_cvb2Val>\");\n oOut.write(\"</ma_classifierVigBeta2>\");\n oOut.write(\"<ma_classifierVigBeta3>\");\n oOut.write(\"<ma_cvb3Val species=\\\"Species_2\\\">0.001</ma_cvb3Val>\");\n oOut.write(\"<ma_cvb3Val species=\\\"Species_3\\\">0.2</ma_cvb3Val>\");\n oOut.write(\"<ma_cvb3Val species=\\\"Species_4\\\">0.3</ma_cvb3Val>\");\n oOut.write(\"<ma_cvb3Val species=\\\"Species_5\\\">0.4</ma_cvb3Val>\");\n oOut.write(\"</ma_classifierVigBeta3>\");\n oOut.write(\"<ma_classifierQualBeta0>\");\n oOut.write(\"<ma_cqb0Val species=\\\"Species_2\\\">0.25</ma_cqb0Val>\");\n oOut.write(\"<ma_cqb0Val species=\\\"Species_3\\\">1.13</ma_cqb0Val>\");\n oOut.write(\"<ma_cqb0Val species=\\\"Species_4\\\">0</ma_cqb0Val>\");\n oOut.write(\"<ma_cqb0Val species=\\\"Species_5\\\">1.15</ma_cqb0Val>\");\n oOut.write(\"</ma_classifierQualBeta0>\");\n oOut.write(\"<ma_classifierQualBeta11>\");\n oOut.write(\"<ma_cqb11Val species=\\\"Species_2\\\">0.36</ma_cqb11Val>\");\n oOut.write(\"<ma_cqb11Val species=\\\"Species_3\\\">0</ma_cqb11Val>\");\n oOut.write(\"<ma_cqb11Val species=\\\"Species_4\\\">0.4</ma_cqb11Val>\");\n oOut.write(\"<ma_cqb11Val species=\\\"Species_5\\\">0</ma_cqb11Val>\");\n oOut.write(\"</ma_classifierQualBeta11>\");\n oOut.write(\"<ma_classifierQualBeta12>\");\n oOut.write(\"<ma_cqb12Val species=\\\"Species_2\\\">0.02</ma_cqb12Val>\");\n oOut.write(\"<ma_cqb12Val species=\\\"Species_3\\\">10</ma_cqb12Val>\");\n oOut.write(\"<ma_cqb12Val species=\\\"Species_4\\\">0.3</ma_cqb12Val>\");\n oOut.write(\"<ma_cqb12Val species=\\\"Species_5\\\">30</ma_cqb12Val>\");\n oOut.write(\"</ma_classifierQualBeta12>\");\n oOut.write(\"<ma_classifierQualBeta13>\");\n oOut.write(\"<ma_cqb13Val species=\\\"Species_2\\\">0.2</ma_cqb13Val>\");\n oOut.write(\"<ma_cqb13Val species=\\\"Species_3\\\">10</ma_cqb13Val>\");\n oOut.write(\"<ma_cqb13Val species=\\\"Species_4\\\">-0.3</ma_cqb13Val>\");\n oOut.write(\"<ma_cqb13Val species=\\\"Species_5\\\">30</ma_cqb13Val>\");\n oOut.write(\"</ma_classifierQualBeta13>\");\n oOut.write(\"<ma_classifierQualBeta14>\");\n oOut.write(\"<ma_cqb14Val species=\\\"Species_2\\\">-0.2</ma_cqb14Val>\");\n oOut.write(\"<ma_cqb14Val species=\\\"Species_3\\\">10</ma_cqb14Val>\");\n oOut.write(\"<ma_cqb14Val species=\\\"Species_4\\\">-0.4</ma_cqb14Val>\");\n oOut.write(\"<ma_cqb14Val species=\\\"Species_5\\\">30</ma_cqb14Val>\");\n oOut.write(\"</ma_classifierQualBeta14>\");\n oOut.write(\"<ma_classifierQualBeta2>\");\n oOut.write(\"<ma_cqb2Val species=\\\"Species_2\\\">-0.2</ma_cqb2Val>\");\n oOut.write(\"<ma_cqb2Val species=\\\"Species_3\\\">10</ma_cqb2Val>\");\n oOut.write(\"<ma_cqb2Val species=\\\"Species_4\\\">0</ma_cqb2Val>\");\n oOut.write(\"<ma_cqb2Val species=\\\"Species_5\\\">30</ma_cqb2Val>\");\n oOut.write(\"</ma_classifierQualBeta2>\");\n oOut.write(\"<ma_classifierQualBeta3>\");\n oOut.write(\"<ma_cqb3Val species=\\\"Species_2\\\">1</ma_cqb3Val>\");\n oOut.write(\"<ma_cqb3Val species=\\\"Species_3\\\">10</ma_cqb3Val>\");\n oOut.write(\"<ma_cqb3Val species=\\\"Species_4\\\">0.1</ma_cqb3Val>\");\n oOut.write(\"<ma_cqb3Val species=\\\"Species_5\\\">30</ma_cqb3Val>\");\n oOut.write(\"</ma_classifierQualBeta3>\");\n oOut.write(\"<ma_classifierNewAdultProbVigorous>\");\n oOut.write(\"<ma_cnapvVal species=\\\"Species_2\\\">0.1</ma_cnapvVal>\");\n oOut.write(\"<ma_cnapvVal species=\\\"Species_3\\\">0.25</ma_cnapvVal>\");\n oOut.write(\"<ma_cnapvVal species=\\\"Species_4\\\">0.5</ma_cnapvVal>\");\n oOut.write(\"<ma_cnapvVal species=\\\"Species_5\\\">0.74</ma_cnapvVal>\");\n oOut.write(\"</ma_classifierNewAdultProbVigorous>\");\n oOut.write(\"<ma_classifierNewAdultProbSawlog>\");\n oOut.write(\"<ma_cnapsVal species=\\\"Species_2\\\">0.9</ma_cnapsVal>\");\n oOut.write(\"<ma_cnapsVal species=\\\"Species_3\\\">0.25</ma_cnapsVal>\");\n oOut.write(\"<ma_cnapsVal species=\\\"Species_4\\\">0.3</ma_cnapsVal>\");\n oOut.write(\"<ma_cnapsVal species=\\\"Species_5\\\">0.74</ma_cnapsVal>\");\n oOut.write(\"</ma_classifierNewAdultProbSawlog>\");\n oOut.write(\"<ma_classifierDeciduous>\");\n oOut.write(\"<ma_cdVal species=\\\"Species_2\\\">1</ma_cdVal>\");\n oOut.write(\"<ma_cdVal species=\\\"Species_3\\\">0</ma_cdVal>\");\n oOut.write(\"<ma_cdVal species=\\\"Species_4\\\">1</ma_cdVal>\");\n oOut.write(\"<ma_cdVal species=\\\"Species_5\\\">0</ma_cdVal>\");\n oOut.write(\"</ma_classifierDeciduous>\");\n oOut.write(\"</QualityVigorClassifier1>\");\n oOut.write(\"</paramFile>\");\n\n oOut.close();\n return sFileName;\n }", "public static void writeSave(String filepath, ISaveConfiguration scores) {\n try {\n Element root = Writer.buildDocumentWithRoot(DATA_TYPE);\n Document document = root.getOwnerDocument();\n\n addSaves(document, root, scores);\n\n Writer.writeOutput(document, filepath);\n } catch (TransformerException e) {\n throw new XMLException(e, Factory.UNKNOWN_ERROR);\n }\n }", "public static void writeUAV(){\n System.out.println(\"Writing new UAV\");\n Document dom;\n Element e = null;\n\n DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n try {\n DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();\n dom = documentBuilder.newDocument();\n Element rootElement = dom.createElement(\"UAV\");\n\n // Create the name tag and write the name data\n e = dom.createElement(\"name\");\n e.appendChild(dom.createTextNode(name.getText()));\n rootElement.appendChild(e);\n\n // Create the weight tag and write the weight data\n e = dom.createElement(\"weight\");\n e.appendChild(dom.createTextNode(weight.getText()));\n rootElement.appendChild(e);\n\n // Create the turn radius tag and write the turn radius data\n e = dom.createElement(\"turn_radius\");\n e.appendChild(dom.createTextNode(turnRadius.getText()));\n rootElement.appendChild(e);\n\n // Create the max incline angle tag and write the max incline angle data\n e = dom.createElement(\"max_incline\");\n e.appendChild(dom.createTextNode(maxIncline.getText()));\n rootElement.appendChild(e);\n\n // Create the battery type tag and write the battery type data\n e = dom.createElement(\"battery\");\n e.appendChild(dom.createTextNode(battery.getText()));\n rootElement.appendChild(e);\n\n // Create the battery capacity tag and write the battery capacity data\n e = dom.createElement(\"battery_capacity\");\n e.appendChild(dom.createTextNode(batteryCapacity.getText()));\n rootElement.appendChild(e);\n\n dom.appendChild(rootElement);\n\n // Set the transforms to make the XML document\n Transformer tr = TransformerFactory.newInstance().newTransformer();\n tr.setOutputProperty(OutputKeys.INDENT,\"yes\");\n tr.setOutputProperty(OutputKeys.METHOD,\"xml\");\n tr.setOutputProperty(OutputKeys.ENCODING,\"UTF-8\");\n //tr.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,\"uav.dtd\");\n tr.setOutputProperty(\"{http://xml.apache.org/xslt}indent-amount\",\"4\");\n\n // Write the data to the file\n tr.transform(new DOMSource(dom),new StreamResult(\n new FileOutputStream(\"src/uavs/\"+name.getText()+\".uav\")));\n\n }catch (IOException | ParserConfigurationException | TransformerException ioe){\n ioe.printStackTrace();\n // If error, show dialog box with the error message\n // If error, show dialog box with the error message\n Dialog.showDialog(\"Unable to write to write camera settings.\\n\\n\" +\n \"Ensure that \" + path + \" is visible by the application.\",\"Unable to write settings\");\n }\n }", "private static void saveToFile(String xmlExtrato, ArrayList diretorios, String sessionId)\n\t{\n\t try\n\t {\n\t //Percorrendo a lista de diretorios e verificando se existe algum valido.\n\t for(int i = 0; i < diretorios.size(); i++)\n\t {\n\t File diretorio = new File((String)diretorios.get(i));\n\t if((diretorio.exists()) && (diretorio.isDirectory()))\n\t {\n\t \t //Salvando o xml em arquivo\n\t \t String fileName = diretorios.get(i) + File.separator + sessionId;\n\t \t File fileExtrato = new File(fileName);\n\t \t FileWriter writer = new FileWriter(fileExtrato);\n\t \t writer.write(xmlExtrato);\n\t \t writer.close();\n\t \t break;\n\t }\n\t }\n\t }\n\t catch(Exception e)\n\t {\n\t e.printStackTrace();\n\t }\n\t}", "public void save() {\n JAXB.marshal(this, new File(fileName));\n }", "public void createXMLFileForCertificate(Report report) {\n\ttry{\n\t\tFile outDir = new File(report.getXmlFilePath()); \n\t\tboolean isDirCreated = outDir.mkdirs();\n\t\tif (isDirCreated)\n\t\t\tlogger.info(\"In FileUploadDownload class fileUpload() method: upload file folder location created.\");\n\t\telse\n\t\t\tlogger.info(\"In FileUploadDownload class fileUpload() method: upload file folder location already exist.\");\n\t\t\n\t\tDocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n\t\tDocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n\t\t\n\t\t// root elements\n\t\tDocument doc = docBuilder.newDocument();\n\t\tElement rootElement = doc.createElement(\"root\");\n\t\tdoc.appendChild(rootElement);\n\t\n\t\t\tfor(Student student : report.getStudentList()){\n\t\t\t\t\t\n\t\t\t\tElement studentList = doc.createElement(\"student\");\n\t\t\t\trootElement.appendChild(studentList);\n\t\t\t\t\n\t\t\t\tElement schoolname = doc.createElement(\"schoolname\");\n\t\t\t\tschoolname.appendChild(doc.createTextNode((report.getSchoolDetails().getSchoolDetailsName() != null ? report.getSchoolDetails().getSchoolDetailsName() : \"\" )));\n\t\t\t\tstudentList.appendChild(schoolname);\n\t\t\t\t\n\t\t\t\tElement academicYear = doc.createElement(\"academicYear\");\n\t\t\t\tacademicYear.appendChild(doc.createTextNode((String) (report.getAcademicYear().getAcademicYearName()!= null ? report.getAcademicYear().getAcademicYearName() : \"\" )));\n\t\t\t\tstudentList.appendChild(academicYear);\n\t\t\t\t\n\t\t\t\tElement roll = doc.createElement(\"roll\");\n\t\t\t\troll.appendChild(doc.createTextNode((student.getRollNumber().toString()!=null?student.getRollNumber().toString():\"---------\")));\n\t\t\t\tstudentList.appendChild(roll);\n\t\t\t\t\n\t\t\t\t// nickname elements\n\t\t\t\tElement studentname = doc.createElement(\"studentname\");\n\t\t\t\tstudentname.appendChild(doc.createTextNode((student.getStudentName()!=null?student.getStudentName():\"---------------\")));\n\t\t\t\tstudentList.appendChild(studentname);\n\t\t\t\n\t\t\t\t\n\t\t\t\tElement house = doc.createElement(\"house\");\n\t\t\t\thouse.appendChild(doc.createTextNode((student.getHouse()!=null?student.getHouse():\"------\")));\n\t\t\t\tstudentList.appendChild(house);\n\t\t\t\n\t\t\t\tElement standard = doc.createElement(\"standard\");\n\t\t\t\tstandard.appendChild(doc.createTextNode((student.getStandard()!=null?student.getStandard():\"------\")));\n\t\t\t\tstudentList.appendChild(standard);\n\t\t\t\n\t\t\t\tElement section = doc.createElement(\"section\");\n\t\t\t\tsection.appendChild(doc.createTextNode((student.getSection()!=null?student.getSection():\"--------\")));\n\t\t\t\tstudentList.appendChild(section);\n\t\t\t\t\n\t\t\t//\tStudentResult setudentResult = new\n\t\t\t\t\n\t\t\t\tElement exam = doc.createElement(\"exam\");\n\t\t\t\texam.appendChild(doc.createTextNode((student.getStudentResultList().get(0).getExam()!=null?student.getStudentResultList().get(0).getExam():\"--------\")));\n\t\t\t\tstudentList.appendChild(exam);\n\t\t\t}\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(doc);\t\t\n\t\t\tStreamResult result = new StreamResult(new File(report.getXmlFilePath()+report.getXmlFileName()));\n\t\t\t\n\t\t\t// Output to console for testing\n\t\t\t// StreamResult result = new StreamResult(System.out);\t\t\t\n\t\t\ttransformer.transform(source, result);\n\t\t}catch (ParserConfigurationException pce) {\n\t\t\tlogger.error(\"\",pce);\n\t\t} catch (TransformerException tfe) {\n\t\t\tlogger.error(tfe);\n\t\t}\n\t}", "public void saveXMLConfig() {\n\n\t\t// Get the Carma namespace\n\t\tNamespace ns = Namespace.getNamespace(\"Carma\",\n\t\t\t\t\"http://www.mmarray.org\");\n\n\t\t// Update NameServers. First remove them all, then add since\n\t\t// the number of them could have changed\n\t\tElement nameserversElement = _root.getChild(\"pdbi\", ns)\n\t\t .getChild(\"nameServers\", ns);\n\t\tnameserversElement.removeChildren(\"nameServer\", ns);\n\n\t\t// Set the new children one at a time\n\t\tfor (int i = 0; i < _nameservers.size(); i++) {\n\t\t\t nameserversElement.addContent( new Element(\"nameServer\", ns).\n\t\t\t addContent(new Element(\"identifier\", ns).\n\t\t\t\t setText((String)_nameservers.get(i))));\n\t\t}\n\n\t\t// Update NameServerPorts. First remove them all, then add since\n\t\t// the number of them could have changed\n\t\tElement nameserverPortsElement = _root.getChild(\"pdbi\", ns)\n\t\t .getChild(\"nameServerPorts\", ns);\n\t\tnameserverPortsElement.removeChildren(\"nameServerPort\", ns);\n\n\t\t// Set the new children one at a time\n\t\tfor (int i = 0; i < _nameserverPorts.size(); i++) {\n\t\t\t nameserverPortsElement.addContent( new Element(\"nameServerPort\",\n\t\t\t ns).\n\t\t\t addContent(new Element(\"pidentifier\", ns).\n\t\t\t\t setText((String)_nameserverPorts.get(i))));\n\t\t}\n\n\t\t// Update obsRecord Event Channel Name\n\t\t_root.getChild(\"server\", ns)\n\t\t .getChild(\"obsRecordEventChannelName\", ns)\n\t\t .setText(_obsRecordEventChannelName);\n\t}", "int writeTo(OutputStream out, boolean withXmlDecl) throws IOException;", "void writeToPath(Path path, TypeSystem typeSystem) throws IOException, SAXException;", "public void logToXML( Resource output ) {\r\n\t\ttry( OutputStream out = output.newOutputStream() ) {\r\n\t\t\tlogToXML( out );\r\n\t\t} catch( IOException e ) {\r\n\t\t\tthrow new FatalIOException( e );\r\n\t\t}\r\n\t}", "public org.dom4j.Element writeXML() throws Exception {\n return writeXML(sObjName);\n }", "public org.dom4j.Element writeXML() throws Exception {\n return writeXML(sObjName);\n }", "public void logToXML( OutputStream out ) {\r\n\t\tdbVersion.logToXML( out, Charset.forName( \"UTF-8\" ) );\r\n\t}", "private static void createFile(String fileType) throws Exception {\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"yyyy-MM-dd-HH-mm-ss\");\n LocalDateTime now = LocalDateTime.now();\n File xmlFile = new File(System.getProperty(\"user.dir\")+\"/data/saved/\"+dtf.format(now) + fileType + \".xml\");\n OutputFormat out = new OutputFormat();\n out.setIndent(5);\n FileOutputStream fos = new FileOutputStream(xmlFile);\n XML11Serializer serializer = new XML11Serializer(fos, out);\n serializer.serialize(xmlDoc);\n\n }", "public void exportXML() throws Exception{\n\t\t \n\t\t try {\n\n\t // create DOMSource for source XML document\n\t\t Source xmlSource = new DOMSource(convertStringToDocument(iet.editorPane.getText()));\n\t\t \n\t\t JFileChooser c = new JFileChooser();\n\t\t\t\t\n\t\t\t\tint rVal = c.showSaveDialog(null);\n\t\t\t\tString name = c.getSelectedFile().getAbsolutePath() + \".xml\";\n\t \n\t File f = new File(name);\n\t \n\t if (rVal == JFileChooser.APPROVE_OPTION) {\n\n\t\t // create StreamResult for transformation result\n\t\t Result result = new StreamResult(new FileOutputStream(f));\n\n\t\t // create TransformerFactory\n\t\t TransformerFactory transformerFactory = TransformerFactory.newInstance();\n\n\t\t // create Transformer for transformation\n\t\t Transformer transformer = transformerFactory.newTransformer();\n\t\t transformer.setOutputProperty(\"indent\", \"yes\");\n\n\t\t // transform and deliver content to client\n\t\t transformer.transform(xmlSource, result);\n\t\t \n\t\t }\n\t\t }\n\t\t // handle exception creating TransformerFactory\n\t\t catch (TransformerFactoryConfigurationError factoryError) {\n\t\t System.err.println(\"Error creating \" + \"TransformerFactory\");\n\t\t factoryError.printStackTrace();\n\t\t } // end catch 1\n\t\t \t catch (TransformerException transformerError) {\n\t\t System.err.println(\"Error transforming document\");\n\t\t transformerError.printStackTrace();\n\t\t } //end catch 2 \n\t\t \t catch (IOException ioException) {\n\t\t ioException.printStackTrace();\n\t\t } // end catch 3\n\t\t \n\t }", "public void setUpNewXMLFile(File file) {\n\t\tPrintWriter pw = null;\n\t\ttry {\n\t\t\tpw = new PrintWriter(file, \"UTF-8\");\n\t\t\tpw.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?>\\n\");\n\t\t\tpw.write(\"<\" + defaultDocumentElement + \">\\n\");\n\t\t\tpw.write(\"</\" + defaultDocumentElement + \">\\n\");\n\t\t\tpw.close();\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(\"Error creating new XML File.\");\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tpw.close();\n\t\t\t} catch(Exception e) {\n\t\t\t\t//Seems like it was already closed.\n\t\t\t}\n\t\t}\n\t}", "public void writeTo(XMLOutput writer) throws IOException {\n ArrayList<String> actualLines = new ArrayList<String>(30);\n for (String line: build().getLog(30)) {\n if (line.trim().isEmpty()) continue; // Skip empty line to save space\n if (line.contains(\"Building \") && line.contains(\" in workspace \")) {\n // Try to detect start of the build\n actualLines.clear();\n }\n\n actualLines.add(line);\n\n if (line.contains(\"' marked build as failure\")) break; // End of build, the rest it not interesting\n }\n\n final Writer wrtr = writer.asWriter();\n for (String line: actualLines) {\n wrtr.write(line);\n wrtr.write('\\n');\n }\n }", "void save() {\n File file = new File(main.myPath + \"state.xml\");\n Framework.backup(main.myPath + \"state.xml\");\n Framework.transform(stateDoc, new StreamResult(file), null);\n setDirty(false);\n }", "XMLOut(String LegendFile, String start)\n\t\t{\n\t\t\tFileOutputStream fileStream = null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfileStream = new FileOutputStream(LegendFile);\n\t\t\t} catch (Exception e)\n\t\t\t{\n\t\t\t\tDebug.e(\"XMLOut(): \" + e);\n\t\t\t}\n\t\t\tXMLStream = new PrintStream(fileStream);\n\t\t\tstack = new String[top];\n\t\t\tsp = 0;\n\t\t\tpush(start);\n\t\t}", "public void saveTimeline(Timeline timeline, File file) throws Exception {\n\n\t\tJAXBContext context = JAXBContext.newInstance(Timeline.class);\n\t\tMarshaller marshaller = context.createMarshaller();\n\t\tmarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n\t\tmarshaller.marshal(timeline, file);\n\n\t}", "public void saveToXml(String path) throws Exception {\n\t\tDocument doc = XmlHelper.newDocument(\"holiday-rules\");\n\t\t\n\t\tfor (HolidayRule rule : this) {\n\t\t\trule.saveToXml(doc.getDocumentElement());\n\t\t}\n\t\t\n\t\tXmlHelper.saveFile(doc, path);\n\t}", "static void xmlWriter(Document doc, DocWriteDOM dwrite, String name, String dirPath, String dirOut, String tag) {\n NodeList nList = doc.getElementsByTagName(\"ods:\" + tag);\n String id=\"\";\n\n for (int temp = 0; temp < nList.getLength(); temp++) {\n Node nNode = nList.item(temp);\n \n if (nNode.getNodeType() == Node.ELEMENT_NODE) {\n Element eElement = (Element) nNode;\n id=eElement.getElementsByTagName(\"identifier\").item(0).getTextContent();\n dwrite.createEventXml(eElement, name + \"_\" + tag, id, dirPath, dirOut);\n }\n }\n }", "public void saveData(){\n try{\n DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();\n Document document = documentBuilder.newDocument();\n\n Element rootElement = document.createElement(\"departments\");\n document.appendChild(rootElement);\n for (Department department : entities){\n Element dep = document.createElement(\"department\");\n rootElement.appendChild(dep);\n\n dep.setAttribute(\"id\", department.getId().toString());\n dep.appendChild(createElementFromDepartment(\n document, \"name\", department.getName()));\n dep.appendChild(createElementFromDepartment(\n document, \"numberOfPlaces\", department.getNumberOfPlaces().toString()));\n }\n\n DOMSource domSource = new DOMSource(document);\n StreamResult streamResult = new StreamResult(fileName);\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n transformer.transform(domSource, streamResult);\n\n } catch (ParserConfigurationException | TransformerException e) {\n e.printStackTrace();\n }\n }", "public File makeXML(String key, int layerID, String value1, String time1, int totalCopies1, int copyNum1, boolean timerType1, String userId, String time, Certificate cert) {\n\n try {\n\n DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();\n\n DocumentBuilder documentBuilder = documentFactory.newDocumentBuilder();\n\n Document document = documentBuilder.newDocument();\n\n Element key1 = document.createElement(\"Search_Result_for\" + key);\n document.appendChild(key1);\n key1.setAttribute(\"Key\", key);\n\n Element layerid = document.createElement(\"layerid\");\n\n key1.appendChild(layerid);\n layerid.setAttribute(\"Id\", String.valueOf(layerID));\n\n Element Value = document.createElement(\"Value\");\n Value.appendChild(document.createTextNode(value1));\n layerid.appendChild(Value);\n\n Element timer = document.createElement(\"timer\");\n timer.appendChild(document.createTextNode(String.valueOf(time1)));\n layerid.appendChild(timer);\n\n Element totcopies = document.createElement(\"totcopies\");\n totcopies.appendChild(document.createTextNode(String.valueOf(totalCopies1)));\n layerid.appendChild(totcopies);\n\n Element copynum = document.createElement(\"copynum\");\n copynum.appendChild(document.createTextNode(String.valueOf(copyNum1)));\n layerid.appendChild(copynum);\n\n Element timertype = document.createElement(\"timertype\");\n timertype.appendChild(document.createTextNode(String.valueOf(timerType1)));\n layerid.appendChild(timertype);\n\n Element userid = document.createElement(\"userid\");\n userid.appendChild(document.createTextNode(userId));\n layerid.appendChild(userid);\n\n Element time2 = document.createElement(\"time\");\n time2.appendChild(document.createTextNode(String.valueOf(time1)));\n layerid.appendChild(time2);\n\n /*Element cert1 = document.createElement(\"cert\");\n cert1.appendChild(document.createTextNode(String.valueOf(cert)));\n layerid.appendChild((Node) cert);*/\n\n // create the xml file\n //transform the DOM Object to an XML File\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n DOMSource domSource = new DOMSource(document);\n StreamResult streamResult = new StreamResult(new File(layerID + \"_Search Result for \" + key + \".xml\"));\n\n transformer.transform(domSource, streamResult);\n\n System.out.println(\"Done creating XML File\");\n\n } catch (ParserConfigurationException pce) {\n pce.printStackTrace();\n } catch (TransformerException tfe) {\n tfe.printStackTrace();\n }\n\n File file = new File(layerID + \"_Search Result for \" + key + \".xml\");\n return file;\n }", "private void transformToXml(Document doc) {\r\n try {\r\n TransformerFactory tf = TransformerFactory.newInstance();\r\n Transformer trans = tf.newTransformer();\r\n trans.transform(new DOMSource(doc),new StreamResult(new File(\"./evidence.xml\")));\r\n } catch (TransformerException e) {\r\n System.err.println(\"Transformation failed\");\r\n }\r\n }", "void save() throws IOException, ParserConfigurationException, TransformerConfigurationException;", "public void writeXML(InvCatalogImpl catalog, OutputStream os) throws IOException {\n writeXML(catalog, os, false);\n }", "public static void saveStudRecsToFile(File file) {\r\n\t\ttry {\r\n\t\t\tJAXBContext context = JAXBContext\r\n\t\t\t\t\t.newInstance(StudRecsWrapper.class);\r\n\t\t\tMarshaller m = context.createMarshaller();\r\n\t\t\tm.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\r\n\t\t\t\r\n\t\t\tStudRecsWrapper wrapper = new StudRecsWrapper();\r\n\t\t\twrapper.setStudRecs(studRecs);\r\n\t\t\t\r\n\t\t\tm.marshal(wrapper, file);\r\n\t\t\tSystem.out.println(\"File saved!\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Cannot save file, check write permissions!\");\r\n\t\t}\r\n\t}", "private void printFile(Products print, String ufilename) {\n\t\tFile file = new File(\"output\"+File.separator+ufilename+fileId+\".xml\"); \n\t\tSystem.out.println(\"Exporting : \"+ file);\n\t\tJAXBContext jaxbContext;\n\t\ttry {\n\t\t\tjaxbContext = JAXBContext.newInstance(Products.class); \n\t\t\tMarshaller jaxbMarshaller = jaxbContext.createMarshaller();\n\t\t\tjaxbMarshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);\n\t\t\tjaxbMarshaller.setProperty(\"com.sun.xml.internal.bind.xmlHeaders\", \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n\t\t\tjaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);\n\t\t\tjaxbMarshaller.marshal(print, file); // prints the file\n\t\t\t// \t\t jaxbMarshaller.marshal(products, System.out);\n\t\t} catch (JAXBException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public synchronized void outputRule() throws IOException\n{\n File f1 = for_program.getUniverse().getBaseDirectory();\n File f2 = new File(f1,RULE_FILE);\n FileWriter fw = new FileWriter(f2,true);\n IvyXmlWriter xw = new IvyXmlWriter(fw);\n\n xw.begin(\"RULE\");\n xw.field(\"WHEN\",at_time);\n xw.field(\"WHENS\",new Date(at_time).toString());\n\n xw.begin(\"WORLD\");\n for (Map.Entry<UpodParameter,Object> ent : from_world.getParameters().entrySet()) {\n UpodParameter pnm = ent.getKey();\n Object pvl = ent.getValue();\n if (pvl == null) continue;\n xw.begin(\"PARAM\");\n xw.field(\"NAME\",pnm.getName());\n xw.field(\"TYPE\",pvl.getClass().toString());\n xw.cdata(pvl.toString());\n xw.end(\"PARAM\");\n }\n xw.end(\"WORLD\");\n\n for (Map.Entry<UpodDevice,Map<UpodParameter,Object>> ent : sensor_values.entrySet()) {\n UpodDevice us = ent.getKey();\n xw.begin(\"SENSOR\");\n xw.field(\"NAME\",us.getName());\n xw.field(\"ID\",us.getUID());\n for (Map.Entry<UpodParameter,Object> pent : ent.getValue().entrySet()) {\n\t xw.begin(\"PARAM\");\n\t xw.field(\"NAME\",pent.getKey().getName());\n\t xw.cdata(pent.getValue().toString());\n\t xw.end(\"PARAM\");\n }\n xw.end(\"SENSOR\");\n }\n for (Map.Entry<UpodDevice,Map<UpodParameter,Object>> ent : entity_values.entrySet()) {\n UpodDevice ue = ent.getKey();\n xw.begin(\"ENTITY\");\n xw.field(\"NAME\",ue.getName());\n xw.field(\"ID\",ue.getUID());\n for (Map.Entry<UpodParameter,Object> pent : ent.getValue().entrySet()) {\n\t xw.begin(\"PARAM\");\n\t xw.field(\"NAME\",pent.getKey().getName());\n\t xw.cdata(pent.getValue().toString());\n\t xw.end(\"PARAM\");\n }\n xw.end(\"ENTITY\");\n }\n\n for (CalendarEvent ce : calendar_events) {\n if (ce.getStartTime() > at_time + 5*T_MINUTE) continue;\n if (ce.getEndTime() < at_time - 5*T_MINUTE) continue;\n xw.begin(\"CALENDAR\");\n xw.field(\"START\",ce.getStartTime());\n xw.field(\"STARTS\",new Date(ce.getStartTime()).toString());\n xw.field(\"END\",ce.getEndTime());\n xw.field(\"ENDS\",new Date(ce.getEndTime()).toString());\n for (Map.Entry<String,String> ent : ce.getProperties().entrySet()) {\n\t xw.begin(\"FIELD\");\n\t xw.field(\"NAME\",ent.getKey());\n\t xw.field(\"VALUE\",ent.getValue());\n\t xw.end(\"FIELD\");\n }\n xw.end(\"CALENDAR\");\n }\n xw.end(\"RULE\");\n xw.close();\n}", "public static void processDirectory(File directory, String traceability) {\n\t\ttry {\n\t\t\tif(Oscar3Props.getInstance().verbose) System.out.println(\"Processing: \" + directory);\n\t\t\tWriter w = new FileWriter(new File(directory, \"traceability.txt\"));\n\t\t\tw.write(traceability);\n\t\t\tw.close();\n\t\t\t\n\t\t\t/* Get \"side streams\" for output ready */\n\t\t\tDocument safDoc = new Document(new Element(\"dummy\"));\n\t\t\t/* Get the document */\n\t\t\tDocument doc = new Builder().build(new File(directory, \"source.xml\"));\n\t\t\t\n\t\t\tOscarFlow oscarFlow = new OscarFlow(doc);\n\t\t\toscarFlow.processFull();\n\t\t\t\n\t\t\t/* Output time! */\n\t\t\tnew Serializer(new FileOutputStream(new File(directory, \"markedup.xml\"))).write(oscarFlow.getInlineXML());\n\t\t\tsafDoc.getRootElement().addAttribute(new Attribute(\"document\", directory.getName()));\n\t\t\tnew Serializer(new FileOutputStream(new File(directory, \"saf.xml\"))).write(oscarFlow.getSafXML());\n\t\t\tif(oscarFlow.getGeniaSAF() != null) {\n\t\t\t\tnew Serializer(new FileOutputStream(new File(directory, \"geniasaf.xml\"))).write(oscarFlow.getGeniaSAF());\t\t\t\t\n\t\t\t}\n\t\t\tif(oscarFlow.getRelationXML() != null) {\n\t\t\t\tnew Serializer(new FileOutputStream(new File(directory, \"relations.xml\"))).write(oscarFlow.getRelationXML());\t\t\t\t\n\t\t\t}\n\t\t\tif(oscarFlow.getDataXML() != null) {\n\t\t\t\tnew Serializer(new FileOutputStream(new File(directory, \"data.xml\"))).write(oscarFlow.getDataXML());\t\t\t\t\n\t\t\t}\n\n\t\t\t/* PubXML present? Then round-trip it */\n\t\t\tif(new File(directory, \"pubxml-source.xml\").exists()) {\n\t\t\t\tBuilder b = new Builder();\n\t\t\t\tDocument pubXML = b.build(new File(directory, \"pubxml-source.xml\"));\n\t\t\t\tDocument convDoc = b.build(new File(directory, \"conv.xml\"));\n\t\t\t\tDocument outDoc = PubXMLToSciXML.getAnnotatedPubXML(pubXML, oscarFlow.getInlineXML(), oscarFlow.getSourceXML(), convDoc);\n\t\t\t\tnew Serializer(new FileOutputStream(new File(directory, \"pubxml-annotated.xml\"))).write(outDoc);\n\t\t\t}\n\t\t\t/* Write out custom files, if present */\n\t\t\tfor(String filename : oscarFlow.getCustomOutputNames()) {\n\t\t\t\t//InputStream is = oscarFlow.customInputStream(filename);\n\t\t\t\tOutputStream os = new FileOutputStream(new File(directory, filename));\n\t\t\t\t/*byte[] buffer = new byte[1024];\n\t\t\t\tint i = 0;\n\t\t\t\twhile ((i = is.read(buffer)) != -1) {\n\t\t\t\t\tos.write(buffer, 0, i);\n\t\t\t\t}\n\t\t\t\tis.close();\n\t\t\t\tos.close();*/\n\t\t\t\toscarFlow.writeCustomeOutputToStream(filename, os);\n\t\t\t\tos.close();\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Argh. Better luck next time\");\n\t\t}\n\t}", "public void writeToXML(){\n\t\t\n\t\t String s1 = \"\";\n\t\t String s2 = \"\";\n\t\t String s3 = \"\";\n\t\t Element lastElement= null;\n\t\t\n\t\tDocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();\n\t\tDocumentBuilder dbElement;\n\t\tBufferedReader brRead=null;\n\n\t\ttry{\n\t\t\tdbElement = dbfactory.newDocumentBuilder();\n\t\t\t\n\t\t\t//Create the root\n\t\t\tDocument docRoot = dbElement.newDocument();\n\t\t\tElement rootElement = docRoot.createElement(\"ROYAL\");\n\t\t\tdocRoot.appendChild(rootElement);\n\t\t\t\n\t\t\t//Create elements\n\t\t\t\n\t\t\t//Element fam = docRoot.createElement(\"FAM\");\n\t\t\tElement e= null;\n\t\t\tbrRead = new BufferedReader(new FileReader(\"complet.ged\"));\n\t\t\tString line=\"\";\n\t\t\twhile((line = brRead.readLine()) != null){\n\t\t\t\tString lineTrim = line.trim();\n\t\t\t\tString str[] = lineTrim.split(\" \");\n\t\t\t\t//System.out.println(\"length = \"+str.length);\n\n\t\t\t\tif(str.length == 2){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2 = str[1];\n\t\t\t\t\ts3 = \"\";\n\t\t\t\t}else if(str.length ==3){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2=\"\";\n\n\t\t\t\t\ts2 = str[1];\n//\t\t\t\t\tSystem.out.println(\"s2=\"+s2);\n\t\t\t\t\ts3=\"\";\n\t\t\t\t\ts3 = str[2];\n//\t\t\t\t\ts3 = s[0];\n\t\t\t\t\t\n\t\t\t\t}else if(str.length >3){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2 = str[1];\n\t\t\t\t\ts3=\"\";\n\t\t\t\t\tfor(int i =2; i<str.length; i++){\n\t\t\t\t\t\ts3 = s3 + str[i]+ \" \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//System.out.println(s1+\"!\"+s2+\"!\"+s3+\"!\");\n\t\t\t\t//Write to file xml\n\t\t\t\t//writeToXML(s1, s2, s3);\n\t\t\t//Element indi = docRoot.createElement(\"INDI\");\t\n\t\t\t//System.out.println(\"Check0 :\" + s1);\n\t\t\tif( Integer.parseInt(s1)==0){\n\t\t\t\t\n\t\t\t\t//System.out.println(\"Check1\");\n\t\t\t\tif(s3.equalsIgnoreCase(\"INDI\")){\n\t\t\t\t\t//System.out.println(\"Check2\");\n\t\t\t\t\tSystem.out.println(\"This is a famille Individual!\");\n\t\t\t\t\te = docRoot.createElement(\"INDI\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t\n\t\t\t\t\t//Set attribute to INDI\n\t\t\t\t\tAttr indiAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tindiAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(indiAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\n\t\t\t\t}if(s3.equalsIgnoreCase(\"FAM\")){\n\t\t\t\t\t//System.out.println(\"Check3\");\n\t\t\t\t\tSystem.out.println(\"This is a famille!\");\n\t\t\t\t\te = docRoot.createElement(\"FAM\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t//Set attribute to FAM\n\t\t\t\t\tAttr famAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tfamAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(famAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}if(s2.equalsIgnoreCase(\"HEAD\")){\n\t\t\t\t\tSystem.out.println(\"This is a head!\");\n\t\t\t\t\te = docRoot.createElement(\"HEAD\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\n\t\t\t\t}if(s3.equalsIgnoreCase(\"SUBM\")){\n\n\t\t\t\t\tSystem.out.println(\"This is a subm!\");\n\t\t\t\t\te = docRoot.createElement(\"SUBM\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t//Set attribute to FAM\n\t\t\t\t\tAttr famAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tfamAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(famAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(Integer.parseInt(s1)==1){\n\n\t\t\t\tString child = s2;\n\t\t\t\tif(child.equalsIgnoreCase(\"SOUR\")||child.equalsIgnoreCase(\"DEST\")||child.equalsIgnoreCase(\"DATE\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"FILE\")||child.equalsIgnoreCase(\"CHAR\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"NAME\")||child.equalsIgnoreCase(\"TITL\")||child.equalsIgnoreCase(\"SEX\")||child.equalsIgnoreCase(\"REFN\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"PHON\")||child.equalsIgnoreCase(\"DIV\")){\n\t\t\t\t\tString name = lastElement.getNodeName();\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"HEAD\")||name.equalsIgnoreCase(\"FAM\")||name.equalsIgnoreCase(\"SUBM\")){\t\n\t\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\t\te.setTextContent(s3);\n\t\t\t\t\t\t\n\t\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\t\tx.setTextContent(s3);\n\t\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"BIRT\")||child.equalsIgnoreCase(\"DEAT\")||child.equalsIgnoreCase(\"COMM\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"BURI\")||child.equalsIgnoreCase(\"ADDR\")||child.equalsIgnoreCase(\"CHR\")){\n\t\t\t\t\t\n\t\t\t\t\tString name = lastElement.getNodeName();\t\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"FAM\")||name.equalsIgnoreCase(\"SUBM\")){\t\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\te.setTextContent(s3);\n\t\t\t\t\t\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\tx.setTextContent(s3);\n\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\tlastElement = x;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"FAMS\")||child.equalsIgnoreCase(\"FAMC\")){\n\t\t\t\t\tString name = lastElement.getNodeName();\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"FAM\")){\t\n\t\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\t\te.setAttribute(\"id\",s3);\n\t\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\t\t\tx.setAttribute(\"id\",s3);\n\t\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\t\tlastElement = x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"HUSB\")||child.equalsIgnoreCase(\"WIFE\")||child.equalsIgnoreCase(\"CHIL\")){\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\te.setAttribute(\"id\",s3);\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"MARR\")){\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(Integer.parseInt(s1)==2){\n\t\t\t\tString lastName = lastElement.getNodeName();\n\t\t\t\tif((lastName.equalsIgnoreCase(\"BIRT\"))||(lastName.equalsIgnoreCase(\"DEAT\"))||(lastName.equalsIgnoreCase(\"BURI\"))\n\t\t\t\t\t\t||(lastName.equalsIgnoreCase(\"MARR\"))||(lastName.equalsIgnoreCase(\"CHR\"))){\n\t\t\t\t\t//Add child nodes to birt, deat or marr\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"DATE\")){\n\t\t\t\t\t\tElement date = docRoot.createElement(\"DATE\");\n\t\t\t\t\t\tdate.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(date);\n\t\t\t\t\t}\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"PLAC\")){\n\t\t\t\t\t\tElement plac = docRoot.createElement(\"PLAC\");\n\t\t\t\t\t\tplac.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(plac);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif(lastName.equalsIgnoreCase(\"COMM\")||lastName.equalsIgnoreCase(\"ADDR\")){\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"CONT\")){\n\t\t\t\t\t\tElement plac = docRoot.createElement(\"CONT\");\n\t\t\t\t\t\tplac.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(plac);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//lastElement = e;\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t//Saved this element for the next step\n\t\t\t\n\t\t\t//Write to file\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\ttransformer.setOutputProperty(OutputKeys.ENCODING, \"iso-8859-1\");\n\t\t\ttransformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n\t\t\ttransformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, \"Royal.dtd\");\n\t\t\tDOMSource source = new DOMSource(docRoot);\n\t\t\tStreamResult result = new StreamResult(new File(\"complet.xml\"));\n\t \n\t\t\t// Output to console for testing\n\t\t\t// StreamResult result = new StreamResult(System.out);\t \n\t\t\ttransformer.transform(source, result);\n\t \n\t\t\tSystem.out.println(\"\\nXML DOM Created Successfully.\");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void saveRecordingClause(SuiteEntry suite, File dirPath) throws Exception {\n // Fortify Mod: make sure that dirPath is a legal path\n if( dirPath != null ) {\n TEPath tpath = new TEPath(dirPath.getAbsolutePath());\n if( ! tpath.isValid() ) \n throw new IllegalArgumentException(\"TEPath error on path \" + dirPath.getAbsolutePath());\n }\n if (dirPath != null && null != suite && SetupOptions.recordingInfo(suite.getLocalName()) == true) {\n try {\n //Create a Source for saving the data.\n DOMSource source = new DOMSource(TECore.docClause);\n TransformerFactory xformFactory = TransformerFactory.newInstance();\n // Fortify Mod: prevent external entity injection \n xformFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\n Transformer idTransform = xformFactory.newTransformer();\n // Declare document is XML\n idTransform.setOutputProperty(OutputKeys.METHOD, XML);\n // Declare document standard UTF-8\n idTransform.setOutputProperty(OutputKeys.ENCODING, UT_F8);\n // Declare document is well indented\n idTransform.setOutputProperty(OutputKeys.INDENT, YES);\n OutputStream report_logs = new FileOutputStream(new File(dirPath.getAbsolutePath() + Constants.tmp_File));\n Result output = new StreamResult(report_logs);\n //transform the output in xml.\n idTransform.transform(source, output);\n // Fortify Mod: Flush and free up the OutputStream\n report_logs.close();\n BufferedReader bufferedReader = null;\n BufferedWriter bufferedWriter = null;\n // Read the xml data from file\n bufferedReader = new BufferedReader(new FileReader(dirPath.getAbsolutePath() + Constants.tmp_File));\n // Create a xml file for saving the data.\n bufferedWriter = new BufferedWriter(new FileWriter(dirPath.getAbsolutePath() + Constants.result_clausexml));\n String dataString = \"\";\n //Read the data from file.\n while ((dataString = bufferedReader.readLine()) != null) {\n // Replace special symbol code to its symbol\n dataString = dataString.replaceAll(\"&lt;\", \"<\").replaceAll(\"&gt;\", \">\").replaceAll(\"&amp;\", \"&\");\n bufferedWriter.write(dataString);\n bufferedWriter.newLine();\n bufferedWriter.flush();\n }\n // Fortify Mod: Free up the Buffered Reader and Writer and their associated resources\n bufferedReader.close();\n bufferedWriter.close();\n // Check file exists\n File file = new File(dirPath.getAbsolutePath() + Constants.tmp_File);\n if (file.exists()) {\n // Delete file if exists\n file.delete();\n }\n } catch (Exception e) {\n System.out.println(ERROR_ON_SAVE_THE__RECORDING__ + e.toString());\n }\n }\n }", "public void saveToFile(final File file) throws IOException, AnalysisConfigurationException;", "private void exportarXML(){\n \n String nombre_archivo=IO_ES.leerCadena(\"Inserte el nombre del archivo\");\n String[] nombre_elementos= {\"Modulos\", \"Estudiantes\", \"Profesores\"};\n Document doc=XML.iniciarDocument();\n doc=XML.estructurarDocument(doc, nombre_elementos);\n \n for(Persona estudiante : LEstudiantes){\n estudiante.escribirXML(doc);\n }\n for(Persona profesor : LProfesorado){\n profesor.escribirXML(doc);\n }\n for(Modulo modulo: LModulo){\n modulo.escribirXML(doc);\n }\n \n XML.domTransformacion(doc, RUTAXML, nombre_archivo);\n \n }", "public void save(XmlWriter w) throws Throwable {\n w.add(\"progress\", new String[] { \"total\", Integer.toString(_total), \"time\",\n new SimpleDateFormat(DateTime.DATE_TIME_FORMAT).format(time()) }, Integer.toString(_progress));\n }", "public void createXMLFile() {\n\t int jmax = listOfRules.size();\n\t int j = 0;\n\t try {\n\t try {\n\n\t DocumentBuilderFactory docFactory = DocumentBuilderFactory\n\t .newInstance();\n\t DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n\n\t // root elements\n\t Document doc = docBuilder.newDocument();\n\t Element rootElement = doc.createElement(\"profile\");\n\t doc.appendChild(rootElement);\n\t // name\n\t Element name = doc.createElement(\"name\");\n\t name.appendChild(doc.createTextNode(\"Android Lint\"));\n\t rootElement.appendChild(name);\n\t // language\n\t Element language = doc.createElement(\"language\");\n\t language.appendChild(doc.createTextNode(\"Java\"));\n\t rootElement.appendChild(language);\n\t // rules\n\t Element rules = doc.createElement(\"rules\");\n\t rootElement.appendChild(rules);\n\n\t for (j = 0; j < jmax; j++) {\n\t Element rule = doc.createElement(\"rule\");\n\t rules.appendChild(rule);\n\t // repositoryKey\n\t Element repositoryKey = doc.createElement(\"repositoryKey\");\n\t repositoryKey\n\t .appendChild(doc.createTextNode(\"AndroidLint\"));\n\t rule.appendChild(repositoryKey);\n\t // key\n\t Element key = doc.createElement(\"key\");\n\t key.appendChild(doc.createTextNode(listOfRules.get(j)));\n\t rule.appendChild(key);\n\t }\n\n\t // write the content into xml file\n\t TransformerFactory transformerFactory = TransformerFactory\n\t .newInstance();\n\t Transformer transformer = transformerFactory.newTransformer();\n\t DOMSource source = new DOMSource(doc);\n\t StreamResult result = new StreamResult(new File(pathProfileXml+ANDROID_LINT_PROFILE_FILENAME\n\t ));\n\n\t transformer.transform(source, result);\n\n\t System.out.println(\"File \\\"\"+pathProfileXml+ANDROID_LINT_PROFILE_FILENAME+\"\\\" written.\");\n\t System.out.println(\"Quit.\");\n\n\t } catch (ParserConfigurationException pce) {\n\t pce.printStackTrace();\n\t } catch (TransformerException tfe) {\n\t tfe.printStackTrace();\n\t }\n\t } catch (Exception e) {\n\n\t }\n\t }", "public void save(XmlWriter w) throws Throwable {\n w.add(\"status\", new String[] { \"time\", new SimpleDateFormat(DateTime.DATE_TIME_FORMAT).format(_time) },\n _state);\n }" ]
[ "0.6742781", "0.6382843", "0.6339708", "0.6150678", "0.6116198", "0.61128247", "0.59130543", "0.58660376", "0.58539265", "0.58252233", "0.57485807", "0.5748456", "0.5736121", "0.56798977", "0.5643867", "0.5639742", "0.562006", "0.5614816", "0.56133115", "0.56059134", "0.5566331", "0.5547243", "0.550159", "0.5471351", "0.5468204", "0.546726", "0.54662", "0.54654974", "0.54643244", "0.54639715", "0.5448865", "0.54410106", "0.540151", "0.5398134", "0.53611815", "0.5355157", "0.53546673", "0.5353802", "0.5346949", "0.53415394", "0.5340558", "0.53258604", "0.529268", "0.5290861", "0.5284958", "0.5284728", "0.5241697", "0.517672", "0.5164885", "0.5161467", "0.5160175", "0.51577187", "0.5146814", "0.5145713", "0.51413894", "0.514109", "0.5134619", "0.5127739", "0.51249677", "0.5109829", "0.51063466", "0.50971437", "0.50826156", "0.507606", "0.5065524", "0.5064664", "0.50625783", "0.50390726", "0.5036312", "0.5015151", "0.5002728", "0.49977145", "0.499762", "0.49921697", "0.49921697", "0.4991264", "0.49845243", "0.497473", "0.49666813", "0.49642408", "0.4963949", "0.49629444", "0.4947993", "0.49450195", "0.49414715", "0.4932973", "0.49268726", "0.4914901", "0.4891678", "0.48867065", "0.48785442", "0.48613614", "0.48602214", "0.48561046", "0.48551098", "0.48460492", "0.48390955", "0.48376042", "0.48352847", "0.48313934", "0.48299232" ]
0.0
-1
Show the RPC error message to the user
public void onFailure(Throwable caught) { System.out.println("XMLStreamTracer: Failed to end the trace."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showError(String error);", "void showError(String message);", "void showError(String message);", "@Override\n public void showError() {\n }", "public void showError(String errorMessage);", "void showError(String errorMessage);", "void errorResponse( String error );", "void showErrorMsg(String string);", "public void error();", "public String error();", "@Override\r\n\t\tpublic void error(ResponseError error) {\n\t\t\tTools.toastShow(error.getMessage());\r\n\t\t}", "@Override\r\n\t\tpublic void error(ResponseError error) {\n\t\t\tTools.toastShow(error.getMessage());\r\n\t\t}", "void showResultMoError(String e);", "@Override\n\tpublic void showError(String message) {\n\t\t\n\t}", "public void error(String message);", "java.lang.String getError();", "java.lang.String getError();", "java.lang.String getError();", "public abstract void showErrorBox(Throwable error);", "@Override\r\n\t\t\t\t\tpublic void error(ResponseError error) {\n\t\t\t\t\t\tTools.toastShow(error.getMessage());\r\n\t\t\t\t\t}", "@Override\r\n\tpublic final void showCommandError(String command, String message) {\n\t}", "void showSyncFailMessage();", "public void sendError()\n {\n \tString resultText = Integer.toString(stdID);\n \tresultText += \": \";\n\t\tfor(int i = 0; i<registeredCourses.size();i++)\n\t\t{\n\t\t\tresultText += registeredCourses.get(i);\n\t\t\tresultText += \" \";\n\t\t}\n\t\tresultText += \"--\";\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(semesterNum);\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(0); \n\t\tresultText += \" \";\n\t\tprintResults.writeResult(resultText);\n \tSystem.exit(1);\n }", "String errorMessage();", "void errorBox(String title, String message);", "@Override\r\n\tpublic void showErrReq() {\n\t\tdialog.cancel();\r\n\t\tshowNetView(true);\r\n\t}", "@Override\r\n\tpublic void displayError(EntityPropertyCode code, String message) {\n\t}", "public void show(Object errorMessage){\n\t\tSystem.out.println(\"Woops, something bad happened\");\n\t\tSystem.out.println(errorMessage);\n\t}", "void err( Object msg );", "public void Error(String error) throws RemoteException;", "@Override\n\tpublic void onRequestError(String reqID, Exception error) {\n\t\temptyView.showException((ZcdhException)error, this);\n\t}", "void printError(String errorMsg, boolean displayHelp);", "void displayErrorMessage(String message);", "private void showConnectionError() {\n String couldNotConnect = Localization.lang(\"Could not connect to the update server.\");\n String tryLater = Localization.lang(\"Please try again later and/or check your network connection.\");\n if (manualExecution) {\n JOptionPane.showMessageDialog(this.mainFrame, couldNotConnect + \"\\n\" + tryLater,\n couldNotConnect, JOptionPane.ERROR_MESSAGE);\n }\n this.mainFrame.output(couldNotConnect + \" \" + tryLater);\n }", "private void showErrorMessage(String msgRes)\r\n {\r\n applicationContext.getGUISynchronizer().asyncInvoke(\r\n createErrorRunnable(msgRes));\r\n }", "java.lang.String getErr();", "@Override\n\tprotected String showErrorMessage() {\n\t\treturn \"There has been an error. Payment cannot process at this time. Please check with your credit card compay.\";\n\t}", "public void showNetErrorMessage() {\n showMessage(R.string.ic_net_error_tipinfo);\n }", "protodef.b_error.info getError();", "protodef.b_error.info getError();", "private void showErrorDialog(int errorCode) {\n\t\t\n }", "void error (String msg) throws RootException;", "@Override\n\tpublic void getError() {\n System.err.println(\"8877挂掉了\");\n\t}", "protected abstract void error(String err);", "protected abstract void showConnectError();", "@Override\n\tpublic void error(Object message) {\n\n\t}", "private void displayErrorToast()\n {\n Toast.makeText(\n getApplicationContext(),\n \"Connection to the server failed, please try again!\",\n Toast.LENGTH_LONG ).show();\n }", "public static void showErrorPanel(String title, String msg) {\n final DialogBox dialogBox = new DialogBox();\r\n dialogBox.setText(\"Remote Procedure Call\");\r\n dialogBox.setAnimationEnabled(true);\r\n final Button closeButton = new Button(\"Close\");\r\n // We can set the id of a widget by accessing its Element\r\n closeButton.getElement().setId(\"closeButton\");\r\n final HTML serverResponseLabel = new HTML();\r\n VerticalPanel dialogVPanel = new VerticalPanel();\r\n dialogVPanel.addStyleName(\"dialogVPanel\");\r\n dialogVPanel.add(new HTML(\"<br><b>Server replies:</b>\"));\r\n dialogVPanel.add(serverResponseLabel);\r\n dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);\r\n dialogVPanel.add(closeButton);\r\n dialogBox.setWidget(dialogVPanel);\r\n\r\n // Add a handler to close the DialogBox\r\n closeButton.addClickHandler(new ClickHandler() {\r\n\r\n @Override\r\n public void onClick(ClickEvent event) {\r\n dialogBox.hide();\r\n }\r\n });\r\n\r\n // Show the error message to the user\r\n dialogBox.setText(title);\r\n serverResponseLabel.addStyleName(\"serverResponseLabelError\");\r\n serverResponseLabel.setHTML(msg);\r\n dialogBox.center();\r\n closeButton.setFocus(true);\r\n }", "java.lang.String getErrmsg();", "abstract void error(String error);", "private void err(Messenger replyTo, int encoderId, Bundle info) {\n\n // obtain new message\n Message message = obtainMessage(Geotracer.MESSAGE_TYPE_ERROR, encoderId, 0);\n message.setData(info);\n\n // send response\n send(replyTo, message);\n }", "private void showReplCommError(Throwable e) {\n FeedbackReporter.showErrorMessage(REPL_COMM_ERROR_MSG\n + \"<p>Detailed error: \" + e.getMessage() + \"</p>\",\n \"Trouble connecting to device\");\n if (DEBUG) {\n System.out.println (\"Communication with REPL failed: \" + e);\n }\n }", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "public static void exposeError(String errorMessage) {\r\n CmdUx.printHBars(errorMessage);\r\n }", "void drawError(String message);", "public String getMessage() {\n return super.getMessage()+\"\\n error code=\"+error_code+\" error value=\"+error_value; //$NON-NLS-1$ //$NON-NLS-2$\n }", "public void error(String message) {\n ui.say(\"ERROR: \" + message);\n }", "String getErrorMessage();", "String getErrorMessage();", "public void displayError(String e){\n\t\tJOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}", "@Override\n\tpublic void error(Message msg) {\n\n\t}", "@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}", "@Override\n public void errorLogin(String msg) {\n JOptionPane.showMessageDialog(this, msg);\n }", "@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2, Object p3, Object p4,\n\t\t\tObject p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}", "public String formInternalError() \r\n {\r\n return formError(\"500 Internal server error\",\"Server broke\");\r\n }", "public abstract void showErrorBox(String errorMessage, Runnable callback);", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "public void onFailure(Throwable caught) {\n\t\t\t\trpcResult = \"Remote Procedure Call - Failure\\n\" \n\t\t\t\t\t\t\t+ \"Error al obtener lista de items.\";\n\t\t\t\tmessagesLabel.setStyleName(\"messageErrorLabel\");\n\t\t\t\tmessagesLabel.setText(rpcResult);\n\t\t\t\tWindow.alert(rpcResult);\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tallPanel.unmask();\t\t\t\t\t\t\r\n\t\t\t\t\t\tabv30Panel.unmask();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tInfo.display(\"Error\", \"RPC Error\");\r\n\t\t\t\t\t}", "@Override\n\tpublic void error(Marker marker, Message msg) {\n\n\t}", "public void errorFromKernel (String error) {\n clientCommunicationManager.sendErrorToAll(\"NETWORK\", \"[ERROR JUPYTER] \" + error);\n }", "private String getGUIErrorMsg(long errorcode) {\n\t\tif (errorcode == 0) {\n\t\t\treturn \"This popup shouldn't have launched!\";\n\t\t} else if (errorcode == 9) {\n\t\t\treturn \"Latitude input format incorrect!\\nValid Latitude values are -90 to 90 with negative values being south Latitude.\";\n\t\t} else if (errorcode == 10) {\n\t\t\treturn \"Longitude input format incorrect!\\nValid Longitude values are -180 to 180 with negative values being west latitude.\";\n\t\t} else if (errorcode == 11) {\n\t\t\treturn \"Date input format incorrect!\\nValid dates go <year>-<month>-<day>\\nValid month values are 1- 12 and valid day values are 1 - 31.\";\n\t\t} else if (errorcode == 12) {\n\t\t\treturn \"Time input format incorrect!\\nValid times go <hour>-<minute>-<second>\\nValid hour values are 0 - 23 and valid minute and second values are 0 - 59\";\n\t\t} else if (errorcode == 1) {\n\t\t\treturn \"Invalid latitude!\\nValid Latitude values are -90 to 90 with negative values being south Latitude.\";\n\t\t} else if (errorcode == 2) {\n\t\t\treturn \"Invalid Longitude!\\nValid Longitude values are -180 to 180 with negative values being west latitude.\";\n\t\t} else if (errorcode == 3) {\n\t\t\treturn \"Invalid Year!\\nValid year values are \" + Integer.MIN_VALUE + \" - \" + Integer.MAX_VALUE + \".\";\n\t\t} else if (errorcode == 4) {\n\t\t\treturn \"Invalid Month!\\nValid month values are 1 - 12\";\n\t\t} else if (errorcode == 5) {\n\t\t\treturn \"Invalid Day!\\nValid day values are 1 - 31\";\n\t\t} else if (errorcode == 6) {\n\t\t\treturn \"Invalid Hour!\\nValid hour values are 0 - 23\";\n\t\t} else if (errorcode == 7) {\n\t\t\treturn \"Invalid Minute!\\nValid minute values are 0 - 59\";\n\t\t} else if (errorcode == 8) {\n\t\t\treturn \"Invalid Second!\\nValid second values are 0 - 59\";\n\t\t} \n\t\treturn \"Undefined Error Message!\";\n\t}", "@Override\n\tpublic String getMessage()\n\t{\n\t\treturn errMessage;\n\t}", "public void ErrorMessage(String error) {\n \tJOptionPane.showMessageDialog(parent, error);\n }", "@Override\n public final String toString() {\n return ErrorMessages.invalidOperation(getMessage());\n }", "public static String operationFailed() {\n return holder.format(\"operationFailed\");\n }", "@Override\n\tpublic void error(Marker marker, String message, Object p0) {\n\n\t}", "private void showError(String message){\n\t\tsetupErrorState();\n\t\tsynapseAlert.showError(message);\n\t}", "void notSupported(String errorcode);", "public boolean getSendErrorToClient();", "@Override\n\tpublic void error(Marker marker, Object message) {\n\n\t}", "@Override\n\tpublic void error(String message, Object p0) {\n\n\t}", "@Override\n\tpublic void error(Marker marker, String message, Object... params) {\n\n\t}", "@Override\n\tpublic void error(Marker marker, String message) {\n\n\t}", "public void getMessage() {\r\n // use JOptionPane to have a pop up box informing user of the invalid token\r\n JOptionPane.showMessageDialog(null, \"Invalid Token \" + invalidToken);\r\n }", "public void onFailure(Throwable caught) {\n\t\t\t\trpcResult = \"Remote Procedure Call - Failure\\n\" \n\t\t\t\t\t\t\t+ \"Error al guardar item.\";\n\t\t\t\tmessagesLabel.setStyleName(\"messageErrorLabel\");\n\t\t\t\tmessagesLabel.setText(rpcResult);\n\t\t\t\tWindow.alert(rpcResult);\n\t\t\t}", "@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2, Object p3, Object p4) {\n\n\t}" ]
[ "0.729417", "0.7190209", "0.7190209", "0.7032782", "0.702754", "0.70209455", "0.69728166", "0.69641274", "0.69545954", "0.69153816", "0.68666023", "0.68666023", "0.68092376", "0.67919785", "0.676801", "0.6760941", "0.6760941", "0.6760941", "0.6736302", "0.67330396", "0.6650877", "0.6638223", "0.6593806", "0.6578334", "0.65633065", "0.6528328", "0.65279835", "0.65159136", "0.6505639", "0.6503342", "0.6458074", "0.6457165", "0.6456335", "0.6429341", "0.64238036", "0.6415954", "0.6413929", "0.64118266", "0.64062345", "0.64062345", "0.6395962", "0.6392278", "0.639168", "0.63915765", "0.63852614", "0.6366391", "0.6360243", "0.6357829", "0.63415277", "0.6334225", "0.6327633", "0.63237345", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63193023", "0.63143665", "0.6310177", "0.6297659", "0.6297607", "0.6292632", "0.6292632", "0.62864345", "0.6282722", "0.6277236", "0.6277179", "0.6275477", "0.62737644", "0.6269834", "0.6266291", "0.6266291", "0.6266291", "0.6266291", "0.62515146", "0.6250522", "0.62443244", "0.6238212", "0.62379664", "0.62323374", "0.6220744", "0.6218755", "0.6210545", "0.6188153", "0.61841446", "0.6181787", "0.61791545", "0.6168921", "0.61414325", "0.6139264", "0.61330086", "0.6132534", "0.61320096", "0.61302215" ]
0.0
-1
Create an event that can be populated using its reference.
@Override public Element newEvent(String source, String type, int t) { // TODO Auto-generated method stub if(!mEventStarted) { mRoot = mDocument.createElement("slice"); mRoot.setAttribute("date", Integer.toString(t)); mDocument.appendChild(mRoot); } else if (t != mLastCycle) { this.finishEvent(); mRoot = mDocument.createElement("slice"); mRoot.setAttribute("date", Integer.toString(t)); mDocument.appendChild(mRoot); } mLastCycle = t; mEventStarted = true; mID++; mCurrentEvent = mDocument.createElement("event"); mCurrentEvent.setAttribute("id", Integer.toString(mID)); mCurrentEvent.setAttribute("source", source); mCurrentEvent.setAttribute("date", Integer.toString(t)); Element typeElement = mDocument.createElement("type"); // typeElement.setTextContent(type); typeElement.appendChild(mDocument.createTextNode(type)); mCurrentEvent.appendChild(typeElement); mRoot.appendChild(mCurrentEvent); return mCurrentEvent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Event createEvent();", "Event createEvent();", "BasicEvent createBasicEvent();", "EventUse createEventUse();", "private IEvent createEvent() throws RodinDBException {\n\t\tfinal IMachineRoot mch = createMachine(\"mch\");\n\t\treturn mch.createChild(IEvent.ELEMENT_TYPE, null, null);\n\t}", "com.walgreens.rxit.ch.cda.EIVLEvent addNewEvent();", "EventChannel create();", "BasicEvents createBasicEvents();", "public Event createOneShotPublish(Address resource, String event);", "EventBinding createEventBinding();", "public Event createEvent(String name) {\r\n\t\tEvent newEvent = new Event(this.GID, name);\r\n\t\tevents.add(newEvent);\r\n\t\treturn newEvent;\r\n\t}", "@Override //to be moved to Cloud service\r\n\tpublic void createEvent(String eventName) {\n\t\t\r\n\t}", "public\n CreateEvent()\n {}", "EventUses createEventUses();", "private void createEvents() {\n\t}", "RemoteEvent createRemoteEvent();", "public void setEventCreated() {\n Date now = new Date();\n this.eventCreated = now;\n }", "public Event() {}", "public void createGenesisEvent() {\n handleNewEvent(buildEvent(null, null));\n }", "public Event createNotify(Address resource, String event);", "public Event() {\n this.name = null;\n this.description = null;\n this.date = new GregorianCalendar();\n }", "CatchingEvent createCatchingEvent();", "public Event createPublish(Address resource, String event, int expires);", "interface Event {\n Event TICK = new Event() {\n };\n}", "EventChannel create(Context context);", "void onNewEvent(Event event);", "public void makeEvent(String type) {\n\t\teventName = type;\n\t}", "public static LogEvent createEmptyEvent()\n\t{\n\t\treturn new LogEvent();\n\t}", "Builder addReleasedEvent(PublicationEvent.Builder value);", "public Event createSubscribe(Address resource, String event, int expires);", "protected ICEvent() {}", "public org.hl7.fhir.CodeableConcept addNewEvent()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().add_element_user(EVENT$0);\n return target;\n }\n }", "StartEvent createStartEvent();", "WithCreate withDestination(EventChannelDestination destination);", "public void createEvent(Event e) {\n\t\tLocalDate date = e.sDate;\n\t\tif(!map.containsKey(date)) {\n\t\t\tArrayList<Event> newList = new ArrayList<>();\n\t\t\tnewList.add(e);\n\t\t\tmap.put(date, newList);\n\t\t}\n\t\telse {\n\t\t\tmap.get(date).add(e);\n\n\t\t}\n\t}", "Event generateEvent(int seed) throws Exception {\n return new Event(\n new Description(\"Event \" + seed),\n new StartTime(\"0900\"),\n new StartDate(Integer.toString((Integer.parseInt(\"200317\") + seed))),\n new EndTime(\"1100\"),\n new EndDate(Integer.toString((Integer.parseInt(\"200317\") + seed))),\n new Location(\"House of \" + seed),\n new UniqueTagList(new Tag(\"tag\" + Math.abs(seed)), new Tag(\"tag\" + Math.abs(seed + 1)))\n );\n }", "private IRefinesEvent createRefinesEvent() throws RodinDBException {\n\t\tfinal IMachineRoot mch = createMachine(\"mch\");\n\t\tfinal IEvent event = createEvent(mch, \"event\");\n\t\treturn event.createChild(IRefinesEvent.ELEMENT_TYPE, null, null);\n\t}", "public AnalyticsEvent build() {\n AnalyticsEvent purchaseEvent = null;\n if(isValid() && doBaseValidation()) {\n purchaseEvent = eventClient.createEvent(PURCHASE_EVENT_NAME);\n\n purchaseEvent.addAttribute(PURCHASE_EVENT_PRODUCT_ID_ATTR, productId);\n purchaseEvent.addAttribute(PURCHASE_EVENT_STORE_ATTR, store);\n purchaseEvent.addMetric(PURCHASE_EVENT_QUANTITY_METRIC, quantity);\n\n if(formattedItemPrice != null) {\n purchaseEvent.addAttribute(PURCHASE_EVENT_PRICE_FORMATTED_ATTR, formattedItemPrice);\n }\n\n if(itemPrice != null) {\n purchaseEvent.addMetric(PURCHASE_EVENT_ITEM_PRICE_METRIC, itemPrice);\n }\n\n if(transactionId != null) {\n purchaseEvent.addAttribute(PURCHASE_EVENT_TRANSACTION_ID_ATTR, transactionId);\n }\n\n if(currency != null) {\n purchaseEvent.addAttribute(PURCHASE_EVENT_CURRENCY_ATTR, currency);\n }\n }\n \n return purchaseEvent;\n }", "Builder addPublication(PublicationEvent.Builder value);", "public Event() {\r\n\r\n\t}", "public LogEvent newInstance()\n {\n return new LogEvent();\n }", "@EventName(\"targetCreated\")\n EventListener onTargetCreated(EventHandler<TargetCreated> eventListener);", "@Override\n public SoapEvent create(SoapEvent event) {\n throw new UnsupportedOperationException();\n }", "WithCreate withSource(EventChannelSource source);", "public Event() {\n\n }", "@NonNull\n public Trigger build() {\n if (UAStringUtil.isEmpty(eventName)) {\n return new Trigger(type, goal, null);\n }\n\n JsonPredicate predicate = JsonPredicate.newBuilder()\n .setPredicateType(JsonPredicate.AND_PREDICATE_TYPE)\n .addMatcher(JsonMatcher.newBuilder()\n .setKey(CustomEvent.EVENT_NAME)\n .setValueMatcher(ValueMatcher.newValueMatcher(JsonValue.wrap(eventName)))\n .build())\n .build();\n return new Trigger(type, goal, predicate);\n }", "public Event(EventType type, String eventKey) \n\t{\n\t\tsuper();\n\t\tthis.evntType = type;\n\t\tthis.key = eventKey;\n\t\tthis.uuid = UUID.randomUUID().toString();\n\t\tthis.milliseconds = 0;\n\t\tthis.repeated = false;\n\t}", "public Builder setEvent(EventType value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n event_ = value.getNumber();\n onChanged();\n return this;\n }", "@NonNull\n public static CustomEventTriggerBuilder newCustomEventTriggerBuilder() {\n return new CustomEventTriggerBuilder();\n }", "public Event() {\n }", "public Event() {\n }", "ThrowingEvent createThrowingEvent();", "public Event() {\n\t}", "@Override\n public Object getEvent() {\n return eventObj;\n }", "@WebMethod public Event createEvent(Date date, Team a, Team b) throws EventAlreadyExist;", "public PgEventTrigger() {\n this(\"pg_event_trigger\", null);\n }", "@Override\n\tpublic EventDto createEvent(EventDto event) {\n\t\tEventEntity eventEntity=new EventEntity();\n\t\tBeanUtils.copyProperties(event, eventEntity);\n\t\t\n\t\tString eventid=utils.generateEventId(20);\n\t\teventEntity.setEventid(eventid);\n\t\t\n\t\tEventEntity storedEvent=eventRepository.save(eventEntity);\n\t\t\n\t\tEventDto returnvalue=new EventDto();\n\t\tBeanUtils.copyProperties(storedEvent, returnvalue);\n\t\t\n\t\treturn returnvalue;\n\t}", "public interface Event extends Serializable {\n\n Long getEventId();\n\n String getEventTitle();\n\n String getEventDescription();\n\n Long getEventAssignerId();\n\n Date getOriginalEventStartDate();\n\n Date getEventStartDate();\n\n /***\n * Sets the new start date for new generating event.\n *\n * @param startEventDate\n */\n void setEventStartDate(Date startEventDate);\n\n Date getEventEndDate();\n\n /***\n * Sets the new end date for new generating event.\n *\n * @param endEventDate\n */\n void setEventEndDate(Date endEventDate);\n//\n// Date getEventRemindDate();\n//\n// /***\n// * Sets the new remind date for new generating event.\n// *\n// * @param endEventDate\n// */\n// void setEventRemindDate(Date endEventDate);\n\n /***\n * Return calendarId field generated with system calendar after sync it\n *\n * @return\n * @see SyncUtils\n */\n Long getCalendarId();\n\n /***\n * Sets calendarId field generated with system calendar after sync it\n *\n * @param calendarId\n * @see SyncUtils\n */\n void setCalendarId(Long calendarId);\n\n /***\n * @return repeat period for current entity instance\n * @see EventProperties.RepeatPeriod\n */\n @EventProperties.RepeatPeriod\n int getEventRepeatPeriod();\n\n /***\n * @return event icon url\n */\n String getEventIconUrl();\n\n /***\n * @return boolean which indicates is event editable\n */\n Boolean isEditable();\n\n /***\n * @return boolean which indicates is event length All day long\n */\n Boolean isAllDayEvent();\n}", "ProgramEventEvent createProgramEventEvent();", "public EventImpl convertToEventImpl() {\n final EventImpl event = new EventImpl(\n getBaseEventHashedData(),\n getBaseEventUnhashedData(),\n getConsensusData(),\n getSelfParent(),\n getOtherParent());\n CryptographyHolder.get().digestSync(event);\n return event;\n }", "void onIssueCreatedEvent(T event);", "@Test\r\n public void testEvent() {\n Event event = new Event();\r\n }", "public Eventd() {\n }", "Builder addRecordedAt(Event.Builder value);", "public Event(){\n \n }", "Builder addPublication(PublicationEvent value);", "public EventDelegate() {\n mNativeRef = nativeCreateDelegate();\n }", "public NodeEvent() {\n\t\tthis(new Note(), DEFAULT_LIKELIHOOD);\n\t}", "ConferenceScheduleBuilderService createEventsFromLunchToNetwork();", "public ScheduleEvent()\n\t{\n\n\t}", "BoundaryEvent createBoundaryEvent();", "public static com.opentext.bn.converters.avro.entity.DocumentEvent.Builder newBuilder() {\n return new com.opentext.bn.converters.avro.entity.DocumentEvent.Builder();\n }", "protected IEvent createEvent(IMachineRoot machine, String eventLabel)\n\t\t\tthrows RodinDBException {\n\t\tIEvent event = machine.createChild(IEvent.ELEMENT_TYPE, null, null);\n\t\tevent.setLabel(eventLabel, null);\n\t\tevent.setExtended(false, null);\n\t\tevent.setConvergence(ORDINARY, null);\n\t\treturn event;\n\t}", "private void addNewMember(Event x) {\r\n \r\n \r\n \r\n }", "private static Event makeEvent(GreenhouseControls gc,Map.Entry<String, Long> me) {\r\n\t\tString key = me.getKey();\r\n\t\tLong value = me.getValue();\r\n\t\tif(\"Bell\".equals(key))\r\n\t\t\treturn gc.new Bell(value);\r\n\t\tif(\"LightOn\".equals(key))\r\n\t\t\treturn gc.new LightOn(value);\r\n\t\tif(\"LightOff\".equals(key))\r\n\t\t\treturn gc.new LightOff(value);\r\n\t\tif(\"WaterOn\".equals(key))\r\n\t\t\treturn gc.new WaterOn(value);\r\n\t\tif(\"WaterOff\".equals(key))\r\n\t\t\treturn gc.new WaterOff(value);\r\n\t\tif(\"ThermostatDay\".equals(key))\r\n\t\t\treturn gc.new ThermostatDay(value);\r\n\t\tif(\"ThermostatNight\".equals(key))\r\n\t\t\treturn gc.new ThermostatNight(value);\r\n\t\treturn null;\r\n\t}", "public interface Event\n\t{\n\t\tpublic static final String EVENT_ID = \"aether.event.id\";\n\t\tpublic static final String TIME = \"aether.event.time\";\n\t\tpublic static final String EVENT_TYPE = \"aether.event.type\";\n\t}", "public Event publish(Address resource, String event, int expires, Content body);", "private void pushNewEvent(Event e) {\n\t\tec.pushNewElement(e);\n\t}", "UsageEvents.Event buildEvent(String packageName, String className) {\n UsageEvents.Event event = new UsageEvents.Event();\n event.mPackage = getCachedStringRef(packageName);\n if (className != null) {\n event.mClass = getCachedStringRef(className);\n }\n return event;\n }", "ConferenceScheduleBuilderService createEventsFromStartToLunch();", "public void create(T e);", "public void tagCreated(TagEvent event) {\n createdEvent = event;\n }", "public Event(){\n\n }", "public interface Event {\n public static final String NAMESPACE = \"http://purl.org/NET/c4dm/event.owl#\";\n\n // classes\n public static final URI\n Event = new URIImpl(NAMESPACE + \"Event\"),\n Factor = new URIImpl(NAMESPACE + \"Factor\"),\n Product = new URIImpl(NAMESPACE + \"Product\");\n\n // properties\n public static final URI\n agent = new URIImpl(NAMESPACE + \"agent\"),\n agent_in = new URIImpl(NAMESPACE + \"agent_in\"),\n factor = new URIImpl(NAMESPACE + \"factor\"),\n factor_of = new URIImpl(NAMESPACE + \"factor_of\"),\n hasAgent = new URIImpl(NAMESPACE + \"hasAgent\"),\n hasFactor = new URIImpl(NAMESPACE + \"hasFactor\"),\n hasLiteralFactor = new URIImpl(NAMESPACE + \"hasLiteralFactor\"),\n hasProduct = new URIImpl(NAMESPACE + \"hasProduct\"),\n hasSubEvent = new URIImpl(NAMESPACE + \"hasSubEvent\"),\n isAgentIn = new URIImpl(NAMESPACE + \"isAgentIn\"),\n isFactorOf = new URIImpl(NAMESPACE + \"isFactorOf\"),\n literal_factor = new URIImpl(NAMESPACE + \"literal_factor\"),\n place = new URIImpl(NAMESPACE + \"place\"),\n producedIn = new URIImpl(NAMESPACE + \"producedIn\"),\n produced_in = new URIImpl(NAMESPACE + \"produced_in\"),\n product = new URIImpl(NAMESPACE + \"product\"),\n sub_event = new URIImpl(NAMESPACE + \"sub_event\"),\n time = new URIImpl(NAMESPACE + \"time\");\n}", "EventItem(double absoluteTime_, double relativeTime_) {\n absoluteTime = absoluteTime_;\n relativeTime = relativeTime_;\n link = null;\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 }", "protected MapEvent instantiateMapEvent(\n int nId, Object oKey, Object oValueOld, Object oValueNew)\n {\n return new MapEvent(this, nId, oKey, oValueOld, oValueNew);\n }", "public interface EventDefinition extends EObject {\r\n}", "private static Entity<Event> event(String uid, Entity<Enrollment> parent) {\n Event event = Event.builder().event(uid).enrollment(parent.entity.getUid()).build();\n parent.entity.getEvents().add(event);\n return new Entity<>(event);\n }", "Builder addRecordedAt(Event value);", "Builder addReleasedEvent(PublicationEvent value);", "public EventObject(Object source) {\n\tif (source == null)\n\t throw new IllegalArgumentException(\"null source\");\n\n this.source = source;\n }", "public Event() {\n // Unique random UID number for each event\n UID = UUID.randomUUID().toString().toUpperCase();\n TimeZone tz = TimeZone.getTimeZone(\"UTC\");\n Calendar cal = Calendar.getInstance(tz);\n\n /* get time stamp */\n int hour = cal.get(Calendar.HOUR);\n int minute = cal.get(Calendar.MINUTE);\n int second = cal.get(Calendar.SECOND);\n\n /* check current time */\n currentTime = \"\";\n if (hour < 10) {\n currentTime += \"0\" + hour;\n }\n else {\n currentTime += \"\" + hour;\n }\n if (minute < 10) {\n currentTime += \"0\" + minute;\n }\n else {\n currentTime += \"\" + minute;\n }\n if (second < 10) {\n currentTime += \"0\" + second;\n }\n else {\n currentTime += \"\" + second;\n }\n\n /* get date stamp */\n int year = cal.get(Calendar.YEAR);\n int month = cal.get(Calendar.MONTH);\n int day = cal.get(Calendar.DAY_OF_MONTH);\n\n /* check date */\n currentDate = \"\";\n if (year < 10) {\n currentDate += \"0\" + year;\n }\n else {\n currentDate += \"\" + year;\n }\n\n if (month < 10) {\n currentDate += \"0\" + month;\n }\n else {\n currentDate += \"\" + month;\n }\n if (day < 10) {\n currentDate += \"0\" + day;\n }\n else {\n currentDate += \"\" + day;\n }\n }", "public QPEvent() {}", "protected abstract void createHistoryEvents();", "@WebMethod public void createEvent(String description, LocalDate eventDate) throws EventAlreadyExist;", "int addHabitEvent(Habit habit, HabitEvent habitEvent);", "@Override\r\n public void createEvent(EventBean event) throws BusinessLogicException {\n }", "public InspectorEvent (double time,double clock, Inspector insp, factoryComponent fc,EventTypes type){\n eventfTime = time + clock;\n eventsTime = clock;\n this.fc = fc;\n this.insp = insp;\n eventType = type;\n }", "public Event(int type) {\n this.type=type;\n this.arg=null;\n }", "public static com.opentext.bn.converters.avro.entity.DocumentEvent.Builder newBuilder(com.opentext.bn.converters.avro.entity.DocumentEvent other) {\n return new com.opentext.bn.converters.avro.entity.DocumentEvent.Builder(other);\n }" ]
[ "0.72216874", "0.72216874", "0.6629205", "0.6603441", "0.6360137", "0.6234062", "0.61354786", "0.61113656", "0.60618603", "0.60402304", "0.6038997", "0.60081756", "0.6005787", "0.59852326", "0.5979449", "0.59792864", "0.58511204", "0.584247", "0.5812372", "0.5773969", "0.57611746", "0.5745459", "0.5713357", "0.570394", "0.569942", "0.56760037", "0.56739384", "0.5656778", "0.5656538", "0.56467205", "0.5618395", "0.5614964", "0.56034213", "0.55943483", "0.5583333", "0.5581203", "0.5579918", "0.5573971", "0.5550503", "0.553165", "0.55144054", "0.55100954", "0.55065256", "0.5499089", "0.5497117", "0.54952633", "0.54891646", "0.5468864", "0.54539776", "0.54451895", "0.54451895", "0.5430351", "0.541594", "0.53754985", "0.53745306", "0.5363027", "0.535715", "0.5340095", "0.5330304", "0.531268", "0.5293244", "0.52861625", "0.5285913", "0.5284513", "0.5282778", "0.52749795", "0.5253134", "0.52529526", "0.52495587", "0.5235809", "0.5234128", "0.52332073", "0.5229947", "0.5210518", "0.52078223", "0.52016175", "0.5183002", "0.5180682", "0.51719785", "0.5166205", "0.51655614", "0.51607573", "0.5159606", "0.5159349", "0.5153591", "0.5152555", "0.5147471", "0.51421976", "0.5138023", "0.5134288", "0.5134074", "0.51332027", "0.51306736", "0.512436", "0.5120803", "0.51184845", "0.5106784", "0.50918734", "0.50913405", "0.509073", "0.50882137" ]
0.0
-1
Create a new event that can be populated with elements later.
@Override public void startNewEvent(int t) { // TODO Auto-generated method stub this.newEvent("Ernest", "action", t); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Event createEvent();", "Event createEvent();", "private void createEvents() {\n\t}", "BasicEvent createBasicEvent();", "com.walgreens.rxit.ch.cda.EIVLEvent addNewEvent();", "private IEvent createEvent() throws RodinDBException {\n\t\tfinal IMachineRoot mch = createMachine(\"mch\");\n\t\treturn mch.createChild(IEvent.ELEMENT_TYPE, null, null);\n\t}", "BasicEvents createBasicEvents();", "private void pushNewEvent(Event e) {\n\t\tec.pushNewElement(e);\n\t}", "public void createGenesisEvent() {\n handleNewEvent(buildEvent(null, null));\n }", "public Event createEvent(String name) {\r\n\t\tEvent newEvent = new Event(this.GID, name);\r\n\t\tevents.add(newEvent);\r\n\t\treturn newEvent;\r\n\t}", "EventUse createEventUse();", "void onNewEvent(Event event);", "public Event() {}", "@Override\n public SoapEvent create(SoapEvent event) {\n throw new UnsupportedOperationException();\n }", "public void createEvent(Event e) {\n\t\tLocalDate date = e.sDate;\n\t\tif(!map.containsKey(date)) {\n\t\t\tArrayList<Event> newList = new ArrayList<>();\n\t\t\tnewList.add(e);\n\t\t\tmap.put(date, newList);\n\t\t}\n\t\telse {\n\t\t\tmap.get(date).add(e);\n\n\t\t}\n\t}", "EventChannel create();", "public static LogEvent createEmptyEvent()\n\t{\n\t\treturn new LogEvent();\n\t}", "public\n CreateEvent()\n {}", "public Event() {\r\n\r\n\t}", "public Event() {\n }", "public Event() {\n }", "@Override\r\n\tpublic Element newEvent(String source, String type, int t) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(!mEventStarted) {\r\n\t\t\tmRoot = mDocument.createElement(\"slice\");\r\n\t\t\tmRoot.setAttribute(\"date\", Integer.toString(t));\r\n\t\t\tmDocument.appendChild(mRoot);\r\n\t\t} else if (t != mLastCycle) {\r\n\t\t\tthis.finishEvent();\r\n\t\t\tmRoot = mDocument.createElement(\"slice\");\r\n\t\t\tmRoot.setAttribute(\"date\", Integer.toString(t));\r\n\t\t\tmDocument.appendChild(mRoot);\r\n\t\t}\r\n\t\tmLastCycle = t;\r\n\t\tmEventStarted = true;\r\n\t\t\r\n\t\tmID++;\r\n\t\tmCurrentEvent = mDocument.createElement(\"event\");\r\n\t\tmCurrentEvent.setAttribute(\"id\", Integer.toString(mID));\r\n\t\tmCurrentEvent.setAttribute(\"source\", source);\r\n\t\tmCurrentEvent.setAttribute(\"date\", Integer.toString(t));\r\n\t\tElement typeElement = mDocument.createElement(\"type\");\r\n//\t\ttypeElement.setTextContent(type);\r\n\t\ttypeElement.appendChild(mDocument.createTextNode(type));\r\n\t\tmCurrentEvent.appendChild(typeElement);\r\n\t\tmRoot.appendChild(mCurrentEvent);\r\n\r\n\t\treturn mCurrentEvent;\r\n\t}", "public Event() {\n this.name = null;\n this.description = null;\n this.date = new GregorianCalendar();\n }", "public AnalyticsEvent build() {\n AnalyticsEvent purchaseEvent = null;\n if(isValid() && doBaseValidation()) {\n purchaseEvent = eventClient.createEvent(PURCHASE_EVENT_NAME);\n\n purchaseEvent.addAttribute(PURCHASE_EVENT_PRODUCT_ID_ATTR, productId);\n purchaseEvent.addAttribute(PURCHASE_EVENT_STORE_ATTR, store);\n purchaseEvent.addMetric(PURCHASE_EVENT_QUANTITY_METRIC, quantity);\n\n if(formattedItemPrice != null) {\n purchaseEvent.addAttribute(PURCHASE_EVENT_PRICE_FORMATTED_ATTR, formattedItemPrice);\n }\n\n if(itemPrice != null) {\n purchaseEvent.addMetric(PURCHASE_EVENT_ITEM_PRICE_METRIC, itemPrice);\n }\n\n if(transactionId != null) {\n purchaseEvent.addAttribute(PURCHASE_EVENT_TRANSACTION_ID_ATTR, transactionId);\n }\n\n if(currency != null) {\n purchaseEvent.addAttribute(PURCHASE_EVENT_CURRENCY_ATTR, currency);\n }\n }\n \n return purchaseEvent;\n }", "protected ICEvent() {}", "EventUses createEventUses();", "@Override //to be moved to Cloud service\r\n\tpublic void createEvent(String eventName) {\n\t\t\r\n\t}", "public LogEvent newInstance()\n {\n return new LogEvent();\n }", "public Event() {\n\t}", "StartEvent createStartEvent();", "public Event() {\n\n }", "protected IEvent createEvent(IMachineRoot machine, String eventLabel)\n\t\t\tthrows RodinDBException {\n\t\tIEvent event = machine.createChild(IEvent.ELEMENT_TYPE, null, null);\n\t\tevent.setLabel(eventLabel, null);\n\t\tevent.setExtended(false, null);\n\t\tevent.setConvergence(ORDINARY, null);\n\t\treturn event;\n\t}", "CatchingEvent createCatchingEvent();", "Event generateEvent(int seed) throws Exception {\n return new Event(\n new Description(\"Event \" + seed),\n new StartTime(\"0900\"),\n new StartDate(Integer.toString((Integer.parseInt(\"200317\") + seed))),\n new EndTime(\"1100\"),\n new EndDate(Integer.toString((Integer.parseInt(\"200317\") + seed))),\n new Location(\"House of \" + seed),\n new UniqueTagList(new Tag(\"tag\" + Math.abs(seed)), new Tag(\"tag\" + Math.abs(seed + 1)))\n );\n }", "public void makeEvent(String type) {\n\t\teventName = type;\n\t}", "private IRefinesEvent createRefinesEvent() throws RodinDBException {\n\t\tfinal IMachineRoot mch = createMachine(\"mch\");\n\t\tfinal IEvent event = createEvent(mch, \"event\");\n\t\treturn event.createChild(IRefinesEvent.ELEMENT_TYPE, null, null);\n\t}", "EventBinding createEventBinding();", "RemoteEvent createRemoteEvent();", "ProgramEventEvent createProgramEventEvent();", "ViewElementEvent createViewElementEvent();", "public void addEvent(Event event) {\n\t\t\n\t}", "public DocumentEvent() {}", "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 }", "private void initEvents(){\n ArrayList<Event> en = new ArrayList();\n en.add(new Event_MessangerOfGods(this.village));\n en.add(new Event_PaganPriest(this.village));\n this.events = en;\n }", "private void createEvents()\r\n\t{\r\n\t\teventsCount.add(new Event(RequestMethod.PUT, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.GET, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.POST, 0));\r\n\t}", "UsageEvents.Event buildEvent(String packageName, String className) {\n UsageEvents.Event event = new UsageEvents.Event();\n event.mPackage = getCachedStringRef(packageName);\n if (className != null) {\n event.mClass = getCachedStringRef(className);\n }\n return event;\n }", "public Eventd() {\n }", "private void createEvents() {\n\t\taddBtn.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbuildOutput();\n\t\t\t}\n\t\t});\n\t}", "public EventRoomBuilder(int capacity){\r\n itemFactory = new ItemFactory();\r\n newRoom = new EventRoom(capacity);\r\n eventRoomItems = new EventRoomItems();\r\n }", "private void createEvents() {\n\t\tbtnPushTheButton.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t\n\t\t\tprivate List<String> b;\n\n\t\n\t\t\t//@SuppressWarnings(\"unchecked\")\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tact = true;\n\t\t\t\t\n//\t\t\t\tb = new ArrayList<String>();\n//\t\t\t\t\n//\t\t\t\tthis.b= (List<String>) ((List<Object>) (agent.v.getData())).stream().map(item -> {\n//\t\t\t\t\treturn (String) item;\n//\t\t\t\t});\n//\t\t\t\tString c = String.join(\", \", b);\n//\t\t\t\tclassTextArea.setText(c);\n//\t\t\t\n//\t\t\t\tclassTextArea.setText(b.toString());\n//\t\t\t\t\n//\t\t\t\treturn;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t});\n\t\t\n\t}", "public Event(){\n \n }", "@Override\r\n\tpublic Element addEventElement(String name) {\r\n\t\treturn this.addEventElementImpl(name, \"\", true);\r\n\t}", "public Event(){\n\n }", "public QPEvent() {}", "public void addEvent(Event e) {\n\t\t\n\t}", "public void addEvent(Event e) {\n\t\t\n\t}", "public void addEvPEC(Event ev);", "EndEvent createEndEvent();", "ThrowingEvent createThrowingEvent();", "Event(int start, int end, String eventName) {\r\n this.start = start;\r\n this.end = end;\r\n this.eventName = eventName;\r\n this.description = \"\";\r\n }", "private Event(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Event(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public org.hl7.fhir.CodeableConcept addNewEvent()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().add_element_user(EVENT$0);\n return target;\n }\n }", "@Override\n public SoapEvent convertType(Event parent) {\n return new SoapEvent(parent);\n }", "public void setEventCreated() {\n Date now = new Date();\n this.eventCreated = now;\n }", "public NodeEvent() {\n\t\tthis(new Note(), DEFAULT_LIKELIHOOD);\n\t}", "public Builder setEvent(EventType value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n event_ = value.getNumber();\n onChanged();\n return this;\n }", "Event generateEventWithName(String description) throws Exception {\n fordate++;\n return new Event(\n new Description(description),\n new StartTime(\"0800\"),\n new StartDate(Integer.toString(Integer.parseInt(\"100301\") + fordate)),\n new EndTime(\"1200\"),\n new EndDate(Integer.toString(Integer.parseInt(\"100301\") + fordate)),\n new Location(\"House of 1\"),\n new UniqueTagList(new Tag(\"tag\"))\n );\n }", "@Test\n public void constructor() {\n Event event1 = new Event(\"Eat Apple\", \"2020-12-12 12:00\", \"2020-12-12 13:00\",\n false);\n Event event2 = new Event(\"Write paper\", \"2020-05-05 12:00\", \"2020-05-06 23:59\",\n true);\n\n assertEquals(\"Eat Apple\", event1.description);\n assertEquals(LocalDateTime.parse(\"2020-12-12 12:00\", Event.PARSER_FORMATTER), event1.startAt);\n assertEquals(LocalDateTime.parse(\"2020-12-12 13:00\", Event.PARSER_FORMATTER), event1.endAt);\n assertEquals(false, event1.isDone);\n assertEquals(\"Write paper\", event2.description);\n assertEquals(LocalDateTime.parse(\"2020-05-05 12:00\", Event.PARSER_FORMATTER), event2.startAt);\n assertEquals(LocalDateTime.parse(\"2020-05-06 23:59\", Event.PARSER_FORMATTER), event2.endAt);\n assertEquals(true, event2.isDone);\n }", "@Override\n\tpublic EventDto createEvent(EventDto event) {\n\t\tEventEntity eventEntity=new EventEntity();\n\t\tBeanUtils.copyProperties(event, eventEntity);\n\t\t\n\t\tString eventid=utils.generateEventId(20);\n\t\teventEntity.setEventid(eventid);\n\t\t\n\t\tEventEntity storedEvent=eventRepository.save(eventEntity);\n\t\t\n\t\tEventDto returnvalue=new EventDto();\n\t\tBeanUtils.copyProperties(storedEvent, returnvalue);\n\t\t\n\t\treturn returnvalue;\n\t}", "Event(int start, int end, String eventName, String description) {\r\n this.start = start;\r\n this.end = end;\r\n this.eventName = eventName;\r\n this.description = description;\r\n }", "public CreateEventFragment() {\n // Required empty public constructor\n }", "@Override\n\t\tpublic NewHighwayEvent build(IniSection ini) {\n\t\t\tNewHighwayEvent event = null;\n\t\t\tint lanes;\n\n\t\t\tif (TAG.equals(ini.getTag()) && isCorrectType(ini, TYPE)) {\n\t\t\t\ttry {\n\t\t\t\t\tLogger log = Logger.getLogger(NewHighwayEvent.class\n\t\t\t\t\t\t\t.getName());\n\t\t\t\t\tlog.info(\"Attempting to parse NewHighwayEvent...\");\n\n\t\t\t\t\tNewRoadEvent ev = super.build(ini);\n\t\t\t\t\tlanes = parsePositiveInt(ini, \"lanes\");\n\t\t\t\t\tevent = new NewHighwayEvent(ev, lanes);\n\n\t\t\t\t\tlog.info(\"Event parsed\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\tEVENT_PARSE_ERROR_MSG + e.getMessage(), e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}", "Builder addReleasedEvent(PublicationEvent.Builder value);", "public ScheduleEvent()\n\t{\n\n\t}", "public Event(EventType type, String eventKey) \n\t{\n\t\tsuper();\n\t\tthis.evntType = type;\n\t\tthis.key = eventKey;\n\t\tthis.uuid = UUID.randomUUID().toString();\n\t\tthis.milliseconds = 0;\n\t\tthis.repeated = false;\n\t}", "private static Entity<Event> event(String uid, Entity<Enrollment> parent) {\n Event event = Event.builder().event(uid).enrollment(parent.entity.getUid()).build();\n parent.entity.getEvents().add(event);\n return new Entity<>(event);\n }", "public EventMessage(Event event)\r\n {\r\n //super(\"EventMessage\");\r\n super(TYPE_IDENT, event);\r\n }", "public Event insertEvent() throws IOException {\n Event event = new Event()\n .setSummary(\"Cita médica\")\n .setLocation(\"Virtual\")\n .setDescription(\"Cita médica Virtual\");\n \n DateTime startDateTime = new DateTime(\"2020-03-25T16:00:00-05:00\");\n EventDateTime start = new EventDateTime()\n .setDateTime(startDateTime)\n .setTimeZone(TIME_ZONE);\n event.setStart(start);\n \n DateTime endDateTime = new DateTime(\"2020-03-25T17:00:00-05:00\");\n EventDateTime end = new EventDateTime()\n .setDateTime(endDateTime)\n .setTimeZone(TIME_ZONE);\n event.setEnd(end);\n \n EventAttendee[] attendees = new EventAttendee[] {\n new EventAttendee().setEmail(\"oscar.ortiz@xertica.com\"),\n new EventAttendee().setEmail(\"admin@david.eforcers.com.co\"),\n };\n event.setAttendees(Arrays.asList(attendees));\n \n EventReminder[] reminderOverrides = new EventReminder[] {\n new EventReminder().setMethod(\"popup\").setMinutes(10)\n };\n Event.Reminders reminders = new Event.Reminders()\n .setUseDefault(false)\n .setOverrides(Arrays.asList(reminderOverrides));\n event.setReminders(reminders);\n \n String calendarId = DEFAULT_CALENDAR;\n event = service.events().insert(calendarId, event).execute();\n \n return event;\n }", "@Test\n\tpublic void testElementAddedEvent() {\n\t\tfinal DiagramElement newElement = new DiagramElement(diagram, 1, dummyBoh,\n\t\t\t\tnew RelativeBusinessObjectReference(\"1\"));\n\t\tdiagram.modify(\"Add Element\", m -> m.addElement(newElement));\n\n\t\tassertThat(ml.elementAddedEventsReceived, is(equalTo(1)));\n\t\tassertThat(ml.modificationsCompletedEventsReceived, is(equalTo(1)));\n\t\tassertThat(ml.getTotalEventsReceived(), is(equalTo(2)));\n\t}", "@Override\n protected void initEventAndData() {\n }", "BoundaryEvent createBoundaryEvent();", "private UIEvent generateModifyEvent(){\n List<DataAttribut> dataAttributeList = new ArrayList<>();\n for(int i = 0; i< attributModel.size(); i++){\n String attribut = attributModel.elementAt(i);\n dataAttributeList.add(new DataAttribut(attribut));\n }\n //Erstellen des geänderten Produktdatums und des Events\n DataProduktDatum proposal = new DataProduktDatum(name.getText(), new DataId(id.getText()), dataAttributeList, verweise.getText());\n UIModifyProduktDatumEvent modifyEvent = new UIModifyProduktDatumEvent(dataId, proposal);\n return modifyEvent;\n }", "ConferenceScheduleBuilderService createEventsFromLunchToNetwork();", "public Event createEvent(String descendant, String personID, double latitude,\n double longitude, String country, String city,\n String eventType, int year)\n throws DatabaseException, InvalidValuesException {\n\n String eventID = UUID.randomUUID().toString();\n\n Event event = new Event(\n eventID,\n descendant,\n personID,\n latitude,\n longitude,\n country,\n city,\n eventType,\n year\n );\n\n addEvent(event);\n\n return event;\n }", "@NonNull\n public static CustomEventTriggerBuilder newCustomEventTriggerBuilder() {\n return new CustomEventTriggerBuilder();\n }", "public void addEvent() {\n TimetableUserItem event;\n try {\n String description = getDescription();\n String date = getDate();\n String startTime = getStartTime();\n String endTime = getEndTime();\n verifyCorrectTime(startTime, endTime);\n String location = getLocation();\n event = new TimetableUserItem(description, date, startTime, endTime, location);\n verifyNoConflict(event);\n timetable.addEvent(event.getDayOfWeek(), event);\n timetable.addToEvents(event);\n addUI.printEventMessage(event);\n } catch (AddException e) {\n e.printMessage();\n logger.log(Level.WARNING, \"Invalid event created, event has not been added to timetable\");\n }\n }", "public static com.opentext.bn.converters.avro.entity.DocumentEvent.Builder newBuilder() {\n return new com.opentext.bn.converters.avro.entity.DocumentEvent.Builder();\n }", "private void createNotification(FoodEvents event) {\n Context context = getBaseContext();\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_launcher).setContentTitle(event.getTitle())\n .setContentText(event.getDescription());\n Intent resultIntent = new Intent(this, EventDetails.class);\n resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n resultIntent.putExtra(EventDetails.EXTRA_EVENT, event);\n PendingIntent resultPendingIntent = PendingIntent.getActivity(getBaseContext(), 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT, null);\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, mBuilder.build());\n notifyMyWatch(event);\n }", "private Event convertToEvent(String message) {\n\t\tJSONParser parser = new JSONParser();\n\t\tJSONObject jsonObject;\n\t\ttry {\n\t\t\tjsonObject = (JSONObject) parser.parse(message);\n\t\t} catch (ParseException e) {\n\t\t\tthrow new RuntimeException(\"ParseException caught trying to parse message text into JSON object\");\n\t\t}\n\t\tJSONArray events = (JSONArray) jsonObject.get(\"events\");\n\t\tList<EventAttribute> eventAttributes = new ArrayList<>();\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tIterator<JSONObject> iterator = events.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tJSONObject jsonT = (JSONObject) iterator.next();\n\t\t\tJSONObject jsonEventAttribute = (JSONObject) jsonT.get(\"attributes\");\n\t\t\tString accountNum = (String) jsonEventAttribute.get(\"Account Number\");\n\t\t\tString txAmount = (String) jsonEventAttribute.get(\"Transaction Amount\");\n\t\t\tString cardMemberName = (String) jsonEventAttribute.get(\"Name\");\n\t\t\tString product = (String) jsonEventAttribute.get(\"Product\");\n\t\t\tEventAttribute eventAttribute = new EventAttribute(accountNum, txAmount, cardMemberName, product);\n\t\t\teventAttributes.add(eventAttribute);\n\t\t}\n\n\t\treturn new Event(eventAttributes);\n\t}", "public void startNewEvent() {\n // JCudaDriver.cuEventRecord(cUevent,stream);\n }", "private void initializeEvents() {\r\n\t}", "EventChannel create(Context context);", "private Event createEditedEvent(Optional<EventName> name, Optional<Address> location, Optional<Set<Tag>> tags) {\n EventName eventName = name.orElse(currentEvent.getName());\n Address eventLocation = location.orElse(currentEvent.getLocation());\n Set<Tag> eventTags = tags.orElse(currentEvent.getTags());\n Event editedEvent = new Event(eventName, eventLocation, eventTags);\n\n if (currentEvent.getDate().isPresent()) {\n editedEvent.setDate(currentEvent.getDate().get());\n }\n if (currentEvent.getStartTime().isPresent() && currentEvent.getEndTime().isPresent()) {\n editedEvent.setTime(currentEvent.getStartTime().get(), currentEvent.getEndTime().get());\n }\n editedEvent.setOrganiser(currentEvent.getOrganiser());\n editedEvent.setPolls(currentEvent.getPolls());\n editedEvent.setParticipantList(currentEvent.getParticipantList());\n return editedEvent;\n }", "public EventBus build() {\n return new EventBus(this);\n }", "ConferenceScheduleBuilderService createEventsFromStartToLunch();", "public void addEvent(String eventString) {\n String eventInfo[] = eventString.split(\",\");\n if (eventInfo[EVENT_TYPE_POS_IN_EVENT_STRING].equals(DelayEvent.DELAY_EVENT)) {\n int delay = Integer.parseInt(eventInfo[DELAY_POS_IN_EVENT_STRING]);\n events.add(new DelayEvent(delay));\n } else {\n int spawnNumber = Integer.parseInt(eventInfo[SLICER_NUMBER_POS_IN_EVENT_STRING]);\n String slicerType = eventInfo[SLICER_TYPE_POS_IN_EVENT_STRING];\n int spawnDelay = Integer.parseInt(eventInfo[SPAWN_DELAY_IN_EVENT_STRING]);\n events.add(new SpawnEvent(spawnNumber, slicerType, spawnDelay));\n }\n }", "private void createFrame() {\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal JFrame frame = new JFrame(\"Create Event\");\n\t\t\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\t\t\ttry {\n\t\t\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tfinal JTextArea textArea = new JTextArea(15, 50);\n\t\t\t\ttextArea.setText(\"Untitled Event\");\n\t\t\t\ttextArea.setWrapStyleWord(true);\n\t\t\t\ttextArea.setEditable(true);\n\t\t\t\ttextArea.setFont(Font.getFont(Font.SANS_SERIF));\n\n\t\t\t\tJPanel panel = new JPanel();\n\t\t\t\tpanel.setLayout(new GridLayout(1, 4));\n\t\t\t\tfinal JTextField d = new JTextField(\"\" + year + \"/\" + month + \"/\" + day);\n\t\t\t\tfinal JTextField startTime = new JTextField(\"1:00am\");\n\t\t\t\tJTextField t = new JTextField(\"to\");\n\t\t\t\tt.setEditable(false);\n\t\t\t\tfinal JTextField endTime = new JTextField(\"2:00am\");\n\t\t\t\tJButton save = new JButton(\"Save\");\n\t\t\t\tpanel.add(d);\n\t\t\t\tpanel.add(startTime);\n\t\t\t\tpanel.add(t);\n\t\t\t\tpanel.add(endTime);\n\t\t\t\tpanel.add(save);\n\n\t\t\t\tsave.addActionListener(new ActionListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\teventsData.addEvent(new Event(YYYYMMDD(d.getText().trim()), startTime.getText(),\n\t\t\t\t\t\t\t\t\tendTime.getText(), textArea.getText()));\n\t\t\t\t\t\t\tupdateEventsView(eventsRender);\n\t\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\t\tif (ex instanceof IllegalArgumentException)\n\t\t\t\t\t\t\t\tpromptMsg(ex.getMessage(), \"Error\");\n\t\t\t\t\t\t\telse promptMsg(ex.getMessage(), \"Error\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tframe.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tframe.setSize(500, 100);\n\t\t\t\tframe.setLayout(new GridLayout(2, 1));\n\t\t\t\tframe.add(textArea);\n\t\t\t\tframe.add(panel);\n\t\t\t\tframe.setLocationByPlatform(true);\n\t\t\t\tframe.setVisible(true);\n\t\t\t}\n\t\t});\n\t}", "protected abstract void createHistoryEvents();", "Event () {\n // Nothing to do here.\n }", "public Event createNotify(Address resource, String event);" ]
[ "0.77708745", "0.77708745", "0.7255182", "0.72101206", "0.7185832", "0.70874", "0.7059883", "0.67776257", "0.66582763", "0.66369873", "0.6614427", "0.65443283", "0.6509435", "0.64276916", "0.64128643", "0.64017916", "0.63862973", "0.63851255", "0.6281225", "0.6252637", "0.6252637", "0.6249651", "0.62399316", "0.6231377", "0.62301046", "0.6222099", "0.6217129", "0.6212692", "0.6205802", "0.6174208", "0.6141994", "0.6132203", "0.6127279", "0.6115194", "0.61118895", "0.6068852", "0.60567296", "0.605453", "0.60405284", "0.60386425", "0.6024942", "0.5993485", "0.59721184", "0.59697515", "0.5948258", "0.59433895", "0.59177154", "0.59114003", "0.5904324", "0.5889766", "0.588009", "0.5853613", "0.58398485", "0.583143", "0.5826366", "0.5826366", "0.5822405", "0.5816884", "0.57914126", "0.577825", "0.57701737", "0.57701737", "0.57560486", "0.57430565", "0.5734611", "0.5731332", "0.57247955", "0.5723552", "0.5695963", "0.56940687", "0.56939685", "0.56857973", "0.5664927", "0.5660543", "0.5645466", "0.5640554", "0.5633074", "0.5628037", "0.5627576", "0.56235117", "0.5619989", "0.56093484", "0.55984145", "0.55980366", "0.5595036", "0.5588997", "0.558553", "0.55854523", "0.55725247", "0.55680984", "0.5564902", "0.55571866", "0.55553323", "0.55547714", "0.55543756", "0.55461204", "0.55430233", "0.553993", "0.5529217", "0.5522361", "0.5521203" ]
0.0
-1